@Test public void testDefaultProperty() { Properties p = new Properties(); p.put("p1", "v1"); MockInterpreterA intp = new MockInterpreterA(p); assertEquals(1, intp.getProperty().size()); assertEquals("v1", intp.getProperty().get("p1")); assertEquals("v1", intp.getProperty("p1")); }
@ZeppelinApi public Properties getProperty() { Properties p = new Properties(); p.putAll(property); RegisteredInterpreter registeredInterpreter = Interpreter.findRegisteredInterpreterByClassName( getClassName()); if (null != registeredInterpreter) { Map<String, InterpreterProperty> defaultProperties = registeredInterpreter.getProperties(); for (String k : defaultProperties.keySet()) { if (!p.containsKey(k)) { String value = defaultProperties.get(k).getValue(); if (value != null) { p.put(k, defaultProperties.get(k).getValue()); } } } } return p; }
Interpreter { @ZeppelinApi public Properties getProperty() { Properties p = new Properties(); p.putAll(property); RegisteredInterpreter registeredInterpreter = Interpreter.findRegisteredInterpreterByClassName( getClassName()); if (null != registeredInterpreter) { Map<String, InterpreterProperty> defaultProperties = registeredInterpreter.getProperties(); for (String k : defaultProperties.keySet()) { if (!p.containsKey(k)) { String value = defaultProperties.get(k).getValue(); if (value != null) { p.put(k, defaultProperties.get(k).getValue()); } } } } return p; } }
Interpreter { @ZeppelinApi public Properties getProperty() { Properties p = new Properties(); p.putAll(property); RegisteredInterpreter registeredInterpreter = Interpreter.findRegisteredInterpreterByClassName( getClassName()); if (null != registeredInterpreter) { Map<String, InterpreterProperty> defaultProperties = registeredInterpreter.getProperties(); for (String k : defaultProperties.keySet()) { if (!p.containsKey(k)) { String value = defaultProperties.get(k).getValue(); if (value != null) { p.put(k, defaultProperties.get(k).getValue()); } } } } return p; } @ZeppelinApi  Interpreter(Properties property); }
Interpreter { @ZeppelinApi public Properties getProperty() { Properties p = new Properties(); p.putAll(property); RegisteredInterpreter registeredInterpreter = Interpreter.findRegisteredInterpreterByClassName( getClassName()); if (null != registeredInterpreter) { Map<String, InterpreterProperty> defaultProperties = registeredInterpreter.getProperties(); for (String k : defaultProperties.keySet()) { if (!p.containsKey(k)) { String value = defaultProperties.get(k).getValue(); if (value != null) { p.put(k, defaultProperties.get(k).getValue()); } } } } return p; } @ZeppelinApi  Interpreter(Properties property); @ZeppelinApi abstract void open(); @ZeppelinApi abstract void close(); @ZeppelinApi abstract InterpreterResult interpret(String st, InterpreterContext context); @ZeppelinApi abstract void cancel(InterpreterContext context); @ZeppelinApi abstract FormType getFormType(); @ZeppelinApi abstract int getProgress(InterpreterContext context); @ZeppelinApi List<InterpreterCompletion> completion(String buf, int cursor); @ZeppelinApi Scheduler getScheduler(); void setProperty(Properties property); @ZeppelinApi Properties getProperty(); @ZeppelinApi String getProperty(String key); String getClassName(); void setUserName(String userName); String getUserName(); void setInterpreterGroup(InterpreterGroup interpreterGroup); @ZeppelinApi InterpreterGroup getInterpreterGroup(); URL[] getClassloaderUrls(); void setClassloaderUrls(URL[] classloaderUrls); @Experimental void registerHook(String noteId, String event, String cmd); @Experimental void registerHook(String event, String cmd); @Experimental String getHook(String noteId, String event); @Experimental String getHook(String event); @Experimental void unregisterHook(String noteId, String event); @Experimental void unregisterHook(String event); @ZeppelinApi Interpreter getInterpreterInTheSameSessionByClassName(String className); @Deprecated static void register(String name, String group, String className,
      Map<String, InterpreterProperty> properties); @Deprecated static void register(String name, String group, String className,
      boolean defaultInterpreter, Map<String, InterpreterProperty> properties); @Deprecated static void register(RegisteredInterpreter registeredInterpreter); static RegisteredInterpreter findRegisteredInterpreterByClassName(String className); }
Interpreter { @ZeppelinApi public Properties getProperty() { Properties p = new Properties(); p.putAll(property); RegisteredInterpreter registeredInterpreter = Interpreter.findRegisteredInterpreterByClassName( getClassName()); if (null != registeredInterpreter) { Map<String, InterpreterProperty> defaultProperties = registeredInterpreter.getProperties(); for (String k : defaultProperties.keySet()) { if (!p.containsKey(k)) { String value = defaultProperties.get(k).getValue(); if (value != null) { p.put(k, defaultProperties.get(k).getValue()); } } } } return p; } @ZeppelinApi  Interpreter(Properties property); @ZeppelinApi abstract void open(); @ZeppelinApi abstract void close(); @ZeppelinApi abstract InterpreterResult interpret(String st, InterpreterContext context); @ZeppelinApi abstract void cancel(InterpreterContext context); @ZeppelinApi abstract FormType getFormType(); @ZeppelinApi abstract int getProgress(InterpreterContext context); @ZeppelinApi List<InterpreterCompletion> completion(String buf, int cursor); @ZeppelinApi Scheduler getScheduler(); void setProperty(Properties property); @ZeppelinApi Properties getProperty(); @ZeppelinApi String getProperty(String key); String getClassName(); void setUserName(String userName); String getUserName(); void setInterpreterGroup(InterpreterGroup interpreterGroup); @ZeppelinApi InterpreterGroup getInterpreterGroup(); URL[] getClassloaderUrls(); void setClassloaderUrls(URL[] classloaderUrls); @Experimental void registerHook(String noteId, String event, String cmd); @Experimental void registerHook(String event, String cmd); @Experimental String getHook(String noteId, String event); @Experimental String getHook(String event); @Experimental void unregisterHook(String noteId, String event); @Experimental void unregisterHook(String event); @ZeppelinApi Interpreter getInterpreterInTheSameSessionByClassName(String className); @Deprecated static void register(String name, String group, String className,
      Map<String, InterpreterProperty> properties); @Deprecated static void register(String name, String group, String className,
      boolean defaultInterpreter, Map<String, InterpreterProperty> properties); @Deprecated static void register(RegisteredInterpreter registeredInterpreter); static RegisteredInterpreter findRegisteredInterpreterByClassName(String className); static Logger logger; static Map<String, RegisteredInterpreter> registeredInterpreters; }