public void Store(WTree tree, BinaryWriter writer)
            {
                CountCompression.Serialize(writer, checked ((ulong)Count));

                Debug.Assert(Count > 0);
                writer.Write((byte)this[0].Value.NodeType);

                for (int i = 0; i < Count; i++)
                {
                    var     kv      = this[i];
                    FullKey fullkey = kv.Key;
                    Branch  branch  = kv.Value;
                    //lock (branch)
                    //{
                    //}

                    //write locator
                    tree.SerializeLocator(writer, fullkey.Locator);
                    fullkey.Locator.KeyPersist.Write(writer, fullkey.Key);

                    //write branch info
                    writer.Write(branch.NodeHandle);
                    writer.Write((int)branch.NodeState);

                    branch.Cache.Store(tree, writer);
                }
            }
Example #2
0
            public void Store(WTree tree, BinaryWriter writer)
            {
                writer.Write(Count);
                if (Count == 0)
                {
                    return;
                }

                //write cache
                foreach (var kv in this)
                {
                    var locator    = kv.Key;
                    var operations = kv.Value;

                    //write locator
                    tree.SerializeLocator(writer, locator);

                    //write operations
                    locator.OperationsPersist.Write(writer, operations);
                }
            }