From 0ae295639e69f2cbd79ab349cdd6234414e7c463 Mon Sep 17 00:00:00 2001 From: 1ambda <1amb4a@gmail.com> Date: Mon, 28 Nov 2016 11:27:18 +0900 Subject: [PATCH 01/25] chore: Use pluginManagement block so that config be shared in children projects --- pom.xml | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/pom.xml b/pom.xml index d0eb7a7ee57..54b24395b7b 100644 --- a/pom.xml +++ b/pom.xml @@ -334,33 +334,6 @@ org.apache.maven.plugins maven-checkstyle-plugin - - _tools/checkstyle.xml - false - - - - checkstyle-fail-build - validate - - check - - - true - org/apache/zeppelin/interpreter/thrift/*,org/apache/zeppelin/scio/avro/* - - - - checkstyle-gen-html-report - install - - checkstyle-aggregate - - - org/apache/zeppelin/interpreter/thrift/*,org/apache/zeppelin/scio/avro/* - - - @@ -503,6 +476,33 @@ org.apache.maven.plugins maven-checkstyle-plugin ${plugin.checkstyle.version} + + _tools/checkstyle.xml + false + + + + checkstyle-fail-build + validate + + check + + + true + org/apache/zeppelin/interpreter/thrift/*,org/apache/zeppelin/scio/avro/*,org/apache/zeppelin/scio/avro/* + + + + checkstyle-gen-html-report + install + + checkstyle-aggregate + + + org/apache/zeppelin/interpreter/thrift/*,org/apache/zeppelin/scio/avro/*,org/apache/zeppelin/scio/avro/* + + + From 092155dfb06a17f78a0dd949b2edd152a12b907e Mon Sep 17 00:00:00 2001 From: 1ambda <1amb4a@gmail.com> Date: Mon, 28 Nov 2016 11:28:29 +0900 Subject: [PATCH 02/25] chore: Remove useless failOnViolation config its default value is already `true` see https://maven.apache.org/plugins/maven-checkstyle-plugin/check-mojo.html --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 54b24395b7b..cd9e10bd419 100644 --- a/pom.xml +++ b/pom.xml @@ -488,7 +488,6 @@ check - true org/apache/zeppelin/interpreter/thrift/*,org/apache/zeppelin/scio/avro/*,org/apache/zeppelin/scio/avro/* From 1c3048ea763c5108f1489fdf15a72b40b19436f4 Mon Sep 17 00:00:00 2001 From: 1ambda <1amb4a@gmail.com> Date: Mon, 28 Nov 2016 11:29:46 +0900 Subject: [PATCH 03/25] chore: Remove duplicated exclude --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index cd9e10bd419..40f95e1b3c2 100644 --- a/pom.xml +++ b/pom.xml @@ -488,7 +488,7 @@ check - org/apache/zeppelin/interpreter/thrift/*,org/apache/zeppelin/scio/avro/*,org/apache/zeppelin/scio/avro/* + org/apache/zeppelin/interpreter/thrift/*,org/apache/zeppelin/scio/avro/* @@ -498,7 +498,7 @@ checkstyle-aggregate - org/apache/zeppelin/interpreter/thrift/*,org/apache/zeppelin/scio/avro/*,org/apache/zeppelin/scio/avro/* + org/apache/zeppelin/interpreter/thrift/*,org/apache/zeppelin/scio/avro/* From e04de2f52a18ab822f8bdcadbc2e552d47a9a31f Mon Sep 17 00:00:00 2001 From: 1ambda <1amb4a@gmail.com> Date: Mon, 28 Nov 2016 12:08:36 +0900 Subject: [PATCH 04/25] chore: Use recent checkstyle runtime --- pom.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 40f95e1b3c2..733c55b0df8 100644 --- a/pom.xml +++ b/pom.xml @@ -119,7 +119,7 @@ 1.5 1.8.1 1.3.1 - 2.13 + 2.17 2.17 3.0.0 1.2.1 @@ -475,7 +475,14 @@ org.apache.maven.plugins maven-checkstyle-plugin - ${plugin.checkstyle.version} + 2.17 + + + com.puppycrawl.tools + checkstyle + 6.19 + + _tools/checkstyle.xml false From 0e90cc3d39845388742b99bf9501c08965746025 Mon Sep 17 00:00:00 2001 From: 1ambda <1amb4a@gmail.com> Date: Mon, 28 Nov 2016 11:52:15 +0900 Subject: [PATCH 05/25] style: Fix Invalid indents in interpreter [INFO] ------------------------------------------------------------------------ [INFO] Building Zeppelin: Interpreter 0.7.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle-fail-build) @ zeppelin-interpreter --- [INFO] There are 5 errors reported by Checkstyle 6.11.2 with _tools/checkstyle.xml ruleset. [ERROR] src/main/java/org/apache/zeppelin/dep/DependencyResolver.java:[162] (indentation) Indentation: 'Collection' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreter.java:[242] (indentation) Indentation: 'getClassName' have incorrect indentation level 10, expected level should be 12. [ERROR] src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java:[59] (indentation) Indentation: 'extends' have incorrect indentation level 2, expected level should be 4. [ERROR] src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java:[60] (indentation) Indentation: 'implements' have incorrect indentation level 2, expected level should be 4. [ERROR] src/test/resources/log4j.properties:[0] (misc) NewlineAtEndOfFile: File does not end with a newline. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Zeppelin ........................................... SUCCESS [ 3.587 s] [INFO] Zeppelin: Interpreter .............................. FAILURE [ 0.901 s] --- .../java/org/apache/zeppelin/dep/DependencyResolver.java | 2 +- .../zeppelin/interpreter/remote/RemoteInterpreter.java | 2 +- .../zeppelin/interpreter/remote/RemoteInterpreterServer.java | 5 ++--- zeppelin-interpreter/src/test/resources/log4j.properties | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/dep/DependencyResolver.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/dep/DependencyResolver.java index 03f6b323185..c4ec04b5028 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/dep/DependencyResolver.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/dep/DependencyResolver.java @@ -159,7 +159,7 @@ private List loadFromMvn(String artifact, Collection excludes) */ @Override public List getArtifactsWithDep(String dependency, - Collection excludes) throws RepositoryException { + Collection excludes) throws RepositoryException { Artifact artifact = new DefaultArtifact(dependency); DependencyFilter classpathFilter = DependencyFilterUtils.classpathFilter(JavaScopes.COMPILE); PatternExclusionsDependencyFilter exclusionFilter = diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreter.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreter.java index 50ff689bcb7..072651bdf38 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreter.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreter.java @@ -240,7 +240,7 @@ public synchronized void init() { property.put("zeppelin.interpreter.localRepo", localRepoPath); } client.createInterpreter(groupId, sessionKey, - getClassName(), (Map) property, userName); + getClassName(), (Map) property, userName); // Push angular object loaded from JSON file to remote interpreter if (!interpreterGroup.isAngularRegistryPushed()) { pushAngularObjectRegistryToRemote(client); diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java index b167256e6bc..d90117c55eb 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java @@ -58,9 +58,8 @@ * Entry point for Interpreter process. * Accepting thrift connections from ZeppelinServer. */ -public class RemoteInterpreterServer - extends Thread - implements RemoteInterpreterService.Iface, AngularObjectRegistryListener { +public class RemoteInterpreterServer extends Thread + implements RemoteInterpreterService.Iface, AngularObjectRegistryListener { Logger logger = LoggerFactory.getLogger(RemoteInterpreterServer.class); InterpreterGroup interpreterGroup; diff --git a/zeppelin-interpreter/src/test/resources/log4j.properties b/zeppelin-interpreter/src/test/resources/log4j.properties index d8a783974e3..b81d6729f87 100644 --- a/zeppelin-interpreter/src/test/resources/log4j.properties +++ b/zeppelin-interpreter/src/test/resources/log4j.properties @@ -26,4 +26,4 @@ log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c:%L - %m%n # # Root logger option -log4j.rootLogger=INFO, stdout \ No newline at end of file +log4j.rootLogger=INFO, stdout From 13c53fcdfc526f63f083cedb991128fcda1ba739 Mon Sep 17 00:00:00 2001 From: 1ambda <1amb4a@gmail.com> Date: Mon, 28 Nov 2016 12:03:06 +0900 Subject: [PATCH 06/25] style: Fix invalid indents in zengine [INFO] ------------------------------------------------------------------------ [INFO] Building Zeppelin: Zengine 0.7.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle-fail-build) @ zeppelin-zengine --- [INFO] There are 13 errors reported by Checkstyle 6.11.2 with _tools/checkstyle.xml ruleset. [ERROR] src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java:[348] (indentation) Indentation: '.' have incorrect indentation level 5, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java:[412] (indentation) Indentation: '"Information From loaded Interpreter Setting Ref - {} "' have incorrect indentation level10, expected level should be 12. [ERROR] src/main/java/org/apache/zeppelin/notebook/NotebookImportDeserializer.java:[37] (indentation) Indentation: 'array initialization' child have incorrect indentation level 4, expected level shouldbe 6. [ERROR] src/main/java/org/apache/zeppelin/notebook/NotebookImportDeserializer.java:[38] (indentation) Indentation: 'array initialization' child have incorrect indentation level 4, expected level shouldbe 6. [ERROR] src/main/java/org/apache/zeppelin/notebook/NotebookImportDeserializer.java:[39] (indentation) Indentation: 'array initialization' child have incorrect indentation level 4, expected level shouldbe 6. [ERROR] src/main/java/org/apache/zeppelin/notebook/NotebookImportDeserializer.java:[44] (indentation) Indentation: 'JsonDeserializationContext' have incorrect indentation level 4, expected level shouldbe 6. [ERROR] src/main/java/org/apache/zeppelin/notebook/Paragraph.java:[229] (indentation) Indentation: '&&' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/notebook/Paragraph.java:[230] (indentation) Indentation: '&&' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/notebook/Paragraph.java:[306] (indentation) Indentation: 'interpreterHasUser' have incorrect indentation level 8, expected level should be 10. [ERROR] src/main/java/org/apache/zeppelin/notebook/Paragraph.java:[307] (indentation) Indentation: 'isUserAuthorizedToAccessInterpreter' have incorrect indentation level 8, expected level should be 10. [ERROR] src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java:[440] (indentation) Indentation: 'getRepo' have incorrect indentation level 10, expected level should be 12. [ERROR] src/main/java/org/apache/zeppelin/notebook/utility/IdHashes.java:[30] (indentation) Indentation: 'array initialization' child have incorrect indentation level 4, expected level should be one ofthe following: 6, 55, 58. [ERROR] src/main/java/org/apache/zeppelin/notebook/utility/IdHashes.java:[31] (indentation) Indentation: 'array initialization' child have incorrect indentation level 4, expected level should be one ofthe following: 6, 55, 58. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Zeppelin ........................................... SUCCESS [ 3.116 s] [INFO] Zeppelin: Interpreter .............................. SUCCESS [ 1.237 s] [INFO] Zeppelin: Zengine .................................. FAILURE [ 0.612 s] --- .../apache/zeppelin/interpreter/InterpreterFactory.java | 6 +++--- .../zeppelin/notebook/NotebookImportDeserializer.java | 8 ++++---- .../main/java/org/apache/zeppelin/notebook/Paragraph.java | 8 ++++---- .../apache/zeppelin/notebook/repo/NotebookRepoSync.java | 2 +- .../org/apache/zeppelin/notebook/utility/IdHashes.java | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java index c620b3564f0..56342f5ec6e 100644 --- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java +++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java @@ -344,8 +344,8 @@ private List getInterpreterListFromJson(Path filename) } private List getInterpreterListFromJson(InputStream stream) { - Type registeredInterpreterListType = new TypeToken>() { - }.getType(); + Type registeredInterpreterListType = + new TypeToken>() {}.getType(); return gson.fromJson(new InputStreamReader(stream), registeredInterpreterListType); } @@ -409,7 +409,7 @@ private void loadFromFile() throws IOException { interpreterSettingObject = interpreterSettingsRef.get(setting.getGroup()); if (interpreterSettingObject == null) { logger.warn("can't get InterpreterSetting " + - "Information From loaded Interpreter Setting Ref - {} ", setting.getGroup()); + "Information From loaded Interpreter Setting Ref - {} ", setting.getGroup()); continue; } depClassPath = interpreterSettingObject.getPath(); diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/NotebookImportDeserializer.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/NotebookImportDeserializer.java index 86e0f0bf77e..47c3eca43eb 100644 --- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/NotebookImportDeserializer.java +++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/NotebookImportDeserializer.java @@ -34,14 +34,14 @@ */ public class NotebookImportDeserializer implements JsonDeserializer { private static final String[] DATE_FORMATS = new String[] { - "yyyy-MM-dd'T'HH:mm:ssZ", - "MMM d, yyyy h:mm:ss a", - "MMM dd, yyyy HH:mm:ss" + "yyyy-MM-dd'T'HH:mm:ssZ", + "MMM d, yyyy h:mm:ss a", + "MMM dd, yyyy HH:mm:ss" }; @Override public Date deserialize(JsonElement jsonElement, Type typeOF, - JsonDeserializationContext context) throws JsonParseException { + JsonDeserializationContext context) throws JsonParseException { for (String format : DATE_FORMATS) { try { return new SimpleDateFormat(format, Locale.US).parse(jsonElement.getAsString()); diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java index 114babfd008..ddf583d29a8 100644 --- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java +++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java @@ -227,8 +227,8 @@ public List getInterpreterCompletion() { public List completion(String buffer, int cursor) { String lines[] = buffer.split(System.getProperty("line.separator")); if (lines.length > 0 - && lines[0].startsWith("%") - && cursor <= lines[0].trim().length()) { + && lines[0].startsWith("%") + && cursor <= lines[0].trim().length()) { int idx = lines[0].indexOf(' '); if (idx < 0 || (idx > 0 && cursor <= idx)) { @@ -309,8 +309,8 @@ protected Object jobRun() throws Throwable { } if (this.noteHasUser() && this.noteHasInterpreters()) { if (intp != null && - interpreterHasUser(intp) && - isUserAuthorizedToAccessInterpreter(intp.getOption()) == false) { + interpreterHasUser(intp) && + isUserAuthorizedToAccessInterpreter(intp.getOption()) == false) { logger.error("{} has no permission for {} ", authenticationInfo.getUser(), repl); return new InterpreterResult(Code.ERROR, authenticationInfo.getUser() + " has no permission for " + getRequiredReplName()); diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java index 1a513aab86a..9c6470c807d 100644 --- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java +++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java @@ -437,7 +437,7 @@ public Revision checkpoint(String noteId, String checkpointMsg, AuthenticationIn allRepoCheckpoints.add(getRepo(i).checkpoint(noteId, checkpointMsg, subject)); } catch (IOException e) { LOG.warn("Couldn't checkpoint in {} storage with index {} for note {}", - getRepo(i).getClass().toString(), i, noteId); + getRepo(i).getClass().toString(), i, noteId); errorMessage += "Error on storage class " + getRepo(i).getClass().toString() + " with index " + i + " : " + e.getMessage() + "\n"; errorCount++; diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/utility/IdHashes.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/utility/IdHashes.java index 98aaac8a756..e3b6bda93a7 100644 --- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/utility/IdHashes.java +++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/utility/IdHashes.java @@ -27,8 +27,8 @@ */ public class IdHashes { private static final char[] DICTIONARY = new char[] {'1', '2', '3', '4', '5', '6', '7', '8', '9', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', - 'W', 'X', 'Y', 'Z'}; + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', + 'W', 'X', 'Y', 'Z'}; /** * encodes the given string into the base of the dictionary provided in the constructor. From bf6e39fd2d5073b961882a86c575a2a68e59680d Mon Sep 17 00:00:00 2001 From: 1ambda <1amb4a@gmail.com> Date: Mon, 28 Nov 2016 12:11:54 +0900 Subject: [PATCH 07/25] style: Fix indents in spark [INFO] ------------------------------------------------------------------------ [INFO] Building Zeppelin: Spark 0.7.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle-fail-build) @ zeppelin-spark_2.10 --- [INFO] There are 10 errors reported by Checkstyle 6.19 with _tools/checkstyle.xml ruleset. [ERROR] src/main/java/org/apache/zeppelin/spark/DepInterpreter.java:[209] (indentation) Indentation:'intp' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java:[418] (indentation) Indentation: 'e' have incorrect indentation level 10, expected level should be 12. [ERROR] src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java:[493] (indentation) Indentation: 'array initialization' child have incorrect indentation level 6, expected level should be one of the following: 8, 39, 42. [ERROR] src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java:[1158] (indentation) Indentation: '||' have incorrect indentation level 11, expected level should be 12. [ERROR] src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java:[1159] (indentation) Indentation: '||' have incorrect indentation level 11, expected level should be 12. [ERROR] src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java:[1160] (indentation) Indentation: '||' have incorrect indentation level 11, expected level should be 12. [ERROR] src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java:[1451] (indentation) Indentation: 'array initialization' child have incorrect indentation level 12, expected level should be 14. [ERROR] src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java:[1454] (indentation) Indentation: 'array initialization' child have incorrect indentation level 8, expected level should be 10. [ERROR] src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java:[1463] (indentation) Indentation: 'array initialization' child have incorrect indentation level 14, expected level should be 16. [ERROR] src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java:[1465] (indentation) Indentation: 'array initialization' child have incorrect indentation level 10, expected level should be 12. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Zeppelin ........................................... SUCCESS [ 3.472 s] [INFO] Zeppelin: Interpreter .............................. SUCCESS [ 1.153 s] [INFO] Zeppelin: Zengine .................................. SUCCESS [ 0.867 s] [INFO] Zeppelin: Display system apis ...................... SUCCESS [ 0.214 s] [INFO] Zeppelin: Spark dependencies ....................... SUCCESS [ 0.644 s] [INFO] Zeppelin: Spark .................................... FAILURE [ 0.348 s] --- .../apache/zeppelin/spark/DepInterpreter.java | 2 +- .../zeppelin/spark/SparkInterpreter.java | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spark/src/main/java/org/apache/zeppelin/spark/DepInterpreter.java b/spark/src/main/java/org/apache/zeppelin/spark/DepInterpreter.java index 478d0bc794c..a39b8c4152a 100644 --- a/spark/src/main/java/org/apache/zeppelin/spark/DepInterpreter.java +++ b/spark/src/main/java/org/apache/zeppelin/spark/DepInterpreter.java @@ -206,7 +206,7 @@ private Results.Result interpret(String line) { public Object getValue(String name) { Object ret = Utils.invokeMethod( - intp, "valueOfTerm", new Class[]{String.class}, new Object[]{name}); + intp, "valueOfTerm", new Class[]{String.class}, new Object[]{name}); if (ret instanceof None) { return null; } else if (ret instanceof Some) { diff --git a/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java b/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java index e8c76bcccd4..2edb26e0ad1 100644 --- a/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java +++ b/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java @@ -415,7 +415,7 @@ public SparkContext createSparkContext_1() { // continue instead of: throw new InterpreterException(e); // Newer Spark versions (like the patched CDH5.7.0 one) don't contain this method logger.warn(String.format("Spark method classServerUri not available due to: [%s]", - e.getMessage())); + e.getMessage())); } } @@ -490,7 +490,7 @@ private void setupConfForPySpark(SparkConf conf) { //Only one of py4j-0.9-src.zip and py4j-0.8.2.1-src.zip should exist String[] pythonLibs = new String[]{"pyspark.zip", "py4j-0.9-src.zip", "py4j-0.8.2.1-src.zip", - "py4j-0.10.1-src.zip", "py4j-0.10.3-src.zip"}; + "py4j-0.10.1-src.zip", "py4j-0.10.3-src.zip"}; ArrayList pythonLibUris = new ArrayList<>(); for (String lib : pythonLibs) { File libFile = new File(pysparkPath, lib); @@ -1155,9 +1155,9 @@ public InterpreterResult interpretInput(String[] lines, InterpreterContext conte String nextLine = linesToRun[l + 1].trim(); boolean continuation = false; if (nextLine.isEmpty() - || nextLine.startsWith("//") // skip empty line or comment - || nextLine.startsWith("}") - || nextLine.startsWith("object")) { // include "} object" for Scala companion object + || nextLine.startsWith("//") // skip empty line or comment + || nextLine.startsWith("}") + || nextLine.startsWith("object")) { // include "} object" for Scala companion object continuation = true; } else if (!inComment && nextLine.startsWith("/*")) { inComment = true; @@ -1448,10 +1448,10 @@ private Object createHttpServer(File outputDir) { Constructor constructor = getClass().getClassLoader() .loadClass("org.apache.spark.HttpServer") .getConstructor(new Class[]{ - SparkConf.class, File.class, SecurityManager.class, int.class, String.class}); + SparkConf.class, File.class, SecurityManager.class, int.class, String.class}); return constructor.newInstance(new Object[] { - conf, outputDir, new SecurityManager(conf), 0, "HTTP Server"}); + conf, outputDir, new SecurityManager(conf), 0, "HTTP Server"}); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { // fallback to old constructor @@ -1460,9 +1460,9 @@ private Object createHttpServer(File outputDir) { constructor = getClass().getClassLoader() .loadClass("org.apache.spark.HttpServer") .getConstructor(new Class[]{ - File.class, SecurityManager.class, int.class, String.class}); + File.class, SecurityManager.class, int.class, String.class}); return constructor.newInstance(new Object[] { - outputDir, new SecurityManager(conf), 0, "HTTP Server"}); + outputDir, new SecurityManager(conf), 0, "HTTP Server"}); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e1) { logger.error(e1.getMessage(), e1); From 06c4fae53bee3f20755c9a1a0fe2658dbce523b1 Mon Sep 17 00:00:00 2001 From: 1ambda <1amb4a@gmail.com> Date: Mon, 28 Nov 2016 12:18:19 +0900 Subject: [PATCH 08/25] style: Fix indents in shell [INFO] ------------------------------------------------------------------------ [INFO] Building Zeppelin: Shell interpreter 0.7.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle-fail-build) @ zeppelin-shell --- [INFO] There are 5 errors reported by Checkstyle 6.19 with _tools/checkstyle.xml ruleset. [ERROR] src/main/java/org/apache/zeppelin/shell/security/ShellSecurityImpl.java:[39] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/shell/security/ShellSecurityImpl.java:[46] (indentation) Indentation: 'properties' have incorrect indentation level 12, expected level should be 14. [ERROR] src/main/java/org/apache/zeppelin/shell/security/ShellSecurityImpl.java:[47] (indentation) Indentation: 'properties' have incorrect indentation level 12, expected level should be 14. [ERROR] src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java:[94] (indentation) Indentation: '+' have incorrect indentation level 8, expected level should be 10. [ERROR] src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java:[105] (indentation) Indentation: '+' have incorrect indentation level 10, expected level should be 12. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Zeppelin ........................................... SUCCESS [ 3.454 s] [INFO] Zeppelin: Interpreter .............................. SUCCESS [ 1.074 s] [INFO] Zeppelin: Zengine .................................. SUCCESS [ 0.889 s] [INFO] Zeppelin: Display system apis ...................... SUCCESS [ 0.173 s] [INFO] Zeppelin: Spark dependencies ....................... SUCCESS [ 0.723 s] [INFO] Zeppelin: Spark .................................... SUCCESS [ 0.640 s] [INFO] Zeppelin: Markdown interpreter ..................... SUCCESS [ 0.181 s] [INFO] Zeppelin: Angular interpreter ...................... SUCCESS [ 0.135 s] [INFO] Zeppelin: Shell interpreter ........................ FAILURE [ 0.135 s] --- .../java/org/apache/zeppelin/shell/ShellInterpreter.java | 8 ++++---- .../apache/zeppelin/shell/security/ShellSecurityImpl.java | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java b/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java index 838c6f15358..1c760d1ef77 100644 --- a/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java +++ b/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java @@ -90,8 +90,8 @@ public InterpreterResult interpret(String cmd, InterpreterContext contextInterpr executor.setWatchdog(new ExecuteWatchdog(Long.valueOf(getProperty(TIMEOUT_PROPERTY)))); executors.put(contextInterpreter.getParagraphId(), executor); int exitVal = executor.execute(cmdLine); - LOGGER.info("Paragraph " + contextInterpreter.getParagraphId() - + " return with exit value: " + exitVal); + LOGGER.info("Paragraph " + contextInterpreter.getParagraphId() + + " return with exit value: " + exitVal); return new InterpreterResult(Code.SUCCESS, outStream.toString()); } catch (ExecuteException e) { int exitValue = e.getExitValue(); @@ -101,8 +101,8 @@ public InterpreterResult interpret(String cmd, InterpreterContext contextInterpr if (exitValue == 143) { code = Code.INCOMPLETE; message += "Paragraph received a SIGTERM.\n"; - LOGGER.info("The paragraph " + contextInterpreter.getParagraphId() - + " stopped executing: " + message); + LOGGER.info("The paragraph " + contextInterpreter.getParagraphId() + + " stopped executing: " + message); } message += "ExitValue: " + exitValue; return new InterpreterResult(code, message); diff --git a/shell/src/main/java/org/apache/zeppelin/shell/security/ShellSecurityImpl.java b/shell/src/main/java/org/apache/zeppelin/shell/security/ShellSecurityImpl.java index bb3ce861f78..f11576fbd10 100644 --- a/shell/src/main/java/org/apache/zeppelin/shell/security/ShellSecurityImpl.java +++ b/shell/src/main/java/org/apache/zeppelin/shell/security/ShellSecurityImpl.java @@ -36,15 +36,15 @@ public class ShellSecurityImpl { public static void createSecureConfiguration(Properties properties, String shell) { String authType = properties.getProperty("zeppelin.shell.auth.type") - .trim().toUpperCase(); + .trim().toUpperCase(); switch (authType) { case "KERBEROS": CommandLine cmdLine = CommandLine.parse(shell); cmdLine.addArgument("-c", false); String kinitCommand = String.format("kinit -k -t %s %s", - properties.getProperty("zeppelin.shell.keytab.location"), - properties.getProperty("zeppelin.shell.principal")); + properties.getProperty("zeppelin.shell.keytab.location"), + properties.getProperty("zeppelin.shell.principal")); cmdLine.addArgument(kinitCommand, false); DefaultExecutor executor = new DefaultExecutor(); From 787163cb64bde1b9101c762f414079f88ca895a2 Mon Sep 17 00:00:00 2001 From: 1ambda <1amb4a@gmail.com> Date: Mon, 28 Nov 2016 12:25:15 +0900 Subject: [PATCH 09/25] style: Fix indents in jdbc [INFO] ------------------------------------------------------------------------ [INFO] Building Zeppelin: JDBC interpreter 0.7.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle-fail-build) @ zeppelin-jdbc --- [INFO] There are 6 errors reported by Checkstyle 6.19 with _tools/checkstyle.xml ruleset. [ERROR] src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java:[259] (indentation) Indentation:'jdbcUserConfigurationsMap' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java:[282] (indentation) Indentation:'getJDBCConfiguration' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java:[291] (indentation) Indentation:'getEntityName' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java:[302] (indentation) Indentation:'new' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java:[305] (indentation) Indentation:'connectionFactory' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java:[532] (indentation) Indentation:'getJDBCConfiguration' have incorrect indentation level 6, expected level should be 8. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Zeppelin ........................................... SUCCESS [ 3.206 s] [INFO] Zeppelin: Interpreter .............................. SUCCESS [ 1.011 s] [INFO] Zeppelin: Zengine .................................. SUCCESS [ 0.778 s] [INFO] Zeppelin: Display system apis ...................... SUCCESS [ 0.175 s] [INFO] Zeppelin: Spark dependencies ....................... SUCCESS [ 0.481 s] [INFO] Zeppelin: Spark .................................... SUCCESS [ 0.365 s] [INFO] Zeppelin: Markdown interpreter ..................... SUCCESS [ 0.160 s] [INFO] Zeppelin: Angular interpreter ...................... SUCCESS [ 0.142 s] [INFO] Zeppelin: Shell interpreter ........................ SUCCESS [ 0.142 s] [INFO] Zeppelin: Livy interpreter ......................... SUCCESS [ 0.476 s] [INFO] Zeppelin: HBase interpreter ........................ SUCCESS [ 0.272 s] [INFO] Zeppelin: Apache Pig Interpreter ................... SUCCESS [ 0.224 s] [INFO] Zeppelin: PostgreSQL interpreter ................... SUCCESS [ 0.200 s] [INFO] Zeppelin: JDBC interpreter ......................... FAILURE [ 0.186 s] --- .../org/apache/zeppelin/jdbc/JDBCInterpreter.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java index 407e81ea2a9..fcd02a0bd3d 100644 --- a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java +++ b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java @@ -256,7 +256,7 @@ private UsernamePassword getUsernamePassword(InterpreterContext interpreterConte public JDBCUserConfigurations getJDBCConfiguration(String user) { JDBCUserConfigurations jdbcUserConfigurations = - jdbcUserConfigurationsMap.get(user); + jdbcUserConfigurationsMap.get(user); if (jdbcUserConfigurations == null) { jdbcUserConfigurations = new JDBCUserConfigurations(); @@ -279,7 +279,7 @@ private void setUserProperty(String propertyKey, InterpreterContext interpreterC String user = interpreterContext.getAuthenticationInfo().getUser(); JDBCUserConfigurations jdbcUserConfigurations = - getJDBCConfiguration(user); + getJDBCConfiguration(user); jdbcUserConfigurations.setPropertyMap(propertyKey, basePropretiesMap.get(propertyKey)); if (existAccountInBaseProperty()) { @@ -288,7 +288,7 @@ private void setUserProperty(String propertyKey, InterpreterContext interpreterC jdbcUserConfigurations.cleanUserProperty(propertyKey); UsernamePassword usernamePassword = getUsernamePassword(interpreterContext, - getEntityName(interpreterContext.getReplName())); + getEntityName(interpreterContext.getReplName())); if (usernamePassword != null) { jdbcUserConfigurations.setUserProperty(propertyKey, usernamePassword); } else { @@ -299,10 +299,10 @@ private void setUserProperty(String propertyKey, InterpreterContext interpreterC private void createConnectionPool(String url, String user, String propertyKey, Properties properties) throws SQLException, ClassNotFoundException { ConnectionFactory connectionFactory = - new DriverManagerConnectionFactory(url, properties); + new DriverManagerConnectionFactory(url, properties); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory( - connectionFactory, null); + connectionFactory, null); ObjectPool connectionPool = new GenericObjectPool(poolableConnectionFactory); poolableConnectionFactory.setPool(connectionPool); @@ -542,7 +542,7 @@ public void cancel(InterpreterContext context) { logger.info("Cancel current query statement."); String paragraphId = context.getParagraphId(); JDBCUserConfigurations jdbcUserConfigurations = - getJDBCConfiguration(context.getAuthenticationInfo().getUser()); + getJDBCConfiguration(context.getAuthenticationInfo().getUser()); try { jdbcUserConfigurations.cancelStatement(paragraphId); } catch (SQLException e) { From b853bf03dceb40d2f202202cadc093ba82fff7d3 Mon Sep 17 00:00:00 2001 From: 1ambda <1amb4a@gmail.com> Date: Mon, 28 Nov 2016 12:28:35 +0900 Subject: [PATCH 10/25] style: Fix indents in lens [INFO] ------------------------------------------------------------------------ [INFO] Building Zeppelin: Lens interpreter 0.7.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle-fail-build) @ zeppelin-lens --- [INFO] There are 18 errors reported by Checkstyle 6.19 with _tools/checkstyle.xml ruleset. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[79] (indentation) Indentation: 'new' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[81] (indentation) Indentation: 'new' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[103,37] (whitespace) WhitespaceAround: '|' is not preceded with whitespace. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[103,38] (whitespace) WhitespaceAround: '|' is not followed by whitespace. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[106] (indentation) Indentation:'+' have incorrect indentation level 10, expected level should be 12. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[110,37] (whitespace) WhitespaceAround: '|' is not preceded with whitespace. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[110,38] (whitespace) WhitespaceAround: '|' is not followed by whitespace. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[269] (indentation) Indentation:'new' have incorrect indentation level 10, expected level should be 12. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[272] (indentation) Indentation:'+' have incorrect indentation level 10, expected level should be 12. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[324] (indentation) Indentation:'result' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[351] (indentation) Indentation:'+' have incorrect indentation level 8, expected level should be 10. [ERROR] src/main/java/org/apache/zeppelin/lens/LensInterpreter.java:[354] (indentation) Indentation:'+' have incorrect indentation level 8, expected level should be 10. [ERROR] src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java:[41] (indentation) Indentation: 'implements' have incorrect indentation level 2, expected level should be 4. [ERROR] src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java:[105] (indentation) Indentation: 'BeanFactoryUtils' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java:[112] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java:[172] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java:[189] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java:[209] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Zeppelin ........................................... SUCCESS [ 3.334 s] [INFO] Zeppelin: Interpreter .............................. SUCCESS [ 1.060 s] [INFO] Zeppelin: Zengine .................................. SUCCESS [ 0.781 s] [INFO] Zeppelin: Display system apis ...................... SUCCESS [ 0.184 s] [INFO] Zeppelin: Spark dependencies ....................... SUCCESS [ 0.514 s] [INFO] Zeppelin: Spark .................................... SUCCESS [ 0.388 s] [INFO] Zeppelin: Markdown interpreter ..................... SUCCESS [ 0.155 s] [INFO] Zeppelin: Angular interpreter ...................... SUCCESS [ 0.133 s] [INFO] Zeppelin: Shell interpreter ........................ SUCCESS [ 0.133 s] [INFO] Zeppelin: Livy interpreter ......................... SUCCESS [ 0.438 s] [INFO] Zeppelin: HBase interpreter ........................ SUCCESS [ 0.256 s] [INFO] Zeppelin: Apache Pig Interpreter ................... SUCCESS [ 0.269 s] [INFO] Zeppelin: PostgreSQL interpreter ................... SUCCESS [ 0.165 s] [INFO] Zeppelin: JDBC interpreter ......................... SUCCESS [ 0.200 s] [INFO] Zeppelin: File System Interpreters ................. SUCCESS [ 0.170 s] [INFO] Zeppelin: Flink .................................... SUCCESS [ 0.241 s] [INFO] Zeppelin: Apache Ignite interpreter ................ SUCCESS [ 0.173 s] [INFO] Zeppelin: Kylin interpreter ........................ SUCCESS [ 0.141 s] [INFO] Zeppelin: Python interpreter ....................... SUCCESS [ 0.188 s] [INFO] Zeppelin: Lens interpreter ......................... FAILURE [ 0.260 s] --- .../apache/zeppelin/lens/LensInterpreter.java | 30 +++++++++---------- .../lens/LensJLineShellComponent.java | 16 +++++----- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java b/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java index 17e3a46c68f..fb95fd6793a 100644 --- a/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java +++ b/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java @@ -75,10 +75,10 @@ public class LensInterpreter extends Interpreter { }; private static Pattern s_queryExecutePattern = Pattern.compile(".*query\\s+execute\\s+(.*)"); - private static Map s_paraToQH = - new ConcurrentHashMap<> (); //tracks paragraphId -> Lens QueryHandle + private static Map s_paraToQH = + new ConcurrentHashMap<> (); //tracks paragraphId -> Lens QueryHandle private static Map s_clientMap = - new ConcurrentHashMap<>(); + new ConcurrentHashMap<>(); private int m_maxResults; private int m_maxThreads; @@ -100,14 +100,14 @@ public LensInterpreter(Properties property) { m_lensConf.set(LENS_PERSIST_RESULTSET, property.get(LENS_PERSIST_RESULTSET).toString()); try { m_maxResults = Integer.parseInt(property.get(ZEPPELIN_MAX_ROWS).toString()); - } catch (NumberFormatException|NullPointerException e) { + } catch (NumberFormatException | NullPointerException e) { m_maxResults = 1000; - s_logger.error("unable to parse " + ZEPPELIN_MAX_ROWS + " :" - + property.get(ZEPPELIN_MAX_ROWS), e); + s_logger.error("unable to parse " + ZEPPELIN_MAX_ROWS + " :" + + property.get(ZEPPELIN_MAX_ROWS), e); } try { m_maxThreads = Integer.parseInt(property.get(ZEPPELIN_LENS_CONCURRENT_SESSIONS).toString()); - } catch (NumberFormatException|NullPointerException e) { + } catch (NumberFormatException | NullPointerException e) { m_maxThreads = 10; s_logger.error("unable to parse " + ZEPPELIN_LENS_CONCURRENT_SESSIONS + " :" + property.get(ZEPPELIN_LENS_CONCURRENT_SESSIONS), e); @@ -265,11 +265,11 @@ public InterpreterResult interpret(String input, InterpreterContext context) { && res.getResult().toString().trim().matches("[a-z0-9-]+")) { // setup query progress tracking qh = res.getResult().toString(); - s_paraToQH.put(context.getParagraphId(), - new ExecutionDetail(qh, lensClient, shell)); + s_paraToQH.put(context.getParagraphId(), + new ExecutionDetail(qh, lensClient, shell)); String getResultsCmd = "query results --async false " + qh; - s_logger.info("executing query results command : " + context.getParagraphId() - + " : " + getResultsCmd); + s_logger.info("executing query results command : " + context.getParagraphId() + + " : " + getResultsCmd); res = shell.executeCommand(getResultsCmd); s_paraToQH.remove(context.getParagraphId()); } @@ -321,7 +321,7 @@ private String formatResult(String st, CommandResult result) { } } if (s_queryExecutePattern.matcher(st.toLowerCase()).find() && - result.getResult().toString().contains(" rows process in (")) { + result.getResult().toString().contains(" rows process in (")) { sb.append("%table "); } if (sb.length() > 0) { @@ -347,11 +347,11 @@ public void cancel(InterpreterContext context) { s_clientMap.put(lensClient, true); s_logger.info("invoke query kill (" + context.getParagraphId() + ") " + qh); CommandResult res = shell.executeCommand("query kill " + qh); - s_logger.info("query kill returned (" + context.getParagraphId() + ") " + qh - + " with: " + res.getResult()); + s_logger.info("query kill returned (" + context.getParagraphId() + ") " + qh + + " with: " + res.getResult()); } catch (Exception e) { s_logger.error("unable to kill query (" - + context.getParagraphId() + ") " + qh, e); + + context.getParagraphId() + ") " + qh, e); } finally { try { if (lensClient != null) { diff --git a/lens/src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java b/lens/src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java index 7bf20592651..97a857b1f70 100644 --- a/lens/src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java +++ b/lens/src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java @@ -37,8 +37,8 @@ /** * workaround for https://github.com/spring-projects/spring-shell/issues/73 */ -public class LensJLineShellComponent extends JLineShell - implements SmartLifecycle, ApplicationContextAware, InitializingBean { +public class LensJLineShellComponent extends JLineShell + implements SmartLifecycle, ApplicationContextAware, InitializingBean { @Autowired private CommandLine commandLine; @@ -101,15 +101,15 @@ public boolean isRunning() { @SuppressWarnings("rawtypes") public void afterPropertiesSet() { - Map commands = - BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext, + Map commands = + BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext, CommandMarker.class); for (CommandMarker command : commands.values()) { getSimpleParser().add(command); } Map converters = BeanFactoryUtils - .beansOfTypeIncludingAncestors(applicationContext, Converter.class); + .beansOfTypeIncludingAncestors(applicationContext, Converter.class); for (Converter converter : converters.values()) { getSimpleParser().add(converter); } @@ -169,7 +169,7 @@ public void customizePlugin() { */ protected String getHistoryFileName() { HistoryFileNameProvider historyFileNameProvider = PluginUtils - .getHighestPriorityProvider(this.applicationContext, HistoryFileNameProvider.class); + .getHighestPriorityProvider(this.applicationContext, HistoryFileNameProvider.class); String providerHistoryFileName = historyFileNameProvider.getHistoryFileName(); if (providerHistoryFileName != null) { return providerHistoryFileName; @@ -186,7 +186,7 @@ protected String getHistoryFileName() { */ protected String getPromptText() { PromptProvider promptProvider = PluginUtils - .getHighestPriorityProvider(this.applicationContext, PromptProvider.class); + .getHighestPriorityProvider(this.applicationContext, PromptProvider.class); String providerPromptText = promptProvider.getPrompt(); if (providerPromptText != null) { return providerPromptText; @@ -206,7 +206,7 @@ protected String getPromptText() { private String[] getBannerText() { String[] bannerText = new String[4]; BannerProvider provider = PluginUtils - .getHighestPriorityProvider(this.applicationContext, BannerProvider.class); + .getHighestPriorityProvider(this.applicationContext, BannerProvider.class); bannerText[0] = provider.getBanner(); bannerText[1] = provider.getWelcomeMessage(); bannerText[2] = provider.getVersion(); From 6f6a17d9814a42a63727b656ccedbed5c4e64298 Mon Sep 17 00:00:00 2001 From: 1ambda <1amb4a@gmail.com> Date: Mon, 28 Nov 2016 12:31:09 +0900 Subject: [PATCH 11/25] style: Fix indents in elasticsearch [INFO] ------------------------------------------------------------------------ [INFO] Building Zeppelin: Elasticsearch interpreter 0.7.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle-fail-build) @ zeppelin-elasticsearch --- [INFO] There are 30 errors reported by Checkstyle 6.19 with _tools/checkstyle.xml ruleset. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[80] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[81] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[82] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[83] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[84] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[85] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[86] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[87] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[88] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[89] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[90] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[91] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[92] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[93] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[94] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[95] (indentation) Indentation: '+' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[98] (indentation) Indentation: '"count"' have incorrect indentation level 4, expected level should be 6. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[125] (indentation) Indentation: 'property' have incorrect indentation level 8, expected level should be 10. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[134] (indentation) Indentation: '.' have incorrect indentation level 8, expected level should be 10. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[135] (indentation) Indentation: '.' have incorrect indentation level 8, expected level should be 10. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[136] (indentation) Indentation: '.' have incorrect indentation level 8, expected level should be 10. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[283] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[284] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[354] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[355] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[356] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[381] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[382] (indentation) Indentation: '.' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[397] (indentation) Indentation: 'client' have incorrect indentation level 6, expected level should be 8. [ERROR] src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java:[513] (indentation) Indentation: 'flattenJsonMap' have incorrect indentation level 12, expected level should be 14. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Zeppelin ........................................... SUCCESS [ 3.534 s] [INFO] Zeppelin: Interpreter .............................. SUCCESS [ 1.155 s] [INFO] Zeppelin: Zengine .................................. SUCCESS [ 0.954 s] [INFO] Zeppelin: Display system apis ...................... SUCCESS [ 0.185 s] [INFO] Zeppelin: Spark dependencies ....................... SUCCESS [ 0.617 s] [INFO] Zeppelin: Spark .................................... SUCCESS [ 0.410 s] [INFO] Zeppelin: Markdown interpreter ..................... SUCCESS [ 0.168 s] [INFO] Zeppelin: Angular interpreter ...................... SUCCESS [ 0.149 s] [INFO] Zeppelin: Shell interpreter ........................ SUCCESS [ 0.154 s] [INFO] Zeppelin: Livy interpreter ......................... SUCCESS [ 0.645 s] [INFO] Zeppelin: HBase interpreter ........................ SUCCESS [ 0.258 s] [INFO] Zeppelin: Apache Pig Interpreter ................... SUCCESS [ 0.211 s] [INFO] Zeppelin: PostgreSQL interpreter ................... SUCCESS [ 0.174 s] [INFO] Zeppelin: JDBC interpreter ......................... SUCCESS [ 0.211 s] [INFO] Zeppelin: File System Interpreters ................. SUCCESS [ 0.176 s] [INFO] Zeppelin: Flink .................................... SUCCESS [ 0.235 s] [INFO] Zeppelin: Apache Ignite interpreter ................ SUCCESS [ 0.174 s] [INFO] Zeppelin: Kylin interpreter ........................ SUCCESS [ 0.152 s] [INFO] Zeppelin: Python interpreter ....................... SUCCESS [ 0.181 s] [INFO] Zeppelin: Lens interpreter ......................... SUCCESS [ 0.319 s] [INFO] Zeppelin: Apache Cassandra interpreter ............. SUCCESS [ 0.276 s] [INFO] Zeppelin: Elasticsearch interpreter ................ FAILURE [ 0.236 s] --- .../ElasticsearchInterpreter.java | 61 +++++++++---------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/elasticsearch/src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java b/elasticsearch/src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java index 549b5f25efd..5ea3265a4ca 100644 --- a/elasticsearch/src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java +++ b/elasticsearch/src/main/java/org/apache/zeppelin/elasticsearch/ElasticsearchInterpreter.java @@ -77,29 +77,28 @@ public class ElasticsearchInterpreter extends Interpreter { private static Logger logger = LoggerFactory.getLogger(ElasticsearchInterpreter.class); private static final String HELP = "Elasticsearch interpreter:\n" - + "General format: ///