Ejemplo n.º 1
0
        public static RocksDb OpenWithTtl(OptionsHandle options, string path, int ttlSeconds)
        {
            IntPtr db = Native.Instance.rocksdb_open_with_ttl(options.Handle, path, ttlSeconds);

            return(new RocksDb(db, optionsReferences: null, cfOptionsRefs: null));
        }
Ejemplo n.º 2
0
        public static RocksDb Open(OptionsHandle options, string path)
        {
            IntPtr db = Native.Instance.rocksdb_open(options.Handle, path);

            return(new RocksDb(db, optionsReferences: null, cfOptionsRefs: null));
        }
Ejemplo n.º 3
0
        public static RocksDb OpenReadOnly(OptionsHandle options, string path, bool errorIfLogFileExists)
        {
            IntPtr db = Native.Instance.rocksdb_open_for_read_only(options.Handle, path, errorIfLogFileExists);

            return(new RocksDb(db, optionsReferences: null, cfOptionsRefs: null));
        }
 public ulong Get(byte[] key, ulong keyLength, byte[] buffer, ulong offset, ulong length, ColumnFamilyHandle cf = null, OptionsHandle options = null)
 {
     unsafe
     {
         var ptr = Native.Instance.rocksdb_writebatch_wi_get_from_batch(Handle, (options ?? RocksDb.DefaultOptions).Handle, key, keyLength, out ulong valLength, cf);
         valLength = Math.Min(length, valLength);
         Marshal.Copy(ptr, buffer, (int)offset, (int)valLength);
         Native.Instance.rocksdb_free(ptr);
         return(valLength);
     }
 }
 public ulong Get(byte[] key, byte[] buffer, ulong offset, ulong length, ColumnFamilyHandle cf = null, OptionsHandle options = null)
 {
     return(Get(key, (ulong)key.GetLongLength(0), buffer, offset, length, cf, options));
 }
 public byte[] Get(byte[] key, ulong keyLength, ColumnFamilyHandle cf = null, OptionsHandle options = null)
 {
     return(Native.Instance.rocksdb_writebatch_wi_get_from_batch(Handle, (options ?? RocksDb.DefaultOptions).Handle, key, keyLength, cf));
 }
 public byte[] Get(byte[] key, ColumnFamilyHandle cf = null, OptionsHandle options = null)
 {
     return(Get(key, (ulong)key.GetLongLength(0), cf, options));
 }
 public string Get(string key, ColumnFamilyHandle cf = null, OptionsHandle options = null, Encoding encoding = null)
 {
     return(Native.Instance.rocksdb_writebatch_wi_get_from_batch(Handle, (options ?? RocksDb.DefaultOptions).Handle, key, cf, encoding ?? defaultEncoding));
 }