예제 #1
0
        public Dictionary <string, string> Gets(IEnumerable <string> keys)
        {
            var maps = new Dictionary <string, string>();

            if (keys.xIsEmpty())
            {
                return(maps);
            }

            var bytesKeys = new List <byte[]>();

            keys.xForEach(key => { bytesKeys.Add(key.xToBytes()); });

            var keyvalues = _db.MultiGet(bytesKeys.ToArray());

            keyvalues.xForEach(kv => { maps.Add(kv.Key.xToString(), kv.Value.xToString()); });

            return(maps);
        }
예제 #2
0
 public KeyValuePair <byte[], byte[]>[] this[byte[][] keys] => Db.MultiGet(keys);
예제 #3
0
 public KeyValuePair <byte[], byte[]>[] this[byte[][] keys] => _rocksDb.MultiGet(keys, keys.Select(k => _columnFamily).ToArray());
예제 #4
0
 public IDictionary <byte[], byte[]> GetMany(IEnumerable <byte[]> keys)
 {
     _ThrowIfNotInitialized();
     return(_rocksDb.MultiGet(keys.ToArray()).ToDictionary(kv => kv.Key, k => k.Value));
 }
예제 #5
0
 public Task <IDictionary <byte[], byte[]> > GetMany(IEnumerable <byte[]> keys)
 {
     return(Task.FromResult <IDictionary <byte[], byte[]> >(_rocksDb.MultiGet(keys.ToArray())
                                                            .ToDictionary(kv => kv.Key, k => k.Value)));
 }