sumitagrawl commented on code in PR #4255:
URL: https://github.com/apache/ozone/pull/4255#discussion_r1105757787
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -1411,33 +1415,49 @@ public List<OpenKeyBucket> getExpiredOpenKeys(Duration
expireThreshold,
final long expiredCreationTimestamp =
expireThreshold.negated().plusMillis(Time.now()).toMillis();
- OpenKey.Builder builder = OpenKey.newBuilder();
int num = 0;
while (num < count && keyValueTableIterator.hasNext()) {
KeyValue<String, OmKeyInfo> openKeyValue =
keyValueTableIterator.next();
String dbOpenKeyName = openKeyValue.getKey();
+
+ final int lastPrefix = dbOpenKeyName.lastIndexOf(OM_KEY_PREFIX);
+ final String dbKeyName = dbOpenKeyName.substring(0, lastPrefix);
OmKeyInfo openKeyInfo = openKeyValue.getValue();
if (openKeyInfo.getCreationTime() <= expiredCreationTimestamp) {
- final String volume = openKeyInfo.getVolumeName();
- final String bucket = openKeyInfo.getBucketName();
- final String mapKey = volume + OM_KEY_PREFIX + bucket;
- if (!expiredKeys.containsKey(mapKey)) {
- expiredKeys.put(mapKey,
- OpenKeyBucket.newBuilder()
- .setVolumeName(volume)
- .setBucketName(bucket));
+ final OmKeyInfo info = kt.get(dbKeyName);
+
+ if (info == null) {
+ // add non-hsync'ed keys
+ expiredKeys.addOpenKey(openKeyInfo, dbOpenKeyName);
+ } else {
+ // add hsync'ed keys
+ final KeyArgs.Builder keyArgs = KeyArgs.newBuilder()
Review Comment:
There is no distinction if key needs to be applied for hsync OR its to be
rejected as explicit commit is not performed.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]