Skip to content

Commit

Permalink
fixing some missing flipping buffer triggers #75
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed May 2, 2018
1 parent 0c7be49 commit b4f5bf8
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Integer retrieve(Integer key) {
ByteBuffer cachedData = null;
Integer record = null;
try (Txn<ByteBuffer> tx = environment.txnRead()) {
keyBuffer.put(KBEnvironment.serialize(key));
keyBuffer.put(KBEnvironment.serialize(key)).flip();
cachedData = db.get(tx, keyBuffer);
if (cachedData != null) {
record = (Integer) KBEnvironment.deserialize(cachedData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public Long retrieve(Integer key) {
ByteBuffer cachedData = null;
Long record = null;
try (Txn<ByteBuffer> tx = environment.txnRead()) {
keyBuffer.put(KBEnvironment.serialize(key));
keyBuffer.put(KBEnvironment.serialize(key)).flip();
cachedData = db.get(tx, keyBuffer);
if (cachedData != null) {
record = (Long) KBEnvironment.deserialize(cachedData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public Record retrieve(Integer key) {
ByteBuffer cachedData = null;
Record record = null;
try (Txn<ByteBuffer> tx = environment.txnRead()) {
keyBuffer.put(KBEnvironment.serialize(key));
keyBuffer.put(KBEnvironment.serialize(key)).flip();
cachedData = db.get(tx, keyBuffer);
if (cachedData != null) {
record = (Record) KBEnvironment.deserialize(cachedData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public String retrieve(Integer key) {
ByteBuffer cachedData = null;
String record = null;
try (Txn<ByteBuffer> tx = environment.txnRead()) {
keyBuffer.put(KBEnvironment.serialize(key));
keyBuffer.put(KBEnvironment.serialize(key)).flip();
cachedData = db.get(tx, keyBuffer);
if (cachedData != null) {
record = (String) KBEnvironment.deserialize(cachedData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public void loadReverseStatements(boolean overwrite, StatementDatabase statement
newStatements.add(statement);

final ByteBuffer keyBuffer = allocateDirect(environment.getMaxKeySize());
keyBuffer.put(KBEnvironment.serialize(value));
keyBuffer.put(KBEnvironment.serialize(value)).flip();
final byte[] serializedValue = KBEnvironment.serialize(newStatements);
final ByteBuffer valBuffer = allocateDirect(serializedValue.length);
valBuffer.put(serializedValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public Integer retrieve(String key) {
ByteBuffer cachedData = null;
Integer record = null;
try (Txn<ByteBuffer> tx = environment.txnRead()) {
keyBuffer.put(KBEnvironment.serialize(key));
keyBuffer.put(KBEnvironment.serialize(key)).flip();
cachedData = db.get(tx, keyBuffer);
if (cachedData != null) {
record = (Integer) KBEnvironment.deserialize(cachedData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public List<String> getDomains(int pageId) {

ByteBuffer cachedData = null;
try (Txn<ByteBuffer> tx = environment.txnRead()) {
keyBuffer.put(KBEnvironment.serialize(pageId));
keyBuffer.put(KBEnvironment.serialize(pageId)).flip();

cachedData = db.get(tx, keyBuffer);
if (cachedData != null) {
Expand Down

0 comments on commit b4f5bf8

Please sign in to comment.