vjagadish1989 commented on a change in pull request #1075: SAMZA-2242 : Improve
logging on offset-file code-path
URL: https://github.com/apache/samza/pull/1075#discussion_r291788386
##########
File path:
samza-core/src/main/java/org/apache/samza/storage/StorageManagerUtil.java
##########
@@ -145,10 +145,14 @@ public static boolean isOffsetFileValid(File storeDir,
Set<SystemStreamPartition
boolean hasValidOffsetFile = false;
if (storeDir.exists()) {
Map<SystemStreamPartition, String> offsetContents =
readOffsetFile(storeDir, storeSSPs, isSideInput);
- if (offsetContents != null && !offsetContents.isEmpty() &&
offsetContents.keySet().equals(storeSSPs)) {
- hasValidOffsetFile = true;
+ if (offsetContents == null) {
+ LOG.info("Offset file is not valid for store: {}.", storeDir.toPath()
+ "; the file does not exist.");
+ } else if (offsetContents.isEmpty()) {
+ LOG.info("Offset file is not valid for store: {}.", storeDir.toPath()
+ "; the file is empty.");
+ } else if (!offsetContents.keySet().equals(storeSSPs)) {
+ LOG.info("Offset file is not valid for store: {}.", storeDir.toPath()
+ "; the file does not match store SSPs: " + storeSSPs.toString() + ".");
Review comment:
Can you log the offsetContents.keySet() in addition to the storeSSPs?
----------------------------------------------------------------
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