@@ -93,24 +93,24 @@ class TaskStorageManager(
9393 debug(" Cleaning base directories for stores." )
9494
9595 taskStores.keys.foreach(storeName => {
96- val storagePartitionDir = TaskStorageManager .getStorePartitionDir(storeBaseDir, storeName, taskName)
97- info(" Got default storage partition directory as %s" format storagePartitionDir .toPath.toString)
96+ val storePartitionDir = TaskStorageManager .getStorePartitionDir(storeBaseDir, storeName, taskName)
97+ info(" Got default storage partition directory as %s" format storePartitionDir .toPath.toString)
9898
99- if (storagePartitionDir .exists()) {
100- info(" Deleting default storage partition directory %s" format storagePartitionDir .toPath.toString)
101- Util .rm(storagePartitionDir )
99+ if (storePartitionDir .exists()) {
100+ info(" Deleting default storage partition directory %s" format storePartitionDir .toPath.toString)
101+ Util .rm(storePartitionDir )
102102 }
103103
104- val loggedStoreDir = TaskStorageManager .getStorePartitionDir(loggedStoreBaseDir, storeName, taskName)
105- info(" Got logged storage partition directory as %s" format loggedStoreDir .toPath.toString)
104+ val loggedStorePartitionDir = TaskStorageManager .getStorePartitionDir(loggedStoreBaseDir, storeName, taskName)
105+ info(" Got logged storage partition directory as %s" format loggedStorePartitionDir .toPath.toString)
106106
107107 // Delete the logged store if it is not valid.
108- if (! isLoggedStoreValid(storeName, loggedStoreDir )) {
109- info(" Deleting logged storage partition directory %s." format loggedStoreDir .toPath.toString)
110- Util .rm(loggedStoreDir )
108+ if (! isLoggedStoreValid(storeName, loggedStorePartitionDir )) {
109+ info(" Deleting logged storage partition directory %s." format loggedStorePartitionDir .toPath.toString)
110+ Util .rm(loggedStorePartitionDir )
111111 } else {
112- val offset = readOffsetFile(loggedStoreDir )
113- info(" Read offset %s for the store %s from logged storage partition directory %s." format(offset, storeName, loggedStoreDir ))
112+ val offset = readOffsetFile(loggedStorePartitionDir )
113+ info(" Read offset %s for the store %s from logged storage partition directory %s." format(offset, storeName, loggedStorePartitionDir ))
114114 fileOffset.put(new SystemStreamPartition (changeLogSystemStreams(storeName), partition), offset)
115115 }
116116 })
@@ -182,13 +182,13 @@ class TaskStorageManager(
182182 taskStores.foreach {
183183 case (storeName, storageEngine) =>
184184 if (storageEngine.getStoreProperties.isLoggedStore) {
185- val loggedStoragePartitionDir = TaskStorageManager .getStorePartitionDir(loggedStoreBaseDir, storeName, taskName)
186- info(" Using logged storage partition directory: %s for store: %s." format(loggedStoragePartitionDir .toPath.toString, storeName))
187- if (! loggedStoragePartitionDir .exists()) loggedStoragePartitionDir .mkdirs()
185+ val loggedStorePartitionDir = TaskStorageManager .getStorePartitionDir(loggedStoreBaseDir, storeName, taskName)
186+ info(" Using logged storage partition directory: %s for store: %s." format(loggedStorePartitionDir .toPath.toString, storeName))
187+ if (! loggedStorePartitionDir .exists()) loggedStorePartitionDir .mkdirs()
188188 } else {
189- val storagePartitionDir = TaskStorageManager .getStorePartitionDir(storeBaseDir, storeName, taskName)
190- info(" Using storage partition directory: %s for store: %s." format(storagePartitionDir .toPath.toString, storeName))
191- storagePartitionDir .mkdirs()
189+ val storePartitionDir = TaskStorageManager .getStorePartitionDir(storeBaseDir, storeName, taskName)
190+ info(" Using storage partition directory: %s for store: %s." format(storePartitionDir .toPath.toString, storeName))
191+ storePartitionDir .mkdirs()
192192 }
193193 }
194194 }
@@ -322,7 +322,8 @@ class TaskStorageManager(
322322 }
323323 debug(" Got offset %s for store %s" format(newestOffset, storeName))
324324
325- val offsetFile = new File (TaskStorageManager .getStorePartitionDir(loggedStoreBaseDir, storeName, taskName), offsetFileName)
325+ val loggedStorePartitionDir = TaskStorageManager .getStorePartitionDir(loggedStoreBaseDir, storeName, taskName)
326+ val offsetFile = new File (loggedStorePartitionDir, offsetFileName)
326327 if (newestOffset != null ) {
327328 debug(" Storing offset for store in OFFSET file " )
328329 Util .writeDataToFile(offsetFile, newestOffset)
0 commit comments