You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2018/06/15 03:44:52 UTC
zeppelin git commit: [HOTFIX] Remove InterpreterContextRunnerPool
Repository: zeppelin
Updated Branches:
refs/heads/master 7af861682 -> bf4e1f93b
[HOTFIX] Remove InterpreterContextRunnerPool
Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/bf4e1f93
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/bf4e1f93
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/bf4e1f93
Branch: refs/heads/master
Commit: bf4e1f93b22d4f5da54c70247339cb675111b00e
Parents: 7af8616
Author: Jeff Zhang <zj...@apache.org>
Authored: Fri Jun 15 11:35:20 2018 +0800
Committer: Jeff Zhang <zj...@apache.org>
Committed: Fri Jun 15 11:35:20 2018 +0800
----------------------------------------------------------------------
.../remote/InterpreterContextRunnerPool.java | 88 --------------------
.../remote/RemoteInterpreterProcess.java | 2 -
2 files changed, 90 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/bf4e1f93/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/InterpreterContextRunnerPool.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/InterpreterContextRunnerPool.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/InterpreterContextRunnerPool.java
deleted file mode 100644
index 7653824..0000000
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/InterpreterContextRunnerPool.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * 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.interpreter.remote;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.zeppelin.interpreter.InterpreterContextRunner;
-import org.apache.zeppelin.interpreter.InterpreterException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- *
- */
-public class InterpreterContextRunnerPool {
- Logger logger = LoggerFactory.getLogger(InterpreterContextRunnerPool.class);
- private Map<String, List<InterpreterContextRunner>> interpreterContextRunners;
-
- public InterpreterContextRunnerPool() {
- interpreterContextRunners = new HashMap<>();
-
- }
-
- // add runner
- public void add(String noteId, InterpreterContextRunner runner) {
- synchronized (interpreterContextRunners) {
- if (!interpreterContextRunners.containsKey(noteId)) {
- interpreterContextRunners.put(noteId, new LinkedList<InterpreterContextRunner>());
- }
-
- interpreterContextRunners.get(noteId).add(runner);
- }
- }
-
- // replace all runners to noteId
- public void addAll(String noteId, List<InterpreterContextRunner> runners) {
- synchronized (interpreterContextRunners) {
- if (!interpreterContextRunners.containsKey(noteId)) {
- interpreterContextRunners.put(noteId, new LinkedList<InterpreterContextRunner>());
- }
-
- interpreterContextRunners.get(noteId).addAll(runners);
- }
- }
-
- public void clear(String noteId) {
- synchronized (interpreterContextRunners) {
- interpreterContextRunners.remove(noteId);
- }
- }
-
-
- public void run(String noteId, String paragraphId) {
- synchronized (interpreterContextRunners) {
- List<InterpreterContextRunner> list = interpreterContextRunners.get(noteId);
- if (list != null) {
- for (InterpreterContextRunner r : list) {
- if (noteId.equals(r.getNoteId()) && paragraphId.equals(r.getParagraphId())) {
- logger.info("run paragraph {} on note {} from InterpreterContext",
- r.getParagraphId(), r.getNoteId());
- r.run();
- return;
- }
- }
- }
-
- throw new RuntimeException("Can not run paragraph " + paragraphId + " on " + noteId);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/bf4e1f93/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
index 787e882..e8b3482 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
@@ -31,12 +31,10 @@ public abstract class RemoteInterpreterProcess implements InterpreterClient {
private static final Logger logger = LoggerFactory.getLogger(RemoteInterpreterProcess.class);
private GenericObjectPool<Client> clientPool;
- private final InterpreterContextRunnerPool interpreterContextRunnerPool;
private int connectTimeout;
public RemoteInterpreterProcess(
int connectTimeout) {
- this.interpreterContextRunnerPool = new InterpreterContextRunnerPool();
this.connectTimeout = connectTimeout;
}