// ReleaseSnapshot releases the existing snapshot handle for the // given snapshotID. func (r *RocksDB) ReleaseSnapshot(snapshotID string) error { if r.rdb == nil { return util.Errorf("RocksDB is not initialized yet") } snapshotHandle, ok := r.snapshots[snapshotID] if !ok { return util.Errorf("snapshotID %s does not exist", snapshotID) } C.rocksdb_release_snapshot(r.rdb, snapshotHandle) delete(r.snapshots, snapshotID) return nil }
func (opt *ReadOptions) Destroy() { if opt.rOpt != nil { C.rocksdb_readoptions_destroy(opt.rOpt) opt.rOpt = nil } if opt.snap != nil { C.rocksdb_release_snapshot(opt.db, opt.snap) opt.snap = nil opt.db = nil } }
func (s *Snapshot) Close() { C.rocksdb_release_snapshot(s.db.db, s.snap) s.iteratorOpts.Close() s.readOpts.Close() }
// ReleaseSnapshot removes the snapshot from the database's list of snapshots, // and deallocates it. func (db *DB) ReleaseSnapshot(snap *Snapshot) { C.rocksdb_release_snapshot(db.Ldb, snap.snap) }
// Release removes the snapshot from the database's list of snapshots. func (s *Snapshot) Release() { C.rocksdb_release_snapshot(s.cDb, s.c) s.c, s.cDb = nil, nil }
// Release removes the snapshot from the database's list of snapshots. func (self *Snapshot) Release() { C.rocksdb_release_snapshot(self.cDb, self.c) self.c, self.cDb = nil, nil }