Esempio n. 1
0
        private ReadOperation ReadReadOperation(BinaryReader reader)
        {
            IData key    = KeyPersist.Read(reader);
            long  handle = reader.ReadInt64();

            return(new ReadOperation(key, handle));
        }
Esempio n. 2
0
        private RefreshRangeOperation ReadRefreshRangeOperation(BinaryReader reader)
        {
            IData from = KeyPersist.Read(reader);
            IData to   = KeyPersist.Read(reader);

            return(new RefreshRangeOperation(from, to));
        }
Esempio n. 3
0
        private InsertOrIgnoreOperation ReadInsertOrIgnoreOperation(BinaryReader reader)
        {
            IData key    = KeyPersist.Read(reader);
            IData record = RecordPersist.Read(reader);

            return(new InsertOrIgnoreOperation(key, record));
        }
Esempio n. 4
0
        private ReplaceOperation ReadReplaceOperation(BinaryReader reader)
        {
            IData key    = KeyPersist.Read(reader);
            IData record = RecordPersist.Read(reader);

            return(new ReplaceOperation(key, record));
        }
Esempio n. 5
0
        private TryGetOperation ReadTryGetOperation(BinaryReader reader)
        {
            IData key    = KeyPersist.Read(reader);
            IData record = reader.ReadBoolean() ? RecordPersist.Read(reader) : null;

            return(new TryGetOperation(key, record));
        }
Esempio n. 6
0
        private DeleteRangeOperation ReadDeleteRangeOperation(BinaryReader reader)
        {
            IData from = KeyPersist.Read(reader);
            IData to   = KeyPersist.Read(reader);

            return(new DeleteRangeOperation(from, to));
        }
Esempio n. 7
0
        private LastRowOperation ReadLastRowOperation(BinaryReader reader)
        {
            bool  hasValues = (reader.ReadBoolean());
            IData key       = hasValues ? KeyPersist.Read(reader) : null;
            IData rec       = hasValues ? RecordPersist.Read(reader) : null;

            return(new LastRowOperation(new KeyValuePair <IData, IData>(key, rec)));
        }
        private LastRowCommand ReadLastRowCommand(BinaryReader reader)
        {
            bool  hasValue = (reader.ReadBoolean());
            IData key      = hasValue ? KeyPersist.Read(reader) : null;
            IData rec      = hasValue ? RecordPersist.Read(reader) : null;

            return(new LastRowCommand(hasValue ? (KeyValuePair <IData, IData>?) new KeyValuePair <IData, IData>(key, rec) : null));
        }
Esempio n. 9
0
        private ForwardOperation ReadForwardOperation(BinaryReader reader)
        {
            int   pageCount = reader.ReadInt32();
            IData from      = reader.ReadBoolean() ? KeyPersist.Read(reader) : null;
            IData to        = reader.ReadBoolean() ? KeyPersist.Read(reader) : null;
            List <KeyValuePair <IData, IData> > list = reader.ReadBoolean() ? DeserializeList(reader) : null;

            return(new ForwardOperation(pageCount, from, to, list));
        }
        private BackwardCommand ReadBackwardCommand(BinaryReader reader)
        {
            int   pageCount = reader.ReadInt32();
            IData from      = reader.ReadBoolean() ? KeyPersist.Read(reader) : null;
            IData to        = reader.ReadBoolean() ? KeyPersist.Read(reader) : null;
            List <KeyValuePair <IData, IData> > list = reader.ReadBoolean() ? DeserializeList(reader) : null;

            return(new BackwardCommand(pageCount, from, to, list));
        }
        private FindBeforeCommand ReadFindBeforeCommand(BinaryReader reader)
        {
            IData Key = KeyPersist.Read(reader);

            bool  hasValue = (reader.ReadBoolean());
            IData key      = hasValue ? KeyPersist.Read(reader) : null;
            IData rec      = hasValue ? RecordPersist.Read(reader) : null;

            return(new FindBeforeCommand(Key, hasValue ? (KeyValuePair <IData, IData>?) new KeyValuePair <IData, IData>(key, rec) : null));
        }
Esempio n. 12
0
        private FindBeforeOperation ReadFindBeforeOperation(BinaryReader reader)
        {
            IData from = KeyPersist.Read(reader);

            bool  hasValues = (reader.ReadBoolean());
            IData key       = hasValues ? KeyPersist.Read(reader) : null;
            IData rec       = hasValues ? RecordPersist.Read(reader) : null;

            return(new FindBeforeOperation(from, new KeyValuePair <IData, IData>(key, rec)));
        }
Esempio n. 13
0
        private List <KeyValuePair <IData, IData> > DeserializeList(BinaryReader reader)
        {
            int count = reader.ReadInt32();

            List <KeyValuePair <IData, IData> > list = new List <KeyValuePair <IData, IData> >(count);

            for (int i = 0; i < count; i++)
            {
                IData key = KeyPersist.Read(reader);
                IData rec = RecordPersist.Read(reader);
                list.Add(new KeyValuePair <IData, IData>(key, rec));
            }

            return(list);
        }
 private DeleteRangeCommand ReadDeleteRangeCommand(BinaryReader reader)
 {
     return(new DeleteRangeCommand(KeyPersist.Read(reader), KeyPersist.Read(reader)));
 }
 private InsertOrIgnoreCommand ReadInsertOrIgnoreCommand(BinaryReader reader)
 {
     return(new InsertOrIgnoreCommand(KeyPersist.Read(reader), RecordPersist.Read(reader)));
 }
Esempio n. 16
0
        private DeleteOperation ReadDeleteOperation(BinaryReader reader)
        {
            IData key = KeyPersist.Read(reader);

            return(new DeleteOperation(key));
        }
 private ReplaceCommand ReadReplaceCommand(BinaryReader reader)
 {
     return(new ReplaceCommand(KeyPersist.Read(reader), RecordPersist.Read(reader)));
 }
 private TryGetCommand ReadTryGetCommand(BinaryReader reader)
 {
     return(new TryGetCommand(KeyPersist.Read(reader), reader.ReadBoolean() ? RecordPersist.Read(reader) : null));
 }
Esempio n. 19
0
        private RefreshPointOperation ReadRefreshPointOperation(BinaryReader reader)
        {
            IData key = KeyPersist.Read(reader);

            return(new RefreshPointOperation(key));
        }