Commit [r71] Maximize Restore History

added code for memtables

ultralight32 2013-12-12

added /trunk/src/SparkDbNet.Core/Memtables/MemtableManager.cs
added /trunk/src/packages/C5.2.2.5073.27396/lib/portable-net40+sl50+wp80+win/C5.xml
added /trunk/src/packages/C5.2.2.5073.27396/C5.2.2.5073.27396.nupkg
added /trunk/src/packages/C5.2.2.5073.27396/C5.2.2.5073.27396.nuspec
added /trunk/src/packages/C5.2.2.5073.27396/lib/portable-net40+sl50+wp80+win/C5.dll
changed /trunk/src/SparkDbNet.Core/packages.config
changed /trunk/src/SparkDbNet.Core/SparkDbNet.Core.csproj
changed /trunk/src/SparkDbNet.Core/BigTable/Row.cs
changed /trunk/src/SparkDbNet.Core/app.config
changed /trunk/src/SparkDbNet.Core/BigTable/InternalValue.cs
changed /trunk/src/SparkDbNet.Core/Properties/Settings.settings
changed /trunk/src/SparkDbNet.Core/Properties/Settings.Designer.cs
changed /trunk/src/SparkDbNet.Core/BigTable/RowReader.cs
changed /trunk/src/SparkDbNet.Debug/Program.cs
changed /trunk/src/SparkDbNet.Core/BigTable/RowWriter.cs
copied /trunk/src/SparkDbNet.Core/Journaling/JornualManager.cs -> /trunk/src/SparkDbNet.Core/Journaling/JournalManager.cs
/trunk/src/SparkDbNet.Core/Memtables/MemtableManager.cs Diff Switch to side-by-side view
Loading...
/trunk/src/packages/C5.2.2.5073.27396/lib/portable-net40+sl50+wp80+win/C5.xml Diff Switch to side-by-side view
Loading...
/trunk/src/packages/C5.2.2.5073.27396/C5.2.2.5073.27396.nupkg Diff Switch to side-by-side view
Loading...
/trunk/src/packages/C5.2.2.5073.27396/C5.2.2.5073.27396.nuspec Diff Switch to side-by-side view
Loading...
/trunk/src/packages/C5.2.2.5073.27396/lib/portable-net40+sl50+wp80+win/C5.dll Diff Switch to side-by-side view
Loading...
/trunk/src/SparkDbNet.Core/packages.config Diff Switch to side-by-side view
Loading...
/trunk/src/SparkDbNet.Core/SparkDbNet.Core.csproj Diff Switch to side-by-side view
Loading...
/trunk/src/SparkDbNet.Core/BigTable/Row.cs Diff Switch to side-by-side view
Loading...
/trunk/src/SparkDbNet.Core/app.config Diff Switch to side-by-side view
Loading...
/trunk/src/SparkDbNet.Core/BigTable/InternalValue.cs Diff Switch to side-by-side view
Loading...
/trunk/src/SparkDbNet.Core/Properties/Settings.settings Diff Switch to side-by-side view
Loading...
/trunk/src/SparkDbNet.Core/Properties/Settings.Designer.cs Diff Switch to side-by-side view
Loading...
/trunk/src/SparkDbNet.Core/BigTable/RowReader.cs Diff Switch to side-by-side view
Loading...
/trunk/src/SparkDbNet.Debug/Program.cs Diff Switch to side-by-side view
Loading...
/trunk/src/SparkDbNet.Core/BigTable/RowWriter.cs Diff Switch to side-by-side view
Loading...
/trunk/src/SparkDbNet.Core/Journaling/JornualManager.cs to /trunk/src/SparkDbNet.Core/Journaling/JournalManager.cs
--- a/trunk/src/SparkDbNet.Core/Journaling/JornualManager.cs
+++ b/trunk/src/SparkDbNet.Core/Journaling/JournalManager.cs
@@ -36,7 +36,7 @@
         public Journal(string name)
         {
             Filename = name;
-            Backfile = new FileStream(name, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
+            Backfile = new FileStream(name, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None, 64*1024);
         }
 
         /// <summary>
@@ -144,17 +144,6 @@
             {
                 Lock.ReleaseReaderLock();
             }
-            //SortedDictionary<RowKey, Row> d = new SortedDictionary<RowKey, Row>();
-            //Lock.ReaderLock(() =>
-            //{
-            //    foreach (var key in Cache.Keys)
-            //    {
-            //        var r = this.GetRow(key);
-            //        if (r != null)
-            //            d[r] = r;
-            //    }
-            //});
-            //return d.Values;
         }
 
         /// <summary>
@@ -278,20 +267,6 @@
                     return this.GetRow(candidate);
                 else
                     return null;
-                //foreach (var key in Cache.Keys)// bad perf???
-                //{
-                //    var r = this.GetRow(key);
-                //    if (r != null)
-                //    {
-                //        if (r.Key.CompareTo(start_excl_key) <= 0)
-                //            continue;
-                //        if (candidate == null)
-                //            candidate = r;
-                //        else if (r.CompareTo(candidate) < 0)
-                //            candidate = r;
-                //    }
-                //}
-                //return candidate;
             });
         }
     }
@@ -302,7 +277,7 @@
         private Journal CurrentJournal = null;
         private List<Journal> FullJournals = new List<Journal>();
         private ReaderWriterLock Lock = new ReaderWriterLock();
-#warning TODO: 1 journal per keyspace.column_family
+        // TODO: 1 journal per keyspace.column_family <- NO because of atomic batches
         // http://wiki.apache.org/cassandra/MemtableThresholds http://wiki.apache.org/cassandra/MemtableSSTable
         #region Ctor: Start & recovery