Esempio n. 1
0
        private TsdbTableEntity Convert(BinaryWriter writer, MemoryStream stream, TEntry entry, string partitionKey)
        {
            var entity = new TsdbTableEntity();

            entity.RowKey       = AtsKeyCalculator.CalculateRowKey(entry.GetTimestamp());
            entity.PartitionKey = partitionKey;
            AtsSerializer.SerializeEntry <TKey, TEntry>(writer, entry);
            entity.P0 = stream.ToArray();
            return(entity);
        }
Esempio n. 2
0
        private List <TsdbTableEntity> CreateTableEntitiesFor(TKey key, List <TEntry> entries)
        {
            List <TsdbTableEntity> tableEntities = new List <TsdbTableEntity>();
            var id = _keyConverter.Convert(key);

            var results = AtsSerializer.Serialize <TKey, TEntry>(entries, TsdbTableEntity.MaxByteCapacity);

            foreach (var result in results)
            {
                var entity = new TsdbTableEntity();
                entity.SetData(result.Data);
                entity.RowKey       = AtsKeyCalculator.CalculateRowKey(result.From);
                entity.PartitionKey = AtsKeyCalculator.CalculatePartitionKey(id, key, result.From, _partitioningProvider);

                tableEntities.Add(entity);
            }

            return(tableEntities);
        }
Esempio n. 3
0
 private TEntry Convert(BinaryReader reader, TsdbTableEntity entity)
 {
     return(AtsSerializer.DeserializeEntry <TKey, TEntry>(reader));
 }
Esempio n. 4
0
 public AtsOperation(TsdbTableEntity row, AtsOperationType operationType)
 {
     Row           = row;
     OperationType = operationType;
 }