You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2018/06/22 01:03:17 UTC

zeppelin git commit: ZEPPELIN-3155. checkstyle for geode

Repository: zeppelin
Updated Branches:
  refs/heads/master fea24e228 -> b9f005a62


ZEPPELIN-3155. checkstyle for geode

### What is this PR for?
Straightforwrad fix for code style of geode module.

### What type of PR is it?
[Refactoring]

### Todos
* [ ] - Task

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3155

### How should this be tested?
* CI pass

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Jeff Zhang <zj...@apache.org>

Closes #3030 from zjffdu/ZEPPELIN-3155 and squashes the following commits:

374277805 [Jeff Zhang] ZEPPELIN-3155. checkstyle for geode


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/b9f005a6
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/b9f005a6
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/b9f005a6

Branch: refs/heads/master
Commit: b9f005a62b947cc1a51a1298757049d8b2a89846
Parents: fea24e2
Author: Jeff Zhang <zj...@apache.org>
Authored: Tue Jun 19 10:38:10 2018 +0800
Committer: Jeff Zhang <zj...@apache.org>
Committed: Fri Jun 22 09:03:10 2018 +0800

----------------------------------------------------------------------
 geode/pom.xml                                   |  7 +++
 .../zeppelin/geode/GeodeOqlInterpreter.java     | 37 +++++++------
 .../zeppelin/geode/GeodeOqlInterpreterTest.java | 57 ++++++++++----------
 3 files changed, 52 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/b9f005a6/geode/pom.xml
----------------------------------------------------------------------
diff --git a/geode/pom.xml b/geode/pom.xml
index d2adaad..5e354ae 100644
--- a/geode/pom.xml
+++ b/geode/pom.xml
@@ -95,6 +95,13 @@
       <plugin>
         <artifactId>maven-resources-plugin</artifactId>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <skip>false</skip>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/b9f005a6/geode/src/main/java/org/apache/zeppelin/geode/GeodeOqlInterpreter.java
----------------------------------------------------------------------
diff --git a/geode/src/main/java/org/apache/zeppelin/geode/GeodeOqlInterpreter.java b/geode/src/main/java/org/apache/zeppelin/geode/GeodeOqlInterpreter.java
index 1825008..638a9f3 100644
--- a/geode/src/main/java/org/apache/zeppelin/geode/GeodeOqlInterpreter.java
+++ b/geode/src/main/java/org/apache/zeppelin/geode/GeodeOqlInterpreter.java
@@ -4,9 +4,9 @@
  * 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
- *
+ * <p>
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * <p>
  * 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
@@ -14,11 +14,13 @@
  */
 package org.apache.zeppelin.geode;
 
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
 import org.apache.commons.lang.StringUtils;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ClientCacheFactory;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.Struct;
+import org.apache.geode.pdx.PdxInstance;
 import org.apache.zeppelin.interpreter.Interpreter;
 import org.apache.zeppelin.interpreter.InterpreterContext;
 import org.apache.zeppelin.interpreter.InterpreterResult;
@@ -29,16 +31,13 @@ import org.apache.zeppelin.scheduler.SchedulerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.geode.cache.client.ClientCache;
-import org.apache.geode.cache.client.ClientCacheFactory;
-import org.apache.geode.cache.query.QueryService;
-import org.apache.geode.cache.query.SelectResults;
-import org.apache.geode.cache.query.Struct;
-import org.apache.geode.pdx.PdxInstance;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
 
 /**
  * Apache Geode OQL Interpreter (http://geode.apache.org)
- * 
+ *
  * <ul>
  * <li>{@code geode.locator.host} - The Geode Locator {@code <HOST>} to connect to.</li>
  * <li>{@code geode.locator.port} - The Geode Locator {@code <PORT>} to connect to.</li>
@@ -49,12 +48,12 @@ import org.apache.geode.pdx.PdxInstance;
  * {@code %geode.oql} <br/>
  * {@code SELECT * FROM /regionEmployee e WHERE e.companyId > 95} <br/>
  * {@code SELECT * FROM /regionEmployee ORDER BY employeeId} <br/>
- * {@code 
- * SELECT * FROM /regionEmployee 
+ * {@code
+ * SELECT * FROM /regionEmployee
  * WHERE companyId IN SET(1, 3, 7) OR lastName IN SET('NameA', 'NameB')
  * } <br/>
- * {@code 
- * SELECT e.employeeId, c.id as companyId FROM /regionEmployee e, /regionCompany c 
+ * {@code
+ * SELECT e.employeeId, c.id as companyId FROM /regionEmployee e, /regionCompany c
  * WHERE e.companyId = c.id
  * }
  * </p>
@@ -65,7 +64,7 @@ import org.apache.geode.pdx.PdxInstance;
  * <p>
  * When the Zeppelin server is collocated with Geode Shell (gfsh) one can use the %sh interpreter to
  * run Geode shell commands: <br/>
- * {@code 
+ * {@code
  * %sh
  *  source /etc/geode/conf/geode-env.sh
  *  gfsh << EOF
@@ -283,7 +282,7 @@ public class GeodeOqlInterpreter extends Interpreter {
 
   @Override
   public List<InterpreterCompletion> completion(String buf, int cursor,
-      InterpreterContext interpreterContext) {
+                                                InterpreterContext interpreterContext) {
     return null;
   }
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/b9f005a6/geode/src/test/java/org/apache/zeppelin/geode/GeodeOqlInterpreterTest.java
----------------------------------------------------------------------
diff --git a/geode/src/test/java/org/apache/zeppelin/geode/GeodeOqlInterpreterTest.java b/geode/src/test/java/org/apache/zeppelin/geode/GeodeOqlInterpreterTest.java
index 2a529fc..1ba2add 100644
--- a/geode/src/test/java/org/apache/zeppelin/geode/GeodeOqlInterpreterTest.java
+++ b/geode/src/test/java/org/apache/zeppelin/geode/GeodeOqlInterpreterTest.java
@@ -4,9 +4,9 @@
  * 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
- *
+ * <p>
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * <p>
  * 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
@@ -14,29 +14,6 @@
  */
 package org.apache.zeppelin.geode;
 
-import static org.apache.zeppelin.geode.GeodeOqlInterpreter.*;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Properties;
-
-import org.apache.zeppelin.interpreter.Interpreter.FormType;
-import org.apache.zeppelin.interpreter.InterpreterResult;
-import org.apache.zeppelin.interpreter.InterpreterResult.Code;
-import org.junit.Test;
-
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.cache.query.SelectResults;
 import org.apache.geode.cache.query.Struct;
@@ -45,6 +22,26 @@ import org.apache.geode.cache.query.internal.types.StructTypeImpl;
 import org.apache.geode.pdx.PdxInstance;
 import org.apache.geode.pdx.internal.PdxInstanceImpl;
 import org.apache.geode.pdx.internal.PdxType;
+import org.apache.zeppelin.interpreter.Interpreter.FormType;
+import org.apache.zeppelin.interpreter.InterpreterResult;
+import org.apache.zeppelin.interpreter.InterpreterResult.Code;
+import org.junit.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 public class GeodeOqlInterpreterTest {
 
@@ -81,9 +78,9 @@ public class GeodeOqlInterpreterTest {
 
   @Test
   public void oqlStructResponse() throws Exception {
-    String[] fields = new String[] {"field1", "field2"};
-    Struct s1 = new StructImpl(new StructTypeImpl(fields), new String[] {"val11", "val12"});
-    Struct s2 = new StructImpl(new StructTypeImpl(fields), new String[] {"val21", "val22"});
+    String[] fields = new String[]{"field1", "field2"};
+    Struct s1 = new StructImpl(new StructTypeImpl(fields), new String[]{"val11", "val12"});
+    Struct s2 = new StructImpl(new StructTypeImpl(fields), new String[]{"val21", "val22"});
 
     testOql(asIterator(s1, s2), "field1\tfield2\t\nval11\tval12\t\nval21\tval22\t\n", 10);
     testOql(asIterator(s1, s2), "field1\tfield2\t\nval11\tval12\t\n", 1);
@@ -91,8 +88,8 @@ public class GeodeOqlInterpreterTest {
 
   @Test
   public void oqlStructResponseWithReservedCharacters() throws Exception {
-    String[] fields = new String[] {"fi\teld1", "f\nield2"};
-    Struct s1 = new StructImpl(new StructTypeImpl(fields), new String[] {"v\nal\t1", "val2"});
+    String[] fields = new String[]{"fi\teld1", "f\nield2"};
+    Struct s1 = new StructImpl(new StructTypeImpl(fields), new String[]{"v\nal\t1", "val2"});
 
     testOql(asIterator(s1), "fi eld1\tf ield2\t\nv al 1\tval2\t\n", 10);
   }