-
Notifications
You must be signed in to change notification settings - Fork 18
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
parameterised log message, final variable migration, removing unused methods #60
Conversation
|
345cabf
to
8cafd91
Compare
@@ -15,8 +15,6 @@ | |||
package org.janusgraph.diskstorage.foundationdb; | |||
|
|||
import com.apple.foundationdb.KeyValue; | |||
import com.apple.foundationdb.LocalityUtil; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing ununsed imports
@@ -74,11 +71,6 @@ private static FoundationDBTx getTransaction(StoreTransaction txh) { | |||
|
|||
@Override | |||
public synchronized void close() throws BackendException { | |||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant code as nothing was inside try catch. also no 82-83 do not call foundation db.
@@ -167,7 +159,7 @@ public void insert(StaticBuffer key, StaticBuffer value, StoreTransaction txh, I | |||
|
|||
return new FoundationDBRecordAsyncIterator(db, tx, rangeQuery, result, query.getKeySelector()); | |||
} catch (Exception e) { | |||
log.error("getSliceAsync db=%s, tx=%s with exception", name, txh, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
migrating to slf4j parameterized logging
@@ -257,13 +249,6 @@ public void delete(StaticBuffer key, StoreTransaction txh) throws BackendExcepti | |||
throw new PermanentBackendException(e); | |||
} | |||
} | |||
public List<StaticBuffer> getBoundaryKeys() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved. Please let me know if i need to. update the comment.
@@ -25,10 +25,10 @@ | |||
*/ | |||
public class FoundationDBRangeQuery { | |||
|
|||
private KVQuery originalQuery; | |||
private final KVQuery originalQuery; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both these attributes could be final
@@ -52,19 +52,19 @@ | |||
|
|||
private final Database db; | |||
|
|||
private List<Insert> inserts = Collections.synchronizedList(new ArrayList<>()); | |||
private List<byte[]> deletions = Collections.synchronizedList(new ArrayList<>()); | |||
private final List<Insert> inserts = Collections.synchronizedList(new ArrayList<>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these attributes can be final
@@ -149,7 +149,7 @@ public synchronized void rollback() throws BackendException { | |||
|
|||
|
|||
private void logFDBException(Throwable t) { | |||
if (t != null && t instanceof FDBException) { | |||
if (t instanceof FDBException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t!=null
was redundant as t instanceof FDBException
checks for null case as well
@@ -449,8 +449,8 @@ public void clear(final byte[] key) { | |||
|
|||
|
|||
private class Insert { | |||
private byte[] key; | |||
private byte[] value; | |||
private final byte[] key; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both the attributes could be final
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for cleaning up @nischalkumar, I appreciate that!
I have one remark, otherwise this PR looks good to me.
@@ -257,13 +249,6 @@ public void delete(StaticBuffer key, StoreTransaction txh) throws BackendExcepti | |||
throw new PermanentBackendException(e); | |||
} | |||
} | |||
public List<StaticBuffer> getBoundaryKeys() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def3510
to
cc6d2cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good, thanks!
Would you please squash your commits into a single one and resolve merge conflicts?
Edit: I just found out about the problems with our testing environment. I will try to go ahead and fix it so that CI will execute correctly.
Blocked on #61 |
468e026
to
8156764
Compare
…methods Signed-off-by: Nischal Kumar <nischalkumarsagar@gmail.com>
8156764
to
327be29
Compare
@rngcntr I have squashed all commits into one. Conflicts are also resolved. |
@nischalkumar Very nice, thanks a lot for your contribution! |
Small refactor to improve code quality. This pr includes three things