eolivelli commented on a change in pull request #2975:
URL: https://github.com/apache/bookkeeper/pull/2975#discussion_r778798070
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java
##########
@@ -1259,7 +1261,17 @@ LedgerDescriptor getLedgerForEntry(ByteBuf entry, final
byte[] masterKey)
}
private Journal getJournal(long ledgerId) {
- return journals.get(MathUtils.signSafeMod(ledgerId, journals.size()));
+ String dividendString = Double.toString(ledgerId);
+ byte[] secretBytes = null;
+ int index = 0;
+ try {
+ secretBytes =
MessageDigest.getInstance("md5").digest(dividendString.getBytes());
+ BigInteger md5Code = new BigInteger(1, secretBytes);
Review comment:
It looks to me that computing this value for every write to the journal
is quite expensive.
Can we find something less resource consuming?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]