zjffdu commented on a change in pull request #3485: [ZEPPELIN-3548] KSQL 
Interpreter for Zeppelin
URL: https://github.com/apache/zeppelin/pull/3485#discussion_r337398644
 
 

 ##########
 File path: ksql/src/main/java/org/apache/zeppelin/ksql/KSQLInterpreter.java
 ##########
 @@ -0,0 +1,170 @@
+/*
+* Copyright 2016 Google Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.zeppelin.ksql;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.lang.StringUtils;
+import org.apache.zeppelin.interpreter.Interpreter;
+import org.apache.zeppelin.interpreter.InterpreterContext;
+import org.apache.zeppelin.interpreter.InterpreterException;
+import org.apache.zeppelin.interpreter.InterpreterResult;
+import org.apache.zeppelin.interpreter.util.InterpreterOutputStream;
+import org.apache.zeppelin.scheduler.Scheduler;
+import org.apache.zeppelin.scheduler.SchedulerFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.Collectors;
+
+
+public class KSQLInterpreter extends Interpreter {
+  private static final String NEW_LINE = "\n";
+
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(KSQLInterpreter.class);
+  public static final String TABLE_DELIMITER = "\t";
+
+  private InterpreterOutputStream interpreterOutput = new 
InterpreterOutputStream(LOGGER);
+
+  private final KSQLRestService ksqlRestService;
+
+  private static final ObjectMapper json = new ObjectMapper();
+
+  public KSQLInterpreter(Properties properties) {
+    this(properties, new KSQLRestService(properties.entrySet().stream()
+            .collect(Collectors.toMap(e -> e.getKey().toString(),
+                e -> e.getValue() != null ? e.getValue().toString() : null))));
+  }
+
+  // VisibleForTesting
+  public KSQLInterpreter(Properties properties, KSQLRestService 
ksqlRestService) {
+    super(properties);
+    this.ksqlRestService = ksqlRestService;
+  }
+
+  @Override
+  public void open() throws InterpreterException {}
 
 Review comment:
   OK

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to