Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/integrate latest rocksb6.20+ #1

Merged
merged 77 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e08b908
fix windows dynamic build crash
ananclub Oct 19, 2016
533a9e9
Merge remote-tracking branch 'remotes/upstream/master'
ananclub Nov 23, 2017
eff08f0
use rocksdb_free for release
ananclub Nov 23, 2017
fc04b74
add wal iterator
olebedev Jan 31, 2018
2280d59
add wrapper for GetOptionsFromString
jialeicui Nov 12, 2018
e0ef1dd
Add GetStatisticsString method to Options
bmermet Dec 15, 2018
28210cc
fix memory leak in deleting filterpolicy and mergeoperator value
Dec 24, 2018
f1ea5ee
fix GetApproximateSizes
paulmach Jan 10, 2019
65e4f3a
Add support for opening a db with TTL support
rupertchen Jan 28, 2019
41daeed
Add *DB.SetOptions().
rupertchen Jan 28, 2019
c32be75
DeleteRange DeleteRangeCF
Apr 25, 2019
53f98ff
Add pinned slices
jackwakefield Dec 1, 2018
5709d75
Merge pull request #156 from rupertchen/open-with-ttl
tecbot May 19, 2019
e56d531
Merge pull request #160 from applinskinner/pinned
tecbot May 19, 2019
d8a660f
Merge pull request #155 from rupertchen/set-options
tecbot May 19, 2019
330989c
Merge pull request #153 from paulmach/fix-approx-sizes
tecbot May 19, 2019
28ce0c0
Merge pull request #151 from bmermet/statistics_string
tecbot May 19, 2019
8e5cf18
Merge pull request #150 from jialeicui/rocksdb_get_options_from_string
tecbot May 19, 2019
025c3cf
Merge pull request #152 from NgaiShunChan/fix-memory-leak
tecbot May 19, 2019
3e9dad2
Correct default value for SetWriteBufferSize
artemyarulin May 23, 2019
acc24fc
DeleteFileInRange
May 24, 2019
89a20de
Merge branch 'master' of https://github.com/tecbot/gorocksdb
May 24, 2019
ea499c0
DeleteFileInRange and comments
Jun 3, 2019
ce1489d
add test for DeleteRange
Jun 3, 2019
5444b9d
change int to uint64
Jun 17, 2019
a5447a1
add SetEnablePipelinedWrite
Jun 24, 2019
f35f041
Merge branch 'master' of https://github.com/gritzko/gorocksdb
Jun 24, 2019
96eadb8
improve the PR of wal iterator
Jun 24, 2019
930ad62
format code
Jun 24, 2019
20a9aac
add err ret for GetUpdatesSince
Jun 25, 2019
2836957
Add bindings for lowering CPU and IO priority of thread pools
JelteF May 6, 2019
014684f
Add some helpers for Slice usage
JelteF Jun 25, 2019
972a764
Use xenial for travis
JelteF Jun 25, 2019
a72a84b
Add -ldl needed apparently
JelteF Jun 25, 2019
99b1b1e
Add -ldl needed apparently
JelteF Jun 25, 2019
c0434aa
add SetWALRecoveryMode
Jun 27, 2019
7930eb8
add SetWALRecoveryMode
Jun 27, 2019
bffa652
Merge pull request #159 from JimChengLin/master
tecbot Jul 5, 2019
6552642
Merge pull request #163 from GetStream/slice-helpers
tecbot Jul 5, 2019
1625521
Merge pull request #161 from artemyarulin/patch-1
tecbot Jul 5, 2019
b3e6411
correct SetWALRecoveryMode documentation
Jul 8, 2019
f6e26c0
improve documentation of WALIterator
Jul 8, 2019
b3df346
remove compression library flags
Stumble Jul 17, 2019
cbd8fd2
added NewNoopPrefixTransform
Jul 26, 2019
66c8e72
added SetMemTablePrefixBloomSizeRatio()
Jul 26, 2019
c59f936
added SetOptimizeFiltersForHits()
Jul 26, 2019
616329e
fix build
Jul 26, 2019
65294a3
remove ldflags if static flag is set
Stumble Jul 29, 2019
7390370
Adding SetPrefixSameAsStart
jamesbibby Aug 20, 2019
8354395
Add PutLogData support for WriteBatch object, for users to build a re…
Aug 21, 2019
18a098b
Problem
jamesbibby Sep 13, 2019
f0de349
Workaround for Linux 32-bit build
michilu Sep 20, 2019
87975f4
Merge pull request #172 from jamesbibby/partial-merge-multi
tecbot Sep 24, 2019
b8859bc
Merge pull request #169 from jamesbibby/add-prefix-same-as-start
tecbot Sep 24, 2019
db81abc
Merge pull request #166 from badoo/add_new_functions_to_api
tecbot Sep 24, 2019
3aa0860
Merge pull request #170 from zjay1987/add-putlogdata-support
tecbot Sep 24, 2019
caad327
Merge pull request #164 from JimChengLin/master
tecbot Sep 24, 2019
759d835
Merge pull request #162 from GetStream/add-lower-priority-c-bindings-pr
tecbot Sep 24, 2019
f3d486e
Merge pull request #173 from michilu/fix/issues-145-build-error-on-armhf
tecbot Sep 24, 2019
bbab159
Merge pull request #1 from tecbot/master
ananclub Sep 25, 2019
f43d6ee
use rocksdb_free to fix windows run crash
Sep 25, 2019
bb1c9e9
Revert "Add bindings for lowering CPU and IO priority of thread pools"
tecbot Sep 30, 2019
1ddf313
Merge pull request #176 from tecbot/revert-162-add-lower-priority-c-b…
tecbot Sep 30, 2019
65a88f0
Merge pull request #119 from ananclub/master
jamesbibby Sep 30, 2019
55ce39d
Attempting to destroy the opts.cst will segfault
jamesbibby Oct 16, 2019
d217d93
Merge pull request #174 from Stumble/yumin/remove-flags
jamesbibby Oct 17, 2019
a1e313d
Add CreateNewBackupFlush alongside CreateNewBackup
kr-mohak Oct 4, 2019
1c5d8be
Add the method PurgeOldBackups to BackupEngine
kr-mohak Oct 7, 2019
400c562
Merge pull request #178 from kr-mohak/backup-improvements
jamesbibby Oct 19, 2019
343ac07
Add missing table options and full bloom filter
kenny-house Nov 5, 2019
b74127c
Adjust go versions in travis
ferhatelmas Nov 15, 2019
712d449
Merge pull request #184 from ferhatelmas/go-versions
jamesbibby Nov 22, 2019
a180c0b
Merge pull request #181 from kenny-house/partitioned-index-options
jamesbibby Nov 22, 2019
eb0a0d0
Merge pull request #180 from tecbot/dont-destroy-cst
jamesbibby Nov 22, 2019
bbc5fe7
add NewMemEnv
flxflx Dec 11, 2019
f0fad39
Merge pull request #187 from edgelesssys/master
jamesbibby Dec 17, 2019
9721107
- fix for latest rocksdb
ssardana08 Jan 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
dist: xenial
language: go
go:
- 1.11
- 1.12.x
- 1.13.x
- tip

before_install:
Expand Down
29 changes: 23 additions & 6 deletions backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func OpenBackupEngine(opts *Options, path string) (*BackupEngine, error) {

be := C.rocksdb_backup_engine_open(opts.c, cpath, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
defer C.rocksdb_free(unsafe.Pointer(cErr))
return nil, errors.New(C.GoString(cErr))
}
return &BackupEngine{
Expand All @@ -104,19 +104,25 @@ func (b *BackupEngine) UnsafeGetBackupEngine() unsafe.Pointer {
return unsafe.Pointer(b.c)
}

// CreateNewBackup takes a new backup from db.
func (b *BackupEngine) CreateNewBackup(db *DB) error {
// CreateNewBackupFlush takes a new backup from db. If flush is set to true,
// it flushes the WAL before taking the backup.
func (b *BackupEngine) CreateNewBackupFlush(db *DB, flush bool) error {
var cErr *C.char

C.rocksdb_backup_engine_create_new_backup(b.c, db.c, &cErr)
C.rocksdb_backup_engine_create_new_backup_flush(b.c, db.c, boolToChar(flush), &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
defer C.rocksdb_free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}

return nil
}

// CreateNewBackup takes a new backup from db.
func (b *BackupEngine) CreateNewBackup(db *DB) error {
return b.CreateNewBackupFlush(db, false)
}

// GetInfo gets an object that gives information about
// the backups that have already been taken
func (b *BackupEngine) GetInfo() *BackupEngineInfo {
Expand All @@ -138,7 +144,18 @@ func (b *BackupEngine) RestoreDBFromLatestBackup(dbDir, walDir string, ro *Resto

C.rocksdb_backup_engine_restore_db_from_latest_backup(b.c, cDbDir, cWalDir, ro.c, &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
defer C.rocksdb_free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
}

// PurgeOldBackups deletes all backups older than the latest 'n' backups
func (b *BackupEngine) PurgeOldBackups(n uint32) error {
var cErr *C.char
C.rocksdb_backup_engine_purge_old_backups(b.c, C.uint32_t(n), &cErr)
if cErr != nil {
defer C.rocksdb_free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
Expand Down
10 changes: 5 additions & 5 deletions cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Cache struct {
}

// NewLRUCache creates a new LRU Cache object with the capacity given.
func NewLRUCache(capacity int) *Cache {
func NewLRUCache(capacity uint64) *Cache {
return NewNativeCache(C.rocksdb_cache_create_lru(C.size_t(capacity)))
}

Expand All @@ -19,13 +19,13 @@ func NewNativeCache(c *C.rocksdb_cache_t) *Cache {
}

// GetUsage returns the Cache memory usage.
func (c *Cache) GetUsage() int {
return int(C.rocksdb_cache_get_usage(c.c))
func (c *Cache) GetUsage() uint64 {
return uint64(C.rocksdb_cache_get_usage(c.c))
}

// GetPinnedUsage returns the Cache pinned memory usage.
func (c *Cache) GetPinnedUsage() int {
return int(C.rocksdb_cache_get_pinned_usage(c.c))
func (c *Cache) GetPinnedUsage() uint64 {
return uint64(C.rocksdb_cache_get_pinned_usage(c.c))
}

// Destroy deallocates the Cache object.
Expand Down
2 changes: 1 addition & 1 deletion checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (checkpoint *Checkpoint) CreateCheckpoint(checkpoint_dir string, log_size_f

C.rocksdb_checkpoint_create(checkpoint.c, cDir, C.uint64_t(log_size_for_flush), &cErr)
if cErr != nil {
defer C.free(unsafe.Pointer(cErr))
defer C.rocksdb_free(unsafe.Pointer(cErr))
return errors.New(C.GoString(cErr))
}
return nil
Expand Down
3 changes: 2 additions & 1 deletion checkpoint_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package gorocksdb

import (
"github.com/facebookgo/ensure"
"io/ioutil"
"os"
"testing"

"github.com/facebookgo/ensure"
)

func TestCheckpoint(t *testing.T) {
Expand Down
Loading