id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
29,400 | tecbot/gorocksdb | transaction.go | Destroy | func (transaction *Transaction) Destroy() {
C.rocksdb_transaction_destroy(transaction.c)
transaction.c = nil
} | go | func (transaction *Transaction) Destroy() {
C.rocksdb_transaction_destroy(transaction.c)
transaction.c = nil
} | [
"func",
"(",
"transaction",
"*",
"Transaction",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_transaction_destroy",
"(",
"transaction",
".",
"c",
")",
"\n",
"transaction",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the transaction object. | [
"Destroy",
"deallocates",
"the",
"transaction",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/transaction.go#L122-L125 |
29,401 | tecbot/gorocksdb | backup.go | GetTimestamp | func (b *BackupEngineInfo) GetTimestamp(index int) int64 {
return int64(C.rocksdb_backup_engine_info_timestamp(b.c, C.int(index)))
} | go | func (b *BackupEngineInfo) GetTimestamp(index int) int64 {
return int64(C.rocksdb_backup_engine_info_timestamp(b.c, C.int(index)))
} | [
"func",
"(",
"b",
"*",
"BackupEngineInfo",
")",
"GetTimestamp",
"(",
"index",
"int",
")",
"int64",
"{",
"return",
"int64",
"(",
"C",
".",
"rocksdb_backup_engine_info_timestamp",
"(",
"b",
".",
"c",
",",
"C",
".",
"int",
"(",
"index",
")",
")",
")",
"\n... | // GetTimestamp gets the timestamp at which the backup index was taken. | [
"GetTimestamp",
"gets",
"the",
"timestamp",
"at",
"which",
"the",
"backup",
"index",
"was",
"taken",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/backup.go#L24-L26 |
29,402 | tecbot/gorocksdb | backup.go | GetBackupId | func (b *BackupEngineInfo) GetBackupId(index int) int64 {
return int64(C.rocksdb_backup_engine_info_backup_id(b.c, C.int(index)))
} | go | func (b *BackupEngineInfo) GetBackupId(index int) int64 {
return int64(C.rocksdb_backup_engine_info_backup_id(b.c, C.int(index)))
} | [
"func",
"(",
"b",
"*",
"BackupEngineInfo",
")",
"GetBackupId",
"(",
"index",
"int",
")",
"int64",
"{",
"return",
"int64",
"(",
"C",
".",
"rocksdb_backup_engine_info_backup_id",
"(",
"b",
".",
"c",
",",
"C",
".",
"int",
"(",
"index",
")",
")",
")",
"\n"... | // GetBackupId gets an id that uniquely identifies a backup
// regardless of its position. | [
"GetBackupId",
"gets",
"an",
"id",
"that",
"uniquely",
"identifies",
"a",
"backup",
"regardless",
"of",
"its",
"position",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/backup.go#L30-L32 |
29,403 | tecbot/gorocksdb | backup.go | GetSize | func (b *BackupEngineInfo) GetSize(index int) int64 {
return int64(C.rocksdb_backup_engine_info_size(b.c, C.int(index)))
} | go | func (b *BackupEngineInfo) GetSize(index int) int64 {
return int64(C.rocksdb_backup_engine_info_size(b.c, C.int(index)))
} | [
"func",
"(",
"b",
"*",
"BackupEngineInfo",
")",
"GetSize",
"(",
"index",
"int",
")",
"int64",
"{",
"return",
"int64",
"(",
"C",
".",
"rocksdb_backup_engine_info_size",
"(",
"b",
".",
"c",
",",
"C",
".",
"int",
"(",
"index",
")",
")",
")",
"\n",
"}"
] | // GetSize get the size of the backup in bytes. | [
"GetSize",
"get",
"the",
"size",
"of",
"the",
"backup",
"in",
"bytes",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/backup.go#L35-L37 |
29,404 | tecbot/gorocksdb | backup.go | GetNumFiles | func (b *BackupEngineInfo) GetNumFiles(index int) int32 {
return int32(C.rocksdb_backup_engine_info_number_files(b.c, C.int(index)))
} | go | func (b *BackupEngineInfo) GetNumFiles(index int) int32 {
return int32(C.rocksdb_backup_engine_info_number_files(b.c, C.int(index)))
} | [
"func",
"(",
"b",
"*",
"BackupEngineInfo",
")",
"GetNumFiles",
"(",
"index",
"int",
")",
"int32",
"{",
"return",
"int32",
"(",
"C",
".",
"rocksdb_backup_engine_info_number_files",
"(",
"b",
".",
"c",
",",
"C",
".",
"int",
"(",
"index",
")",
")",
")",
"... | // GetNumFiles gets the number of files in the backup index. | [
"GetNumFiles",
"gets",
"the",
"number",
"of",
"files",
"in",
"the",
"backup",
"index",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/backup.go#L40-L42 |
29,405 | tecbot/gorocksdb | backup.go | Destroy | func (b *BackupEngineInfo) Destroy() {
C.rocksdb_backup_engine_info_destroy(b.c)
b.c = nil
} | go | func (b *BackupEngineInfo) Destroy() {
C.rocksdb_backup_engine_info_destroy(b.c)
b.c = nil
} | [
"func",
"(",
"b",
"*",
"BackupEngineInfo",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_backup_engine_info_destroy",
"(",
"b",
".",
"c",
")",
"\n",
"b",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy destroys the backup engine info instance. | [
"Destroy",
"destroys",
"the",
"backup",
"engine",
"info",
"instance",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/backup.go#L45-L48 |
29,406 | tecbot/gorocksdb | backup.go | SetKeepLogFiles | func (ro *RestoreOptions) SetKeepLogFiles(v int) {
C.rocksdb_restore_options_set_keep_log_files(ro.c, C.int(v))
} | go | func (ro *RestoreOptions) SetKeepLogFiles(v int) {
C.rocksdb_restore_options_set_keep_log_files(ro.c, C.int(v))
} | [
"func",
"(",
"ro",
"*",
"RestoreOptions",
")",
"SetKeepLogFiles",
"(",
"v",
"int",
")",
"{",
"C",
".",
"rocksdb_restore_options_set_keep_log_files",
"(",
"ro",
".",
"c",
",",
"C",
".",
"int",
"(",
"v",
")",
")",
"\n",
"}"
] | // SetKeepLogFiles is used to set or unset the keep_log_files option
// If true, restore won't overwrite the existing log files in wal_dir. It will
// also move all log files from archive directory to wal_dir.
// By default, this is false. | [
"SetKeepLogFiles",
"is",
"used",
"to",
"set",
"or",
"unset",
"the",
"keep_log_files",
"option",
"If",
"true",
"restore",
"won",
"t",
"overwrite",
"the",
"existing",
"log",
"files",
"in",
"wal_dir",
".",
"It",
"will",
"also",
"move",
"all",
"log",
"files",
... | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/backup.go#L67-L69 |
29,407 | tecbot/gorocksdb | backup.go | OpenBackupEngine | func OpenBackupEngine(opts *Options, path string) (*BackupEngine, error) {
var cErr *C.char
cpath := C.CString(path)
defer C.free(unsafe.Pointer(cpath))
be := C.rocksdb_backup_engine_open(opts.c, cpath, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, errors.New(C.GoString(cErr))
}
ret... | go | func OpenBackupEngine(opts *Options, path string) (*BackupEngine, error) {
var cErr *C.char
cpath := C.CString(path)
defer C.free(unsafe.Pointer(cpath))
be := C.rocksdb_backup_engine_open(opts.c, cpath, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, errors.New(C.GoString(cErr))
}
ret... | [
"func",
"OpenBackupEngine",
"(",
"opts",
"*",
"Options",
",",
"path",
"string",
")",
"(",
"*",
"BackupEngine",
",",
"error",
")",
"{",
"var",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cpath",
":=",
"C",
".",
"CString",
"(",
"path",
")",
"\n",
"defer",
... | // OpenBackupEngine opens a backup engine with specified options. | [
"OpenBackupEngine",
"opens",
"a",
"backup",
"engine",
"with",
"specified",
"options",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/backup.go#L85-L100 |
29,408 | tecbot/gorocksdb | backup.go | CreateNewBackup | func (b *BackupEngine) CreateNewBackup(db *DB) error {
var cErr *C.char
C.rocksdb_backup_engine_create_new_backup(b.c, db.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | go | func (b *BackupEngine) CreateNewBackup(db *DB) error {
var cErr *C.char
C.rocksdb_backup_engine_create_new_backup(b.c, db.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | [
"func",
"(",
"b",
"*",
"BackupEngine",
")",
"CreateNewBackup",
"(",
"db",
"*",
"DB",
")",
"error",
"{",
"var",
"cErr",
"*",
"C",
".",
"char",
"\n\n",
"C",
".",
"rocksdb_backup_engine_create_new_backup",
"(",
"b",
".",
"c",
",",
"db",
".",
"c",
",",
"... | // CreateNewBackup takes a new backup from db. | [
"CreateNewBackup",
"takes",
"a",
"new",
"backup",
"from",
"db",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/backup.go#L108-L118 |
29,409 | tecbot/gorocksdb | backup.go | GetInfo | func (b *BackupEngine) GetInfo() *BackupEngineInfo {
return &BackupEngineInfo{
c: C.rocksdb_backup_engine_get_backup_info(b.c),
}
} | go | func (b *BackupEngine) GetInfo() *BackupEngineInfo {
return &BackupEngineInfo{
c: C.rocksdb_backup_engine_get_backup_info(b.c),
}
} | [
"func",
"(",
"b",
"*",
"BackupEngine",
")",
"GetInfo",
"(",
")",
"*",
"BackupEngineInfo",
"{",
"return",
"&",
"BackupEngineInfo",
"{",
"c",
":",
"C",
".",
"rocksdb_backup_engine_get_backup_info",
"(",
"b",
".",
"c",
")",
",",
"}",
"\n",
"}"
] | // GetInfo gets an object that gives information about
// the backups that have already been taken | [
"GetInfo",
"gets",
"an",
"object",
"that",
"gives",
"information",
"about",
"the",
"backups",
"that",
"have",
"already",
"been",
"taken"
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/backup.go#L122-L126 |
29,410 | tecbot/gorocksdb | backup.go | Close | func (b *BackupEngine) Close() {
C.rocksdb_backup_engine_close(b.c)
b.c = nil
} | go | func (b *BackupEngine) Close() {
C.rocksdb_backup_engine_close(b.c)
b.c = nil
} | [
"func",
"(",
"b",
"*",
"BackupEngine",
")",
"Close",
"(",
")",
"{",
"C",
".",
"rocksdb_backup_engine_close",
"(",
"b",
".",
"c",
")",
"\n",
"b",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Close close the backup engine and cleans up state
// The backups already taken remain on storage. | [
"Close",
"close",
"the",
"backup",
"engine",
"and",
"cleans",
"up",
"state",
"The",
"backups",
"already",
"taken",
"remain",
"on",
"storage",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/backup.go#L149-L152 |
29,411 | tecbot/gorocksdb | options_env.go | Destroy | func (opts *EnvOptions) Destroy() {
C.rocksdb_envoptions_destroy(opts.c)
opts.c = nil
} | go | func (opts *EnvOptions) Destroy() {
C.rocksdb_envoptions_destroy(opts.c)
opts.c = nil
} | [
"func",
"(",
"opts",
"*",
"EnvOptions",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_envoptions_destroy",
"(",
"opts",
".",
"c",
")",
"\n",
"opts",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the EnvOptions object. | [
"Destroy",
"deallocates",
"the",
"EnvOptions",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_env.go#L22-L25 |
29,412 | tecbot/gorocksdb | sst_file_writer.go | NewSSTFileWriter | func NewSSTFileWriter(opts *EnvOptions, dbOpts *Options) *SSTFileWriter {
c := C.rocksdb_sstfilewriter_create(opts.c, dbOpts.c)
return &SSTFileWriter{c: c}
} | go | func NewSSTFileWriter(opts *EnvOptions, dbOpts *Options) *SSTFileWriter {
c := C.rocksdb_sstfilewriter_create(opts.c, dbOpts.c)
return &SSTFileWriter{c: c}
} | [
"func",
"NewSSTFileWriter",
"(",
"opts",
"*",
"EnvOptions",
",",
"dbOpts",
"*",
"Options",
")",
"*",
"SSTFileWriter",
"{",
"c",
":=",
"C",
".",
"rocksdb_sstfilewriter_create",
"(",
"opts",
".",
"c",
",",
"dbOpts",
".",
"c",
")",
"\n",
"return",
"&",
"SST... | // NewSSTFileWriter creates an SSTFileWriter object. | [
"NewSSTFileWriter",
"creates",
"an",
"SSTFileWriter",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/sst_file_writer.go#L19-L22 |
29,413 | tecbot/gorocksdb | sst_file_writer.go | Open | func (w *SSTFileWriter) Open(path string) error {
var (
cErr *C.char
cPath = C.CString(path)
)
defer C.free(unsafe.Pointer(cPath))
C.rocksdb_sstfilewriter_open(w.c, cPath, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | go | func (w *SSTFileWriter) Open(path string) error {
var (
cErr *C.char
cPath = C.CString(path)
)
defer C.free(unsafe.Pointer(cPath))
C.rocksdb_sstfilewriter_open(w.c, cPath, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | [
"func",
"(",
"w",
"*",
"SSTFileWriter",
")",
"Open",
"(",
"path",
"string",
")",
"error",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cPath",
"=",
"C",
".",
"CString",
"(",
"path",
")",
"\n",
")",
"\n",
"defer",
"C",
".",
"free",
"("... | // Open prepares SstFileWriter to write into file located at "path". | [
"Open",
"prepares",
"SstFileWriter",
"to",
"write",
"into",
"file",
"located",
"at",
"path",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/sst_file_writer.go#L25-L37 |
29,414 | tecbot/gorocksdb | sst_file_writer.go | Finish | func (w *SSTFileWriter) Finish() error {
var cErr *C.char
C.rocksdb_sstfilewriter_finish(w.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | go | func (w *SSTFileWriter) Finish() error {
var cErr *C.char
C.rocksdb_sstfilewriter_finish(w.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | [
"func",
"(",
"w",
"*",
"SSTFileWriter",
")",
"Finish",
"(",
")",
"error",
"{",
"var",
"cErr",
"*",
"C",
".",
"char",
"\n",
"C",
".",
"rocksdb_sstfilewriter_finish",
"(",
"w",
".",
"c",
",",
"&",
"cErr",
")",
"\n",
"if",
"cErr",
"!=",
"nil",
"{",
... | // Finish finishes writing to sst file and close file. | [
"Finish",
"finishes",
"writing",
"to",
"sst",
"file",
"and",
"close",
"file",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/sst_file_writer.go#L54-L62 |
29,415 | tecbot/gorocksdb | options_transactiondb.go | Destroy | func (opts *TransactionDBOptions) Destroy() {
C.rocksdb_transactiondb_options_destroy(opts.c)
opts.c = nil
} | go | func (opts *TransactionDBOptions) Destroy() {
C.rocksdb_transactiondb_options_destroy(opts.c)
opts.c = nil
} | [
"func",
"(",
"opts",
"*",
"TransactionDBOptions",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_transactiondb_options_destroy",
"(",
"opts",
".",
"c",
")",
"\n",
"opts",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the TransactionDBOptions object. | [
"Destroy",
"deallocates",
"the",
"TransactionDBOptions",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_transactiondb.go#L69-L72 |
29,416 | tecbot/gorocksdb | cache.go | NewLRUCache | func NewLRUCache(capacity int) *Cache {
return NewNativeCache(C.rocksdb_cache_create_lru(C.size_t(capacity)))
} | go | func NewLRUCache(capacity int) *Cache {
return NewNativeCache(C.rocksdb_cache_create_lru(C.size_t(capacity)))
} | [
"func",
"NewLRUCache",
"(",
"capacity",
"int",
")",
"*",
"Cache",
"{",
"return",
"NewNativeCache",
"(",
"C",
".",
"rocksdb_cache_create_lru",
"(",
"C",
".",
"size_t",
"(",
"capacity",
")",
")",
")",
"\n",
"}"
] | // NewLRUCache creates a new LRU Cache object with the capacity given. | [
"NewLRUCache",
"creates",
"a",
"new",
"LRU",
"Cache",
"object",
"with",
"the",
"capacity",
"given",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/cache.go#L12-L14 |
29,417 | tecbot/gorocksdb | cache.go | Destroy | func (c *Cache) Destroy() {
C.rocksdb_cache_destroy(c.c)
c.c = nil
} | go | func (c *Cache) Destroy() {
C.rocksdb_cache_destroy(c.c)
c.c = nil
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_cache_destroy",
"(",
"c",
".",
"c",
")",
"\n",
"c",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the Cache object. | [
"Destroy",
"deallocates",
"the",
"Cache",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/cache.go#L32-L35 |
29,418 | tecbot/gorocksdb | options_block_based_table.go | Destroy | func (opts *BlockBasedTableOptions) Destroy() {
C.rocksdb_block_based_options_destroy(opts.c)
opts.c = nil
opts.cache = nil
opts.compCache = nil
} | go | func (opts *BlockBasedTableOptions) Destroy() {
C.rocksdb_block_based_options_destroy(opts.c)
opts.c = nil
opts.cache = nil
opts.compCache = nil
} | [
"func",
"(",
"opts",
"*",
"BlockBasedTableOptions",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_block_based_options_destroy",
"(",
"opts",
".",
"c",
")",
"\n",
"opts",
".",
"c",
"=",
"nil",
"\n",
"opts",
".",
"cache",
"=",
"nil",
"\n",
"opts",
".... | // Destroy deallocates the BlockBasedTableOptions object. | [
"Destroy",
"deallocates",
"the",
"BlockBasedTableOptions",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_block_based_table.go#L44-L49 |
29,419 | tecbot/gorocksdb | options_compaction.go | Destroy | func (opts *UniversalCompactionOptions) Destroy() {
C.rocksdb_universal_compaction_options_destroy(opts.c)
opts.c = nil
} | go | func (opts *UniversalCompactionOptions) Destroy() {
C.rocksdb_universal_compaction_options_destroy(opts.c)
opts.c = nil
} | [
"func",
"(",
"opts",
"*",
"UniversalCompactionOptions",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_universal_compaction_options_destroy",
"(",
"opts",
".",
"c",
")",
"\n",
"opts",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the UniversalCompactionOptions object. | [
"Destroy",
"deallocates",
"the",
"UniversalCompactionOptions",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_compaction.go#L127-L130 |
29,420 | tecbot/gorocksdb | slice.go | NewSlice | func NewSlice(data *C.char, size C.size_t) *Slice {
return &Slice{data, size, false}
} | go | func NewSlice(data *C.char, size C.size_t) *Slice {
return &Slice{data, size, false}
} | [
"func",
"NewSlice",
"(",
"data",
"*",
"C",
".",
"char",
",",
"size",
"C",
".",
"size_t",
")",
"*",
"Slice",
"{",
"return",
"&",
"Slice",
"{",
"data",
",",
"size",
",",
"false",
"}",
"\n",
"}"
] | // NewSlice returns a slice with the given data. | [
"NewSlice",
"returns",
"a",
"slice",
"with",
"the",
"given",
"data",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/slice.go#L23-L25 |
29,421 | tecbot/gorocksdb | slice.go | StringToSlice | func StringToSlice(data string) *Slice {
return NewSlice(C.CString(data), C.size_t(len(data)))
} | go | func StringToSlice(data string) *Slice {
return NewSlice(C.CString(data), C.size_t(len(data)))
} | [
"func",
"StringToSlice",
"(",
"data",
"string",
")",
"*",
"Slice",
"{",
"return",
"NewSlice",
"(",
"C",
".",
"CString",
"(",
"data",
")",
",",
"C",
".",
"size_t",
"(",
"len",
"(",
"data",
")",
")",
")",
"\n",
"}"
] | // StringToSlice is similar to NewSlice, but can be called with
// a Go string type. This exists to make testing integration
// with Gorocksdb easier. | [
"StringToSlice",
"is",
"similar",
"to",
"NewSlice",
"but",
"can",
"be",
"called",
"with",
"a",
"Go",
"string",
"type",
".",
"This",
"exists",
"to",
"make",
"testing",
"integration",
"with",
"Gorocksdb",
"easier",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/slice.go#L30-L32 |
29,422 | tecbot/gorocksdb | slice.go | Free | func (s *Slice) Free() {
if !s.freed {
C.free(unsafe.Pointer(s.data))
s.freed = true
}
} | go | func (s *Slice) Free() {
if !s.freed {
C.free(unsafe.Pointer(s.data))
s.freed = true
}
} | [
"func",
"(",
"s",
"*",
"Slice",
")",
"Free",
"(",
")",
"{",
"if",
"!",
"s",
".",
"freed",
"{",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"s",
".",
"data",
")",
")",
"\n",
"s",
".",
"freed",
"=",
"true",
"\n",
"}",
"\n",
"}"
] | // Free frees the slice data. | [
"Free",
"frees",
"the",
"slice",
"data",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/slice.go#L45-L50 |
29,423 | tecbot/gorocksdb | options.go | IncreaseParallelism | func (opts *Options) IncreaseParallelism(total_threads int) {
C.rocksdb_options_increase_parallelism(opts.c, C.int(total_threads))
} | go | func (opts *Options) IncreaseParallelism(total_threads int) {
C.rocksdb_options_increase_parallelism(opts.c, C.int(total_threads))
} | [
"func",
"(",
"opts",
"*",
"Options",
")",
"IncreaseParallelism",
"(",
"total_threads",
"int",
")",
"{",
"C",
".",
"rocksdb_options_increase_parallelism",
"(",
"opts",
".",
"c",
",",
"C",
".",
"int",
"(",
"total_threads",
")",
")",
"\n",
"}"
] | // IncreaseParallelism sets the parallelism.
//
// By default, RocksDB uses only one background thread for flush and
// compaction. Calling this function will set it up such that total of
// `total_threads` is used. Good value for `total_threads` is the number of
// cores. You almost definitely want to call this functi... | [
"IncreaseParallelism",
"sets",
"the",
"parallelism",
".",
"By",
"default",
"RocksDB",
"uses",
"only",
"one",
"background",
"thread",
"for",
"flush",
"and",
"compaction",
".",
"Calling",
"this",
"function",
"will",
"set",
"it",
"up",
"such",
"that",
"total",
"o... | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options.go#L251-L253 |
29,424 | tecbot/gorocksdb | options.go | OptimizeUniversalStyleCompaction | func (opts *Options) OptimizeUniversalStyleCompaction(memtable_memory_budget uint64) {
C.rocksdb_options_optimize_universal_style_compaction(opts.c, C.uint64_t(memtable_memory_budget))
} | go | func (opts *Options) OptimizeUniversalStyleCompaction(memtable_memory_budget uint64) {
C.rocksdb_options_optimize_universal_style_compaction(opts.c, C.uint64_t(memtable_memory_budget))
} | [
"func",
"(",
"opts",
"*",
"Options",
")",
"OptimizeUniversalStyleCompaction",
"(",
"memtable_memory_budget",
"uint64",
")",
"{",
"C",
".",
"rocksdb_options_optimize_universal_style_compaction",
"(",
"opts",
".",
"c",
",",
"C",
".",
"uint64_t",
"(",
"memtable_memory_bu... | // OptimizeUniversalStyleCompaction optimize the DB for universal compaction.
// See note on OptimizeLevelStyleCompaction. | [
"OptimizeUniversalStyleCompaction",
"optimize",
"the",
"DB",
"for",
"universal",
"compaction",
".",
"See",
"note",
"on",
"OptimizeLevelStyleCompaction",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options.go#L296-L298 |
29,425 | tecbot/gorocksdb | options.go | SetMinLevelToCompress | func (opts *Options) SetMinLevelToCompress(value int) {
C.rocksdb_options_set_min_level_to_compress(opts.c, C.int(value))
} | go | func (opts *Options) SetMinLevelToCompress(value int) {
C.rocksdb_options_set_min_level_to_compress(opts.c, C.int(value))
} | [
"func",
"(",
"opts",
"*",
"Options",
")",
"SetMinLevelToCompress",
"(",
"value",
"int",
")",
"{",
"C",
".",
"rocksdb_options_set_min_level_to_compress",
"(",
"opts",
".",
"c",
",",
"C",
".",
"int",
"(",
"value",
")",
")",
"\n",
"}"
] | // SetMinLevelToCompress sets the start level to use compression. | [
"SetMinLevelToCompress",
"sets",
"the",
"start",
"level",
"to",
"use",
"compression",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options.go#L391-L393 |
29,426 | tecbot/gorocksdb | options.go | SetCreateIfMissingColumnFamilies | func (opts *Options) SetCreateIfMissingColumnFamilies(value bool) {
C.rocksdb_options_set_create_missing_column_families(opts.c, boolToChar(value))
} | go | func (opts *Options) SetCreateIfMissingColumnFamilies(value bool) {
C.rocksdb_options_set_create_missing_column_families(opts.c, boolToChar(value))
} | [
"func",
"(",
"opts",
"*",
"Options",
")",
"SetCreateIfMissingColumnFamilies",
"(",
"value",
"bool",
")",
"{",
"C",
".",
"rocksdb_options_set_create_missing_column_families",
"(",
"opts",
".",
"c",
",",
"boolToChar",
"(",
"value",
")",
")",
"\n",
"}"
] | // SetCreateIfMissingColumnFamilies specifies whether the column families
// should be created if they are missing. | [
"SetCreateIfMissingColumnFamilies",
"specifies",
"whether",
"the",
"column",
"families",
"should",
"be",
"created",
"if",
"they",
"are",
"missing",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options.go#L1086-L1088 |
29,427 | tecbot/gorocksdb | options.go | SetBlockBasedTableFactory | func (opts *Options) SetBlockBasedTableFactory(value *BlockBasedTableOptions) {
opts.bbto = value
C.rocksdb_options_set_block_based_table_factory(opts.c, value.c)
} | go | func (opts *Options) SetBlockBasedTableFactory(value *BlockBasedTableOptions) {
opts.bbto = value
C.rocksdb_options_set_block_based_table_factory(opts.c, value.c)
} | [
"func",
"(",
"opts",
"*",
"Options",
")",
"SetBlockBasedTableFactory",
"(",
"value",
"*",
"BlockBasedTableOptions",
")",
"{",
"opts",
".",
"bbto",
"=",
"value",
"\n",
"C",
".",
"rocksdb_options_set_block_based_table_factory",
"(",
"opts",
".",
"c",
",",
"value",... | // SetBlockBasedTableFactory sets the block based table factory. | [
"SetBlockBasedTableFactory",
"sets",
"the",
"block",
"based",
"table",
"factory",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options.go#L1091-L1094 |
29,428 | tecbot/gorocksdb | options.go | Destroy | func (opts *Options) Destroy() {
C.rocksdb_options_destroy(opts.c)
if opts.ccmp != nil {
C.rocksdb_comparator_destroy(opts.ccmp)
}
if opts.cst != nil {
C.rocksdb_slicetransform_destroy(opts.cst)
}
if opts.ccf != nil {
C.rocksdb_compactionfilter_destroy(opts.ccf)
}
opts.c = nil
opts.env = nil
opts.bbto =... | go | func (opts *Options) Destroy() {
C.rocksdb_options_destroy(opts.c)
if opts.ccmp != nil {
C.rocksdb_comparator_destroy(opts.ccmp)
}
if opts.cst != nil {
C.rocksdb_slicetransform_destroy(opts.cst)
}
if opts.ccf != nil {
C.rocksdb_compactionfilter_destroy(opts.ccf)
}
opts.c = nil
opts.env = nil
opts.bbto =... | [
"func",
"(",
"opts",
"*",
"Options",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_options_destroy",
"(",
"opts",
".",
"c",
")",
"\n",
"if",
"opts",
".",
"ccmp",
"!=",
"nil",
"{",
"C",
".",
"rocksdb_comparator_destroy",
"(",
"opts",
".",
"ccmp",
... | // Destroy deallocates the Options object. | [
"Destroy",
"deallocates",
"the",
"Options",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options.go#L1112-L1126 |
29,429 | tecbot/gorocksdb | options_ingest.go | SetMoveFiles | func (opts *IngestExternalFileOptions) SetMoveFiles(flag bool) {
C.rocksdb_ingestexternalfileoptions_set_move_files(opts.c, boolToChar(flag))
} | go | func (opts *IngestExternalFileOptions) SetMoveFiles(flag bool) {
C.rocksdb_ingestexternalfileoptions_set_move_files(opts.c, boolToChar(flag))
} | [
"func",
"(",
"opts",
"*",
"IngestExternalFileOptions",
")",
"SetMoveFiles",
"(",
"flag",
"bool",
")",
"{",
"C",
".",
"rocksdb_ingestexternalfileoptions_set_move_files",
"(",
"opts",
".",
"c",
",",
"boolToChar",
"(",
"flag",
")",
")",
"\n",
"}"
] | // SetMoveFiles specifies if it should move the files instead of copying them.
// Default to false. | [
"SetMoveFiles",
"specifies",
"if",
"it",
"should",
"move",
"the",
"files",
"instead",
"of",
"copying",
"them",
".",
"Default",
"to",
"false",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_ingest.go#L23-L25 |
29,430 | tecbot/gorocksdb | options_ingest.go | SetSnapshotConsistency | func (opts *IngestExternalFileOptions) SetSnapshotConsistency(flag bool) {
C.rocksdb_ingestexternalfileoptions_set_snapshot_consistency(opts.c, boolToChar(flag))
} | go | func (opts *IngestExternalFileOptions) SetSnapshotConsistency(flag bool) {
C.rocksdb_ingestexternalfileoptions_set_snapshot_consistency(opts.c, boolToChar(flag))
} | [
"func",
"(",
"opts",
"*",
"IngestExternalFileOptions",
")",
"SetSnapshotConsistency",
"(",
"flag",
"bool",
")",
"{",
"C",
".",
"rocksdb_ingestexternalfileoptions_set_snapshot_consistency",
"(",
"opts",
".",
"c",
",",
"boolToChar",
"(",
"flag",
")",
")",
"\n",
"}"
... | // SetSnapshotConsistency if specifies the consistency.
// If set to false, an ingested file key could appear in existing snapshots that were created before the
// file was ingested.
// Default to true. | [
"SetSnapshotConsistency",
"if",
"specifies",
"the",
"consistency",
".",
"If",
"set",
"to",
"false",
"an",
"ingested",
"file",
"key",
"could",
"appear",
"in",
"existing",
"snapshots",
"that",
"were",
"created",
"before",
"the",
"file",
"was",
"ingested",
".",
"... | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_ingest.go#L31-L33 |
29,431 | tecbot/gorocksdb | options_ingest.go | Destroy | func (opts *IngestExternalFileOptions) Destroy() {
C.rocksdb_ingestexternalfileoptions_destroy(opts.c)
opts.c = nil
} | go | func (opts *IngestExternalFileOptions) Destroy() {
C.rocksdb_ingestexternalfileoptions_destroy(opts.c)
opts.c = nil
} | [
"func",
"(",
"opts",
"*",
"IngestExternalFileOptions",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_ingestexternalfileoptions_destroy",
"(",
"opts",
".",
"c",
")",
"\n",
"opts",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the IngestExternalFileOptions object. | [
"Destroy",
"deallocates",
"the",
"IngestExternalFileOptions",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_ingest.go#L62-L65 |
29,432 | tecbot/gorocksdb | iterator.go | ValidForPrefix | func (iter *Iterator) ValidForPrefix(prefix []byte) bool {
if C.rocksdb_iter_valid(iter.c) == 0 {
return false
}
key := iter.Key()
result := bytes.HasPrefix(key.Data(), prefix)
key.Free()
return result
} | go | func (iter *Iterator) ValidForPrefix(prefix []byte) bool {
if C.rocksdb_iter_valid(iter.c) == 0 {
return false
}
key := iter.Key()
result := bytes.HasPrefix(key.Data(), prefix)
key.Free()
return result
} | [
"func",
"(",
"iter",
"*",
"Iterator",
")",
"ValidForPrefix",
"(",
"prefix",
"[",
"]",
"byte",
")",
"bool",
"{",
"if",
"C",
".",
"rocksdb_iter_valid",
"(",
"iter",
".",
"c",
")",
"==",
"0",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"key",
":=",
"it... | // ValidForPrefix returns false only when an Iterator has iterated past the
// first or the last key in the database or the specified prefix. | [
"ValidForPrefix",
"returns",
"false",
"only",
"when",
"an",
"Iterator",
"has",
"iterated",
"past",
"the",
"first",
"or",
"the",
"last",
"key",
"in",
"the",
"database",
"or",
"the",
"specified",
"prefix",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/iterator.go#L46-L55 |
29,433 | tecbot/gorocksdb | iterator.go | Key | func (iter *Iterator) Key() *Slice {
var cLen C.size_t
cKey := C.rocksdb_iter_key(iter.c, &cLen)
if cKey == nil {
return nil
}
return &Slice{cKey, cLen, true}
} | go | func (iter *Iterator) Key() *Slice {
var cLen C.size_t
cKey := C.rocksdb_iter_key(iter.c, &cLen)
if cKey == nil {
return nil
}
return &Slice{cKey, cLen, true}
} | [
"func",
"(",
"iter",
"*",
"Iterator",
")",
"Key",
"(",
")",
"*",
"Slice",
"{",
"var",
"cLen",
"C",
".",
"size_t",
"\n",
"cKey",
":=",
"C",
".",
"rocksdb_iter_key",
"(",
"iter",
".",
"c",
",",
"&",
"cLen",
")",
"\n",
"if",
"cKey",
"==",
"nil",
"... | // Key returns the key the iterator currently holds. | [
"Key",
"returns",
"the",
"key",
"the",
"iterator",
"currently",
"holds",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/iterator.go#L58-L65 |
29,434 | tecbot/gorocksdb | iterator.go | Value | func (iter *Iterator) Value() *Slice {
var cLen C.size_t
cVal := C.rocksdb_iter_value(iter.c, &cLen)
if cVal == nil {
return nil
}
return &Slice{cVal, cLen, true}
} | go | func (iter *Iterator) Value() *Slice {
var cLen C.size_t
cVal := C.rocksdb_iter_value(iter.c, &cLen)
if cVal == nil {
return nil
}
return &Slice{cVal, cLen, true}
} | [
"func",
"(",
"iter",
"*",
"Iterator",
")",
"Value",
"(",
")",
"*",
"Slice",
"{",
"var",
"cLen",
"C",
".",
"size_t",
"\n",
"cVal",
":=",
"C",
".",
"rocksdb_iter_value",
"(",
"iter",
".",
"c",
",",
"&",
"cLen",
")",
"\n",
"if",
"cVal",
"==",
"nil",... | // Value returns the value in the database the iterator currently holds. | [
"Value",
"returns",
"the",
"value",
"in",
"the",
"database",
"the",
"iterator",
"currently",
"holds",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/iterator.go#L68-L75 |
29,435 | tecbot/gorocksdb | iterator.go | Seek | func (iter *Iterator) Seek(key []byte) {
cKey := byteToChar(key)
C.rocksdb_iter_seek(iter.c, cKey, C.size_t(len(key)))
} | go | func (iter *Iterator) Seek(key []byte) {
cKey := byteToChar(key)
C.rocksdb_iter_seek(iter.c, cKey, C.size_t(len(key)))
} | [
"func",
"(",
"iter",
"*",
"Iterator",
")",
"Seek",
"(",
"key",
"[",
"]",
"byte",
")",
"{",
"cKey",
":=",
"byteToChar",
"(",
"key",
")",
"\n",
"C",
".",
"rocksdb_iter_seek",
"(",
"iter",
".",
"c",
",",
"cKey",
",",
"C",
".",
"size_t",
"(",
"len",
... | // Seek moves the iterator to the position greater than or equal to the key. | [
"Seek",
"moves",
"the",
"iterator",
"to",
"the",
"position",
"greater",
"than",
"or",
"equal",
"to",
"the",
"key",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/iterator.go#L98-L101 |
29,436 | tecbot/gorocksdb | iterator.go | SeekForPrev | func (iter *Iterator) SeekForPrev(key []byte) {
cKey := byteToChar(key)
C.rocksdb_iter_seek_for_prev(iter.c, cKey, C.size_t(len(key)))
} | go | func (iter *Iterator) SeekForPrev(key []byte) {
cKey := byteToChar(key)
C.rocksdb_iter_seek_for_prev(iter.c, cKey, C.size_t(len(key)))
} | [
"func",
"(",
"iter",
"*",
"Iterator",
")",
"SeekForPrev",
"(",
"key",
"[",
"]",
"byte",
")",
"{",
"cKey",
":=",
"byteToChar",
"(",
"key",
")",
"\n",
"C",
".",
"rocksdb_iter_seek_for_prev",
"(",
"iter",
".",
"c",
",",
"cKey",
",",
"C",
".",
"size_t",
... | // SeekForPrev moves the iterator to the last key that less than or equal
// to the target key, in contrast with Seek. | [
"SeekForPrev",
"moves",
"the",
"iterator",
"to",
"the",
"last",
"key",
"that",
"less",
"than",
"or",
"equal",
"to",
"the",
"target",
"key",
"in",
"contrast",
"with",
"Seek",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/iterator.go#L105-L108 |
29,437 | tecbot/gorocksdb | write_batch.go | WriteBatchFrom | func WriteBatchFrom(data []byte) *WriteBatch {
return NewNativeWriteBatch(C.rocksdb_writebatch_create_from(byteToChar(data), C.size_t(len(data))))
} | go | func WriteBatchFrom(data []byte) *WriteBatch {
return NewNativeWriteBatch(C.rocksdb_writebatch_create_from(byteToChar(data), C.size_t(len(data))))
} | [
"func",
"WriteBatchFrom",
"(",
"data",
"[",
"]",
"byte",
")",
"*",
"WriteBatch",
"{",
"return",
"NewNativeWriteBatch",
"(",
"C",
".",
"rocksdb_writebatch_create_from",
"(",
"byteToChar",
"(",
"data",
")",
",",
"C",
".",
"size_t",
"(",
"len",
"(",
"data",
"... | // WriteBatchFrom creates a write batch from a serialized WriteBatch. | [
"WriteBatchFrom",
"creates",
"a",
"write",
"batch",
"from",
"a",
"serialized",
"WriteBatch",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/write_batch.go#L26-L28 |
29,438 | tecbot/gorocksdb | write_batch.go | Put | func (wb *WriteBatch) Put(key, value []byte) {
cKey := byteToChar(key)
cValue := byteToChar(value)
C.rocksdb_writebatch_put(wb.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))
} | go | func (wb *WriteBatch) Put(key, value []byte) {
cKey := byteToChar(key)
cValue := byteToChar(value)
C.rocksdb_writebatch_put(wb.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))
} | [
"func",
"(",
"wb",
"*",
"WriteBatch",
")",
"Put",
"(",
"key",
",",
"value",
"[",
"]",
"byte",
")",
"{",
"cKey",
":=",
"byteToChar",
"(",
"key",
")",
"\n",
"cValue",
":=",
"byteToChar",
"(",
"value",
")",
"\n",
"C",
".",
"rocksdb_writebatch_put",
"(",... | // Put queues a key-value pair. | [
"Put",
"queues",
"a",
"key",
"-",
"value",
"pair",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/write_batch.go#L31-L35 |
29,439 | tecbot/gorocksdb | write_batch.go | PutCF | func (wb *WriteBatch) PutCF(cf *ColumnFamilyHandle, key, value []byte) {
cKey := byteToChar(key)
cValue := byteToChar(value)
C.rocksdb_writebatch_put_cf(wb.c, cf.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))
} | go | func (wb *WriteBatch) PutCF(cf *ColumnFamilyHandle, key, value []byte) {
cKey := byteToChar(key)
cValue := byteToChar(value)
C.rocksdb_writebatch_put_cf(wb.c, cf.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))
} | [
"func",
"(",
"wb",
"*",
"WriteBatch",
")",
"PutCF",
"(",
"cf",
"*",
"ColumnFamilyHandle",
",",
"key",
",",
"value",
"[",
"]",
"byte",
")",
"{",
"cKey",
":=",
"byteToChar",
"(",
"key",
")",
"\n",
"cValue",
":=",
"byteToChar",
"(",
"value",
")",
"\n",
... | // PutCF queues a key-value pair in a column family. | [
"PutCF",
"queues",
"a",
"key",
"-",
"value",
"pair",
"in",
"a",
"column",
"family",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/write_batch.go#L38-L42 |
29,440 | tecbot/gorocksdb | write_batch.go | Merge | func (wb *WriteBatch) Merge(key, value []byte) {
cKey := byteToChar(key)
cValue := byteToChar(value)
C.rocksdb_writebatch_merge(wb.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))
} | go | func (wb *WriteBatch) Merge(key, value []byte) {
cKey := byteToChar(key)
cValue := byteToChar(value)
C.rocksdb_writebatch_merge(wb.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))
} | [
"func",
"(",
"wb",
"*",
"WriteBatch",
")",
"Merge",
"(",
"key",
",",
"value",
"[",
"]",
"byte",
")",
"{",
"cKey",
":=",
"byteToChar",
"(",
"key",
")",
"\n",
"cValue",
":=",
"byteToChar",
"(",
"value",
")",
"\n",
"C",
".",
"rocksdb_writebatch_merge",
... | // Merge queues a merge of "value" with the existing value of "key". | [
"Merge",
"queues",
"a",
"merge",
"of",
"value",
"with",
"the",
"existing",
"value",
"of",
"key",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/write_batch.go#L45-L49 |
29,441 | tecbot/gorocksdb | write_batch.go | MergeCF | func (wb *WriteBatch) MergeCF(cf *ColumnFamilyHandle, key, value []byte) {
cKey := byteToChar(key)
cValue := byteToChar(value)
C.rocksdb_writebatch_merge_cf(wb.c, cf.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))
} | go | func (wb *WriteBatch) MergeCF(cf *ColumnFamilyHandle, key, value []byte) {
cKey := byteToChar(key)
cValue := byteToChar(value)
C.rocksdb_writebatch_merge_cf(wb.c, cf.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))
} | [
"func",
"(",
"wb",
"*",
"WriteBatch",
")",
"MergeCF",
"(",
"cf",
"*",
"ColumnFamilyHandle",
",",
"key",
",",
"value",
"[",
"]",
"byte",
")",
"{",
"cKey",
":=",
"byteToChar",
"(",
"key",
")",
"\n",
"cValue",
":=",
"byteToChar",
"(",
"value",
")",
"\n"... | // MergeCF queues a merge of "value" with the existing value of "key" in a
// column family. | [
"MergeCF",
"queues",
"a",
"merge",
"of",
"value",
"with",
"the",
"existing",
"value",
"of",
"key",
"in",
"a",
"column",
"family",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/write_batch.go#L53-L57 |
29,442 | tecbot/gorocksdb | write_batch.go | Delete | func (wb *WriteBatch) Delete(key []byte) {
cKey := byteToChar(key)
C.rocksdb_writebatch_delete(wb.c, cKey, C.size_t(len(key)))
} | go | func (wb *WriteBatch) Delete(key []byte) {
cKey := byteToChar(key)
C.rocksdb_writebatch_delete(wb.c, cKey, C.size_t(len(key)))
} | [
"func",
"(",
"wb",
"*",
"WriteBatch",
")",
"Delete",
"(",
"key",
"[",
"]",
"byte",
")",
"{",
"cKey",
":=",
"byteToChar",
"(",
"key",
")",
"\n",
"C",
".",
"rocksdb_writebatch_delete",
"(",
"wb",
".",
"c",
",",
"cKey",
",",
"C",
".",
"size_t",
"(",
... | // Delete queues a deletion of the data at key. | [
"Delete",
"queues",
"a",
"deletion",
"of",
"the",
"data",
"at",
"key",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/write_batch.go#L60-L63 |
29,443 | tecbot/gorocksdb | write_batch.go | DeleteCF | func (wb *WriteBatch) DeleteCF(cf *ColumnFamilyHandle, key []byte) {
cKey := byteToChar(key)
C.rocksdb_writebatch_delete_cf(wb.c, cf.c, cKey, C.size_t(len(key)))
} | go | func (wb *WriteBatch) DeleteCF(cf *ColumnFamilyHandle, key []byte) {
cKey := byteToChar(key)
C.rocksdb_writebatch_delete_cf(wb.c, cf.c, cKey, C.size_t(len(key)))
} | [
"func",
"(",
"wb",
"*",
"WriteBatch",
")",
"DeleteCF",
"(",
"cf",
"*",
"ColumnFamilyHandle",
",",
"key",
"[",
"]",
"byte",
")",
"{",
"cKey",
":=",
"byteToChar",
"(",
"key",
")",
"\n",
"C",
".",
"rocksdb_writebatch_delete_cf",
"(",
"wb",
".",
"c",
",",
... | // DeleteCF queues a deletion of the data at key in a column family. | [
"DeleteCF",
"queues",
"a",
"deletion",
"of",
"the",
"data",
"at",
"key",
"in",
"a",
"column",
"family",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/write_batch.go#L66-L69 |
29,444 | tecbot/gorocksdb | write_batch.go | Data | func (wb *WriteBatch) Data() []byte {
var cSize C.size_t
cValue := C.rocksdb_writebatch_data(wb.c, &cSize)
return charToByte(cValue, cSize)
} | go | func (wb *WriteBatch) Data() []byte {
var cSize C.size_t
cValue := C.rocksdb_writebatch_data(wb.c, &cSize)
return charToByte(cValue, cSize)
} | [
"func",
"(",
"wb",
"*",
"WriteBatch",
")",
"Data",
"(",
")",
"[",
"]",
"byte",
"{",
"var",
"cSize",
"C",
".",
"size_t",
"\n",
"cValue",
":=",
"C",
".",
"rocksdb_writebatch_data",
"(",
"wb",
".",
"c",
",",
"&",
"cSize",
")",
"\n",
"return",
"charToB... | // Data returns the serialized version of this batch. | [
"Data",
"returns",
"the",
"serialized",
"version",
"of",
"this",
"batch",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/write_batch.go#L72-L76 |
29,445 | tecbot/gorocksdb | write_batch.go | NewIterator | func (wb *WriteBatch) NewIterator() *WriteBatchIterator {
data := wb.Data()
if len(data) < 8+4 {
return &WriteBatchIterator{}
}
return &WriteBatchIterator{data: data[12:]}
} | go | func (wb *WriteBatch) NewIterator() *WriteBatchIterator {
data := wb.Data()
if len(data) < 8+4 {
return &WriteBatchIterator{}
}
return &WriteBatchIterator{data: data[12:]}
} | [
"func",
"(",
"wb",
"*",
"WriteBatch",
")",
"NewIterator",
"(",
")",
"*",
"WriteBatchIterator",
"{",
"data",
":=",
"wb",
".",
"Data",
"(",
")",
"\n",
"if",
"len",
"(",
"data",
")",
"<",
"8",
"+",
"4",
"{",
"return",
"&",
"WriteBatchIterator",
"{",
"... | // NewIterator returns a iterator to iterate over the records in the batch. | [
"NewIterator",
"returns",
"a",
"iterator",
"to",
"iterate",
"over",
"the",
"records",
"in",
"the",
"batch",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/write_batch.go#L84-L90 |
29,446 | tecbot/gorocksdb | write_batch.go | Destroy | func (wb *WriteBatch) Destroy() {
C.rocksdb_writebatch_destroy(wb.c)
wb.c = nil
} | go | func (wb *WriteBatch) Destroy() {
C.rocksdb_writebatch_destroy(wb.c)
wb.c = nil
} | [
"func",
"(",
"wb",
"*",
"WriteBatch",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_writebatch_destroy",
"(",
"wb",
".",
"c",
")",
"\n",
"wb",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the WriteBatch object. | [
"Destroy",
"deallocates",
"the",
"WriteBatch",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/write_batch.go#L98-L101 |
29,447 | tecbot/gorocksdb | write_batch.go | Next | func (iter *WriteBatchIterator) Next() bool {
if iter.err != nil || len(iter.data) == 0 {
return false
}
// reset the current record
iter.record.CF = 0
iter.record.Key = nil
iter.record.Value = nil
// parse the record type
iter.record.Type = iter.decodeRecType()
switch iter.record.Type {
case
WriteBatch... | go | func (iter *WriteBatchIterator) Next() bool {
if iter.err != nil || len(iter.data) == 0 {
return false
}
// reset the current record
iter.record.CF = 0
iter.record.Key = nil
iter.record.Value = nil
// parse the record type
iter.record.Type = iter.decodeRecType()
switch iter.record.Type {
case
WriteBatch... | [
"func",
"(",
"iter",
"*",
"WriteBatchIterator",
")",
"Next",
"(",
")",
"bool",
"{",
"if",
"iter",
".",
"err",
"!=",
"nil",
"||",
"len",
"(",
"iter",
".",
"data",
")",
"==",
"0",
"{",
"return",
"false",
"\n",
"}",
"\n",
"// reset the current record",
... | // Next returns the next record.
// Returns false if no further record exists. | [
"Next",
"returns",
"the",
"next",
"record",
".",
"Returns",
"false",
"if",
"no",
"further",
"record",
"exists",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/write_batch.go#L147-L209 |
29,448 | tecbot/gorocksdb | slice_transform.go | NewFixedPrefixTransform | func NewFixedPrefixTransform(prefixLen int) SliceTransform {
return NewNativeSliceTransform(C.rocksdb_slicetransform_create_fixed_prefix(C.size_t(prefixLen)))
} | go | func NewFixedPrefixTransform(prefixLen int) SliceTransform {
return NewNativeSliceTransform(C.rocksdb_slicetransform_create_fixed_prefix(C.size_t(prefixLen)))
} | [
"func",
"NewFixedPrefixTransform",
"(",
"prefixLen",
"int",
")",
"SliceTransform",
"{",
"return",
"NewNativeSliceTransform",
"(",
"C",
".",
"rocksdb_slicetransform_create_fixed_prefix",
"(",
"C",
".",
"size_t",
"(",
"prefixLen",
")",
")",
")",
"\n",
"}"
] | // NewFixedPrefixTransform creates a new fixed prefix transform. | [
"NewFixedPrefixTransform",
"creates",
"a",
"new",
"fixed",
"prefix",
"transform",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/slice_transform.go#L22-L24 |
29,449 | tecbot/gorocksdb | cow.go | NewCOWList | func NewCOWList() *COWList {
var list []interface{}
v := &atomic.Value{}
v.Store(list)
return &COWList{v: v, mu: new(sync.Mutex)}
} | go | func NewCOWList() *COWList {
var list []interface{}
v := &atomic.Value{}
v.Store(list)
return &COWList{v: v, mu: new(sync.Mutex)}
} | [
"func",
"NewCOWList",
"(",
")",
"*",
"COWList",
"{",
"var",
"list",
"[",
"]",
"interface",
"{",
"}",
"\n",
"v",
":=",
"&",
"atomic",
".",
"Value",
"{",
"}",
"\n",
"v",
".",
"Store",
"(",
"list",
")",
"\n",
"return",
"&",
"COWList",
"{",
"v",
":... | // NewCOWList creates a new COWList. | [
"NewCOWList",
"creates",
"a",
"new",
"COWList",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/cow.go#L18-L23 |
29,450 | tecbot/gorocksdb | cow.go | Append | func (c *COWList) Append(i interface{}) int {
c.mu.Lock()
defer c.mu.Unlock()
list := c.v.Load().([]interface{})
newLen := len(list) + 1
newList := make([]interface{}, newLen)
copy(newList, list)
newList[newLen-1] = i
c.v.Store(newList)
return newLen - 1
} | go | func (c *COWList) Append(i interface{}) int {
c.mu.Lock()
defer c.mu.Unlock()
list := c.v.Load().([]interface{})
newLen := len(list) + 1
newList := make([]interface{}, newLen)
copy(newList, list)
newList[newLen-1] = i
c.v.Store(newList)
return newLen - 1
} | [
"func",
"(",
"c",
"*",
"COWList",
")",
"Append",
"(",
"i",
"interface",
"{",
"}",
")",
"int",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"list",
":=",
"c",
".",
"v",
".",
"Load"... | // Append appends an item to the COWList and returns the index for that item. | [
"Append",
"appends",
"an",
"item",
"to",
"the",
"COWList",
"and",
"returns",
"the",
"index",
"for",
"that",
"item",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/cow.go#L26-L36 |
29,451 | tecbot/gorocksdb | cow.go | Get | func (c *COWList) Get(index int) interface{} {
list := c.v.Load().([]interface{})
return list[index]
} | go | func (c *COWList) Get(index int) interface{} {
list := c.v.Load().([]interface{})
return list[index]
} | [
"func",
"(",
"c",
"*",
"COWList",
")",
"Get",
"(",
"index",
"int",
")",
"interface",
"{",
"}",
"{",
"list",
":=",
"c",
".",
"v",
".",
"Load",
"(",
")",
".",
"(",
"[",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"list",
"[",
"index",
"]",... | // Get gets the item at index. | [
"Get",
"gets",
"the",
"item",
"at",
"index",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/cow.go#L39-L42 |
29,452 | tecbot/gorocksdb | env.go | SetHighPriorityBackgroundThreads | func (env *Env) SetHighPriorityBackgroundThreads(n int) {
C.rocksdb_env_set_high_priority_background_threads(env.c, C.int(n))
} | go | func (env *Env) SetHighPriorityBackgroundThreads(n int) {
C.rocksdb_env_set_high_priority_background_threads(env.c, C.int(n))
} | [
"func",
"(",
"env",
"*",
"Env",
")",
"SetHighPriorityBackgroundThreads",
"(",
"n",
"int",
")",
"{",
"C",
".",
"rocksdb_env_set_high_priority_background_threads",
"(",
"env",
".",
"c",
",",
"C",
".",
"int",
"(",
"n",
")",
")",
"\n",
"}"
] | // SetHighPriorityBackgroundThreads sets the size of the high priority
// thread pool that can be used to prevent compactions from stalling
// memtable flushes. | [
"SetHighPriorityBackgroundThreads",
"sets",
"the",
"size",
"of",
"the",
"high",
"priority",
"thread",
"pool",
"that",
"can",
"be",
"used",
"to",
"prevent",
"compactions",
"from",
"stalling",
"memtable",
"flushes",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/env.go#L32-L34 |
29,453 | tecbot/gorocksdb | env.go | Destroy | func (env *Env) Destroy() {
C.rocksdb_env_destroy(env.c)
env.c = nil
} | go | func (env *Env) Destroy() {
C.rocksdb_env_destroy(env.c)
env.c = nil
} | [
"func",
"(",
"env",
"*",
"Env",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_env_destroy",
"(",
"env",
".",
"c",
")",
"\n",
"env",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the Env object. | [
"Destroy",
"deallocates",
"the",
"Env",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/env.go#L37-L40 |
29,454 | tecbot/gorocksdb | db.go | OpenDb | func OpenDb(opts *Options, name string) (*DB, error) {
var (
cErr *C.char
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
db := C.rocksdb_open(opts.c, cName, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, errors.New(C.GoString(cErr))
}
return &DB{
name: name,
c:... | go | func OpenDb(opts *Options, name string) (*DB, error) {
var (
cErr *C.char
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
db := C.rocksdb_open(opts.c, cName, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, errors.New(C.GoString(cErr))
}
return &DB{
name: name,
c:... | [
"func",
"OpenDb",
"(",
"opts",
"*",
"Options",
",",
"name",
"string",
")",
"(",
"*",
"DB",
",",
"error",
")",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cName",
"=",
"C",
".",
"CString",
"(",
"name",
")",
"\n",
")",
"\n",
"defer",
... | // OpenDb opens a database with the specified options. | [
"OpenDb",
"opens",
"a",
"database",
"with",
"the",
"specified",
"options",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L27-L43 |
29,455 | tecbot/gorocksdb | db.go | OpenDbForReadOnly | func OpenDbForReadOnly(opts *Options, name string, errorIfLogFileExist bool) (*DB, error) {
var (
cErr *C.char
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
db := C.rocksdb_open_for_read_only(opts.c, cName, boolToChar(errorIfLogFileExist), &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(... | go | func OpenDbForReadOnly(opts *Options, name string, errorIfLogFileExist bool) (*DB, error) {
var (
cErr *C.char
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
db := C.rocksdb_open_for_read_only(opts.c, cName, boolToChar(errorIfLogFileExist), &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(... | [
"func",
"OpenDbForReadOnly",
"(",
"opts",
"*",
"Options",
",",
"name",
"string",
",",
"errorIfLogFileExist",
"bool",
")",
"(",
"*",
"DB",
",",
"error",
")",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cName",
"=",
"C",
".",
"CString",
"(",... | // OpenDbForReadOnly opens a database with the specified options for readonly usage. | [
"OpenDbForReadOnly",
"opens",
"a",
"database",
"with",
"the",
"specified",
"options",
"for",
"readonly",
"usage",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L46-L62 |
29,456 | tecbot/gorocksdb | db.go | OpenDbColumnFamilies | func OpenDbColumnFamilies(
opts *Options,
name string,
cfNames []string,
cfOpts []*Options,
) (*DB, []*ColumnFamilyHandle, error) {
numColumnFamilies := len(cfNames)
if numColumnFamilies != len(cfOpts) {
return nil, nil, errors.New("must provide the same number of column family names and options")
}
cName :=... | go | func OpenDbColumnFamilies(
opts *Options,
name string,
cfNames []string,
cfOpts []*Options,
) (*DB, []*ColumnFamilyHandle, error) {
numColumnFamilies := len(cfNames)
if numColumnFamilies != len(cfOpts) {
return nil, nil, errors.New("must provide the same number of column family names and options")
}
cName :=... | [
"func",
"OpenDbColumnFamilies",
"(",
"opts",
"*",
"Options",
",",
"name",
"string",
",",
"cfNames",
"[",
"]",
"string",
",",
"cfOpts",
"[",
"]",
"*",
"Options",
",",
")",
"(",
"*",
"DB",
",",
"[",
"]",
"*",
"ColumnFamilyHandle",
",",
"error",
")",
"{... | // OpenDbColumnFamilies opens a database with the specified column families. | [
"OpenDbColumnFamilies",
"opens",
"a",
"database",
"with",
"the",
"specified",
"column",
"families",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L65-L121 |
29,457 | tecbot/gorocksdb | db.go | ListColumnFamilies | func ListColumnFamilies(opts *Options, name string) ([]string, error) {
var (
cErr *C.char
cLen C.size_t
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
cNames := C.rocksdb_list_column_families(opts.c, cName, &cLen, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, er... | go | func ListColumnFamilies(opts *Options, name string) ([]string, error) {
var (
cErr *C.char
cLen C.size_t
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
cNames := C.rocksdb_list_column_families(opts.c, cName, &cLen, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, er... | [
"func",
"ListColumnFamilies",
"(",
"opts",
"*",
"Options",
",",
"name",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cLen",
"C",
".",
"size_t",
"\n",
"cName",
"=",
"C",
".",
"CS... | // ListColumnFamilies lists the names of the column families in the DB. | [
"ListColumnFamilies",
"lists",
"the",
"names",
"of",
"the",
"column",
"families",
"in",
"the",
"DB",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L186-L206 |
29,458 | tecbot/gorocksdb | db.go | Get | func (db *DB) Get(opts *ReadOptions, key []byte) (*Slice, error) {
var (
cErr *C.char
cValLen C.size_t
cKey = byteToChar(key)
)
cValue := C.rocksdb_get(db.c, opts.c, cKey, C.size_t(len(key)), &cValLen, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, errors.New(C.GoString(cErr)... | go | func (db *DB) Get(opts *ReadOptions, key []byte) (*Slice, error) {
var (
cErr *C.char
cValLen C.size_t
cKey = byteToChar(key)
)
cValue := C.rocksdb_get(db.c, opts.c, cKey, C.size_t(len(key)), &cValLen, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, errors.New(C.GoString(cErr)... | [
"func",
"(",
"db",
"*",
"DB",
")",
"Get",
"(",
"opts",
"*",
"ReadOptions",
",",
"key",
"[",
"]",
"byte",
")",
"(",
"*",
"Slice",
",",
"error",
")",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cValLen",
"C",
".",
"size_t",
"\n",
"cK... | // Get returns the data associated with the key from the database. | [
"Get",
"returns",
"the",
"data",
"associated",
"with",
"the",
"key",
"from",
"the",
"database",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L219-L231 |
29,459 | tecbot/gorocksdb | db.go | GetBytes | func (db *DB) GetBytes(opts *ReadOptions, key []byte) ([]byte, error) {
var (
cErr *C.char
cValLen C.size_t
cKey = byteToChar(key)
)
cValue := C.rocksdb_get(db.c, opts.c, cKey, C.size_t(len(key)), &cValLen, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, errors.New(C.GoString(... | go | func (db *DB) GetBytes(opts *ReadOptions, key []byte) ([]byte, error) {
var (
cErr *C.char
cValLen C.size_t
cKey = byteToChar(key)
)
cValue := C.rocksdb_get(db.c, opts.c, cKey, C.size_t(len(key)), &cValLen, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, errors.New(C.GoString(... | [
"func",
"(",
"db",
"*",
"DB",
")",
"GetBytes",
"(",
"opts",
"*",
"ReadOptions",
",",
"key",
"[",
"]",
"byte",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cValLen",
"C",
".",
"size_t",
... | // GetBytes is like Get but returns a copy of the data. | [
"GetBytes",
"is",
"like",
"Get",
"but",
"returns",
"a",
"copy",
"of",
"the",
"data",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L234-L250 |
29,460 | tecbot/gorocksdb | db.go | MultiGet | func (db *DB) MultiGet(opts *ReadOptions, keys ...[]byte) (Slices, error) {
cKeys, cKeySizes := byteSlicesToCSlices(keys)
defer cKeys.Destroy()
vals := make(charsSlice, len(keys))
valSizes := make(sizeTSlice, len(keys))
rocksErrs := make(charsSlice, len(keys))
C.rocksdb_multi_get(
db.c,
opts.c,
C.size_t(le... | go | func (db *DB) MultiGet(opts *ReadOptions, keys ...[]byte) (Slices, error) {
cKeys, cKeySizes := byteSlicesToCSlices(keys)
defer cKeys.Destroy()
vals := make(charsSlice, len(keys))
valSizes := make(sizeTSlice, len(keys))
rocksErrs := make(charsSlice, len(keys))
C.rocksdb_multi_get(
db.c,
opts.c,
C.size_t(le... | [
"func",
"(",
"db",
"*",
"DB",
")",
"MultiGet",
"(",
"opts",
"*",
"ReadOptions",
",",
"keys",
"...",
"[",
"]",
"byte",
")",
"(",
"Slices",
",",
"error",
")",
"{",
"cKeys",
",",
"cKeySizes",
":=",
"byteSlicesToCSlices",
"(",
"keys",
")",
"\n",
"defer",... | // MultiGet returns the data associated with the passed keys from the database | [
"MultiGet",
"returns",
"the",
"data",
"associated",
"with",
"the",
"passed",
"keys",
"from",
"the",
"database"
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L268-L306 |
29,461 | tecbot/gorocksdb | db.go | MultiGetCF | func (db *DB) MultiGetCF(opts *ReadOptions, cf *ColumnFamilyHandle, keys ...[]byte) (Slices, error) {
cfs := make(ColumnFamilyHandles, len(keys))
for i := 0; i < len(keys); i++ {
cfs[i] = cf
}
return db.MultiGetCFMultiCF(opts, cfs, keys)
} | go | func (db *DB) MultiGetCF(opts *ReadOptions, cf *ColumnFamilyHandle, keys ...[]byte) (Slices, error) {
cfs := make(ColumnFamilyHandles, len(keys))
for i := 0; i < len(keys); i++ {
cfs[i] = cf
}
return db.MultiGetCFMultiCF(opts, cfs, keys)
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"MultiGetCF",
"(",
"opts",
"*",
"ReadOptions",
",",
"cf",
"*",
"ColumnFamilyHandle",
",",
"keys",
"...",
"[",
"]",
"byte",
")",
"(",
"Slices",
",",
"error",
")",
"{",
"cfs",
":=",
"make",
"(",
"ColumnFamilyHandles",
... | // MultiGetCF returns the data associated with the passed keys from the column family | [
"MultiGetCF",
"returns",
"the",
"data",
"associated",
"with",
"the",
"passed",
"keys",
"from",
"the",
"column",
"family"
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L309-L315 |
29,462 | tecbot/gorocksdb | db.go | Put | func (db *DB) Put(opts *WriteOptions, key, value []byte) error {
var (
cErr *C.char
cKey = byteToChar(key)
cValue = byteToChar(value)
)
C.rocksdb_put(db.c, opts.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)), &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoS... | go | func (db *DB) Put(opts *WriteOptions, key, value []byte) error {
var (
cErr *C.char
cKey = byteToChar(key)
cValue = byteToChar(value)
)
C.rocksdb_put(db.c, opts.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)), &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoS... | [
"func",
"(",
"db",
"*",
"DB",
")",
"Put",
"(",
"opts",
"*",
"WriteOptions",
",",
"key",
",",
"value",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cKey",
"=",
"byteToChar",
"(",
"key",
")",
"\n",
"cValu... | // Put writes data associated with a key to the database. | [
"Put",
"writes",
"data",
"associated",
"with",
"a",
"key",
"to",
"the",
"database",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L361-L373 |
29,463 | tecbot/gorocksdb | db.go | Delete | func (db *DB) Delete(opts *WriteOptions, key []byte) error {
var (
cErr *C.char
cKey = byteToChar(key)
)
C.rocksdb_delete(db.c, opts.c, cKey, C.size_t(len(key)), &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | go | func (db *DB) Delete(opts *WriteOptions, key []byte) error {
var (
cErr *C.char
cKey = byteToChar(key)
)
C.rocksdb_delete(db.c, opts.c, cKey, C.size_t(len(key)), &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"Delete",
"(",
"opts",
"*",
"WriteOptions",
",",
"key",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cKey",
"=",
"byteToChar",
"(",
"key",
")",
"\n",
")",
"\n",
"C",
... | // Delete removes the data associated with the key from the database. | [
"Delete",
"removes",
"the",
"data",
"associated",
"with",
"the",
"key",
"from",
"the",
"database",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L391-L402 |
29,464 | tecbot/gorocksdb | db.go | Write | func (db *DB) Write(opts *WriteOptions, batch *WriteBatch) error {
var cErr *C.char
C.rocksdb_write(db.c, opts.c, batch.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | go | func (db *DB) Write(opts *WriteOptions, batch *WriteBatch) error {
var cErr *C.char
C.rocksdb_write(db.c, opts.c, batch.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"Write",
"(",
"opts",
"*",
"WriteOptions",
",",
"batch",
"*",
"WriteBatch",
")",
"error",
"{",
"var",
"cErr",
"*",
"C",
".",
"char",
"\n",
"C",
".",
"rocksdb_write",
"(",
"db",
".",
"c",
",",
"opts",
".",
"c",
... | // Write writes a WriteBatch to the database | [
"Write",
"writes",
"a",
"WriteBatch",
"to",
"the",
"database"
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L450-L458 |
29,465 | tecbot/gorocksdb | db.go | NewIterator | func (db *DB) NewIterator(opts *ReadOptions) *Iterator {
cIter := C.rocksdb_create_iterator(db.c, opts.c)
return NewNativeIterator(unsafe.Pointer(cIter))
} | go | func (db *DB) NewIterator(opts *ReadOptions) *Iterator {
cIter := C.rocksdb_create_iterator(db.c, opts.c)
return NewNativeIterator(unsafe.Pointer(cIter))
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"NewIterator",
"(",
"opts",
"*",
"ReadOptions",
")",
"*",
"Iterator",
"{",
"cIter",
":=",
"C",
".",
"rocksdb_create_iterator",
"(",
"db",
".",
"c",
",",
"opts",
".",
"c",
")",
"\n",
"return",
"NewNativeIterator",
"(",... | // NewIterator returns an Iterator over the the database that uses the
// ReadOptions given. | [
"NewIterator",
"returns",
"an",
"Iterator",
"over",
"the",
"the",
"database",
"that",
"uses",
"the",
"ReadOptions",
"given",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L462-L465 |
29,466 | tecbot/gorocksdb | db.go | NewIteratorCF | func (db *DB) NewIteratorCF(opts *ReadOptions, cf *ColumnFamilyHandle) *Iterator {
cIter := C.rocksdb_create_iterator_cf(db.c, opts.c, cf.c)
return NewNativeIterator(unsafe.Pointer(cIter))
} | go | func (db *DB) NewIteratorCF(opts *ReadOptions, cf *ColumnFamilyHandle) *Iterator {
cIter := C.rocksdb_create_iterator_cf(db.c, opts.c, cf.c)
return NewNativeIterator(unsafe.Pointer(cIter))
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"NewIteratorCF",
"(",
"opts",
"*",
"ReadOptions",
",",
"cf",
"*",
"ColumnFamilyHandle",
")",
"*",
"Iterator",
"{",
"cIter",
":=",
"C",
".",
"rocksdb_create_iterator_cf",
"(",
"db",
".",
"c",
",",
"opts",
".",
"c",
","... | // NewIteratorCF returns an Iterator over the the database and column family
// that uses the ReadOptions given. | [
"NewIteratorCF",
"returns",
"an",
"Iterator",
"over",
"the",
"the",
"database",
"and",
"column",
"family",
"that",
"uses",
"the",
"ReadOptions",
"given",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L469-L472 |
29,467 | tecbot/gorocksdb | db.go | NewSnapshot | func (db *DB) NewSnapshot() *Snapshot {
cSnap := C.rocksdb_create_snapshot(db.c)
return NewNativeSnapshot(cSnap)
} | go | func (db *DB) NewSnapshot() *Snapshot {
cSnap := C.rocksdb_create_snapshot(db.c)
return NewNativeSnapshot(cSnap)
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"NewSnapshot",
"(",
")",
"*",
"Snapshot",
"{",
"cSnap",
":=",
"C",
".",
"rocksdb_create_snapshot",
"(",
"db",
".",
"c",
")",
"\n",
"return",
"NewNativeSnapshot",
"(",
"cSnap",
")",
"\n",
"}"
] | // NewSnapshot creates a new snapshot of the database. | [
"NewSnapshot",
"creates",
"a",
"new",
"snapshot",
"of",
"the",
"database",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L475-L478 |
29,468 | tecbot/gorocksdb | db.go | GetProperty | func (db *DB) GetProperty(propName string) string {
cprop := C.CString(propName)
defer C.free(unsafe.Pointer(cprop))
cValue := C.rocksdb_property_value(db.c, cprop)
defer C.free(unsafe.Pointer(cValue))
return C.GoString(cValue)
} | go | func (db *DB) GetProperty(propName string) string {
cprop := C.CString(propName)
defer C.free(unsafe.Pointer(cprop))
cValue := C.rocksdb_property_value(db.c, cprop)
defer C.free(unsafe.Pointer(cValue))
return C.GoString(cValue)
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"GetProperty",
"(",
"propName",
"string",
")",
"string",
"{",
"cprop",
":=",
"C",
".",
"CString",
"(",
"propName",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cprop",
")",
")",
"\n",... | // GetProperty returns the value of a database property. | [
"GetProperty",
"returns",
"the",
"value",
"of",
"a",
"database",
"property",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L487-L493 |
29,469 | tecbot/gorocksdb | db.go | GetPropertyCF | func (db *DB) GetPropertyCF(propName string, cf *ColumnFamilyHandle) string {
cProp := C.CString(propName)
defer C.free(unsafe.Pointer(cProp))
cValue := C.rocksdb_property_value_cf(db.c, cf.c, cProp)
defer C.free(unsafe.Pointer(cValue))
return C.GoString(cValue)
} | go | func (db *DB) GetPropertyCF(propName string, cf *ColumnFamilyHandle) string {
cProp := C.CString(propName)
defer C.free(unsafe.Pointer(cProp))
cValue := C.rocksdb_property_value_cf(db.c, cf.c, cProp)
defer C.free(unsafe.Pointer(cValue))
return C.GoString(cValue)
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"GetPropertyCF",
"(",
"propName",
"string",
",",
"cf",
"*",
"ColumnFamilyHandle",
")",
"string",
"{",
"cProp",
":=",
"C",
".",
"CString",
"(",
"propName",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"P... | // GetPropertyCF returns the value of a database property. | [
"GetPropertyCF",
"returns",
"the",
"value",
"of",
"a",
"database",
"property",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L496-L502 |
29,470 | tecbot/gorocksdb | db.go | CreateColumnFamily | func (db *DB) CreateColumnFamily(opts *Options, name string) (*ColumnFamilyHandle, error) {
var (
cErr *C.char
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
cHandle := C.rocksdb_create_column_family(db.c, opts.c, cName, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil,... | go | func (db *DB) CreateColumnFamily(opts *Options, name string) (*ColumnFamilyHandle, error) {
var (
cErr *C.char
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
cHandle := C.rocksdb_create_column_family(db.c, opts.c, cName, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil,... | [
"func",
"(",
"db",
"*",
"DB",
")",
"CreateColumnFamily",
"(",
"opts",
"*",
"Options",
",",
"name",
"string",
")",
"(",
"*",
"ColumnFamilyHandle",
",",
"error",
")",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cName",
"=",
"C",
".",
"CStr... | // CreateColumnFamily create a new column family. | [
"CreateColumnFamily",
"create",
"a",
"new",
"column",
"family",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L505-L517 |
29,471 | tecbot/gorocksdb | db.go | DropColumnFamily | func (db *DB) DropColumnFamily(c *ColumnFamilyHandle) error {
var cErr *C.char
C.rocksdb_drop_column_family(db.c, c.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | go | func (db *DB) DropColumnFamily(c *ColumnFamilyHandle) error {
var cErr *C.char
C.rocksdb_drop_column_family(db.c, c.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"DropColumnFamily",
"(",
"c",
"*",
"ColumnFamilyHandle",
")",
"error",
"{",
"var",
"cErr",
"*",
"C",
".",
"char",
"\n",
"C",
".",
"rocksdb_drop_column_family",
"(",
"db",
".",
"c",
",",
"c",
".",
"c",
",",
"&",
"c... | // DropColumnFamily drops a column family. | [
"DropColumnFamily",
"drops",
"a",
"column",
"family",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L520-L528 |
29,472 | tecbot/gorocksdb | db.go | GetApproximateSizesCF | func (db *DB) GetApproximateSizesCF(cf *ColumnFamilyHandle, ranges []Range) []uint64 {
sizes := make([]uint64, len(ranges))
if len(ranges) == 0 {
return sizes
}
cStarts := make([]*C.char, len(ranges))
cLimits := make([]*C.char, len(ranges))
cStartLens := make([]C.size_t, len(ranges))
cLimitLens := make([]C.si... | go | func (db *DB) GetApproximateSizesCF(cf *ColumnFamilyHandle, ranges []Range) []uint64 {
sizes := make([]uint64, len(ranges))
if len(ranges) == 0 {
return sizes
}
cStarts := make([]*C.char, len(ranges))
cLimits := make([]*C.char, len(ranges))
cStartLens := make([]C.size_t, len(ranges))
cLimitLens := make([]C.si... | [
"func",
"(",
"db",
"*",
"DB",
")",
"GetApproximateSizesCF",
"(",
"cf",
"*",
"ColumnFamilyHandle",
",",
"ranges",
"[",
"]",
"Range",
")",
"[",
"]",
"uint64",
"{",
"sizes",
":=",
"make",
"(",
"[",
"]",
"uint64",
",",
"len",
"(",
"ranges",
")",
")",
"... | // GetApproximateSizesCF returns the approximate number of bytes of file system
// space used by one or more key ranges in the column family.
//
// The keys counted will begin at Range.Start and end on the key before
// Range.Limit. | [
"GetApproximateSizesCF",
"returns",
"the",
"approximate",
"number",
"of",
"bytes",
"of",
"file",
"system",
"space",
"used",
"by",
"one",
"or",
"more",
"key",
"ranges",
"in",
"the",
"column",
"family",
".",
"The",
"keys",
"counted",
"will",
"begin",
"at",
"Ra... | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L569-L597 |
29,473 | tecbot/gorocksdb | db.go | GetLiveFilesMetaData | func (db *DB) GetLiveFilesMetaData() []LiveFileMetadata {
lf := C.rocksdb_livefiles(db.c)
defer C.rocksdb_livefiles_destroy(lf)
count := C.rocksdb_livefiles_count(lf)
liveFiles := make([]LiveFileMetadata, int(count))
for i := C.int(0); i < count; i++ {
var liveFile LiveFileMetadata
liveFile.Name = C.GoString(... | go | func (db *DB) GetLiveFilesMetaData() []LiveFileMetadata {
lf := C.rocksdb_livefiles(db.c)
defer C.rocksdb_livefiles_destroy(lf)
count := C.rocksdb_livefiles_count(lf)
liveFiles := make([]LiveFileMetadata, int(count))
for i := C.int(0); i < count; i++ {
var liveFile LiveFileMetadata
liveFile.Name = C.GoString(... | [
"func",
"(",
"db",
"*",
"DB",
")",
"GetLiveFilesMetaData",
"(",
")",
"[",
"]",
"LiveFileMetadata",
"{",
"lf",
":=",
"C",
".",
"rocksdb_livefiles",
"(",
"db",
".",
"c",
")",
"\n",
"defer",
"C",
".",
"rocksdb_livefiles_destroy",
"(",
"lf",
")",
"\n\n",
"... | // GetLiveFilesMetaData returns a list of all table files with their
// level, start key and end key. | [
"GetLiveFilesMetaData",
"returns",
"a",
"list",
"of",
"all",
"table",
"files",
"with",
"their",
"level",
"start",
"key",
"and",
"end",
"key",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L610-L631 |
29,474 | tecbot/gorocksdb | db.go | CompactRangeCF | func (db *DB) CompactRangeCF(cf *ColumnFamilyHandle, r Range) {
cStart := byteToChar(r.Start)
cLimit := byteToChar(r.Limit)
C.rocksdb_compact_range_cf(db.c, cf.c, cStart, C.size_t(len(r.Start)), cLimit, C.size_t(len(r.Limit)))
} | go | func (db *DB) CompactRangeCF(cf *ColumnFamilyHandle, r Range) {
cStart := byteToChar(r.Start)
cLimit := byteToChar(r.Limit)
C.rocksdb_compact_range_cf(db.c, cf.c, cStart, C.size_t(len(r.Start)), cLimit, C.size_t(len(r.Limit)))
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"CompactRangeCF",
"(",
"cf",
"*",
"ColumnFamilyHandle",
",",
"r",
"Range",
")",
"{",
"cStart",
":=",
"byteToChar",
"(",
"r",
".",
"Start",
")",
"\n",
"cLimit",
":=",
"byteToChar",
"(",
"r",
".",
"Limit",
")",
"\n",
... | // CompactRangeCF runs a manual compaction on the Range of keys given on the
// given column family. This is not likely to be needed for typical usage. | [
"CompactRangeCF",
"runs",
"a",
"manual",
"compaction",
"on",
"the",
"Range",
"of",
"keys",
"given",
"on",
"the",
"given",
"column",
"family",
".",
"This",
"is",
"not",
"likely",
"to",
"be",
"needed",
"for",
"typical",
"usage",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L643-L647 |
29,475 | tecbot/gorocksdb | db.go | Flush | func (db *DB) Flush(opts *FlushOptions) error {
var cErr *C.char
C.rocksdb_flush(db.c, opts.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | go | func (db *DB) Flush(opts *FlushOptions) error {
var cErr *C.char
C.rocksdb_flush(db.c, opts.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"Flush",
"(",
"opts",
"*",
"FlushOptions",
")",
"error",
"{",
"var",
"cErr",
"*",
"C",
".",
"char",
"\n",
"C",
".",
"rocksdb_flush",
"(",
"db",
".",
"c",
",",
"opts",
".",
"c",
",",
"&",
"cErr",
")",
"\n",
"... | // Flush triggers a manuel flush for the database. | [
"Flush",
"triggers",
"a",
"manuel",
"flush",
"for",
"the",
"database",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L650-L658 |
29,476 | tecbot/gorocksdb | db.go | DisableFileDeletions | func (db *DB) DisableFileDeletions() error {
var cErr *C.char
C.rocksdb_disable_file_deletions(db.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | go | func (db *DB) DisableFileDeletions() error {
var cErr *C.char
C.rocksdb_disable_file_deletions(db.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"DisableFileDeletions",
"(",
")",
"error",
"{",
"var",
"cErr",
"*",
"C",
".",
"char",
"\n",
"C",
".",
"rocksdb_disable_file_deletions",
"(",
"db",
".",
"c",
",",
"&",
"cErr",
")",
"\n",
"if",
"cErr",
"!=",
"nil",
... | // DisableFileDeletions disables file deletions and should be used when backup the database. | [
"DisableFileDeletions",
"disables",
"file",
"deletions",
"and",
"should",
"be",
"used",
"when",
"backup",
"the",
"database",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L661-L669 |
29,477 | tecbot/gorocksdb | db.go | EnableFileDeletions | func (db *DB) EnableFileDeletions(force bool) error {
var cErr *C.char
C.rocksdb_enable_file_deletions(db.c, boolToChar(force), &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | go | func (db *DB) EnableFileDeletions(force bool) error {
var cErr *C.char
C.rocksdb_enable_file_deletions(db.c, boolToChar(force), &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | [
"func",
"(",
"db",
"*",
"DB",
")",
"EnableFileDeletions",
"(",
"force",
"bool",
")",
"error",
"{",
"var",
"cErr",
"*",
"C",
".",
"char",
"\n",
"C",
".",
"rocksdb_enable_file_deletions",
"(",
"db",
".",
"c",
",",
"boolToChar",
"(",
"force",
")",
",",
... | // EnableFileDeletions enables file deletions for the database. | [
"EnableFileDeletions",
"enables",
"file",
"deletions",
"for",
"the",
"database",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L672-L680 |
29,478 | tecbot/gorocksdb | db.go | IngestExternalFile | func (db *DB) IngestExternalFile(filePaths []string, opts *IngestExternalFileOptions) error {
cFilePaths := make([]*C.char, len(filePaths))
for i, s := range filePaths {
cFilePaths[i] = C.CString(s)
}
defer func() {
for _, s := range cFilePaths {
C.free(unsafe.Pointer(s))
}
}()
var cErr *C.char
C.rock... | go | func (db *DB) IngestExternalFile(filePaths []string, opts *IngestExternalFileOptions) error {
cFilePaths := make([]*C.char, len(filePaths))
for i, s := range filePaths {
cFilePaths[i] = C.CString(s)
}
defer func() {
for _, s := range cFilePaths {
C.free(unsafe.Pointer(s))
}
}()
var cErr *C.char
C.rock... | [
"func",
"(",
"db",
"*",
"DB",
")",
"IngestExternalFile",
"(",
"filePaths",
"[",
"]",
"string",
",",
"opts",
"*",
"IngestExternalFileOptions",
")",
"error",
"{",
"cFilePaths",
":=",
"make",
"(",
"[",
"]",
"*",
"C",
".",
"char",
",",
"len",
"(",
"filePat... | // IngestExternalFile loads a list of external SST files. | [
"IngestExternalFile",
"loads",
"a",
"list",
"of",
"external",
"SST",
"files",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L692-L718 |
29,479 | tecbot/gorocksdb | db.go | DestroyDb | func DestroyDb(name string, opts *Options) error {
var (
cErr *C.char
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
C.rocksdb_destroy_db(opts.c, cName, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | go | func DestroyDb(name string, opts *Options) error {
var (
cErr *C.char
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
C.rocksdb_destroy_db(opts.c, cName, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
} | [
"func",
"DestroyDb",
"(",
"name",
"string",
",",
"opts",
"*",
"Options",
")",
"error",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cName",
"=",
"C",
".",
"CString",
"(",
"name",
")",
"\n",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"... | // DestroyDb removes a database entirely, removing everything from the
// filesystem. | [
"DestroyDb",
"removes",
"a",
"database",
"entirely",
"removing",
"everything",
"from",
"the",
"filesystem",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/db.go#L773-L785 |
29,480 | tecbot/gorocksdb | options_write.go | Destroy | func (opts *WriteOptions) Destroy() {
C.rocksdb_writeoptions_destroy(opts.c)
opts.c = nil
} | go | func (opts *WriteOptions) Destroy() {
C.rocksdb_writeoptions_destroy(opts.c)
opts.c = nil
} | [
"func",
"(",
"opts",
"*",
"WriteOptions",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_writeoptions_destroy",
"(",
"opts",
".",
"c",
")",
"\n",
"opts",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the WriteOptions object. | [
"Destroy",
"deallocates",
"the",
"WriteOptions",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_write.go#L39-L42 |
29,481 | tecbot/gorocksdb | options_compression.go | NewCompressionOptions | func NewCompressionOptions(windowBits, level, strategy, maxDictBytes int) *CompressionOptions {
return &CompressionOptions{
WindowBits: windowBits,
Level: level,
Strategy: strategy,
MaxDictBytes: maxDictBytes,
}
} | go | func NewCompressionOptions(windowBits, level, strategy, maxDictBytes int) *CompressionOptions {
return &CompressionOptions{
WindowBits: windowBits,
Level: level,
Strategy: strategy,
MaxDictBytes: maxDictBytes,
}
} | [
"func",
"NewCompressionOptions",
"(",
"windowBits",
",",
"level",
",",
"strategy",
",",
"maxDictBytes",
"int",
")",
"*",
"CompressionOptions",
"{",
"return",
"&",
"CompressionOptions",
"{",
"WindowBits",
":",
"windowBits",
",",
"Level",
":",
"level",
",",
"Strat... | // NewCompressionOptions creates a CompressionOptions object. | [
"NewCompressionOptions",
"creates",
"a",
"CompressionOptions",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_compression.go#L17-L24 |
29,482 | tecbot/gorocksdb | checkpoint.go | Destroy | func (checkpoint *Checkpoint) Destroy() {
C.rocksdb_checkpoint_object_destroy(checkpoint.c)
checkpoint.c = nil
} | go | func (checkpoint *Checkpoint) Destroy() {
C.rocksdb_checkpoint_object_destroy(checkpoint.c)
checkpoint.c = nil
} | [
"func",
"(",
"checkpoint",
"*",
"Checkpoint",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_checkpoint_object_destroy",
"(",
"checkpoint",
".",
"c",
")",
"\n",
"checkpoint",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the Checkpoint object. | [
"Destroy",
"deallocates",
"the",
"Checkpoint",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/checkpoint.go#L53-L56 |
29,483 | tecbot/gorocksdb | options_flush.go | Destroy | func (opts *FlushOptions) Destroy() {
C.rocksdb_flushoptions_destroy(opts.c)
opts.c = nil
} | go | func (opts *FlushOptions) Destroy() {
C.rocksdb_flushoptions_destroy(opts.c)
opts.c = nil
} | [
"func",
"(",
"opts",
"*",
"FlushOptions",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_flushoptions_destroy",
"(",
"opts",
".",
"c",
")",
"\n",
"opts",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the FlushOptions object. | [
"Destroy",
"deallocates",
"the",
"FlushOptions",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_flush.go#L29-L32 |
29,484 | tecbot/gorocksdb | memory_usage.go | GetApproximateMemoryUsageByType | func GetApproximateMemoryUsageByType(dbs []*DB, caches []*Cache) (*MemoryUsage, error) {
// register memory consumers
consumers := C.rocksdb_memory_consumers_create()
defer C.rocksdb_memory_consumers_destroy(consumers)
for _, db := range dbs {
if db != nil {
C.rocksdb_memory_consumers_add_db(consumers, db.c)
... | go | func GetApproximateMemoryUsageByType(dbs []*DB, caches []*Cache) (*MemoryUsage, error) {
// register memory consumers
consumers := C.rocksdb_memory_consumers_create()
defer C.rocksdb_memory_consumers_destroy(consumers)
for _, db := range dbs {
if db != nil {
C.rocksdb_memory_consumers_add_db(consumers, db.c)
... | [
"func",
"GetApproximateMemoryUsageByType",
"(",
"dbs",
"[",
"]",
"*",
"DB",
",",
"caches",
"[",
"]",
"*",
"Cache",
")",
"(",
"*",
"MemoryUsage",
",",
"error",
")",
"{",
"// register memory consumers",
"consumers",
":=",
"C",
".",
"rocksdb_memory_consumers_create... | // GetApproximateMemoryUsageByType returns summary
// memory usage stats for given databases and caches. | [
"GetApproximateMemoryUsageByType",
"returns",
"summary",
"memory",
"usage",
"stats",
"for",
"given",
"databases",
"and",
"caches",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/memory_usage.go#L25-L58 |
29,485 | tecbot/gorocksdb | transactiondb.go | OpenTransactionDb | func OpenTransactionDb(
opts *Options,
transactionDBOpts *TransactionDBOptions,
name string,
) (*TransactionDB, error) {
var (
cErr *C.char
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
db := C.rocksdb_transactiondb_open(
opts.c, transactionDBOpts.c, cName, &cErr)
if cErr != nil {
defer... | go | func OpenTransactionDb(
opts *Options,
transactionDBOpts *TransactionDBOptions,
name string,
) (*TransactionDB, error) {
var (
cErr *C.char
cName = C.CString(name)
)
defer C.free(unsafe.Pointer(cName))
db := C.rocksdb_transactiondb_open(
opts.c, transactionDBOpts.c, cName, &cErr)
if cErr != nil {
defer... | [
"func",
"OpenTransactionDb",
"(",
"opts",
"*",
"Options",
",",
"transactionDBOpts",
"*",
"TransactionDBOptions",
",",
"name",
"string",
",",
")",
"(",
"*",
"TransactionDB",
",",
"error",
")",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
"cName",
... | // OpenTransactionDb opens a database with the specified options. | [
"OpenTransactionDb",
"opens",
"a",
"database",
"with",
"the",
"specified",
"options",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/transactiondb.go#L20-L42 |
29,486 | tecbot/gorocksdb | transactiondb.go | TransactionBegin | func (db *TransactionDB) TransactionBegin(
opts *WriteOptions,
transactionOpts *TransactionOptions,
oldTransaction *Transaction,
) *Transaction {
if oldTransaction != nil {
return NewNativeTransaction(C.rocksdb_transaction_begin(
db.c,
opts.c,
transactionOpts.c,
oldTransaction.c,
))
}
return NewN... | go | func (db *TransactionDB) TransactionBegin(
opts *WriteOptions,
transactionOpts *TransactionOptions,
oldTransaction *Transaction,
) *Transaction {
if oldTransaction != nil {
return NewNativeTransaction(C.rocksdb_transaction_begin(
db.c,
opts.c,
transactionOpts.c,
oldTransaction.c,
))
}
return NewN... | [
"func",
"(",
"db",
"*",
"TransactionDB",
")",
"TransactionBegin",
"(",
"opts",
"*",
"WriteOptions",
",",
"transactionOpts",
"*",
"TransactionOptions",
",",
"oldTransaction",
"*",
"Transaction",
",",
")",
"*",
"Transaction",
"{",
"if",
"oldTransaction",
"!=",
"ni... | // TransactionBegin begins a new transaction
// with the WriteOptions and TransactionOptions given. | [
"TransactionBegin",
"begins",
"a",
"new",
"transaction",
"with",
"the",
"WriteOptions",
"and",
"TransactionOptions",
"given",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/transactiondb.go#L57-L73 |
29,487 | tecbot/gorocksdb | transactiondb.go | NewCheckpoint | func (db *TransactionDB) NewCheckpoint() (*Checkpoint, error) {
var (
cErr *C.char
)
cCheckpoint := C.rocksdb_transactiondb_checkpoint_object_create(
db.c, &cErr,
)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, errors.New(C.GoString(cErr))
}
return NewNativeCheckpoint(cCheckpoint), nil... | go | func (db *TransactionDB) NewCheckpoint() (*Checkpoint, error) {
var (
cErr *C.char
)
cCheckpoint := C.rocksdb_transactiondb_checkpoint_object_create(
db.c, &cErr,
)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
return nil, errors.New(C.GoString(cErr))
}
return NewNativeCheckpoint(cCheckpoint), nil... | [
"func",
"(",
"db",
"*",
"TransactionDB",
")",
"NewCheckpoint",
"(",
")",
"(",
"*",
"Checkpoint",
",",
"error",
")",
"{",
"var",
"(",
"cErr",
"*",
"C",
".",
"char",
"\n",
")",
"\n",
"cCheckpoint",
":=",
"C",
".",
"rocksdb_transactiondb_checkpoint_object_cre... | // NewCheckpoint creates a new Checkpoint for this db. | [
"NewCheckpoint",
"creates",
"a",
"new",
"Checkpoint",
"for",
"this",
"db",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/transactiondb.go#L124-L137 |
29,488 | tecbot/gorocksdb | transactiondb.go | Close | func (transactionDB *TransactionDB) Close() {
C.rocksdb_transactiondb_close(transactionDB.c)
transactionDB.c = nil
} | go | func (transactionDB *TransactionDB) Close() {
C.rocksdb_transactiondb_close(transactionDB.c)
transactionDB.c = nil
} | [
"func",
"(",
"transactionDB",
"*",
"TransactionDB",
")",
"Close",
"(",
")",
"{",
"C",
".",
"rocksdb_transactiondb_close",
"(",
"transactionDB",
".",
"c",
")",
"\n",
"transactionDB",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Close closes the database. | [
"Close",
"closes",
"the",
"database",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/transactiondb.go#L140-L143 |
29,489 | tecbot/gorocksdb | options_transaction.go | SetExpiration | func (opts *TransactionOptions) SetExpiration(expiration int64) {
C.rocksdb_transaction_options_set_expiration(opts.c, C.int64_t(expiration))
} | go | func (opts *TransactionOptions) SetExpiration(expiration int64) {
C.rocksdb_transaction_options_set_expiration(opts.c, C.int64_t(expiration))
} | [
"func",
"(",
"opts",
"*",
"TransactionOptions",
")",
"SetExpiration",
"(",
"expiration",
"int64",
")",
"{",
"C",
".",
"rocksdb_transaction_options_set_expiration",
"(",
"opts",
".",
"c",
",",
"C",
".",
"int64_t",
"(",
"expiration",
")",
")",
"\n",
"}"
] | // SetExpiration sets the Expiration duration in milliseconds.
// If non-negative, transactions that last longer than this many milliseconds will fail to commit.
// If not set, a forgotten transaction that is never committed, rolled back, or deleted
// will never relinquish any locks it holds. This could prevent keys ... | [
"SetExpiration",
"sets",
"the",
"Expiration",
"duration",
"in",
"milliseconds",
".",
"If",
"non",
"-",
"negative",
"transactions",
"that",
"last",
"longer",
"than",
"this",
"many",
"milliseconds",
"will",
"fail",
"to",
"commit",
".",
"If",
"not",
"set",
"a",
... | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_transaction.go#L48-L50 |
29,490 | tecbot/gorocksdb | options_transaction.go | SetDeadlockDetectDepth | func (opts *TransactionOptions) SetDeadlockDetectDepth(depth int64) {
C.rocksdb_transaction_options_set_deadlock_detect_depth(opts.c, C.int64_t(depth))
} | go | func (opts *TransactionOptions) SetDeadlockDetectDepth(depth int64) {
C.rocksdb_transaction_options_set_deadlock_detect_depth(opts.c, C.int64_t(depth))
} | [
"func",
"(",
"opts",
"*",
"TransactionOptions",
")",
"SetDeadlockDetectDepth",
"(",
"depth",
"int64",
")",
"{",
"C",
".",
"rocksdb_transaction_options_set_deadlock_detect_depth",
"(",
"opts",
".",
"c",
",",
"C",
".",
"int64_t",
"(",
"depth",
")",
")",
"\n",
"}... | // SetDeadlockDetectDepth sets the number of traversals to make during deadlock detection. | [
"SetDeadlockDetectDepth",
"sets",
"the",
"number",
"of",
"traversals",
"to",
"make",
"during",
"deadlock",
"detection",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_transaction.go#L53-L55 |
29,491 | tecbot/gorocksdb | options_transaction.go | SetMaxWriteBatchSize | func (opts *TransactionOptions) SetMaxWriteBatchSize(size uint64) {
C.rocksdb_transaction_options_set_max_write_batch_size(opts.c, C.size_t(size))
} | go | func (opts *TransactionOptions) SetMaxWriteBatchSize(size uint64) {
C.rocksdb_transaction_options_set_max_write_batch_size(opts.c, C.size_t(size))
} | [
"func",
"(",
"opts",
"*",
"TransactionOptions",
")",
"SetMaxWriteBatchSize",
"(",
"size",
"uint64",
")",
"{",
"C",
".",
"rocksdb_transaction_options_set_max_write_batch_size",
"(",
"opts",
".",
"c",
",",
"C",
".",
"size_t",
"(",
"size",
")",
")",
"\n",
"}"
] | // SetMaxWriteBatchSize sets the maximum number of bytes used for the write batch. 0 means no limit. | [
"SetMaxWriteBatchSize",
"sets",
"the",
"maximum",
"number",
"of",
"bytes",
"used",
"for",
"the",
"write",
"batch",
".",
"0",
"means",
"no",
"limit",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_transaction.go#L58-L60 |
29,492 | tecbot/gorocksdb | options_transaction.go | Destroy | func (opts *TransactionOptions) Destroy() {
C.rocksdb_transaction_options_destroy(opts.c)
opts.c = nil
} | go | func (opts *TransactionOptions) Destroy() {
C.rocksdb_transaction_options_destroy(opts.c)
opts.c = nil
} | [
"func",
"(",
"opts",
"*",
"TransactionOptions",
")",
"Destroy",
"(",
")",
"{",
"C",
".",
"rocksdb_transaction_options_destroy",
"(",
"opts",
".",
"c",
")",
"\n",
"opts",
".",
"c",
"=",
"nil",
"\n",
"}"
] | // Destroy deallocates the TransactionOptions object. | [
"Destroy",
"deallocates",
"the",
"TransactionOptions",
"object",
"."
] | 8752a943348155073ae407010e2b75c40480271a | https://github.com/tecbot/gorocksdb/blob/8752a943348155073ae407010e2b75c40480271a/options_transaction.go#L63-L66 |
29,493 | prometheus/procfs | proc.go | Self | func (fs FS) Self() (Proc, error) {
p, err := os.Readlink(fs.Path("self"))
if err != nil {
return Proc{}, err
}
pid, err := strconv.Atoi(strings.Replace(p, string(fs), "", -1))
if err != nil {
return Proc{}, err
}
return fs.NewProc(pid)
} | go | func (fs FS) Self() (Proc, error) {
p, err := os.Readlink(fs.Path("self"))
if err != nil {
return Proc{}, err
}
pid, err := strconv.Atoi(strings.Replace(p, string(fs), "", -1))
if err != nil {
return Proc{}, err
}
return fs.NewProc(pid)
} | [
"func",
"(",
"fs",
"FS",
")",
"Self",
"(",
")",
"(",
"Proc",
",",
"error",
")",
"{",
"p",
",",
"err",
":=",
"os",
".",
"Readlink",
"(",
"fs",
".",
"Path",
"(",
"\"",
"\"",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"Proc",
"{"... | // Self returns a process for the current process. | [
"Self",
"returns",
"a",
"process",
"for",
"the",
"current",
"process",
"."
] | 87a4384529e0652f5035fb5cc8095faf73ea9b0b | https://github.com/prometheus/procfs/blob/87a4384529e0652f5035fb5cc8095faf73ea9b0b/proc.go#L68-L78 |
29,494 | prometheus/procfs | proc.go | NewProc | func (fs FS) NewProc(pid int) (Proc, error) {
if _, err := os.Stat(fs.Path(strconv.Itoa(pid))); err != nil {
return Proc{}, err
}
return Proc{PID: pid, fs: fs}, nil
} | go | func (fs FS) NewProc(pid int) (Proc, error) {
if _, err := os.Stat(fs.Path(strconv.Itoa(pid))); err != nil {
return Proc{}, err
}
return Proc{PID: pid, fs: fs}, nil
} | [
"func",
"(",
"fs",
"FS",
")",
"NewProc",
"(",
"pid",
"int",
")",
"(",
"Proc",
",",
"error",
")",
"{",
"if",
"_",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"fs",
".",
"Path",
"(",
"strconv",
".",
"Itoa",
"(",
"pid",
")",
")",
")",
";",
"err"... | // NewProc returns a process for the given pid. | [
"NewProc",
"returns",
"a",
"process",
"for",
"the",
"given",
"pid",
"."
] | 87a4384529e0652f5035fb5cc8095faf73ea9b0b | https://github.com/prometheus/procfs/blob/87a4384529e0652f5035fb5cc8095faf73ea9b0b/proc.go#L81-L86 |
29,495 | prometheus/procfs | proc.go | AllProcs | func (fs FS) AllProcs() (Procs, error) {
d, err := os.Open(fs.Path())
if err != nil {
return Procs{}, err
}
defer d.Close()
names, err := d.Readdirnames(-1)
if err != nil {
return Procs{}, fmt.Errorf("could not read %s: %s", d.Name(), err)
}
p := Procs{}
for _, n := range names {
pid, err := strconv.Pa... | go | func (fs FS) AllProcs() (Procs, error) {
d, err := os.Open(fs.Path())
if err != nil {
return Procs{}, err
}
defer d.Close()
names, err := d.Readdirnames(-1)
if err != nil {
return Procs{}, fmt.Errorf("could not read %s: %s", d.Name(), err)
}
p := Procs{}
for _, n := range names {
pid, err := strconv.Pa... | [
"func",
"(",
"fs",
"FS",
")",
"AllProcs",
"(",
")",
"(",
"Procs",
",",
"error",
")",
"{",
"d",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"fs",
".",
"Path",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"Procs",
"{",
"}",
","... | // AllProcs returns a list of all currently available processes. | [
"AllProcs",
"returns",
"a",
"list",
"of",
"all",
"currently",
"available",
"processes",
"."
] | 87a4384529e0652f5035fb5cc8095faf73ea9b0b | https://github.com/prometheus/procfs/blob/87a4384529e0652f5035fb5cc8095faf73ea9b0b/proc.go#L89-L111 |
29,496 | prometheus/procfs | proc.go | CmdLine | func (p Proc) CmdLine() ([]string, error) {
f, err := os.Open(p.path("cmdline"))
if err != nil {
return nil, err
}
defer f.Close()
data, err := ioutil.ReadAll(f)
if err != nil {
return nil, err
}
if len(data) < 1 {
return []string{}, nil
}
return strings.Split(string(bytes.TrimRight(data, string("\x0... | go | func (p Proc) CmdLine() ([]string, error) {
f, err := os.Open(p.path("cmdline"))
if err != nil {
return nil, err
}
defer f.Close()
data, err := ioutil.ReadAll(f)
if err != nil {
return nil, err
}
if len(data) < 1 {
return []string{}, nil
}
return strings.Split(string(bytes.TrimRight(data, string("\x0... | [
"func",
"(",
"p",
"Proc",
")",
"CmdLine",
"(",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"p",
".",
"path",
"(",
"\"",
"\"",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
... | // CmdLine returns the command line of a process. | [
"CmdLine",
"returns",
"the",
"command",
"line",
"of",
"a",
"process",
"."
] | 87a4384529e0652f5035fb5cc8095faf73ea9b0b | https://github.com/prometheus/procfs/blob/87a4384529e0652f5035fb5cc8095faf73ea9b0b/proc.go#L114-L131 |
29,497 | prometheus/procfs | proc.go | Comm | func (p Proc) Comm() (string, error) {
f, err := os.Open(p.path("comm"))
if err != nil {
return "", err
}
defer f.Close()
data, err := ioutil.ReadAll(f)
if err != nil {
return "", err
}
return strings.TrimSpace(string(data)), nil
} | go | func (p Proc) Comm() (string, error) {
f, err := os.Open(p.path("comm"))
if err != nil {
return "", err
}
defer f.Close()
data, err := ioutil.ReadAll(f)
if err != nil {
return "", err
}
return strings.TrimSpace(string(data)), nil
} | [
"func",
"(",
"p",
"Proc",
")",
"Comm",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"p",
".",
"path",
"(",
"\"",
"\"",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
... | // Comm returns the command name of a process. | [
"Comm",
"returns",
"the",
"command",
"name",
"of",
"a",
"process",
"."
] | 87a4384529e0652f5035fb5cc8095faf73ea9b0b | https://github.com/prometheus/procfs/blob/87a4384529e0652f5035fb5cc8095faf73ea9b0b/proc.go#L134-L147 |
29,498 | prometheus/procfs | proc.go | Executable | func (p Proc) Executable() (string, error) {
exe, err := os.Readlink(p.path("exe"))
if os.IsNotExist(err) {
return "", nil
}
return exe, err
} | go | func (p Proc) Executable() (string, error) {
exe, err := os.Readlink(p.path("exe"))
if os.IsNotExist(err) {
return "", nil
}
return exe, err
} | [
"func",
"(",
"p",
"Proc",
")",
"Executable",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"exe",
",",
"err",
":=",
"os",
".",
"Readlink",
"(",
"p",
".",
"path",
"(",
"\"",
"\"",
")",
")",
"\n",
"if",
"os",
".",
"IsNotExist",
"(",
"err",
"... | // Executable returns the absolute path of the executable command of a process. | [
"Executable",
"returns",
"the",
"absolute",
"path",
"of",
"the",
"executable",
"command",
"of",
"a",
"process",
"."
] | 87a4384529e0652f5035fb5cc8095faf73ea9b0b | https://github.com/prometheus/procfs/blob/87a4384529e0652f5035fb5cc8095faf73ea9b0b/proc.go#L150-L157 |
29,499 | prometheus/procfs | proc.go | Cwd | func (p Proc) Cwd() (string, error) {
wd, err := os.Readlink(p.path("cwd"))
if os.IsNotExist(err) {
return "", nil
}
return wd, err
} | go | func (p Proc) Cwd() (string, error) {
wd, err := os.Readlink(p.path("cwd"))
if os.IsNotExist(err) {
return "", nil
}
return wd, err
} | [
"func",
"(",
"p",
"Proc",
")",
"Cwd",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"wd",
",",
"err",
":=",
"os",
".",
"Readlink",
"(",
"p",
".",
"path",
"(",
"\"",
"\"",
")",
")",
"\n",
"if",
"os",
".",
"IsNotExist",
"(",
"err",
")",
"{... | // Cwd returns the absolute path to the current working directory of the process. | [
"Cwd",
"returns",
"the",
"absolute",
"path",
"to",
"the",
"current",
"working",
"directory",
"of",
"the",
"process",
"."
] | 87a4384529e0652f5035fb5cc8095faf73ea9b0b | https://github.com/prometheus/procfs/blob/87a4384529e0652f5035fb5cc8095faf73ea9b0b/proc.go#L160-L167 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.