Esempio n. 1
0
        public T GetSubDB <T>(long id) where T : class
        {
            object subDB;

            if (_subDBs.TryGetValue(id, out subDB))
            {
                if (!(subDB is T))
                {
                    throw new ArgumentException($"SubDB of id {id} is not type {typeof(T).FullName}");
                }
                return((T)subDB);
            }
            if (typeof(T) == typeof(IChunkStorage))
            {
                subDB = new ChunkStorageInKV(id, _fileCollection, MaxTrLogFileSize);
            }
            _subDBs.Add(id, subDB);
            return((T)subDB);
        }
Esempio n. 2
0
 public ChunkStorageTransaction(ChunkStorageInKV chunkStorageInKV)
 {
     _chunkStorageInKV = chunkStorageInKV;
 }
Esempio n. 3
0
 public ChunkStorageTransaction(ChunkStorageInKV chunkStorageInKV)
 {
     _chunkStorageInKV = chunkStorageInKV;
 }