arp7 commented on a change in pull request #1033: HDDS-1391 : Add ability in OM
to serve delta updates through an API.
URL: https://github.com/apache/hadoop/pull/1033#discussion_r307528176
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/RDBStore.java
##########
@@ -327,6 +329,44 @@ public CodecRegistry getCodecRegistry() {
return codecRegistry;
}
+ @Override
+ public DBUpdatesWrapper getUpdatesSince(long sequenceNumber)
+ throws SequenceNumberNotFoundException {
+
+ DBUpdatesWrapper dbUpdatesWrapper = new DBUpdatesWrapper();
+ try {
+ TransactionLogIterator transactionLogIterator =
+ db.getUpdatesSince(sequenceNumber);
+
+ boolean flag = true;
+
+ while (transactionLogIterator.isValid()) {
+ TransactionLogIterator.BatchResult result =
+ transactionLogIterator.getBatch();
+ long currSequenceNumber = result.sequenceNumber();
+ if (flag && currSequenceNumber > 1 + sequenceNumber) {
+ throw new SequenceNumberNotFoundException("Unable to read data from"
+
+ " RocksDB wal to get delta updates. It may have already been" +
+ "flushed to SSTs.");
+ }
+ flag = false;
Review comment:
I didn't understand why we reset this flag after the first iteration.
Perhaps it will be clear later.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]