Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header Changes PR #956

Merged
merged 10 commits into from
Nov 20, 2024
57 changes: 30 additions & 27 deletions common/client/src/main/java/zingg/common/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
protected S session;
protected PipeUtilBase<S,D,R,C> pipeUtil;
public static final Log LOG = LogFactory.getLog(Client.class);

protected String zFactoryClassName;


Expand All @@ -56,7 +55,6 @@
setOptions(options);
try {
buildAndSetArguments(args, options);
printAnalyticsBanner(arguments.getCollectMetrics());
setZingg(args, options);
}
catch (Exception e) {
Expand Down Expand Up @@ -147,51 +145,48 @@
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()+" *");

Check warning

Code scanning / PMD

Logger calls should be surrounded by log level guards. Warning

Logger calls should be surrounded by log level guards.
LOG.info("* (C) 2021 Zingg Labs, Inc. *");
LOG.info("* *");
LOG.info("* https://www.zingg.ai/ *");
LOG.info("* *");
LOG.info("* using: Zingg v"+getProductVersion()+" *");

Check warning

Code scanning / PMD

Logger calls should be surrounded by log level guards. Warning

Logger calls should be surrounded by log level guards.
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<S,D,R,C,T> getClient(IArguments args, ClientOptions options) throws ZinggClientException;

public ClientOptions getClientOptions(String ... args){
return new ClientOptions(args);
}

public void mainMethod(String... args) {
printBanner();
Client<S,D,R,C,T> client = null;
ClientOptions options = null;

try {

for (String a: args) LOG.debug("args " + a);
Expand All @@ -213,7 +208,7 @@
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
Expand Down Expand Up @@ -358,5 +353,13 @@
public void setPipeUtil(PipeUtilBase<S, D, R, C> pipeUtil) {
this.pipeUtil = pipeUtil;
}

public String getProductName(){
return "Zingg AI";
}

public String getProductVersion(){
return "0.4.1-SNAPSHOT";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.List;

import zingg.common.client.FieldDefinition;
import zingg.common.client.MatchType;

public class FieldDefSelectedCols extends SelectedCols {

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -23,3 +23,4 @@ public interface IVerifyBlockingPipeUtil<S,D,R,C> {
}



Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package zingg.common.core.executor.verifyblocking;
package zingg.common.core.executor.blockingverifier;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<S, D, R, C, T> extends TestExecutorsGeneric<S, D, R, C, T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;

Check warning

Code scanning / PMD

Unused import 'zingg.common.client.util.*' Warning test

Unused import 'zingg.common.core.executor.blockingverifier.*'

public class BlockerValidator<S, D, R, C, T> extends ExecutorValidator<S, D, R, C, T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SparkSession,Dataset<Row>,Row,Column,DataType> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SparkSession,Dataset<Row>,Row,Column>{

Expand Down
Loading