Beispiel #1
0
        private void ReplicationCreateType(BinaryReader reader, TimeSeriesStorage.Writer writer)
        {
            var type = reader.ReadString();

            var fieldsCount = reader.ReadInt32();
            var fields      = new string[fieldsCount];

            for (int i = 0; i < fieldsCount; i++)
            {
                fields[i] = reader.ReadString();
            }

            writer.DoCreateType(type, fields);
        }
Beispiel #2
0
        public void PostReplicationLogItem(ReplicationLogItem logItem, TimeSeriesStorage.Writer writer)
        {
            using (var stream = new MemoryStream(logItem.BinaryData))
                using (var reader = new BinaryReader(stream, Encoding.UTF8))
                {
                    var readByte = (LogTypes)reader.ReadByte();
                    switch (readByte)
                    {
                    case LogTypes.Append:
                        throw new NotImplementedException();
                        break;

                    case LogTypes.DeleteKey:
                        throw new NotImplementedException();
                        break;

                    case LogTypes.DeletePoint:
                        throw new NotImplementedException();
                        break;

                    case LogTypes.DeleteRange:
                        throw new NotImplementedException();
                        break;

                    case LogTypes.CreateType:
                        ReplicationCreateType(reader, writer);
                        break;

                    case LogTypes.DeleteType:
                        ReplicationDeleteType(reader, writer);
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }
                }
        }
Beispiel #3
0
        private void ReplicationDeleteType(BinaryReader reader, TimeSeriesStorage.Writer writer)
        {
            var type = ReadType(reader);

            writer.DoDeleteType(type);
        }