Example #1
0
// 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
}
Example #2
0
File: db.go Project: tradia/gotable
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
	}
}
Example #3
0
func (s *Snapshot) Close() {
	C.rocksdb_release_snapshot(s.db.db, s.snap)
	s.iteratorOpts.Close()
	s.readOpts.Close()
}
Example #4
0
// 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)
}
Example #5
0
// 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
}
Example #6
0
// 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
}