diff --git a/common/client/src/main/java/zingg/common/client/Client.java b/common/client/src/main/java/zingg/common/client/Client.java index 39f2f47df..42886fbf2 100644 --- a/common/client/src/main/java/zingg/common/client/Client.java +++ b/common/client/src/main/java/zingg/common/client/Client.java @@ -32,7 +32,6 @@ public abstract class Client implements Serializable { protected S session; protected PipeUtilBase pipeUtil; public static final Log LOG = LogFactory.getLog(Client.class); - protected String zFactoryClassName; @@ -56,7 +55,6 @@ public Client(IArguments args, ClientOptions options, String zFactory) throws Zi setOptions(options); try { buildAndSetArguments(args, options); - printAnalyticsBanner(arguments.getCollectMetrics()); setZingg(args, options); } catch (Exception e) { @@ -147,41 +145,38 @@ else if (args.getJobId() != -1) { setArguments(args); } - public void printBanner() { - String versionStr = "0.4.1-SNAPSHOT"; - LOG.info(""); - LOG.info("********************************************************"); - LOG.info("* Zingg AI *"); - LOG.info("* (C) 2021 Zingg.AI *"); - LOG.info("********************************************************"); - LOG.info(""); - LOG.info("using: Zingg v" + versionStr); + public void printBanner(boolean collectMetrics) { LOG.info(""); - } - - public void printAnalyticsBanner(boolean collectMetrics) { + LOG.info("**************************************************************************"); + LOG.info("* *"); + LOG.info("* "+getProductName()+" *"); + LOG.info("* (C) 2021 Zingg Labs, Inc. *"); + LOG.info("* *"); + LOG.info("* https://www.zingg.ai/ *"); + LOG.info("* *"); + LOG.info("* using: Zingg v"+getProductVersion()+" *"); + LOG.info("* *"); if(collectMetrics) { - LOG.info(""); - LOG.info("**************************************************************************"); LOG.info("* ** Note about analytics collection by Zingg AI ** *"); LOG.info("* *"); LOG.info("* Please note that Zingg captures a few metrics about application's *"); - LOG.info("* runtime parameters. However, no user's personal data or application *"); - LOG.info("* data is captured. If you want to switch off this feature, please *"); - LOG.info("* set the flag collectMetrics to false in config. For details, please *"); - LOG.info("* refer to the Zingg docs (https://docs.zingg.ai/zingg/security) *"); + LOG.info("* runtime parameters. However, no personal data or application data *"); + LOG.info("* is captured. If you want to switch off this feature, please set the *"); + LOG.info("* flag collectMetrics to false in config. For details, please refer to *"); + LOG.info("* the Zingg docs (https://docs.zingg.ai/zingg/security). *"); + LOG.info("* *"); LOG.info("**************************************************************************"); LOG.info(""); } else { - LOG.info(""); - LOG.info("*************************************************************************************************************"); - LOG.info("* Zingg is not collecting any analytics data and will only log a blank event with the name of the phase *"); - LOG.info("*************************************************************************************************************"); + LOG.info("* Zingg is not collecting any analytics data and will only log a blank *"); + LOG.info("* event with name of the phase. *"); + LOG.info("* *"); + LOG.info("**************************************************************************"); LOG.info(""); } } - + public abstract Client getClient(IArguments args, ClientOptions options) throws ZinggClientException; public ClientOptions getClientOptions(String ... args){ @@ -189,9 +184,9 @@ public ClientOptions getClientOptions(String ... args){ } public void mainMethod(String... args) { - printBanner(); Client client = null; ClientOptions options = null; + try { for (String a: args) LOG.debug("args " + a); @@ -213,7 +208,7 @@ else if (options.get(ClientOptions.CONF).value.endsWith("env")) { else { arguments = getArgsUtil().createArgumentsFromJSONString(options.get(ClientOptions.CONF).value, phase); } - + printBanner(arguments.getCollectMetrics()); client = getClient(arguments, options); client.init(); // after setting arguments etc. as some of the listeners need it @@ -358,5 +353,13 @@ public void setSession(S s) { public void setPipeUtil(PipeUtilBase pipeUtil) { this.pipeUtil = pipeUtil; } + + public String getProductName(){ + return "Zingg AI"; + } + + public String getProductVersion(){ + return "0.4.1-SNAPSHOT"; + } } \ No newline at end of file diff --git a/common/client/src/main/java/zingg/common/client/cols/FieldDefSelectedCols.java b/common/client/src/main/java/zingg/common/client/cols/FieldDefSelectedCols.java index af5f615a0..3584c501b 100644 --- a/common/client/src/main/java/zingg/common/client/cols/FieldDefSelectedCols.java +++ b/common/client/src/main/java/zingg/common/client/cols/FieldDefSelectedCols.java @@ -4,7 +4,6 @@ import java.util.List; import zingg.common.client.FieldDefinition; -import zingg.common.client.MatchType; public class FieldDefSelectedCols extends SelectedCols { diff --git a/common/core/src/main/java/zingg/common/core/executor/verifyBlocking/IVerifyBlockingPipeUtil.java b/common/core/src/main/java/zingg/common/core/executor/blockingverifier/IVerifyBlockingPipeUtil.java similarity index 92% rename from common/core/src/main/java/zingg/common/core/executor/verifyBlocking/IVerifyBlockingPipeUtil.java rename to common/core/src/main/java/zingg/common/core/executor/blockingverifier/IVerifyBlockingPipeUtil.java index 7e2077552..faf1d6cd2 100644 --- a/common/core/src/main/java/zingg/common/core/executor/verifyBlocking/IVerifyBlockingPipeUtil.java +++ b/common/core/src/main/java/zingg/common/core/executor/blockingverifier/IVerifyBlockingPipeUtil.java @@ -1,4 +1,4 @@ -package zingg.common.core.executor.verifyblocking; +package zingg.common.core.executor.blockingverifier; import zingg.common.client.IArguments; import zingg.common.client.pipe.Pipe; @@ -23,3 +23,4 @@ public interface IVerifyBlockingPipeUtil { } + diff --git a/common/core/src/main/java/zingg/common/core/executor/verifyBlocking/VerifyBlocking.java b/common/core/src/main/java/zingg/common/core/executor/blockingverifier/VerifyBlocking.java similarity index 98% rename from common/core/src/main/java/zingg/common/core/executor/verifyBlocking/VerifyBlocking.java rename to common/core/src/main/java/zingg/common/core/executor/blockingverifier/VerifyBlocking.java index c069e6d58..adbb16fb4 100644 --- a/common/core/src/main/java/zingg/common/core/executor/verifyBlocking/VerifyBlocking.java +++ b/common/core/src/main/java/zingg/common/core/executor/blockingverifier/VerifyBlocking.java @@ -1,4 +1,4 @@ -package zingg.common.core.executor.verifyblocking; +package zingg.common.core.executor.blockingverifier; import java.util.List; diff --git a/common/core/src/main/java/zingg/common/core/executor/verifyBlocking/VerifyBlockingPipes.java b/common/core/src/main/java/zingg/common/core/executor/blockingverifier/VerifyBlockingPipes.java similarity index 97% rename from common/core/src/main/java/zingg/common/core/executor/verifyBlocking/VerifyBlockingPipes.java rename to common/core/src/main/java/zingg/common/core/executor/blockingverifier/VerifyBlockingPipes.java index a82f0c0d3..880376cb4 100644 --- a/common/core/src/main/java/zingg/common/core/executor/verifyBlocking/VerifyBlockingPipes.java +++ b/common/core/src/main/java/zingg/common/core/executor/blockingverifier/VerifyBlockingPipes.java @@ -1,4 +1,4 @@ -package zingg.common.core.executor.verifyblocking; +package zingg.common.core.executor.blockingverifier; import zingg.common.client.IArguments; import zingg.common.client.pipe.FilePipe; diff --git a/common/core/src/test/java/zingg/common/core/executor/TestExecutorsSingle.java b/common/core/src/test/java/zingg/common/core/executor/TestExecutorsSingle.java index 05f173e5d..c75e92f06 100644 --- a/common/core/src/test/java/zingg/common/core/executor/TestExecutorsSingle.java +++ b/common/core/src/test/java/zingg/common/core/executor/TestExecutorsSingle.java @@ -13,7 +13,7 @@ import zingg.common.core.executor.validate.MatcherValidator; import zingg.common.core.executor.validate.TrainerValidator; import zingg.common.core.executor.validate.TrainingDataFinderValidator; -import zingg.common.core.executor.verifyblocking.VerifyBlocking; +import zingg.common.core.executor.blockingverifier.VerifyBlocking; public abstract class TestExecutorsSingle extends TestExecutorsGeneric { diff --git a/common/core/src/test/java/zingg/common/core/executor/validate/BlockerValidator.java b/common/core/src/test/java/zingg/common/core/executor/validate/BlockerValidator.java index 60f9ffb77..0aa720a12 100644 --- a/common/core/src/test/java/zingg/common/core/executor/validate/BlockerValidator.java +++ b/common/core/src/test/java/zingg/common/core/executor/validate/BlockerValidator.java @@ -10,9 +10,7 @@ import zingg.common.client.ZFrame; import zingg.common.client.ZinggClientException; import zingg.common.client.util.ColName; -import zingg.common.core.executor.verifyblocking.IVerifyBlockingPipeUtil; -import zingg.common.core.executor.verifyblocking.VerifyBlocking; -import zingg.common.core.executor.verifyblocking.VerifyBlockingPipes; +import zingg.common.core.executor.blockingverifier.*; public class BlockerValidator extends ExecutorValidator { diff --git a/spark/core/src/main/java/zingg/spark/core/executor/SparkVerifyBlocker.java b/spark/core/src/main/java/zingg/spark/core/executor/SparkVerifyBlocker.java index 756f92692..ec0a4787b 100644 --- a/spark/core/src/main/java/zingg/spark/core/executor/SparkVerifyBlocker.java +++ b/spark/core/src/main/java/zingg/spark/core/executor/SparkVerifyBlocker.java @@ -12,7 +12,7 @@ import zingg.common.client.IArguments; import zingg.common.client.ZinggClientException; import zingg.common.client.options.ZinggOptions; -import zingg.common.core.executor.verifyblocking.VerifyBlocking; +import zingg.common.core.executor.blockingverifier.VerifyBlocking; import zingg.spark.core.context.ZinggSparkContext; public class SparkVerifyBlocker extends VerifyBlocking,Row,Column,DataType> { diff --git a/spark/core/src/main/java/zingg/spark/core/executor/SparkVerifyBlockingPipes.java b/spark/core/src/main/java/zingg/spark/core/executor/SparkVerifyBlockingPipes.java index 23a2e139e..97fe903fd 100644 --- a/spark/core/src/main/java/zingg/spark/core/executor/SparkVerifyBlockingPipes.java +++ b/spark/core/src/main/java/zingg/spark/core/executor/SparkVerifyBlockingPipes.java @@ -9,7 +9,7 @@ import zingg.common.client.pipe.FilePipe; import zingg.common.client.pipe.Pipe; import zingg.common.client.util.PipeUtilBase; -import zingg.common.core.executor.verifyblocking.VerifyBlockingPipes; +import zingg.common.core.executor.blockingverifier.VerifyBlockingPipes; public class SparkVerifyBlockingPipes extends VerifyBlockingPipes,Row,Column>{