Permalink
Browse files

Support splitting of pages that are too big

  • Loading branch information...
justinsb committed Dec 10, 2013
1 parent 0ecdc90 commit d913414b6a597bcfad65afc6df7162776976a4a1
@@ -50,7 +50,7 @@ public boolean put(long storeId, byte[] key, byte[] value) throws InterruptedExc
KvEntry entry = KvEntry.newBuilder().setStoreId(storeId).setKey(ByteString.copyFrom(key))
.setAction(KvAction.SET).setValue(ByteString.copyFrom(value)).build();

log.debug("Proposing operation {}", entry);
log.debug("Proposing operation {}", entry.getAction());

return raft.commit(entry.toByteArray());
}
@@ -68,7 +68,7 @@ public void applyOperation(@Nonnull ByteBuffer op) {
// (we need idempotency)
try {
KvEntry entry = KvEntry.parseFrom(ByteString.copyFrom(op));
log.debug("Committing operation {}", entry);
log.debug("Committing operation {}", entry.getAction());

long storeId = entry.getStoreId();

@@ -13,7 +13,7 @@
import com.cloudata.keyvalue.btree.MmapPageStore;
import com.cloudata.keyvalue.btree.PageStore;
import com.cloudata.keyvalue.btree.ReadOnlyTransaction;
import com.cloudata.keyvalue.btree.ReadWriteTransaction;
import com.cloudata.keyvalue.btree.WriteTransaction;

public class KeyValueStore {

@@ -31,7 +31,7 @@ public KeyValueStore(File dir, boolean uniqueKeys) throws IOException {
}

public void doAction(KvAction action, ByteBuffer key, ByteBuffer value) {
try (ReadWriteTransaction txn = btree.beginReadWrite()) {
try (WriteTransaction txn = btree.beginReadWrite()) {
txn.doAction(btree, action, key, value);
txn.commit();
}
Oops, something went wrong.

0 comments on commit d913414

Please sign in to comment.