You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/07/26 11:31:07 UTC
[GitHub] [hadoop] adoroszlai commented on a change in pull request #1167:
HDDS-1863. Freon RandomKeyGenerator even if keySize is set to 0,
it returns some random data to key.
adoroszlai commented on a change in pull request #1167: HDDS-1863. Freon RandomKeyGenerator even if keySize is set to 0, it returns some random data to key.
URL: https://github.com/apache/hadoop/pull/1167#discussion_r307702723
##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java
##########
@@ -697,12 +697,11 @@ private boolean createKey(long globalKeyNumber) {
try (Scope writeScope = GlobalTracer.get().buildSpan("writeKeyData")
.startActive(true)) {
long keyWriteStart = System.nanoTime();
- for (long nrRemaining = keySize - randomValue.length;
+ for (long nrRemaining = keySize;
nrRemaining > 0; nrRemaining -= bufferSize) {
int curSize = (int) Math.min(bufferSize, nrRemaining);
os.write(keyValueBuffer, 0, curSize);
}
- os.write(randomValue);
Review comment:
I think key write validation should be adjusted, too.
`keyValueBuffer` is common for all keys, while `randomValue` is unique per key. The latter is used below in key write validatation (if requested). So validation fails as is, since it still uses `randomValue`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org