mynameborat commented on a change in pull request #1343:
URL: https://github.com/apache/samza/pull/1343#discussion_r427964761



##########
File path: 
samza-core/src/main/java/org/apache/samza/storage/TransactionalTaskSideInputStorageManager.java
##########
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.samza.storage;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.WildcardFileFilter;
+import org.apache.samza.SamzaException;
+import org.apache.samza.checkpoint.CheckpointId;
+import org.apache.samza.container.TaskName;
+import org.apache.samza.job.model.TaskMode;
+import org.apache.samza.system.SystemStreamPartition;
+import org.apache.samza.util.Clock;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class TransactionalTaskSideInputStorageManager extends 
NonTransactionalTaskSideInputStorageManager implements 
TaskSideInputStorageManager {

Review comment:
       That is true for now although it can evolve to handle checkpoints in the 
a non-transactional way need be.
   
   Let me elaborate my first point a bit more. E.g. `writeCheckpoints(...)` 
invokes the  `writeCheckpoint(..)` of the 
`NonTransactionTaskSideInputStorageManager` before supplementing it with its 
own logic. Where we need to perform the responsibilities of this class in 
tandem with `NonTransactionTaskSideInputStorageManager` vs where we will need 
to override the responsibilities is tricky and challenging without knowing the 
ins and out of it. 
   
   Additionally, the helper methods such as validation of stores, inferring 
store properties etc could very well be common for implementors of 
`TaskSideInputStorageManager` but now forces them to either duplicate the code 
within their implementation or extend 
`NonTransactionTaskSideInputStorageManage` even if it may not be necessary.




----------------------------------------------------------------
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]


Reply via email to