Example #1
0
        // {:db/op :set, :db/method "SetCellarMeta"}
        public static void SetCellarMeta(Tx tx, byte cellarId, CellarDto dto)
        {
            tx.TraceStart("SetCellarMeta");
            var key = DslLib.CreateKey((byte)Tables.Cellar, cellarId);

            DslLib.Set(tx, key, dto);
            tx.TraceStop("SetCellarMeta");
        }
Example #2
0
        // {:db/op :set, :db/method "SetStreamPosition"}
        public static void SetStreamPosition(Tx tx, string streamName, long dto)
        {
            tx.TraceStart("SetStreamPosition");
            var key = DslLib.CreateKey((byte)Tables.Meta, streamName);

            DslLib.Set(tx, key, dto);
            tx.TraceStop("SetStreamPosition");
        }
Example #3
0
        // {:db/op :set, :db/method "SetBuffer"}
        public static void SetBuffer(Tx tx, byte bufferId, BufferDto dto)
        {
            tx.TraceStart("SetBuffer");
            var key = DslLib.CreateKey((byte)Tables.Buffer, bufferId);

            DslLib.Set(tx, key, dto);
            tx.TraceStop("SetBuffer");
        }
Example #4
0
        // {:db/op :delete, :db/method "DropChunk"}
        public static void DropChunk(Tx tx, long chunkStartPos)
        {
            tx.TraceStart("DropChunk");
            var key = DslLib.CreateKey((byte)Tables.Chunk, chunkStartPos);

            DslLib.Delete(tx, key);
            tx.TraceStop("DropChunk");
        }
Example #5
0
        // {:db/op :set, :db/method "AddChunk"}
        public static void AddChunk(Tx tx, long chunkStartPos, ChunkDto dto)
        {
            tx.TraceStart("AddChunk");
            var key = DslLib.CreateKey((byte)Tables.Chunk, chunkStartPos);

            DslLib.Set(tx, key, dto);
            tx.TraceStop("AddChunk");
        }
Example #6
0
        // {:db/op :fetch, :db/method "GetStreamPosition"}
        public static long GetStreamPosition(Tx tx, string streamName, long dv = default(long))
        {
            tx.TraceStart("GetStreamPosition");
            var key   = DslLib.CreateKey((byte)Tables.Meta, streamName);
            var value = DslLib.GetOrDefault <long>(tx, key, dv);

            tx.TraceStop("GetStreamPosition");
            return(value);
        }
Example #7
0
        // {:db/op :fetch, :db/method "GetCellarMeta"}
        public static CellarDto GetCellarMeta(Tx tx, byte cellarId, CellarDto dv = default(CellarDto))
        {
            tx.TraceStart("GetCellarMeta");
            var key   = DslLib.CreateKey((byte)Tables.Cellar, cellarId);
            var value = DslLib.GetOrDefault <CellarDto>(tx, key, dv);

            tx.TraceStop("GetCellarMeta");
            return(value);
        }
Example #8
0
        // {:db/op :fetch, :db/method "GetBuffer"}
        public static BufferDto GetBuffer(Tx tx, byte bufferId, BufferDto dv = default(BufferDto))
        {
            tx.TraceStart("GetBuffer");
            var key   = DslLib.CreateKey((byte)Tables.Buffer, bufferId);
            var value = DslLib.GetOrDefault <BufferDto>(tx, key, dv);

            tx.TraceStop("GetBuffer");
            return(value);
        }
Example #9
0
        // {:db/op :fetch, :db/method "GetChunk"}
        public static ChunkDto GetChunk(Tx tx, long chunkStartPos, ChunkDto dv = default(ChunkDto))
        {
            tx.TraceStart("GetChunk");
            var key   = DslLib.CreateKey((byte)Tables.Chunk, chunkStartPos);
            var value = DslLib.GetOrDefault <ChunkDto>(tx, key, dv);

            tx.TraceStop("GetChunk");
            return(value);
        }
Example #10
0
        // {:db/op :scan, :count 0, :db/method "ListChunks"}
        public static IEnumerable <KeyValuePair <ChunkKey, ChunkDto> > ListChunks(Tx tx, int skip = 0)
        {
            var key = DslLib.CreateKey((byte)Tables.Chunk);

            return(DslLib.Scan <ChunkKey, ChunkDto>(tx, key, t => new ChunkKey(t), "ListChunks", skip));
        }