Skip to content

Commit

Permalink
Add PutLogData support for WriteBatch object, for users to build a re…
Browse files Browse the repository at this point in the history
…plication system with RocksDB WAL
  • Loading branch information
jacky committed Aug 21, 2019
1 parent 1625521 commit 8354395
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions write_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ func (wb *WriteBatch) PutCF(cf *ColumnFamilyHandle, key, value []byte) {
C.rocksdb_writebatch_put_cf(wb.c, cf.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))
}

// Append a blob of arbitrary size to the records in this batch.
func (wb *WriteBatch) PutLogData(blob []byte) {
cBlob := byteToChar(blob)
C.rocksdb_writebatch_put_log_data(wb.c, cBlob, C.size_t(len(blob)))
}

// Merge queues a merge of "value" with the existing value of "key".
func (wb *WriteBatch) Merge(key, value []byte) {
cKey := byteToChar(key)
Expand Down

0 comments on commit 8354395

Please sign in to comment.