mynameborat commented on a change in pull request #915: Consolidating offset 
read and write for store-offsets and side-inputs, maintaining backward 
compatbility
URL: https://github.com/apache/samza/pull/915#discussion_r256143994
 
 

 ##########
 File path: 
samza-core/src/main/scala/org/apache/samza/storage/ContainerStorageManager.java
 ##########
 @@ -532,14 +531,19 @@ private void cleanBaseDirsAndReadOffsetFiles() {
             LOG.info("Deleting logged storage partition directory " + 
loggedStorePartitionDir.toPath().toString());
             FileUtil.rm(loggedStorePartitionDir);
           } else {
-            String offset = 
StorageManagerUtil.readOffsetFile(loggedStorePartitionDir, OFFSET_FILE_NAME);
+
+            // if the store has no changelogSSP, simply use null
+            SystemStreamPartition changelogSSP = null;
+            if (changelogSystemStreams.containsKey(storeName))
 
 Review comment:
   Should we just wrap all the code below(until updating fileOffsets) inside 
this if block?
   It gets rid of the scenario where `changelogSSP` can be null but still we 
try fetching offsets for it. It also gets rid of potential NPEs.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to