fix RocksDB java build

Summary: as title

Test Plan: make rocksdbjava

Reviewers: sdong, yhchiang, igor

Reviewed By: igor

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D23193
main
Lei Jin 10 years ago
parent 53404d9fb7
commit dd641b2117
  1. 11
      java/rocksjni/write_batch.cc

@ -12,6 +12,7 @@
#include "include/org_rocksdb_WriteBatchTest.h" #include "include/org_rocksdb_WriteBatchTest.h"
#include "rocksjni/portal.h" #include "rocksjni/portal.h"
#include "rocksdb/db.h" #include "rocksdb/db.h"
#include "rocksdb/immutable_options.h"
#include "db/memtable.h" #include "db/memtable.h"
#include "rocksdb/write_batch.h" #include "rocksdb/write_batch.h"
#include "db/write_batch_internal.h" #include "db/write_batch_internal.h"
@ -203,16 +204,18 @@ jbyteArray Java_org_rocksdb_WriteBatchTest_getContents(
auto factory = std::make_shared<rocksdb::SkipListFactory>(); auto factory = std::make_shared<rocksdb::SkipListFactory>();
rocksdb::Options options; rocksdb::Options options;
options.memtable_factory = factory; options.memtable_factory = factory;
rocksdb::MemTable* mem = new rocksdb::MemTable(cmp, options); rocksdb::MemTable* mem = new rocksdb::MemTable(
cmp, rocksdb::ImmutableCFOptions(options),
rocksdb::MemTableOptions(options));
mem->Ref(); mem->Ref();
std::string state; std::string state;
rocksdb::ColumnFamilyMemTablesDefault cf_mems_default(mem, &options); rocksdb::ColumnFamilyMemTablesDefault cf_mems_default(mem, &options);
rocksdb::Status s = rocksdb::Status s =
rocksdb::WriteBatchInternal::InsertInto(b, &cf_mems_default); rocksdb::WriteBatchInternal::InsertInto(b, &cf_mems_default);
int count = 0; int count = 0;
Arena arena; rocksdb::Arena arena;
ScopedArenaIterator iter(mem->NewIterator( rocksdb::ScopedArenaIterator iter(mem->NewIterator(
rocksdb::ReadOptions(), false /*don't enforce total order*/, &arena)); rocksdb::ReadOptions(), &arena));
for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {
rocksdb::ParsedInternalKey ikey; rocksdb::ParsedInternalKey ikey;
memset(reinterpret_cast<void*>(&ikey), 0, sizeof(ikey)); memset(reinterpret_cast<void*>(&ikey), 0, sizeof(ikey));

Loading…
Cancel
Save