-
Notifications
You must be signed in to change notification settings - Fork 504
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
Move lz4 decompress to backend executor #1237
Conversation
Change-Id: Idf2e796739fda1dc5ce5ffcfa16bc61b6e1a6281
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.
update the title to "Move lz4 decompress to backend executor"
@@ -230,7 +230,8 @@ private void waitIfBusy() { | |||
if (this.busyCounter.get() > 0) { | |||
synchronized (this) { | |||
if (this.busyCounter.get() > 0) { | |||
this.busyCounter.decrementAndGet(); | |||
LOG.info("Decrease busy counter: [{}]", | |||
this.busyCounter.decrementAndGet()); |
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.
prefer to define a var
/** | ||
* Maybe useful in the future | ||
*/ | ||
private boolean isRPCTimeout(Status status) { |
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.
prefer isRpcTimeout
Change-Id: I4b4c470228caa4ba7e44df9618a7aa1f35da06ef
public static final ConfigOption<Integer> RAFT_RPC_BUF_HIGH_WATER_MARK = | ||
new ConfigOption<>( | ||
"raft.rpc_buf_high_water_mark", | ||
"", |
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.
ditto
public static final ConfigOption<Integer> RAFT_RPC_BUF_LOW_WATER_MARK = | ||
new ConfigOption<>( | ||
"raft.rpc_buf_low_water_mark", | ||
"", |
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.
prefer write some description
@@ -266,6 +267,9 @@ public void notifyCache(HugeType type, Id id) { | |||
eventHub = this.params.graphEventHub(); | |||
} else if (type.isSchema()) { | |||
eventHub = this.params.schemaEventHub(); | |||
if (id.number() && id.asLong() < 0) { | |||
return; |
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.
add some comment
@@ -54,6 +54,10 @@ public static BytesBuffer compress(byte[] bytes, int blockSize, | |||
} catch (IOException e) { | |||
throw new BackendException("Failed to compress", e); | |||
} | |||
/* | |||
* If need perform reading outside the 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.
need to perform
Change-Id: I70c2fcfd92ed923d801394cd6f97b31afa8475d4
@@ -107,7 +107,9 @@ private void listenChanges() { | |||
if ("invalid".equals(args[0])) { | |||
HugeType type = (HugeType) args[1]; | |||
Id id = (Id) args[2]; | |||
this.arrayCaches.remove(type, id); | |||
if (id.number() && id.asLong() > 0) { | |||
this.arrayCaches.remove(type, id); |
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.
move to remove() method
Change-Id: I8008c86b8e7c92d72dac205eca8894826a39edb8
da6a0bd
to
d1189c7
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.
this.set(schema.type(), id, schema); | ||
} | ||
} | ||
|
||
public V get(HugeType type, Id id) { | ||
assert id.number() && id.asLong() > 0 : id; | ||
assert id.number(); | ||
if (id.asLong() <= 0L) { |
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.
define var longId=id.asLong()
@@ -348,7 +349,10 @@ public V get(HugeType type, Id id) { | |||
} | |||
|
|||
public void set(HugeType type, Id id, V value) { | |||
assert id.number() && id.asLong() > 0 : id; | |||
assert id.number(); | |||
if (id.asLong() <= 0L) { |
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.
ditto
@@ -373,7 +377,10 @@ public void set(HugeType type, Id id, V value) { | |||
} | |||
|
|||
public void remove(HugeType type, Id id) { | |||
assert id.number() && id.asLong() > 0 : id; | |||
assert id.number(); | |||
if (id.asLong() <= 0L) { |
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.
ditto
Change-Id: Ia15672c9e0564cb9673a0b8ab983272c3943c276
assert id.number() && id.asLong() > 0 : id; | ||
assert id.number(); | ||
if (id.asLong() <= 0L) { | ||
return; |
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.
add assert false : id
;
Change-Id: I4d7a90c5e40117e00c1e017917ac5d83824df3ce
Change-Id: Ic7770f0b8cb9a81dbb714ea9ce8ef99d5b710807
Codecov Report
@@ Coverage Diff @@
## master #1237 +/- ##
============================================
+ Coverage 62.21% 62.42% +0.20%
- Complexity 5736 5758 +22
============================================
Files 371 374 +3
Lines 31153 31284 +131
Branches 4381 4393 +12
============================================
+ Hits 19382 19529 +147
+ Misses 9795 9772 -23
- Partials 1976 1983 +7
Continue to review full report at Codecov.
|
* use whitebox to set LOW_WATER_MARK and HIGH_WATER_MARK Change-Id: Ic7770f0b8cb9a81dbb714ea9ce8ef99d5b710807
Change-Id: Idf2e796739fda1dc5ce5ffcfa16bc61b6e1a6281