Till Westmann has submitted this change and it was merged. Change subject: Random cleanup ......................................................................
Random cleanup Change-Id: I44e64473f22d8587d6f98e8177287493e0216ecd Reviewed-on: https://asterix-gerrit.ics.uci.edu/1478 Sonar-Qube: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> BAD: Jenkins <[email protected]> Integration-Tests: Jenkins <[email protected]> Reviewed-by: abdullah alamoudi <[email protected]> --- M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AndDescriptor.java M hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/ExecutionTimeProfiler.java M hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/OperatorExecutionTimeProfiler.java 3 files changed, 4 insertions(+), 12 deletions(-) Approvals: abdullah alamoudi: Looks good to me, approved Jenkins: Verified; No violations found; No violations found; Verified diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AndDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AndDescriptor.java index b029b68..9fd5dc4 100644 --- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AndDescriptor.java +++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AndDescriptor.java @@ -87,7 +87,6 @@ public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException { resultStorage.reset(); int n = args.length; - boolean res = true; boolean metNull = false; boolean metMissing = false; for (int i = 0; i < n; i++) { @@ -112,13 +111,12 @@ ATypeTag.SERIALIZED_BOOLEAN_TYPE_TAG); } boolean argResult = ABooleanSerializerDeserializer.getBoolean(bytes, offset + 1); - if (argResult == false) { + if (! argResult) { // anything AND FALSE = FALSE booleanSerde.serialize(ABoolean.FALSE, out); result.set(resultStorage); return; } - res &= argResult; } if (metMissing) { // MISSING AND NULL = MISSING @@ -128,8 +126,7 @@ // NULL AND TRUE = NULL nullSerde.serialize(ANull.NULL, out); } else { - ABoolean aResult = res ? ABoolean.TRUE : ABoolean.FALSE; - booleanSerde.serialize(aResult, out); + booleanSerde.serialize(ABoolean.TRUE, out); } result.set(resultStorage); } diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/ExecutionTimeProfiler.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/ExecutionTimeProfiler.java index 7673f2c..66f7f10 100644 --- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/ExecutionTimeProfiler.java +++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/ExecutionTimeProfiler.java @@ -27,29 +27,24 @@ public class ExecutionTimeProfiler { public static final boolean PROFILE_MODE = false; - public static final String INIT = "init"; private FileOutputStream fos; private String filePath; private StringBuilder sb; - private int printInterval; - private int addCount; private Object lock1 = new Object(); // [Key: Job, Value: [Key: Operator, Value: Duration of each operators]] private HashMap<String, LinkedHashMap<String, String>> spentTimePerJobMap; - public ExecutionTimeProfiler(String filePath, int printInterval) { + public ExecutionTimeProfiler(String filePath) { this.filePath = new String(filePath); this.sb = new StringBuilder(); - this.printInterval = printInterval; this.spentTimePerJobMap = new HashMap<String, LinkedHashMap<String, String>>(); } public void begin() { try { fos = ExperimentProfilerUtils.openOutputFile(filePath); - addCount = 0; } catch (IOException e) { e.printStackTrace(); throw new IllegalStateException(e); diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/OperatorExecutionTimeProfiler.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/OperatorExecutionTimeProfiler.java index b5d632b..55c7915 100644 --- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/OperatorExecutionTimeProfiler.java +++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/OperatorExecutionTimeProfiler.java @@ -31,7 +31,7 @@ //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss-SSS"); try { executionTimeProfiler = new ExecutionTimeProfiler(profileHomeDir + "executionTime-" - + Inet4Address.getLocalHost().getHostAddress() + ".txt", 1); + + Inet4Address.getLocalHost().getHostAddress() + ".txt"); } catch (UnknownHostException e) { e.printStackTrace(); } -- To view, visit https://asterix-gerrit.ics.uci.edu/1478 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I44e64473f22d8587d6f98e8177287493e0216ecd Gerrit-PatchSet: 2 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Till Westmann <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-Reviewer: abdullah alamoudi <[email protected]>
