[GitHub] [samza] shanthoosh commented on a change in pull request #955: SAMZA-2131: [Scala cleanup] Convert FileSystemCheckpointManagerConfig.scala and SystemConfig.scala to Java

2019-03-24 Thread GitBox
shanthoosh commented on a change in pull request #955: SAMZA-2131: [Scala 
cleanup] Convert FileSystemCheckpointManagerConfig.scala and SystemConfig.scala 
to Java
URL: https://github.com/apache/samza/pull/955#discussion_r268481428
 
 

 ##
 File path: 
samza-core/src/test/java/org/apache/samza/config/TestSystemConfig.java
 ##
 @@ -0,0 +1,266 @@
+/*
+ * 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.config;
+
+import java.util.HashMap;
+import java.util.Map;
+import com.google.common.collect.ImmutableMap;
+import org.apache.samza.metrics.MetricsRegistry;
+import org.apache.samza.system.SystemAdmin;
+import org.apache.samza.system.SystemConsumer;
+import org.apache.samza.system.SystemFactory;
+import org.apache.samza.system.SystemProducer;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+
+
 
 Review comment:
   Minor: Remove empty new-line here.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [samza] shanthoosh commented on a change in pull request #955: SAMZA-2131: [Scala cleanup] Convert FileSystemCheckpointManagerConfig.scala and SystemConfig.scala to Java

2019-03-24 Thread GitBox
shanthoosh commented on a change in pull request #955: SAMZA-2131: [Scala 
cleanup] Convert FileSystemCheckpointManagerConfig.scala and SystemConfig.scala 
to Java
URL: https://github.com/apache/samza/pull/955#discussion_r268481956
 
 

 ##
 File path: 
samza-core/src/main/scala/org/apache/samza/checkpoint/file/FileSystemCheckpointManager.scala
 ##
 @@ -22,17 +22,18 @@ package org.apache.samza.checkpoint.file
 import java.io.File
 import java.io.FileNotFoundException
 import java.io.FileOutputStream
-import java.util
+
 
 Review comment:
   Minor: Remove this empty line. 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [samza] shanthoosh commented on a change in pull request #955: SAMZA-2131: [Scala cleanup] Convert FileSystemCheckpointManagerConfig.scala and SystemConfig.scala to Java

2019-03-24 Thread GitBox
shanthoosh commented on a change in pull request #955: SAMZA-2131: [Scala 
cleanup] Convert FileSystemCheckpointManagerConfig.scala and SystemConfig.scala 
to Java
URL: https://github.com/apache/samza/pull/955#discussion_r268481222
 
 

 ##
 File path: samza-core/src/main/java/org/apache/samza/config/SystemConfig.java
 ##
 @@ -147,4 +153,31 @@ public String getSystemOffsetDefault(String systemName) {
 
 return systemOffsetDefault;
   }
+
+  public Optional getSystemKeySerde(String systemName) {
+return getSystemDefaultStreamProperty(systemName, 
StreamConfig.KEY_SERDE());
+  }
+
+  public Optional getSystemMsgSerde(String systemName) {
+return getSystemDefaultStreamProperty(systemName, 
StreamConfig.MSG_SERDE());
+  }
+
+  public boolean deleteCommittedMessages(String systemName) {
+return getBoolean(String.format(DELETE_COMMITTED_MESSAGES, systemName), 
false);
+  }
+
+  private Optional getSystemDefaultStreamProperty(String systemName, 
String propertyName) {
 
 Review comment:
   Minor: Would be better to add java docs for this the method. 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [samza] shanthoosh commented on a change in pull request #955: SAMZA-2131: [Scala cleanup] Convert FileSystemCheckpointManagerConfig.scala and SystemConfig.scala to Java

2019-03-24 Thread GitBox
shanthoosh commented on a change in pull request #955: SAMZA-2131: [Scala 
cleanup] Convert FileSystemCheckpointManagerConfig.scala and SystemConfig.scala 
to Java
URL: https://github.com/apache/samza/pull/955#discussion_r268010269
 
 

 ##
 File path: samza-core/src/main/java/org/apache/samza/config/SystemConfig.java
 ##
 @@ -33,27 +34,35 @@
 /**
  * a java version of the system config
  */
-public class JavaSystemConfig extends MapConfig {
-  public static final String SYSTEM_PREFIX = "systems.";
-  public static final String SYSTEM_FACTORY_SUFFIX = ".samza.factory";
-  public static final String SYSTEM_FACTORY_FORMAT = SYSTEM_PREFIX + "%s" + 
SYSTEM_FACTORY_SUFFIX;
-  private static final String SYSTEM_DEFAULT_STREAMS_PREFIX_FORMAT = 
SYSTEM_PREFIX + "%s" + ".default.stream.";
+public class SystemConfig extends MapConfig {
+  public static final String SYSTEMS_PREFIX = "systems.";
 
 Review comment:
   Minor: Would be better to group private public, package-private constants 
together. 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [samza] shanthoosh commented on a change in pull request #955: SAMZA-2131: [Scala cleanup] Convert FileSystemCheckpointManagerConfig.scala and SystemConfig.scala to Java

2019-03-24 Thread GitBox
shanthoosh commented on a change in pull request #955: SAMZA-2131: [Scala 
cleanup] Convert FileSystemCheckpointManagerConfig.scala and SystemConfig.scala 
to Java
URL: https://github.com/apache/samza/pull/955#discussion_r268415931
 
 

 ##
 File path: 
samza-core/src/main/scala/org/apache/samza/util/CoordinatorStreamUtil.scala
 ##
 @@ -66,9 +66,9 @@ object CoordinatorStreamUtil {
 */
   def getCoordinatorSystemFactory(config: Config) = {
 val systemName = config.getCoordinatorSystemName
-val systemFactoryClassName = config
-  .getSystemFactory(systemName)
-  .getOrElse(throw new SamzaException("Missing configuration: " + 
SystemConfig.SYSTEM_FACTORY format systemName))
+val systemConfig = new SystemConfig(config);
 
 Review comment:
   Minor: Remove the unnecessary semicolon at the end. 


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:
us...@infra.apache.org


With regards,
Apache Git Services