Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -128,31 +128,39 @@ public Pair<String, Boolean> process(OMUpdateEventBatch events) {
continue;
}
String updatedKey = omdbUpdateEvent.getKey();
OmKeyInfo omKeyInfo = omdbUpdateEvent.getValue();
Object value = omdbUpdateEvent.getValue();
Comment thread
smengcl marked this conversation as resolved.

try {
switch (omdbUpdateEvent.getAction()) {
case PUT:
handlePutKeyEvent(omKeyInfo, fileSizeCountMap);
break;
if (value instanceof OmKeyInfo) {
OmKeyInfo omKeyInfo = (OmKeyInfo) value;

case DELETE:
handleDeleteKeyEvent(updatedKey, omKeyInfo, fileSizeCountMap);
break;
try {
switch (omdbUpdateEvent.getAction()) {
case PUT:
handlePutKeyEvent(omKeyInfo, fileSizeCountMap);
break;

case UPDATE:
handleDeleteKeyEvent(updatedKey, omdbUpdateEvent.getOldValue(),
fileSizeCountMap);
handlePutKeyEvent(omKeyInfo, fileSizeCountMap);
break;
case DELETE:
handleDeleteKeyEvent(updatedKey, omKeyInfo, fileSizeCountMap);
break;

default: LOG.trace("Skipping DB update event : {}",
omdbUpdateEvent.getAction());
case UPDATE:
handleDeleteKeyEvent(updatedKey, omdbUpdateEvent.getOldValue(),
fileSizeCountMap);
handlePutKeyEvent(omKeyInfo, fileSizeCountMap);
break;

default:
LOG.trace("Skipping DB update event : {}",
omdbUpdateEvent.getAction());
}
} catch (Exception e) {
LOG.error("Unexpected exception while processing key {}.",
updatedKey, e);
return new ImmutablePair<>(getTaskName(), false);
}
} catch (Exception e) {
LOG.error("Unexpected exception while processing key {}.",
updatedKey, e);
return new ImmutablePair<>(getTaskName(), false);
} else {
LOG.warn("Unexpected value type {} for key {}. Skipping processing.",
Comment thread
ArafatKhan2198 marked this conversation as resolved.
value.getClass().getName(), updatedKey);
}
}
writeCountsToDB(false, fileSizeCountMap);
Expand Down