zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jongy...@apache.org
Subject [10/49] zeppelin git commit: [ZEPPELIN-3740] Adopt `google-java-format` and `fmt-maven-plugin`
Date Sun, 26 Aug 2018 04:43:53 GMT
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-server/src/test/java/org/apache/zeppelin/service/NotebookServiceTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/service/NotebookServiceTest.java b/zeppelin-server/src/test/java/org/apache/zeppelin/service/NotebookServiceTest.java
index ad13dae..45965fe 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/service/NotebookServiceTest.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/service/NotebookServiceTest.java
@@ -17,6 +17,20 @@
 
 package org.apache.zeppelin.service;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.verify;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
 import org.apache.zeppelin.conf.ZeppelinConfiguration;
 import org.apache.zeppelin.notebook.Note;
 import org.apache.zeppelin.notebook.Paragraph;
@@ -27,21 +41,6 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.verify;
-
 public class NotebookServiceTest extends AbstractTestRestApi {
 
   private static NotebookService notebookService;
@@ -53,8 +52,8 @@ public class NotebookServiceTest extends AbstractTestRestApi {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    System.setProperty(ZeppelinConfiguration.ConfVars.ZEPPELIN_HELIUM_REGISTRY.getVarName(),
-        "helium");
+    System.setProperty(
+        ZeppelinConfiguration.ConfVars.ZEPPELIN_HELIUM_REGISTRY.getVarName(), "helium");
     AbstractTestRestApi.startUp(NotebookServiceTest.class.getSimpleName());
     notebookService = ZeppelinServer.notebookWsServer.getNotebookService();
   }
@@ -116,8 +115,8 @@ public class NotebookServiceTest extends AbstractTestRestApi {
 
     // clone note
     reset(callback);
-    Note clonedNote = notebookService.cloneNote(importedNote.getId(), "Cloned Note", context,
-        callback);
+    Note clonedNote =
+        notebookService.cloneNote(importedNote.getId(), "Cloned Note", context, callback);
     assertEquals(importedNote.getParagraphCount(), clonedNote.getParagraphCount());
     verify(callback).onSuccess(clonedNote, context);
   }
@@ -132,16 +131,23 @@ public class NotebookServiceTest extends AbstractTestRestApi {
 
     // add paragraph
     reset(callback);
-    Paragraph p = notebookService.insertParagraph(note1.getId(), 1, new HashMap<>(), context,
-        callback);
+    Paragraph p =
+        notebookService.insertParagraph(note1.getId(), 1, new HashMap<>(), context, callback);
     assertNotNull(p);
     verify(callback).onSuccess(p, context);
     assertEquals(2, note1.getParagraphCount());
 
     // update paragraph
     reset(callback);
-    notebookService.updateParagraph(note1.getId(), p.getId(), "my_title", "my_text",
-        new HashMap<>(), new HashMap<>(), context, callback);
+    notebookService.updateParagraph(
+        note1.getId(),
+        p.getId(),
+        "my_title",
+        "my_text",
+        new HashMap<>(),
+        new HashMap<>(),
+        context,
+        callback);
     assertEquals("my_title", p.getTitle());
     assertEquals("my_text", p.getText());
 
@@ -153,22 +159,52 @@ public class NotebookServiceTest extends AbstractTestRestApi {
 
     // run paragraph asynchronously
     reset(callback);
-    boolean runStatus = notebookService.runParagraph(note1.getId(), p.getId(), "my_title", "1+1",
-        new HashMap<>(), new HashMap<>(), false, false, context, callback);
+    boolean runStatus =
+        notebookService.runParagraph(
+            note1.getId(),
+            p.getId(),
+            "my_title",
+            "1+1",
+            new HashMap<>(),
+            new HashMap<>(),
+            false,
+            false,
+            context,
+            callback);
     assertTrue(runStatus);
     verify(callback).onSuccess(p, context);
 
     // run paragraph synchronously via correct code
     reset(callback);
-    runStatus = notebookService.runParagraph(note1.getId(), p.getId(), "my_title", "1+1",
-        new HashMap<>(), new HashMap<>(), false, true, context, callback);
+    runStatus =
+        notebookService.runParagraph(
+            note1.getId(),
+            p.getId(),
+            "my_title",
+            "1+1",
+            new HashMap<>(),
+            new HashMap<>(),
+            false,
+            true,
+            context,
+            callback);
     assertTrue(runStatus);
     verify(callback).onSuccess(p, context);
 
     // run paragraph synchronously via invalid code
     reset(callback);
-    runStatus = notebookService.runParagraph(note1.getId(), p.getId(), "my_title", "invalid_code",
-        new HashMap<>(), new HashMap<>(), false, true, context, callback);
+    runStatus =
+        notebookService.runParagraph(
+            note1.getId(),
+            p.getId(),
+            "my_title",
+            "invalid_code",
+            new HashMap<>(),
+            new HashMap<>(),
+            false,
+            true,
+            context,
+            callback);
     assertFalse(runStatus);
     // TODO(zjffdu) Enable it after ZEPPELIN-3699
     // assertNotNull(p.getResult());

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java b/zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java
index 03e7ee6..a9bc448 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java
@@ -16,6 +16,26 @@
  */
 package org.apache.zeppelin.socket;
 
+import static java.util.Arrays.asList;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.HashSet;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
 import org.apache.zeppelin.conf.ZeppelinConfiguration;
 import org.apache.zeppelin.display.AngularObject;
 import org.apache.zeppelin.display.AngularObjectBuilder;
@@ -37,30 +57,7 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.HashSet;
-import java.util.List;
-
-import static java.util.Arrays.asList;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
-import static org.mockito.Mockito.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-/**
- * Basic REST API tests for notebookServer.
- */
+/** Basic REST API tests for notebookServer. */
 public class NotebookServerTest extends AbstractTestRestApi {
   private static Notebook notebook;
   private static NotebookServer notebookServer;
@@ -90,12 +87,13 @@ public class NotebookServerTest extends AbstractTestRestApi {
     NotebookServer server = new NotebookServer();
     String origin = "http://" + InetAddress.getLocalHost().getHostName() + ":8080";
 
-    assertTrue("Origin " + origin + " is not allowed. Please check your hostname.",
-          server.checkOrigin(mockRequest, origin));
+    assertTrue(
+        "Origin " + origin + " is not allowed. Please check your hostname.",
+        server.checkOrigin(mockRequest, origin));
   }
 
   @Test
-  public void checkInvalidOrigin(){
+  public void checkInvalidOrigin() {
     NotebookServer server = new NotebookServer();
     assertFalse(server.checkOrigin(mockRequest, "http://evillocalhost:8080"));
   }
@@ -125,12 +123,13 @@ public class NotebookServerTest extends AbstractTestRestApi {
     Paragraph paragraph = createdNote.getParagraphs().get(0);
     String paragraphId = paragraph.getId();
 
-    String[] patches = new String[]{
-        "@@ -0,0 +1,3 @@\n+ABC\n",            // ABC
-        "@@ -1,3 +1,4 @@\n ABC\n+%0A\n",      // press Enter
-        "@@ -1,4 +1,7 @@\n ABC%0A\n+abc\n",   // abc
-        "@@ -1,7 +1,45 @@\n ABC\n-%0Aabc\n+ ssss%0Aabc ssss\n" // add text in two string
-    };
+    String[] patches =
+        new String[] {
+          "@@ -0,0 +1,3 @@\n+ABC\n", // ABC
+          "@@ -1,3 +1,4 @@\n ABC\n+%0A\n", // press Enter
+          "@@ -1,4 +1,7 @@\n ABC%0A\n+abc\n", // abc
+          "@@ -1,7 +1,45 @@\n ABC\n-%0Aabc\n+ ssss%0Aabc ssss\n" // add text in two string
+        };
 
     int sock1SendCount = 0;
     int sock2SendCount = 0;
@@ -168,14 +167,14 @@ public class NotebookServerTest extends AbstractTestRestApi {
 
   @Test
   public void testMakeSureNoAngularObjectBroadcastToWebsocketWhoFireTheEvent()
-          throws IOException, InterruptedException {
+      throws IOException, InterruptedException {
     // create a notebook
     Note note1 = notebook.createNote(anonymous);
 
     // get reference to interpreterGroup
     InterpreterGroup interpreterGroup = null;
-    List<InterpreterSetting> settings = notebook.getInterpreterSettingManager()
-            .getInterpreterSettings(note1.getId());
+    List<InterpreterSetting> settings =
+        notebook.getInterpreterSettingManager().getInterpreterSettings(note1.getId());
     for (InterpreterSetting setting : settings) {
       if (setting.getName().equals("md")) {
         interpreterGroup = setting.getOrCreateInterpreterGroup("anonymous", "sharedProcess");
@@ -220,13 +219,14 @@ public class NotebookServerTest extends AbstractTestRestApi {
     reset(sock2);
 
     // update object from sock1
-    notebookServer.onMessage(sock1,
+    notebookServer.onMessage(
+        sock1,
         new Message(OP.ANGULAR_OBJECT_UPDATED)
-        .put("noteId", note1.getId())
-        .put("name", "object1")
-        .put("value", "value1")
-        .put("interpreterGroupId", interpreterGroup.getId()).toJson());
-
+            .put("noteId", note1.getId())
+            .put("name", "object1")
+            .put("value", "value1")
+            .put("interpreterGroupId", interpreterGroup.getId())
+            .toJson());
 
     // expect object is broadcasted except for where the update is created
     verify(sock1, times(0)).send(anyString());
@@ -237,35 +237,39 @@ public class NotebookServerTest extends AbstractTestRestApi {
 
   @Test
   public void testImportNotebook() throws IOException {
-    String msg = "{\"op\":\"IMPORT_NOTE\",\"data\":" +
-        "{\"note\":{\"paragraphs\": [{\"text\": \"Test " +
-        "paragraphs import\"," + "\"progressUpdateIntervalMs\":500," +
-        "\"config\":{},\"settings\":{}}]," +
-        "\"name\": \"Test Zeppelin notebook import\",\"config\": " +
-        "{}}}}";
+    String msg =
+        "{\"op\":\"IMPORT_NOTE\",\"data\":"
+            + "{\"note\":{\"paragraphs\": [{\"text\": \"Test "
+            + "paragraphs import\","
+            + "\"progressUpdateIntervalMs\":500,"
+            + "\"config\":{},\"settings\":{}}],"
+            + "\"name\": \"Test Zeppelin notebook import\",\"config\": "
+            + "{}}}}";
     Message messageReceived = notebookServer.deserializeMessage(msg);
     Note note = null;
     try {
       note = notebookServer.importNote(null, messageReceived);
     } catch (NullPointerException e) {
-      //broadcastNoteList(); failed nothing to worry.
-      LOG.error("Exception in NotebookServerTest while testImportNotebook, failed nothing to " +
-          "worry ", e);
+      // broadcastNoteList(); failed nothing to worry.
+      LOG.error(
+          "Exception in NotebookServerTest while testImportNotebook, failed nothing to " + "worry ",
+          e);
     }
 
     assertNotEquals(null, notebook.getNote(note.getId()));
     assertEquals("Test Zeppelin notebook import", notebook.getNote(note.getId()).getName());
-    assertEquals("Test paragraphs import", notebook.getNote(note.getId()).getParagraphs().get(0)
-            .getText());
+    assertEquals(
+        "Test paragraphs import", notebook.getNote(note.getId()).getParagraphs().get(0).getText());
     notebook.removeNote(note.getId(), anonymous);
   }
 
   @Test
   public void bindAngularObjectToRemoteForParagraphs() throws Exception {
-    //Given
+    // Given
     final String varName = "name";
     final String value = "DuyHai DOAN";
-    final Message messageReceived = new Message(OP.ANGULAR_OBJECT_CLIENT_BIND)
+    final Message messageReceived =
+        new Message(OP.ANGULAR_OBJECT_CLIENT_BIND)
             .put("noteId", "noteId")
             .put("name", varName)
             .put("value", value)
@@ -285,20 +289,22 @@ public class NotebookServerTest extends AbstractTestRestApi {
 
     when(paragraph.getBindedInterpreter().getInterpreterGroup()).thenReturn(mdGroup);
 
-    final AngularObject<String> ao1 = AngularObjectBuilder.build(varName, value, "noteId",
-            "paragraphId");
+    final AngularObject<String> ao1 =
+        AngularObjectBuilder.build(varName, value, "noteId", "paragraphId");
 
     when(mdRegistry.addAndNotifyRemoteProcess(varName, value, "noteId", "paragraphId"))
-            .thenReturn(ao1);
+        .thenReturn(ao1);
 
     NotebookSocket conn = mock(NotebookSocket.class);
     NotebookSocket otherConn = mock(NotebookSocket.class);
 
-    final String mdMsg1 =  server.serializeMessage(new Message(OP.ANGULAR_OBJECT_UPDATE)
-            .put("angularObject", ao1)
-            .put("interpreterGroupId", "mdGroup")
-            .put("noteId", "noteId")
-            .put("paragraphId", "paragraphId"));
+    final String mdMsg1 =
+        server.serializeMessage(
+            new Message(OP.ANGULAR_OBJECT_UPDATE)
+                .put("angularObject", ao1)
+                .put("interpreterGroupId", "mdGroup")
+                .put("noteId", "noteId")
+                .put("paragraphId", "paragraphId"));
 
     server.getConnectionManager().noteSocketMap.put("noteId", asList(conn, otherConn));
 
@@ -313,10 +319,11 @@ public class NotebookServerTest extends AbstractTestRestApi {
 
   @Test
   public void bindAngularObjectToLocalForParagraphs() throws Exception {
-    //Given
+    // Given
     final String varName = "name";
     final String value = "DuyHai DOAN";
-    final Message messageReceived = new Message(OP.ANGULAR_OBJECT_CLIENT_BIND)
+    final Message messageReceived =
+        new Message(OP.ANGULAR_OBJECT_CLIENT_BIND)
             .put("noteId", "noteId")
             .put("name", varName)
             .put("value", value)
@@ -335,19 +342,21 @@ public class NotebookServerTest extends AbstractTestRestApi {
 
     when(paragraph.getBindedInterpreter().getInterpreterGroup()).thenReturn(mdGroup);
 
-    final AngularObject<String> ao1 = AngularObjectBuilder.build(varName, value, "noteId",
-            "paragraphId");
+    final AngularObject<String> ao1 =
+        AngularObjectBuilder.build(varName, value, "noteId", "paragraphId");
 
     when(mdRegistry.add(varName, value, "noteId", "paragraphId")).thenReturn(ao1);
 
     NotebookSocket conn = mock(NotebookSocket.class);
     NotebookSocket otherConn = mock(NotebookSocket.class);
 
-    final String mdMsg1 =  server.serializeMessage(new Message(OP.ANGULAR_OBJECT_UPDATE)
-            .put("angularObject", ao1)
-            .put("interpreterGroupId", "mdGroup")
-            .put("noteId", "noteId")
-            .put("paragraphId", "paragraphId"));
+    final String mdMsg1 =
+        server.serializeMessage(
+            new Message(OP.ANGULAR_OBJECT_UPDATE)
+                .put("angularObject", ao1)
+                .put("interpreterGroupId", "mdGroup")
+                .put("noteId", "noteId")
+                .put("paragraphId", "paragraphId"));
 
     server.getConnectionManager().noteSocketMap.put("noteId", asList(conn, otherConn));
 
@@ -360,10 +369,11 @@ public class NotebookServerTest extends AbstractTestRestApi {
 
   @Test
   public void unbindAngularObjectFromRemoteForParagraphs() throws Exception {
-    //Given
+    // Given
     final String varName = "name";
     final String value = "val";
-    final Message messageReceived = new Message(OP.ANGULAR_OBJECT_CLIENT_UNBIND)
+    final Message messageReceived =
+        new Message(OP.ANGULAR_OBJECT_CLIENT_UNBIND)
             .put("noteId", "noteId")
             .put("name", varName)
             .put("paragraphId", "paragraphId");
@@ -381,17 +391,19 @@ public class NotebookServerTest extends AbstractTestRestApi {
 
     when(paragraph.getBindedInterpreter().getInterpreterGroup()).thenReturn(mdGroup);
 
-    final AngularObject<String> ao1 = AngularObjectBuilder.build(varName, value, "noteId",
-            "paragraphId");
+    final AngularObject<String> ao1 =
+        AngularObjectBuilder.build(varName, value, "noteId", "paragraphId");
     when(mdRegistry.removeAndNotifyRemoteProcess(varName, "noteId", "paragraphId")).thenReturn(ao1);
     NotebookSocket conn = mock(NotebookSocket.class);
     NotebookSocket otherConn = mock(NotebookSocket.class);
 
-    final String mdMsg1 =  server.serializeMessage(new Message(OP.ANGULAR_OBJECT_REMOVE)
-            .put("angularObject", ao1)
-            .put("interpreterGroupId", "mdGroup")
-            .put("noteId", "noteId")
-            .put("paragraphId", "paragraphId"));
+    final String mdMsg1 =
+        server.serializeMessage(
+            new Message(OP.ANGULAR_OBJECT_REMOVE)
+                .put("angularObject", ao1)
+                .put("interpreterGroupId", "mdGroup")
+                .put("noteId", "noteId")
+                .put("paragraphId", "paragraphId"));
 
     server.getConnectionManager().noteSocketMap.put("noteId", asList(conn, otherConn));
 
@@ -406,10 +418,11 @@ public class NotebookServerTest extends AbstractTestRestApi {
 
   @Test
   public void unbindAngularObjectFromLocalForParagraphs() throws Exception {
-    //Given
+    // Given
     final String varName = "name";
     final String value = "val";
-    final Message messageReceived = new Message(OP.ANGULAR_OBJECT_CLIENT_UNBIND)
+    final Message messageReceived =
+        new Message(OP.ANGULAR_OBJECT_CLIENT_UNBIND)
             .put("noteId", "noteId")
             .put("name", varName)
             .put("paragraphId", "paragraphId");
@@ -427,19 +440,21 @@ public class NotebookServerTest extends AbstractTestRestApi {
 
     when(paragraph.getBindedInterpreter().getInterpreterGroup()).thenReturn(mdGroup);
 
-    final AngularObject<String> ao1 = AngularObjectBuilder.build(varName, value, "noteId",
-            "paragraphId");
+    final AngularObject<String> ao1 =
+        AngularObjectBuilder.build(varName, value, "noteId", "paragraphId");
 
     when(mdRegistry.remove(varName, "noteId", "paragraphId")).thenReturn(ao1);
 
     NotebookSocket conn = mock(NotebookSocket.class);
     NotebookSocket otherConn = mock(NotebookSocket.class);
 
-    final String mdMsg1 =  server.serializeMessage(new Message(OP.ANGULAR_OBJECT_REMOVE)
-            .put("angularObject", ao1)
-            .put("interpreterGroupId", "mdGroup")
-            .put("noteId", "noteId")
-            .put("paragraphId", "paragraphId"));
+    final String mdMsg1 =
+        server.serializeMessage(
+            new Message(OP.ANGULAR_OBJECT_REMOVE)
+                .put("angularObject", ao1)
+                .put("interpreterGroupId", "mdGroup")
+                .put("noteId", "noteId")
+                .put("paragraphId", "paragraphId"));
     server.getConnectionManager().noteSocketMap.put("noteId", asList(conn, otherConn));
 
     // When
@@ -468,10 +483,12 @@ public class NotebookServerTest extends AbstractTestRestApi {
       defaultInterpreterId = settings.get(0).getId();
     }
     // create note from sock1
-    notebookServer.onMessage(sock1,
+    notebookServer.onMessage(
+        sock1,
         new Message(OP.NEW_NOTE)
-        .put("name", noteName)
-        .put("defaultInterpreterId", defaultInterpreterId).toJson());
+            .put("name", noteName)
+            .put("defaultInterpreterId", defaultInterpreterId)
+            .toJson());
 
     int sendCount = 2;
     if (ZeppelinConfiguration.create().isZeppelinNotebookCollaborativeModeEnable()) {
@@ -489,8 +506,12 @@ public class NotebookServerTest extends AbstractTestRestApi {
     }
 
     if (settings.size() > 1) {
-      assertEquals(notebook.getInterpreterSettingManager().getDefaultInterpreterSetting(
-              createdNote.getId()).getId(), defaultInterpreterId);
+      assertEquals(
+          notebook
+              .getInterpreterSettingManager()
+              .getDefaultInterpreterSetting(createdNote.getId())
+              .getId(),
+          defaultInterpreterId);
     }
     notebook.removeNote(createdNote.getId(), anonymous);
   }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-server/src/test/java/org/apache/zeppelin/ticket/TicketContainerTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/ticket/TicketContainerTest.java b/zeppelin-server/src/test/java/org/apache/zeppelin/ticket/TicketContainerTest.java
index 02f48f7..e1a5d3b 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/ticket/TicketContainerTest.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/ticket/TicketContainerTest.java
@@ -56,4 +56,3 @@ public class TicketContainerTest {
     assertFalse(ok);
   }
 }
-

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/Helium.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/Helium.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/Helium.java
index 399aea8..b767a40 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/Helium.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/Helium.java
@@ -17,6 +17,9 @@
 package org.apache.zeppelin.helium;
 
 import com.google.gson.Gson;
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.zeppelin.interpreter.Interpreter;
@@ -30,13 +33,7 @@ import org.apache.zeppelin.resource.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-
-/**
- * Manages helium packages
- */
+/** Manages helium packages */
 public class Helium {
   private Logger logger = LoggerFactory.getLogger(Helium.class);
   private List<HeliumRegistry> registry = new LinkedList<>();
@@ -159,8 +156,8 @@ public class Helium {
    * @param refresh
    * @param packageName
    */
-  public Map<String, List<HeliumPackageSearchResult>> getAllPackageInfo(boolean refresh,
-                                                                        String packageName) {
+  public Map<String, List<HeliumPackageSearchResult>> getAllPackageInfo(
+      boolean refresh, String packageName) {
     Map<String, String> enabledPackageInfo = heliumConf.getEnabledPackages();
 
     synchronized (registry) {
@@ -170,8 +167,7 @@ public class Helium {
             for (HeliumPackage pkg : r.getAll()) {
               String name = pkg.getName();
 
-              if (!StringUtils.isEmpty(packageName) &&
-                  !name.equals(packageName)) {
+              if (!StringUtils.isEmpty(packageName) && !name.equals(packageName)) {
                 continue;
               }
 
@@ -188,8 +184,7 @@ public class Helium {
         }
       } else {
         for (String name : allPackages.keySet()) {
-          if (!StringUtils.isEmpty(packageName) &&
-              !name.equals(packageName)) {
+          if (!StringUtils.isEmpty(packageName) && !name.equals(packageName)) {
             continue;
           }
 
@@ -208,12 +203,14 @@ public class Helium {
       // sort version (artifact)
       for (String name : allPackages.keySet()) {
         List<HeliumPackageSearchResult> packages = allPackages.get(name);
-        Collections.sort(packages, new Comparator<HeliumPackageSearchResult>() {
-          @Override
-          public int compare(HeliumPackageSearchResult o1, HeliumPackageSearchResult o2) {
-            return o2.getPkg().getArtifact().compareTo(o1.getPkg().getArtifact());
-          }
-        });
+        Collections.sort(
+            packages,
+            new Comparator<HeliumPackageSearchResult>() {
+              @Override
+              public int compare(HeliumPackageSearchResult o1, HeliumPackageSearchResult o2) {
+                return o2.getPkg().getArtifact().compareTo(o1.getPkg().getArtifact());
+              }
+            });
       }
       return allPackages;
     }
@@ -259,7 +256,8 @@ public class Helium {
     Map<String, List<HeliumPackageSearchResult>> infos = getAllPackageInfo(false, pkgName);
     List<HeliumPackageSearchResult> packages = infos.get(pkgName);
     if (StringUtils.isBlank(artifact)) {
-      return packages.get(0); /** return the FIRST package */
+      return packages.get(0);
+      /** return the FIRST package */
     } else {
       for (HeliumPackageSearchResult pkg : packages) {
         if (pkg.getPkg().getArtifact().equals(artifact)) {
@@ -364,11 +362,12 @@ public class Helium {
     for (List<HeliumPackageSearchResult> pkgs : allPackages.values()) {
       for (HeliumPackageSearchResult pkg : pkgs) {
         if (pkg.getPkg().getType() == HeliumType.APPLICATION && pkg.isEnabled()) {
-          ResourceSet resources = ApplicationLoader.findRequiredResourceSet(
-              pkg.getPkg().getResources(),
-              paragraph.getNote().getId(),
-              paragraph.getId(),
-              allResources);
+          ResourceSet resources =
+              ApplicationLoader.findRequiredResourceSet(
+                  pkg.getPkg().getResources(),
+                  paragraph.getNote().getId(),
+                  paragraph.getId(),
+                  allResources);
           if (resources == null) {
             continue;
           } else {
@@ -422,20 +421,19 @@ public class Helium {
   }
 
   private boolean canBundle(HeliumPackageSearchResult pkgInfo) {
-    return (pkgInfo.isEnabled() &&
-        HeliumPackage.isBundleType(pkgInfo.getPkg().getType()));
+    return (pkgInfo.isEnabled() && HeliumPackage.isBundleType(pkgInfo.getPkg().getType()));
   }
 
   /**
    * Get enabled package list in order
+   *
    * @return
    */
   public List<String> getVisualizationPackageOrder() {
     return heliumConf.getBundleDisplayOrder();
   }
 
-  public void setVisualizationPackageOrder(List<String> orderedPackageList)
-      throws IOException {
+  public void setVisualizationPackageOrder(List<String> orderedPackageList) throws IOException {
     heliumConf.setBundleDisplayOrder(orderedPackageList);
     saveConfig();
   }
@@ -454,14 +452,12 @@ public class Helium {
     HeliumPackage enabledPackage = result.getPkg();
 
     Map<String, Object> configSpec = enabledPackage.getConfig();
-    Map<String, Object> configPersisted =
-        getPackagePersistedConfig(enabledPackage.getArtifact());
+    Map<String, Object> configPersisted = getPackagePersistedConfig(enabledPackage.getArtifact());
 
     return createMixedConfig(configPersisted, configSpec);
   }
 
-  public Map<String, Map<String, Object>> getPackageConfig(String pkgName,
-                                                           String artifact) {
+  public Map<String, Map<String, Object>> getPackageConfig(String pkgName, String artifact) {
 
     HeliumPackageSearchResult result = getPackageInfo(pkgName, artifact);
 
@@ -472,14 +468,13 @@ public class Helium {
     HeliumPackage requestedPackage = result.getPkg();
 
     Map<String, Object> configSpec = requestedPackage.getConfig();
-    Map<String, Object> configPersisted =
-        getPackagePersistedConfig(artifact);
+    Map<String, Object> configPersisted = getPackagePersistedConfig(artifact);
 
     return createMixedConfig(configPersisted, configSpec);
   }
 
-  private static Map<String, Map<String, Object>> createMixedConfig(Map<String, Object> persisted,
-                                                                   Map<String, Object> spec) {
+  private static Map<String, Map<String, Object>> createMixedConfig(
+      Map<String, Object> persisted, Map<String, Object> spec) {
     Map<String, Map<String, Object>> mixed = new HashMap<>();
     mixed.put("confPersisted", persisted);
     mixed.put("confSpec", spec);
@@ -494,8 +489,8 @@ public class Helium {
   private ResourceSet getAllResourcesExcept(String interpreterGroupExcludsion) {
     ResourceSet resourceSet = new ResourceSet();
     for (ManagedInterpreterGroup intpGroup : interpreterSettingManager.getAllInterpreterGroup()) {
-      if (interpreterGroupExcludsion != null &&
-          intpGroup.getId().equals(interpreterGroupExcludsion)) {
+      if (interpreterGroupExcludsion != null
+          && intpGroup.getId().equals(interpreterGroupExcludsion)) {
         continue;
       }
 
@@ -506,14 +501,15 @@ public class Helium {
           resourceSet.addAll(localPool.getAll());
         }
       } else if (remoteInterpreterProcess.isRunning()) {
-        List<String> resourceList = remoteInterpreterProcess.callRemoteFunction(
-            new RemoteInterpreterProcess.RemoteFunction<List<String>>() {
-              @Override
-              public List<String> call(RemoteInterpreterService.Client client) throws Exception {
-                return client.resourcePoolGetAll();
-              }
-            }
-        );
+        List<String> resourceList =
+            remoteInterpreterProcess.callRemoteFunction(
+                new RemoteInterpreterProcess.RemoteFunction<List<String>>() {
+                  @Override
+                  public List<String> call(RemoteInterpreterService.Client client)
+                      throws Exception {
+                    return client.resourcePoolGetAll();
+                  }
+                });
         Gson gson = new Gson();
         for (String res : resourceList) {
           resourceSet.add(gson.fromJson(res, Resource.class));

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumApplicationFactory.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumApplicationFactory.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumApplicationFactory.java
index 707a230..a09f10a 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumApplicationFactory.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumApplicationFactory.java
@@ -16,6 +16,8 @@
  */
 package org.apache.zeppelin.helium;
 
+import java.util.List;
+import java.util.concurrent.ExecutorService;
 import org.apache.zeppelin.interpreter.*;
 import org.apache.zeppelin.interpreter.remote.RemoteAngularObjectRegistry;
 import org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess;
@@ -27,12 +29,7 @@ import org.apache.zeppelin.scheduler.Job;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-
-/**
- * HeliumApplicationFactory
- */
+/** HeliumApplicationFactory */
 public class HeliumApplicationFactory implements ApplicationEventListener, NotebookEventListener {
   private final Logger logger = LoggerFactory.getLogger(HeliumApplicationFactory.class);
   private final ExecutorService executor;
@@ -40,29 +37,27 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
   private ApplicationEventListener applicationEventListener;
 
   public HeliumApplicationFactory() {
-    executor = ExecutorFactory.singleton().createOrGet(
-        HeliumApplicationFactory.class.getName(), 10);
+    executor =
+        ExecutorFactory.singleton().createOrGet(HeliumApplicationFactory.class.getName(), 10);
   }
 
   private boolean isRemote(InterpreterGroup group) {
     return group.getAngularObjectRegistry() instanceof RemoteAngularObjectRegistry;
   }
 
-
-  /**
-   * Load pkg and run task
-   */
+  /** Load pkg and run task */
   public String loadAndRun(HeliumPackage pkg, Paragraph paragraph) {
     ApplicationState appState = paragraph.createOrGetApplicationState(pkg);
-    onLoad(paragraph.getNote().getId(), paragraph.getId(), appState.getId(),
+    onLoad(
+        paragraph.getNote().getId(),
+        paragraph.getId(),
+        appState.getId(),
         appState.getHeliumPackage());
     executor.submit(new LoadApplication(appState, pkg, paragraph));
     return appState.getId();
   }
 
-  /**
-   * Load application and run in the remote process
-   */
+  /** Load application and run in the remote process */
   private class LoadApplication implements Runnable {
     private final HeliumPackage pkg;
     private final Paragraph paragraph;
@@ -114,19 +109,16 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
         final String pkgInfo = pkg.toJson();
         final String appId = appState.getId();
 
-        RemoteApplicationResult ret = intpProcess.callRemoteFunction(
-            new RemoteInterpreterProcess.RemoteFunction<RemoteApplicationResult>() {
-              @Override
-              public RemoteApplicationResult call(RemoteInterpreterService.Client client)
-                  throws Exception {
-                return client.loadApplication(
-                    appId,
-                    pkgInfo,
-                    paragraph.getNote().getId(),
-                    paragraph.getId());
-              }
-            }
-        );
+        RemoteApplicationResult ret =
+            intpProcess.callRemoteFunction(
+                new RemoteInterpreterProcess.RemoteFunction<RemoteApplicationResult>() {
+                  @Override
+                  public RemoteApplicationResult call(RemoteInterpreterService.Client client)
+                      throws Exception {
+                    return client.loadApplication(
+                        appId, pkgInfo, paragraph.getNote().getId(), paragraph.getId());
+                  }
+                });
         if (ret.isSuccess()) {
           appStatusChange(paragraph, appState.getId(), ApplicationState.Status.LOADED);
         } else {
@@ -138,6 +130,7 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
 
   /**
    * Get ApplicationState
+   *
    * @param paragraph
    * @param appId
    * @return
@@ -147,8 +140,7 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
   }
 
   /**
-   * Unload application
-   * It does not remove ApplicationState
+   * Unload application It does not remove ApplicationState
    *
    * @param paragraph
    * @param appId
@@ -157,9 +149,7 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
     executor.execute(new UnloadApplication(paragraph, appId));
   }
 
-  /**
-   * Unload application task
-   */
+  /** Unload application task */
   private class UnloadApplication implements Runnable {
     private final Paragraph paragraph;
     private final String appId;
@@ -213,15 +203,15 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
           throw new ApplicationException("Target interpreter process is not running");
         }
 
-        RemoteApplicationResult ret = intpProcess.callRemoteFunction(
-            new RemoteInterpreterProcess.RemoteFunction<RemoteApplicationResult>() {
-              @Override
-              public RemoteApplicationResult call(RemoteInterpreterService.Client client)
-                  throws Exception {
-                return client.unloadApplication(appsToUnload.getId());
-              }
-            }
-        );
+        RemoteApplicationResult ret =
+            intpProcess.callRemoteFunction(
+                new RemoteInterpreterProcess.RemoteFunction<RemoteApplicationResult>() {
+                  @Override
+                  public RemoteApplicationResult call(RemoteInterpreterService.Client client)
+                      throws Exception {
+                    return client.unloadApplication(appsToUnload.getId());
+                  }
+                });
         if (ret.isSuccess()) {
           appStatusChange(paragraph, appsToUnload.getId(), ApplicationState.Status.UNLOADED);
         } else {
@@ -232,8 +222,7 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
   }
 
   /**
-   * Run application
-   * It does not remove ApplicationState
+   * Run application It does not remove ApplicationState
    *
    * @param paragraph
    * @param appId
@@ -242,9 +231,7 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
     executor.execute(new RunApplication(paragraph, appId));
   }
 
-  /**
-   * Run application task
-   */
+  /** Run application task */
   private class RunApplication implements Runnable {
     private final Paragraph paragraph;
     private final String appId;
@@ -278,8 +265,7 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
     private void run(final ApplicationState app) throws ApplicationException {
       synchronized (app) {
         if (app.getStatus() != ApplicationState.Status.LOADED) {
-          throw new ApplicationException(
-              "Can't run application status " + app.getStatus());
+          throw new ApplicationException("Can't run application status " + app.getStatus());
         }
 
         Interpreter intp = null;
@@ -294,15 +280,15 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
         if (intpProcess == null) {
           throw new ApplicationException("Target interpreter process is not running");
         }
-        RemoteApplicationResult ret = intpProcess.callRemoteFunction(
-            new RemoteInterpreterProcess.RemoteFunction<RemoteApplicationResult>() {
-              @Override
-              public RemoteApplicationResult call(RemoteInterpreterService.Client client)
-                  throws Exception {
-                return client.runApplication(app.getId());
-              }
-            }
-        );
+        RemoteApplicationResult ret =
+            intpProcess.callRemoteFunction(
+                new RemoteInterpreterProcess.RemoteFunction<RemoteApplicationResult>() {
+                  @Override
+                  public RemoteApplicationResult call(RemoteInterpreterService.Client client)
+                      throws Exception {
+                    return client.runApplication(app.getId());
+                  }
+                });
         if (ret.isSuccess()) {
           // success
         } else {
@@ -330,8 +316,12 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
 
   @Override
   public void onOutputUpdated(
-      String noteId, String paragraphId, int index, String appId,
-      InterpreterResult.Type type, String output) {
+      String noteId,
+      String paragraphId,
+      int index,
+      String appId,
+      InterpreterResult.Type type,
+      String output) {
     ApplicationState appToUpdate = getAppState(noteId, paragraphId, appId);
 
     if (appToUpdate != null) {
@@ -364,9 +354,7 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
     }
   }
 
-  private void appStatusChange(Paragraph paragraph,
-                               String appId,
-                               ApplicationState.Status status) {
+  private void appStatusChange(Paragraph paragraph, String appId, ApplicationState.Status status) {
     ApplicationState app = paragraph.getApplicationState(appId);
     app.setStatus(status);
     onStatusChange(paragraph.getNote().getId(), paragraph.getId(), appId, status.toString());
@@ -410,13 +398,10 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
   }
 
   @Override
-  public void onNoteRemove(Note note) {
-  }
+  public void onNoteRemove(Note note) {}
 
   @Override
-  public void onNoteCreate(Note note) {
-
-  }
+  public void onNoteCreate(Note note) {}
 
   @Override
   public void onParagraphRemove(Paragraph paragraph) {
@@ -428,9 +413,7 @@ public class HeliumApplicationFactory implements ApplicationEventListener, Noteb
   }
 
   @Override
-  public void onParagraphCreate(Paragraph p) {
-
-  }
+  public void onParagraphCreate(Paragraph p) {}
 
   @Override
   public void onParagraphStatusChange(Paragraph p, Job.Status status) {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumBundleFactory.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumBundleFactory.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumBundleFactory.java
index 3b5aa3b..5777184 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumBundleFactory.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumBundleFactory.java
@@ -17,13 +17,14 @@
 package org.apache.zeppelin.helium;
 
 import com.github.eirslett.maven.plugins.frontend.lib.*;
-
 import com.google.common.base.Charsets;
 import com.google.common.io.Resources;
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
 import com.google.gson.stream.JsonReader;
-
+import java.io.*;
+import java.net.URI;
+import java.util.*;
 import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
 import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
 import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
@@ -35,18 +36,11 @@ import org.apache.log4j.PatternLayout;
 import org.apache.log4j.WriterAppender;
 import org.apache.log4j.spi.Filter;
 import org.apache.log4j.spi.LoggingEvent;
+import org.apache.zeppelin.conf.ZeppelinConfiguration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.*;
-import java.net.URI;
-import java.util.*;
-
-import org.apache.zeppelin.conf.ZeppelinConfiguration;
-
-/**
- * Load helium visualization & spell
- */
+/** Load helium visualization & spell */
 public class HeliumBundleFactory {
   private Logger logger = LoggerFactory.getLogger(HeliumBundleFactory.class);
   private static final String NODE_VERSION = "v6.9.1";
@@ -82,7 +76,7 @@ public class HeliumBundleFactory {
   private Gson gson;
   private boolean nodeAndNpmInstalled = false;
 
-  private ByteArrayOutputStream out  = new ByteArrayOutputStream();
+  private ByteArrayOutputStream out = new ByteArrayOutputStream();
 
   public HeliumBundleFactory(
       ZeppelinConfiguration conf,
@@ -90,7 +84,8 @@ public class HeliumBundleFactory {
       File moduleDownloadPath,
       File tabledataModulePath,
       File visualizationModulePath,
-      File spellModulePath) throws TaskRunnerException {
+      File spellModulePath)
+      throws TaskRunnerException {
     this(conf, nodeInstallationDir, moduleDownloadPath);
     this.tabledataModulePath = tabledataModulePath;
     this.visualizationModulePath = visualizationModulePath;
@@ -98,9 +93,8 @@ public class HeliumBundleFactory {
   }
 
   private HeliumBundleFactory(
-      ZeppelinConfiguration conf,
-      File nodeInstallationDir,
-      File moduleDownloadPath) throws TaskRunnerException {
+      ZeppelinConfiguration conf, File nodeInstallationDir, File moduleDownloadPath)
+      throws TaskRunnerException {
     this.heliumLocalRepoDirectory = new File(moduleDownloadPath, HELIUM_LOCAL_REPO);
     this.heliumBundleDirectory = new File(heliumLocalRepoDirectory, HELIUM_BUNDLES_DIR);
     this.heliumLocalModuleDirectory = new File(heliumLocalRepoDirectory, HELIUM_LOCAL_MODULE_DIR);
@@ -109,11 +103,11 @@ public class HeliumBundleFactory {
     this.defaultNpmInstallerUrl = conf.getHeliumNpmInstallerUrl();
     this.defaultYarnInstallerUrl = conf.getHeliumYarnInstallerUrl();
 
-    nodeInstallationDirectory = (nodeInstallationDir == null) ?
-        heliumLocalRepoDirectory : nodeInstallationDir;
+    nodeInstallationDirectory =
+        (nodeInstallationDir == null) ? heliumLocalRepoDirectory : nodeInstallationDir;
 
-    frontEndPluginFactory = new FrontendPluginFactory(
-            heliumLocalRepoDirectory, nodeInstallationDirectory);
+    frontEndPluginFactory =
+        new FrontendPluginFactory(heliumLocalRepoDirectory, nodeInstallationDirectory);
 
     gson = new Gson();
   }
@@ -123,20 +117,20 @@ public class HeliumBundleFactory {
       return;
     }
     try {
-      NodeInstaller nodeInstaller = frontEndPluginFactory
-              .getNodeInstaller(getProxyConfig(isSecure(defaultNodeInstallerUrl)));
+      NodeInstaller nodeInstaller =
+          frontEndPluginFactory.getNodeInstaller(getProxyConfig(isSecure(defaultNodeInstallerUrl)));
       nodeInstaller.setNodeVersion(NODE_VERSION);
       nodeInstaller.setNodeDownloadRoot(defaultNodeInstallerUrl);
       nodeInstaller.install();
 
-      NPMInstaller npmInstaller = frontEndPluginFactory
-              .getNPMInstaller(getProxyConfig(isSecure(defaultNpmInstallerUrl)));
+      NPMInstaller npmInstaller =
+          frontEndPluginFactory.getNPMInstaller(getProxyConfig(isSecure(defaultNpmInstallerUrl)));
       npmInstaller.setNpmVersion(NPM_VERSION);
       npmInstaller.setNpmDownloadRoot(defaultNpmInstallerUrl + "/" + NPM_PACKAGE_NAME + "/-/");
       npmInstaller.install();
 
-      YarnInstaller yarnInstaller = frontEndPluginFactory
-              .getYarnInstaller(getProxyConfig(isSecure(defaultYarnInstallerUrl)));
+      YarnInstaller yarnInstaller =
+          frontEndPluginFactory.getYarnInstaller(getProxyConfig(isSecure(defaultYarnInstallerUrl)));
       yarnInstaller.setYarnVersion(YARN_VERSION);
       yarnInstaller.setYarnDownloadRoot(defaultYarnInstallerUrl);
       yarnInstaller.install();
@@ -154,11 +148,15 @@ public class HeliumBundleFactory {
   private ProxyConfig getProxyConfig(boolean isSecure) {
     List<ProxyConfig.Proxy> proxies = new LinkedList<>();
 
-    String httpProxy = StringUtils.isBlank(System.getenv("http_proxy")) ?
-            System.getenv("HTTP_PROXY") : System.getenv("http_proxy");
+    String httpProxy =
+        StringUtils.isBlank(System.getenv("http_proxy"))
+            ? System.getenv("HTTP_PROXY")
+            : System.getenv("http_proxy");
 
-    String httpsProxy = StringUtils.isBlank(System.getenv("https_proxy")) ?
-            System.getenv("HTTPS_PROXY") : System.getenv("https_proxy");
+    String httpsProxy =
+        StringUtils.isBlank(System.getenv("https_proxy"))
+            ? System.getenv("HTTPS_PROXY")
+            : System.getenv("https_proxy");
 
     try {
       if (isSecure && StringUtils.isNotBlank(httpsProxy))
@@ -187,8 +185,10 @@ public class HeliumBundleFactory {
         username = authority[0];
       }
     }
-    String nonProxyHosts = StringUtils.isBlank(System.getenv("no_proxy")) ?
-            System.getenv("NO_PROXY") : System.getenv("no_proxy");
+    String nonProxyHosts =
+        StringUtils.isBlank(System.getenv("no_proxy"))
+            ? System.getenv("NO_PROXY")
+            : System.getenv("no_proxy");
     return new ProxyConfig.Proxy(proxyId, protocol, host, port, username, password, nonProxyHosts);
   }
 
@@ -214,8 +214,8 @@ public class HeliumBundleFactory {
 
   private static List<String> unTgz(File tarFile, File directory) throws IOException {
     List<String> result = new ArrayList<>();
-    try (TarArchiveInputStream in = new TarArchiveInputStream(
-            new GzipCompressorInputStream(new FileInputStream(tarFile)))) {
+    try (TarArchiveInputStream in =
+        new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(tarFile)))) {
       TarArchiveEntry entry = in.getNextTarEntry();
       while (entry != null) {
         if (entry.isDirectory()) {
@@ -237,34 +237,35 @@ public class HeliumBundleFactory {
     return result;
   }
 
-  /**
-   * @return main file name of this helium package (relative path)
-   */
-  private String downloadPackage(HeliumPackage pkg, String[] nameAndVersion, File bundleDir,
-                                String templateWebpackConfig, String templatePackageJson,
-                                FrontendPluginFactory fpf) throws IOException, TaskRunnerException {
+  /** @return main file name of this helium package (relative path) */
+  private String downloadPackage(
+      HeliumPackage pkg,
+      String[] nameAndVersion,
+      File bundleDir,
+      String templateWebpackConfig,
+      String templatePackageJson,
+      FrontendPluginFactory fpf)
+      throws IOException, TaskRunnerException {
     if (bundleDir.exists()) {
       FileUtils.deleteQuietly(bundleDir);
     }
     FileUtils.forceMkdir(bundleDir);
 
-    FileFilter copyFilter = new FileFilter() {
-      @Override
-      public boolean accept(File pathname) {
-        String fileName = pathname.getName();
-        if (fileName.startsWith(".") || fileName.startsWith("#") || fileName.startsWith("~")) {
-          return false;
-        } else {
-          return true;
-        }
-      }
-    };
+    FileFilter copyFilter =
+        new FileFilter() {
+          @Override
+          public boolean accept(File pathname) {
+            String fileName = pathname.getName();
+            if (fileName.startsWith(".") || fileName.startsWith("#") || fileName.startsWith("~")) {
+              return false;
+            } else {
+              return true;
+            }
+          }
+        };
 
     if (isLocalPackage(pkg)) {
-      FileUtils.copyDirectory(
-              new File(pkg.getArtifact()),
-              bundleDir,
-              copyFilter);
+      FileUtils.copyDirectory(new File(pkg.getArtifact()), bundleDir, copyFilter);
     } else {
       // if online package
       String version = nameAndVersion[1];
@@ -276,7 +277,7 @@ public class HeliumBundleFactory {
       File extracted = new File(heliumBundleDirectory, "package");
       FileUtils.deleteDirectory(extracted);
       List<String> entries = unTgz(tgz, heliumBundleDirectory);
-      for (String entry: entries) logger.debug("Extracted " + entry);
+      for (String entry : entries) logger.debug("Extracted " + entry);
       tgz.delete();
       FileUtils.copyDirectory(extracted, bundleDir);
       FileUtils.deleteDirectory(extracted);
@@ -285,20 +286,22 @@ public class HeliumBundleFactory {
     // 1. setup package.json
     File existingPackageJson = new File(bundleDir, "package.json");
     JsonReader reader = new JsonReader(new FileReader(existingPackageJson));
-    Map<String, Object> packageJson = gson.fromJson(reader,
-            new TypeToken<Map<String, Object>>(){}.getType());
+    Map<String, Object> packageJson =
+        gson.fromJson(reader, new TypeToken<Map<String, Object>>() {}.getType());
     Map<String, String> existingDeps = (Map<String, String>) packageJson.get("dependencies");
     String mainFileName = (String) packageJson.get("main");
 
     StringBuilder dependencies = new StringBuilder();
     int index = 0;
-    for (Map.Entry<String, String> e: existingDeps.entrySet()) {
+    for (Map.Entry<String, String> e : existingDeps.entrySet()) {
       dependencies.append("    \"").append(e.getKey()).append("\": ");
-      if (e.getKey().equals("zeppelin-vis") ||
-          e.getKey().equals("zeppelin-tabledata") ||
-          e.getKey().equals("zeppelin-spell")) {
-        dependencies.append("\"file:../../" + HELIUM_LOCAL_MODULE_DIR + "/")
-                .append(e.getKey()).append("\"");
+      if (e.getKey().equals("zeppelin-vis")
+          || e.getKey().equals("zeppelin-tabledata")
+          || e.getKey().equals("zeppelin-spell")) {
+        dependencies
+            .append("\"file:../../" + HELIUM_LOCAL_MODULE_DIR + "/")
+            .append(e.getKey())
+            .append("\"");
       } else {
         dependencies.append("\"").append(e.getValue()).append("\"");
       }
@@ -321,8 +324,8 @@ public class HeliumBundleFactory {
     return mainFileName;
   }
 
-  private void prepareSource(HeliumPackage pkg, String[] moduleNameVersion,
-                            String mainFileName) throws IOException {
+  private void prepareSource(HeliumPackage pkg, String[] moduleNameVersion, String mainFileName)
+      throws IOException {
     StringBuilder loadJsImport = new StringBuilder();
     StringBuilder loadJsRegister = new StringBuilder();
     String className = "bundles" + pkg.getName().replaceAll("[-_]", "");
@@ -332,10 +335,7 @@ public class HeliumBundleFactory {
       mainFileName = mainFileName.substring(0, mainFileName.length() - 3);
     }
 
-    loadJsImport
-        .append("import ")
-        .append(className)
-        .append(" from \"../" + mainFileName + "\"\n");
+    loadJsImport.append("import ").append(className).append(" from \"../" + mainFileName + "\"\n");
 
     loadJsRegister.append(HELIUM_BUNDLES_VAR + ".push({\n");
     loadJsRegister.append("id: \"" + moduleNameVersion[0] + "\",\n");
@@ -347,17 +347,17 @@ public class HeliumBundleFactory {
 
     File srcDir = getHeliumPackageSourceDirectory(pkg.getName());
     FileUtils.forceMkdir(srcDir);
-    FileUtils.write(new File(srcDir, HELIUM_BUNDLES_SRC),
-            loadJsImport.append(loadJsRegister).toString());
+    FileUtils.write(
+        new File(srcDir, HELIUM_BUNDLES_SRC), loadJsImport.append(loadJsRegister).toString());
   }
 
   private synchronized void installNodeModules(FrontendPluginFactory fpf) throws IOException {
     try {
       out.reset();
       String commandForNpmInstall =
-              String.format("install --fetch-retries=%d --fetch-retry-factor=%d " +
-                              "--fetch-retry-mintimeout=%d",
-                      FETCH_RETRY_COUNT, FETCH_RETRY_FACTOR_COUNT, FETCH_RETRY_MIN_TIMEOUT);
+          String.format(
+              "install --fetch-retries=%d --fetch-retry-factor=%d " + "--fetch-retry-mintimeout=%d",
+              FETCH_RETRY_COUNT, FETCH_RETRY_FACTOR_COUNT, FETCH_RETRY_MIN_TIMEOUT);
       logger.info("Installing required node modules");
       yarnCommand(fpf, commandForNpmInstall);
       logger.info("Installed required node modules");
@@ -366,8 +366,8 @@ public class HeliumBundleFactory {
     }
   }
 
-  private synchronized File bundleHeliumPackage(FrontendPluginFactory fpf,
-                                               File bundleDir) throws IOException {
+  private synchronized File bundleHeliumPackage(FrontendPluginFactory fpf, File bundleDir)
+      throws IOException {
     try {
       out.reset();
       logger.info("Bundling helium packages");
@@ -380,8 +380,7 @@ public class HeliumBundleFactory {
     String bundleStdoutResult = new String(out.toByteArray());
     File heliumBundle = new File(bundleDir, HELIUM_BUNDLE);
     if (!heliumBundle.isFile()) {
-      throw new IOException(
-              "Can't create bundle: \n" + bundleStdoutResult);
+      throw new IOException("Can't create bundle: \n" + bundleStdoutResult);
     }
 
     WebpackResult result = getWebpackResultFromOutput(bundleStdoutResult);
@@ -393,9 +392,8 @@ public class HeliumBundleFactory {
     return heliumBundle;
   }
 
-  public synchronized File buildPackage(HeliumPackage pkg,
-                                        boolean rebuild,
-                                        boolean recopyLocalModule) throws IOException {
+  public synchronized File buildPackage(
+      HeliumPackage pkg, boolean rebuild, boolean recopyLocalModule) throws IOException {
     if (pkg == null) {
       return null;
     }
@@ -426,20 +424,20 @@ public class HeliumBundleFactory {
       FileUtils.deleteQuietly(heliumLocalRepoDirectory);
       FileUtils.forceMkdir(heliumLocalRepoDirectory);
     }
-    FrontendPluginFactory fpf = new FrontendPluginFactory(
-            bundleDir, nodeInstallationDirectory);
+    FrontendPluginFactory fpf = new FrontendPluginFactory(bundleDir, nodeInstallationDirectory);
 
     // resources: webpack.js, package.json
-    String templateWebpackConfig = Resources.toString(
-        Resources.getResource("helium/webpack.config.js"), Charsets.UTF_8);
-    String templatePackageJson = Resources.toString(
-        Resources.getResource("helium/" + PACKAGE_JSON), Charsets.UTF_8);
+    String templateWebpackConfig =
+        Resources.toString(Resources.getResource("helium/webpack.config.js"), Charsets.UTF_8);
+    String templatePackageJson =
+        Resources.toString(Resources.getResource("helium/" + PACKAGE_JSON), Charsets.UTF_8);
 
     // 2. download helium package using `npm pack`
     String mainFileName = null;
     try {
-      mainFileName = downloadPackage(pkg, moduleNameVersion, bundleDir,
-              templateWebpackConfig, templatePackageJson, fpf);
+      mainFileName =
+          downloadPackage(
+              pkg, moduleNameVersion, bundleDir, templateWebpackConfig, templatePackageJson, fpf);
     } catch (TaskRunnerException e) {
       throw new IOException(e);
     }
@@ -478,36 +476,34 @@ public class HeliumBundleFactory {
     }
   }
 
-  private void copyFrameworkModule(boolean recopy, FileFilter filter,
-                           File src, File dest) throws IOException {
+  private void copyFrameworkModule(boolean recopy, FileFilter filter, File src, File dest)
+      throws IOException {
     if (src != null) {
       if (recopy && dest.exists()) {
         FileUtils.deleteDirectory(dest);
       }
 
       if (!dest.exists()) {
-        FileUtils.copyDirectory(
-            src,
-            dest,
-            filter);
+        FileUtils.copyDirectory(src, dest, filter);
       }
     }
   }
 
   private void deleteYarnCache() {
-    FilenameFilter filter = new FilenameFilter() {
-      @Override
-      public boolean accept(File dir, String name) {
-        if ((name.startsWith("npm-zeppelin-vis-") ||
-            name.startsWith("npm-zeppelin-tabledata-") ||
-            name.startsWith("npm-zeppelin-spell-")) &&
-            dir.isDirectory()) {
-          return true;
-        }
+    FilenameFilter filter =
+        new FilenameFilter() {
+          @Override
+          public boolean accept(File dir, String name) {
+            if ((name.startsWith("npm-zeppelin-vis-")
+                    || name.startsWith("npm-zeppelin-tabledata-")
+                    || name.startsWith("npm-zeppelin-spell-"))
+                && dir.isDirectory()) {
+              return true;
+            }
 
-        return false;
-      }
-    };
+            return false;
+          }
+        };
 
     File[] localModuleCaches = yarnCacheDir.listFiles(filter);
     if (localModuleCaches != null) {
@@ -517,42 +513,38 @@ public class HeliumBundleFactory {
     }
   }
 
-  void copyFrameworkModulesToInstallPath(boolean recopy)
-      throws IOException {
+  void copyFrameworkModulesToInstallPath(boolean recopy) throws IOException {
 
-    FileFilter npmPackageCopyFilter = new FileFilter() {
-      @Override
-      public boolean accept(File pathname) {
-        String fileName = pathname.getName();
-        if (fileName.startsWith(".") || fileName.startsWith("#") || fileName.startsWith("~")) {
-          return false;
-        } else {
-          return true;
-        }
-      }
-    };
+    FileFilter npmPackageCopyFilter =
+        new FileFilter() {
+          @Override
+          public boolean accept(File pathname) {
+            String fileName = pathname.getName();
+            if (fileName.startsWith(".") || fileName.startsWith("#") || fileName.startsWith("~")) {
+              return false;
+            } else {
+              return true;
+            }
+          }
+        };
 
     FileUtils.forceMkdir(heliumLocalModuleDirectory);
     // should delete yarn caches for local modules since they might be updated
     deleteYarnCache();
 
     // install tabledata module
-    File tabledataModuleInstallPath = new File(heliumLocalModuleDirectory,
-        "zeppelin-tabledata");
-    copyFrameworkModule(recopy, npmPackageCopyFilter,
-        tabledataModulePath, tabledataModuleInstallPath);
+    File tabledataModuleInstallPath = new File(heliumLocalModuleDirectory, "zeppelin-tabledata");
+    copyFrameworkModule(
+        recopy, npmPackageCopyFilter, tabledataModulePath, tabledataModuleInstallPath);
 
     // install visualization module
-    File visModuleInstallPath = new File(heliumLocalModuleDirectory,
-        "zeppelin-vis");
-    copyFrameworkModule(recopy, npmPackageCopyFilter,
-        visualizationModulePath, visModuleInstallPath);
+    File visModuleInstallPath = new File(heliumLocalModuleDirectory, "zeppelin-vis");
+    copyFrameworkModule(
+        recopy, npmPackageCopyFilter, visualizationModulePath, visModuleInstallPath);
 
     // install spell module
-    File spellModuleInstallPath = new File(heliumLocalModuleDirectory,
-        "zeppelin-spell");
-    copyFrameworkModule(recopy, npmPackageCopyFilter,
-        spellModulePath, spellModuleInstallPath);
+    File spellModuleInstallPath = new File(heliumLocalModuleDirectory, "zeppelin-spell");
+    copyFrameworkModule(recopy, npmPackageCopyFilter, spellModulePath, spellModuleInstallPath);
   }
 
   private WebpackResult getWebpackResultFromOutput(String output) {
@@ -609,8 +601,7 @@ public class HeliumBundleFactory {
         return null;
       }
       try {
-        NpmPackage npmPackage = NpmPackage.fromJson(
-            FileUtils.readFileToString(packageJson));
+        NpmPackage npmPackage = NpmPackage.fromJson(FileUtils.readFileToString(packageJson));
 
         String[] nameVersion = new String[2];
         nameVersion[0] = npmPackage.name;
@@ -627,9 +618,7 @@ public class HeliumBundleFactory {
       if ((pos = artifact.indexOf('@')) > 0) {
         nameVersion[0] = artifact.substring(0, pos);
         nameVersion[1] = artifact.substring(pos + 1);
-      } else if (
-          (pos = artifact.indexOf('^')) > 0 ||
-              (pos = artifact.indexOf('~')) > 0) {
+      } else if ((pos = artifact.indexOf('^')) > 0 || (pos = artifact.indexOf('~')) > 0) {
         nameVersion[0] = artifact.substring(0, pos);
         nameVersion[1] = artifact.substring(pos);
       } else {
@@ -642,9 +631,13 @@ public class HeliumBundleFactory {
 
   synchronized void install(HeliumPackage pkg) throws TaskRunnerException {
     String commandForNpmInstallArtifact =
-        String.format("install %s --fetch-retries=%d --fetch-retry-factor=%d " +
-                        "--fetch-retry-mintimeout=%d", pkg.getArtifact(),
-                FETCH_RETRY_COUNT, FETCH_RETRY_FACTOR_COUNT, FETCH_RETRY_MIN_TIMEOUT);
+        String.format(
+            "install %s --fetch-retries=%d --fetch-retry-factor=%d "
+                + "--fetch-retry-mintimeout=%d",
+            pkg.getArtifact(),
+            FETCH_RETRY_COUNT,
+            FETCH_RETRY_FACTOR_COUNT,
+            FETCH_RETRY_MIN_TIMEOUT);
     npmCommand(commandForNpmInstallArtifact);
   }
 
@@ -653,7 +646,8 @@ public class HeliumBundleFactory {
   }
 
   private void npmCommand(String args, Map<String, String> env) throws TaskRunnerException {
-    NpmRunner npm = frontEndPluginFactory.getNpmRunner(
+    NpmRunner npm =
+        frontEndPluginFactory.getNpmRunner(
             getProxyConfig(isSecure(defaultNpmInstallerUrl)), defaultNpmInstallerUrl);
     npm.execute(args, env);
   }
@@ -666,37 +660,36 @@ public class HeliumBundleFactory {
     yarnCommand(fpf, args, new HashMap<String, String>());
   }
 
-  private void yarnCommand(FrontendPluginFactory fpf,
-                           String args, Map<String, String> env) throws TaskRunnerException {
-    YarnRunner yarn = fpf.getYarnRunner(
-            getProxyConfig(isSecure(defaultNpmInstallerUrl)), defaultNpmInstallerUrl);
+  private void yarnCommand(FrontendPluginFactory fpf, String args, Map<String, String> env)
+      throws TaskRunnerException {
+    YarnRunner yarn =
+        fpf.getYarnRunner(getProxyConfig(isSecure(defaultNpmInstallerUrl)), defaultNpmInstallerUrl);
     yarn.execute(args, env);
   }
 
   private synchronized void configureLogger() {
-    org.apache.log4j.Logger npmLogger = org.apache.log4j.Logger.getLogger(
-        "com.github.eirslett.maven.plugins.frontend.lib.DefaultYarnRunner");
+    org.apache.log4j.Logger npmLogger =
+        org.apache.log4j.Logger.getLogger(
+            "com.github.eirslett.maven.plugins.frontend.lib.DefaultYarnRunner");
     Enumeration appenders = org.apache.log4j.Logger.getRootLogger().getAllAppenders();
 
     if (appenders != null) {
       while (appenders.hasMoreElements()) {
         Appender appender = (Appender) appenders.nextElement();
-        appender.addFilter(new Filter() {
-
-          @Override
-          public int decide(LoggingEvent loggingEvent) {
-            if (loggingEvent.getLoggerName().contains("DefaultYarnRunner")) {
-              return DENY;
-            } else {
-              return NEUTRAL;
-            }
-          }
-        });
+        appender.addFilter(
+            new Filter() {
+
+              @Override
+              public int decide(LoggingEvent loggingEvent) {
+                if (loggingEvent.getLoggerName().contains("DefaultYarnRunner")) {
+                  return DENY;
+                } else {
+                  return NEUTRAL;
+                }
+              }
+            });
       }
     }
-    npmLogger.addAppender(new WriterAppender(
-        new PatternLayout("%m%n"),
-        out
-    ));
+    npmLogger.addAppender(new WriterAppender(new PatternLayout("%m%n"), out));
   }
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumConf.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumConf.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumConf.java
index c7fec86..07ac07e 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumConf.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumConf.java
@@ -18,30 +18,26 @@ package org.apache.zeppelin.helium;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
-import org.apache.zeppelin.common.JsonSerializable;
-
 import java.util.*;
+import org.apache.zeppelin.common.JsonSerializable;
 
-/**
- * Helium config. This object will be persisted to conf/helium.conf
- */
+/** Helium config. This object will be persisted to conf/helium.conf */
 public class HeliumConf implements JsonSerializable {
-  private static final Gson gson =  new GsonBuilder()
-    .setPrettyPrinting()
-    .registerTypeAdapter(HeliumRegistry.class, new HeliumRegistrySerializer())
-    .create();
+  private static final Gson gson =
+      new GsonBuilder()
+          .setPrettyPrinting()
+          .registerTypeAdapter(HeliumRegistry.class, new HeliumRegistrySerializer())
+          .create();
 
   // enabled packages {name, version}
   private Map<String, String> enabled = Collections.synchronizedMap(new HashMap<String, String>());
 
   // {artifact, {configKey, configValue}}
   private Map<String, Map<String, Object>> packageConfig =
-      Collections.synchronizedMap(
-          new HashMap<String, Map<String, Object>>());
+      Collections.synchronizedMap(new HashMap<String, Map<String, Object>>());
 
   // enabled visualization package display order
-  private List<String> bundleDisplayOrder =
-          Collections.synchronizedList(new LinkedList<String>());
+  private List<String> bundleDisplayOrder = Collections.synchronizedList(new LinkedList<String>());
 
   public Map<String, String> getEnabledPackages() {
     return new HashMap<>(enabled);
@@ -51,26 +47,21 @@ public class HeliumConf implements JsonSerializable {
     enabled.put(name, artifact);
   }
 
-  public void updatePackageConfig(String artifact,
-                                  Map<String, Object> newConfig) {
+  public void updatePackageConfig(String artifact, Map<String, Object> newConfig) {
     if (!packageConfig.containsKey(artifact)) {
-      packageConfig.put(artifact,
-          Collections.synchronizedMap(new HashMap<String, Object>()));
+      packageConfig.put(artifact, Collections.synchronizedMap(new HashMap<String, Object>()));
     }
     packageConfig.put(artifact, newConfig);
   }
 
-  /**
-   * @return versioned package config `{artifact, {configKey, configVal}}`
-   */
-  public Map<String, Map<String, Object>> getAllPackageConfigs () {
+  /** @return versioned package config `{artifact, {configKey, configVal}}` */
+  public Map<String, Map<String, Object>> getAllPackageConfigs() {
     return packageConfig;
   }
 
   public Map<String, Object> getPackagePersistedConfig(String artifact) {
     if (!packageConfig.containsKey(artifact)) {
-      packageConfig.put(artifact,
-          Collections.synchronizedMap(new HashMap<String, Object>()));
+      packageConfig.put(artifact, Collections.synchronizedMap(new HashMap<String, Object>()));
     }
 
     return packageConfig.get(artifact);

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumLocalRegistry.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumLocalRegistry.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumLocalRegistry.java
index 7328dca..5f62c4b 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumLocalRegistry.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumLocalRegistry.java
@@ -18,19 +18,16 @@ package org.apache.zeppelin.helium;
 
 import com.google.gson.Gson;
 import com.google.gson.stream.JsonReader;
-import org.apache.commons.io.FileUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.StringReader;
 import java.util.LinkedList;
 import java.util.List;
+import org.apache.commons.io.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-/**
- * Simple Helium registry on local filesystem
- */
+/** Simple Helium registry on local filesystem */
 public class HeliumLocalRegistry extends HeliumRegistry {
   private Logger logger = LoggerFactory.getLogger(HeliumLocalRegistry.class);
 
@@ -39,7 +36,6 @@ public class HeliumLocalRegistry extends HeliumRegistry {
   public HeliumLocalRegistry(String name, String uri) {
     super(name, uri);
     gson = new Gson();
-
   }
 
   @Override
@@ -47,7 +43,7 @@ public class HeliumLocalRegistry extends HeliumRegistry {
     List<HeliumPackage> result = new LinkedList<>();
 
     File file = new File(uri());
-    File [] files = file.listFiles();
+    File[] files = file.listFiles();
     if (files == null) {
       return result;
     }
@@ -76,5 +72,4 @@ public class HeliumLocalRegistry extends HeliumRegistry {
       return null;
     }
   }
-
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumOnlineRegistry.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumOnlineRegistry.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumOnlineRegistry.java
index e54687a..b868472 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumOnlineRegistry.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumOnlineRegistry.java
@@ -18,20 +18,6 @@ package org.apache.zeppelin.helium;
 
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.zeppelin.conf.ZeppelinConfiguration;
-import org.apache.zeppelin.util.Util;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -43,20 +29,24 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.http.HttpHost;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.zeppelin.conf.ZeppelinConfiguration;
+import org.apache.zeppelin.util.Util;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
- * This registry reads helium package json data
- * from specified url.
+ * This registry reads helium package json data from specified url.
  *
- * File should be look like
- * [
- *    "packageName": {
- *       "0.0.1": json serialized HeliumPackage class,
- *       "0.0.2": json serialized HeliumPackage class,
- *       ...
- *    },
- *    ...
- * ]
+ * <p>File should be look like [ "packageName": { "0.0.1": json serialized HeliumPackage class,
+ * "0.0.2": json serialized HeliumPackage class, ... }, ... ]
  */
 public class HeliumOnlineRegistry extends HeliumRegistry {
   private Logger logger = LoggerFactory.getLogger(HeliumOnlineRegistry.class);
@@ -74,10 +64,11 @@ public class HeliumOnlineRegistry extends HeliumRegistry {
 
   @Override
   public synchronized List<HeliumPackage> getAll() throws IOException {
-    HttpClient client = HttpClientBuilder.create()
-        .setUserAgent("ApacheZeppelin/" + Util.getVersion())
-        .setProxy(getProxy(uri()))
-        .build();
+    HttpClient client =
+        HttpClientBuilder.create()
+            .setUserAgent("ApacheZeppelin/" + Util.getVersion())
+            .setProxy(getProxy(uri()))
+            .build();
     HttpGet get = new HttpGet(uri());
     HttpResponse response;
     try {
@@ -85,10 +76,8 @@ public class HeliumOnlineRegistry extends HeliumRegistry {
       if ((get.getURI().getHost().equals(cfg.getS3Endpoint()))) {
         if (cfg.getS3Timeout() != null) {
           int timeout = Integer.valueOf(cfg.getS3Timeout());
-          RequestConfig requestCfg = RequestConfig.custom()
-                  .setConnectTimeout(timeout)
-                  .setSocketTimeout(timeout)
-                  .build();
+          RequestConfig requestCfg =
+              RequestConfig.custom().setConnectTimeout(timeout).setSocketTimeout(timeout).build();
           get.setConfig(requestCfg);
         }
       }
@@ -106,13 +95,11 @@ public class HeliumOnlineRegistry extends HeliumRegistry {
       List<HeliumPackage> packageList = new LinkedList<>();
 
       BufferedReader reader;
-      reader = new BufferedReader(
-          new InputStreamReader(response.getEntity().getContent()));
+      reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
 
-      List<Map<String, Map<String, HeliumPackage>>> packages = gson.fromJson(
-          reader,
-          new TypeToken<List<Map<String, Map<String, HeliumPackage>>>>() {
-          }.getType());
+      List<Map<String, Map<String, HeliumPackage>>> packages =
+          gson.fromJson(
+              reader, new TypeToken<List<Map<String, Map<String, HeliumPackage>>>>() {}.getType());
       reader.close();
 
       for (Map<String, Map<String, HeliumPackage>> pkg : packages) {
@@ -127,25 +114,27 @@ public class HeliumOnlineRegistry extends HeliumRegistry {
   }
 
   private HttpHost getProxy(String uri) {
-    String httpProxy = StringUtils.isBlank(System.getenv("http_proxy")) ?
-            System.getenv("HTTP_PROXY") : System.getenv("http_proxy");
+    String httpProxy =
+        StringUtils.isBlank(System.getenv("http_proxy"))
+            ? System.getenv("HTTP_PROXY")
+            : System.getenv("http_proxy");
 
-    String httpsProxy = StringUtils.isBlank(System.getenv("https_proxy")) ?
-            System.getenv("HTTPS_PROXY") : System.getenv("https_proxy");
+    String httpsProxy =
+        StringUtils.isBlank(System.getenv("https_proxy"))
+            ? System.getenv("HTTPS_PROXY")
+            : System.getenv("https_proxy");
 
     try {
       String scheme = new URI(uri).getScheme();
       if (scheme.toLowerCase().startsWith("https") && StringUtils.isNotBlank(httpsProxy)) {
         URI httpsProxyUri = new URI(httpsProxy);
-        return new HttpHost(httpsProxyUri.getHost(),
-                httpsProxyUri.getPort(), httpsProxyUri.getScheme());
-      }
-      else if (scheme.toLowerCase().startsWith("http") && StringUtils.isNotBlank(httpProxy)){
+        return new HttpHost(
+            httpsProxyUri.getHost(), httpsProxyUri.getPort(), httpsProxyUri.getScheme());
+      } else if (scheme.toLowerCase().startsWith("http") && StringUtils.isNotBlank(httpProxy)) {
         URI httpProxyUri = new URI(httpProxy);
-        return new HttpHost(httpProxyUri.getHost(),
-                httpProxyUri.getPort(), httpProxyUri.getScheme());
-      }
-      else return null;
+        return new HttpHost(
+            httpProxyUri.getHost(), httpProxyUri.getPort(), httpProxyUri.getScheme());
+      } else return null;
     } catch (Exception ex) {
       logger.error(ex.getMessage(), ex);
       return null;
@@ -157,9 +146,7 @@ public class HeliumOnlineRegistry extends HeliumRegistry {
       if (registryCacheFile.isFile()) {
         try {
           return gson.fromJson(
-              new FileReader(registryCacheFile),
-              new TypeToken<List<HeliumPackage>>() {
-              }.getType());
+              new FileReader(registryCacheFile), new TypeToken<List<HeliumPackage>>() {}.getType());
         } catch (FileNotFoundException e) {
           logger.error(e.getMessage(), e);
           return new LinkedList<>();

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumPackageSearchResult.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumPackageSearchResult.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumPackageSearchResult.java
index 36b6115..63d8b9e 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumPackageSearchResult.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumPackageSearchResult.java
@@ -16,9 +16,7 @@
  */
 package org.apache.zeppelin.helium;
 
-/**
- * search result
- */
+/** search result */
 public class HeliumPackageSearchResult {
   private final String registry;
   private final HeliumPackage pkg;
@@ -26,6 +24,7 @@ public class HeliumPackageSearchResult {
 
   /**
    * Create search result item
+   *
    * @param registry registry name
    * @param pkg package information
    */

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumPackageSuggestion.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumPackageSuggestion.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumPackageSuggestion.java
index 9df6abc..adb69a2 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumPackageSuggestion.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumPackageSuggestion.java
@@ -21,9 +21,7 @@ import java.util.Comparator;
 import java.util.LinkedList;
 import java.util.List;
 
-/**
- * Suggested apps
- */
+/** Suggested apps */
 public class HeliumPackageSuggestion {
   private final List<HeliumPackageSearchResult> available = new LinkedList<>();
 
@@ -32,21 +30,20 @@ public class HeliumPackageSuggestion {
    * provides n - 'favorite' list, based on occurrence of apps in notebook
    */
 
-  public HeliumPackageSuggestion() {
-
-  }
+  public HeliumPackageSuggestion() {}
 
   public void addAvailablePackage(HeliumPackageSearchResult r) {
     available.add(r);
-
   }
 
   public void sort() {
-    Collections.sort(available, new Comparator<HeliumPackageSearchResult>() {
-      @Override
-      public int compare(HeliumPackageSearchResult o1, HeliumPackageSearchResult o2) {
-        return o1.getPkg().getName().compareTo(o2.getPkg().getName());
-      }
-    });
+    Collections.sort(
+        available,
+        new Comparator<HeliumPackageSearchResult>() {
+          @Override
+          public int compare(HeliumPackageSearchResult o1, HeliumPackageSearchResult o2) {
+            return o1.getPkg().getName().compareTo(o2.getPkg().getName());
+          }
+        });
   }
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumRegistry.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumRegistry.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumRegistry.java
index 125ad92..d2b2dd4 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumRegistry.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumRegistry.java
@@ -17,12 +17,9 @@
 package org.apache.zeppelin.helium;
 
 import java.io.IOException;
-import java.net.URI;
 import java.util.List;
 
-/**
- * Helium package registry
- */
+/** Helium package registry */
 public abstract class HeliumRegistry {
   private final String name;
   private final String uri;
@@ -31,11 +28,14 @@ public abstract class HeliumRegistry {
     this.name = name;
     this.uri = uri;
   }
+
   public String name() {
     return name;
   }
+
   public String uri() {
     return uri;
   }
+
   public abstract List<HeliumPackage> getAll() throws IOException;
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumRegistrySerializer.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumRegistrySerializer.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumRegistrySerializer.java
index 3abcb9f..2e63925 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumRegistrySerializer.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumRegistrySerializer.java
@@ -17,26 +17,20 @@
 package org.apache.zeppelin.helium;
 
 import com.google.gson.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Type;
-import java.net.URI;
-import java.net.URISyntaxException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-/**
- * HeliumRegistrySerializer (and deserializer) for gson
- */
+/** HeliumRegistrySerializer (and deserializer) for gson */
 public class HeliumRegistrySerializer
     implements JsonSerializer<HeliumRegistry>, JsonDeserializer<HeliumRegistry> {
   Logger logger = LoggerFactory.getLogger(HeliumRegistrySerializer.class);
 
   @Override
-  public HeliumRegistry deserialize(JsonElement json,
-                                Type type,
-                                JsonDeserializationContext jsonDeserializationContext)
+  public HeliumRegistry deserialize(
+      JsonElement json, Type type, JsonDeserializationContext jsonDeserializationContext)
       throws JsonParseException {
     JsonObject jsonObject = json.getAsJsonObject();
     String className = jsonObject.get("class").getAsString();
@@ -50,17 +44,19 @@ public class HeliumRegistrySerializer
       Constructor<HeliumRegistry> constructor = cls.getConstructor(String.class, String.class);
       HeliumRegistry registry = constructor.newInstance(name, uri);
       return registry;
-    } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException |
-        InstantiationException | InvocationTargetException e) {
+    } catch (ClassNotFoundException
+        | NoSuchMethodException
+        | IllegalAccessException
+        | InstantiationException
+        | InvocationTargetException e) {
       logger.error(e.getMessage(), e);
       return null;
     }
   }
 
   @Override
-  public JsonElement serialize(HeliumRegistry heliumRegistry,
-                               Type type,
-                               JsonSerializationContext jsonSerializationContext) {
+  public JsonElement serialize(
+      HeliumRegistry heliumRegistry, Type type, JsonSerializationContext jsonSerializationContext) {
     JsonObject json = new JsonObject();
     json.addProperty("class", heliumRegistry.getClass().getName());
     json.addProperty("uri", heliumRegistry.uri());

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/NpmPackage.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/NpmPackage.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/NpmPackage.java
index c2234c6..f643f12 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/NpmPackage.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/NpmPackage.java
@@ -17,13 +17,10 @@
 package org.apache.zeppelin.helium;
 
 import com.google.gson.Gson;
-import org.apache.zeppelin.common.JsonSerializable;
-
 import java.util.Map;
+import org.apache.zeppelin.common.JsonSerializable;
 
-/**
- * To read package.json
- */
+/** To read package.json */
 public class NpmPackage implements JsonSerializable {
   private static final Gson gson = new Gson();
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/WebpackResult.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/WebpackResult.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/WebpackResult.java
index 4175cad..3d0fb6e 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/WebpackResult.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/WebpackResult.java
@@ -19,14 +19,12 @@ package org.apache.zeppelin.helium;
 import com.google.gson.Gson;
 import org.apache.zeppelin.common.JsonSerializable;
 
-/**
- * Represetns webpack json format result
- */
+/** Represetns webpack json format result */
 public class WebpackResult implements JsonSerializable {
   private static final Gson gson = new Gson();
 
-  public final String [] errors = new String[0];
-  public final String [] warnings = new String[0];
+  public final String[] errors = new String[0];
+  public final String[] warnings = new String[0];
 
   public String toJson() {
     return gson.toJson(this);


Mime
View raw message