Skip to content

Commit

Permalink
#5039: rename to BeakerXClient
Browse files Browse the repository at this point in the history
  • Loading branch information
jaroslawmalekcodete committed Jun 20, 2018
1 parent 9da9a2a commit 3f05a8f
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

public class BeakerxClientManager {

private static BeakerClient beakerxClientInst;
private static BeakerXClient beakerxClientInst;

public static BeakerClient register(BeakerClient beakerxClient) {
public static BeakerXClient register(BeakerXClient beakerxClient) {
beakerxClientInst = beakerxClient;
return beakerxClientInst;
}

public static BeakerClient get() {
public static BeakerXClient get() {
return beakerxClientInst;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import static com.fasterxml.jackson.databind.SerializationFeature.WRITE_ENUMS_USING_TO_STRING;
import static com.twosigma.beakerx.kernel.msg.JupyterMessages.COMM_MSG;

public class NamespaceClient implements BeakerClient {
public class NamespaceClient implements BeakerXClient {

private static Map<String, SynchronousQueue<Object>> messagePool = new HashMap<>();
private ObjectMapper objectMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.twosigma.beakerx.evaluator;

import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.BeakerxClientManager;
import com.twosigma.beakerx.DefaultJVMVariables;
import com.twosigma.beakerx.inspect.Inspect;
Expand Down Expand Up @@ -55,7 +55,7 @@ public abstract class BaseEvaluator implements Evaluator {
protected Imports imports;
private final CellExecutor executor;
private Path tempFolder;
private BeakerClient beakerxClient;
private BeakerXClient beakerxClient;
protected EvaluatorParameters evaluatorParameters;
private EvaluatorHooks cancelHooks = new EvaluatorHooks();

Expand All @@ -66,7 +66,7 @@ public BaseEvaluator(String id,
CellExecutor cellExecutor,
TempFolderFactory tempFolderFactory,
EvaluatorParameters evaluatorParameters,
BeakerClient beakerxClient) {
BeakerXClient beakerxClient) {
shellId = id;
sessionId = sId;
executor = cellExecutor;
Expand Down Expand Up @@ -109,7 +109,7 @@ public ClassLoader getClassLoaderForImport() {
}

@Override
public BeakerClient getBeakerx() {
public BeakerXClient getBeakerx() {
return beakerxClient;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.twosigma.beakerx.evaluator;

import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.inspect.InspectResult;
import com.twosigma.beakerx.TryResult;
import com.twosigma.beakerx.kernel.AddImportStatus;
Expand Down Expand Up @@ -76,5 +76,5 @@ public interface Evaluator {

void registerCancelHook(Hook hook);

BeakerClient getBeakerx();
BeakerXClient getBeakerx();
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.twosigma.beakerx.evaluator;

import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.TryResult;
import com.twosigma.beakerx.autocomplete.AutocompleteResult;
import com.twosigma.beakerx.inspect.InspectResult;
Expand Down Expand Up @@ -120,7 +120,7 @@ public void registerCancelHook(Hook hook) {
evaluator.registerCancelHook(hook);
}

public BeakerClient getBeakerx() {
public BeakerXClient getBeakerx() {
return evaluator.getBeakerx();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.twosigma.beakerx.evaluator;

import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.CodeCell;
import com.twosigma.beakerx.TryResult;
import com.twosigma.beakerx.autocomplete.AutocompleteResult;
Expand Down Expand Up @@ -195,7 +195,7 @@ public int getResetEnvironmentCounter() {
}


public static class BeakexClientTestImpl implements BeakerClient {
public static class BeakexClientTestImpl implements BeakerXClient {

@Override
public void showProgressUpdate(String message, int progress) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import clojure.lang.RT;
import clojure.lang.Symbol;
import clojure.lang.Var;
import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.TryResult;
import com.twosigma.beakerx.autocomplete.AutocompleteResult;
import com.twosigma.beakerx.clojure.autocomplete.ClojureAutocomplete;
Expand Down Expand Up @@ -60,13 +60,13 @@ public ClojureEvaluator(String id,
CellExecutor cellExecutor,
TempFolderFactory tempFolderFactory,
EvaluatorParameters evaluatorParameters,
BeakerClient beakerxClient) {
BeakerXClient beakerxClient) {
super(id, sId, cellExecutor, tempFolderFactory, evaluatorParameters, beakerxClient);
requirements = new ArrayList<>();
init();
}

public ClojureEvaluator(String id, String sId, EvaluatorParameters evaluatorParameters, BeakerClient beakerxClient) {
public ClojureEvaluator(String id, String sId, EvaluatorParameters evaluatorParameters, BeakerXClient beakerxClient) {
this(id,
sId,
new BeakerCellExecutor("clojure"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.twosigma.beakerx.groovy.evaluator;

import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.TryResult;
import com.twosigma.beakerx.autocomplete.AutocompleteResult;
import com.twosigma.beakerx.evaluator.BaseEvaluator;
Expand Down Expand Up @@ -54,7 +54,7 @@ public class GroovyEvaluator extends BaseEvaluator {
private ImportCustomizer icz;
private BeakerXUrlClassLoader beakerxUrlClassLoader;

public GroovyEvaluator(String id, String sId, EvaluatorParameters evaluatorParameters, BeakerClient beakerxClient) {
public GroovyEvaluator(String id, String sId, EvaluatorParameters evaluatorParameters, BeakerXClient beakerxClient) {
this(id,
sId,
new BeakerCellExecutor("groovy"),
Expand All @@ -68,7 +68,7 @@ public GroovyEvaluator(String id,
CellExecutor cellExecutor,
TempFolderFactory tempFolderFactory,
EvaluatorParameters evaluatorParameters,
BeakerClient beakerxClient) {
BeakerXClient beakerxClient) {
super(id, sId, cellExecutor, tempFolderFactory, evaluatorParameters, beakerxClient);
cps = new GroovyClasspathScanner();
gac = createGroovyAutocomplete(cps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.twosigma.beakerx.groovy;

import com.twosigma.beakerx.AutotranslationService;
import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.evaluator.BaseEvaluator;
import com.twosigma.beakerx.evaluator.EvaluatorTest;
import com.twosigma.beakerx.evaluator.TempFolderFactory;
Expand Down Expand Up @@ -56,7 +56,7 @@ public String getContextAsString() {
};
}

public static BaseEvaluator groovyEvaluator(BeakerClient client) {
public static BaseEvaluator groovyEvaluator(BeakerXClient client) {
GroovyEvaluator evaluator = new GroovyEvaluator(
"id",
"sid",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.twosigma.beakerx.javash.evaluator;

import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.TryResult;
import com.twosigma.beakerx.autocomplete.AutocompleteResult;
import com.twosigma.beakerx.evaluator.BaseEvaluator;
Expand Down Expand Up @@ -45,7 +45,7 @@ public class JavaEvaluator extends BaseEvaluator {
private JavaAutocomplete jac;
private JavaBeakerXUrlClassLoader loader = null;

public JavaEvaluator(String id, String sId, EvaluatorParameters evaluatorParameters, BeakerClient beakerxClient) {
public JavaEvaluator(String id, String sId, EvaluatorParameters evaluatorParameters, BeakerXClient beakerxClient) {
this(id, sId, new BeakerCellExecutor("javash"), new TempFolderFactoryImpl(), evaluatorParameters, beakerxClient);
}

Expand All @@ -54,7 +54,7 @@ public JavaEvaluator(String id,
CellExecutor cellExecutor,
TempFolderFactory tempFolderFactory,
EvaluatorParameters evaluatorParameters,
BeakerClient beakerxClient) {
BeakerXClient beakerxClient) {
super(id, sId, cellExecutor, tempFolderFactory, evaluatorParameters, beakerxClient);
packageId = "com.twosigma.beaker.javash.bkr" + shellId.split("-")[0];
cps = new JavaClasspathScanner();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.twosigma.beakerx.kotlin.evaluator;

import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.TryResult;
import com.twosigma.beakerx.autocomplete.AutocompleteResult;
import com.twosigma.beakerx.autocomplete.ClasspathScanner;
Expand Down Expand Up @@ -52,11 +52,11 @@ public class KotlinEvaluator extends BaseEvaluator {
private ReplClassLoader loader = null;
private BeakerXUrlClassLoader kotlinClassLoader;

public KotlinEvaluator(String id, String sId, EvaluatorParameters evaluatorParameters, BeakerClient beakerxClient) {
public KotlinEvaluator(String id, String sId, EvaluatorParameters evaluatorParameters, BeakerXClient beakerxClient) {
this(id, sId, new BeakerCellExecutor("kotlin"), new TempFolderFactoryImpl(), evaluatorParameters, beakerxClient);
}

public KotlinEvaluator(String id, String sId, CellExecutor cellExecutor, TempFolderFactory tempFolderFactory, EvaluatorParameters evaluatorParameters, BeakerClient beakerxClient) {
public KotlinEvaluator(String id, String sId, CellExecutor cellExecutor, TempFolderFactory tempFolderFactory, EvaluatorParameters evaluatorParameters, BeakerXClient beakerxClient) {
super(id, sId, cellExecutor, tempFolderFactory, evaluatorParameters, beakerxClient);
cps = new ClasspathScanner();
createRepl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.twosigma.beakerx.scala.evaluator;

import com.google.inject.Provider;
import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.TryResult;
import com.twosigma.beakerx.autocomplete.AutocompleteResult;
import com.twosigma.beakerx.evaluator.BaseEvaluator;
Expand Down Expand Up @@ -56,7 +56,7 @@ public class ScalaEvaluator extends BaseEvaluator {
private BeakerXUrlClassLoader classLoader;
private ScalaEvaluatorGlue shell;

public ScalaEvaluator(String id, String sId, Provider<BeakerObjectConverter> osp, EvaluatorParameters evaluatorParameters, BeakerClient beakerxClient) {
public ScalaEvaluator(String id, String sId, Provider<BeakerObjectConverter> osp, EvaluatorParameters evaluatorParameters, BeakerXClient beakerxClient) {
this(id,
sId,
osp,
Expand All @@ -67,7 +67,7 @@ public ScalaEvaluator(String id, String sId, Provider<BeakerObjectConverter> osp
beakerxClient);
}

public ScalaEvaluator(String id, String sId, Provider<BeakerObjectConverter> osp, CellExecutor cellExecutor, BeakerxObjectFactory beakerxObjectFactory, TempFolderFactory tempFolderFactory, EvaluatorParameters evaluatorParameters, BeakerClient beakerxClient) {
public ScalaEvaluator(String id, String sId, Provider<BeakerObjectConverter> osp, CellExecutor cellExecutor, BeakerxObjectFactory beakerxObjectFactory, TempFolderFactory tempFolderFactory, EvaluatorParameters evaluatorParameters, BeakerXClient beakerxClient) {
super(id, sId, cellExecutor, tempFolderFactory, evaluatorParameters, beakerxClient);
this.objectSerializerProvider = osp;
this.beakerxObjectFactory = beakerxObjectFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.twosigma.beakerx.sql;

import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;

import java.io.IOException;
import java.sql.SQLException;
Expand All @@ -41,7 +41,7 @@ public class BeakerParser {

protected final JDBCClient jdbcClient;

private BeakerClient client;
private BeakerXClient client;
private ConnectionStringHolder dbURI;
private Map<String, String> inputs = new HashMap<>();
private Set<String> outputs = new HashSet<>();
Expand All @@ -50,7 +50,7 @@ public class BeakerParser {

private List<BeakerParseResult> results = new ArrayList<>();

public BeakerParser(String script, BeakerClient client, ConnectionStringHolder defaultConnectionString, Map<String, ConnectionStringHolder> namedConnectionString, JDBCClient jdbcClient) throws IOException, DBConnectionException {
public BeakerParser(String script, BeakerXClient client, ConnectionStringHolder defaultConnectionString, Map<String, ConnectionStringHolder> namedConnectionString, JDBCClient jdbcClient) throws IOException, DBConnectionException {
this.client = client;
this.jdbcClient = jdbcClient;
this.defaultConnectionString = defaultConnectionString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.twosigma.beakerx.sql;

import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.jvm.object.OutputCell;
import com.twosigma.beakerx.jvm.object.OutputContainer;
import com.twosigma.beakerx.table.TableDisplay;
Expand Down Expand Up @@ -47,7 +47,7 @@ public QueryExecutor(JDBCClient jdbcClient) {
this.jdbcClient = jdbcClient;
}

public synchronized Object executeQuery(String script, BeakerClient namespaceClient, ConnectionStringHolder defaultConnectionString, Map<String, ConnectionStringHolder> namedConnectionString)
public synchronized Object executeQuery(String script, BeakerXClient namespaceClient, ConnectionStringHolder defaultConnectionString, Map<String, ConnectionStringHolder> namedConnectionString)
throws SQLException, IOException, ReadVariableException {

BeakerParser beakerParser = new BeakerParser(script, namespaceClient, defaultConnectionString, namedConnectionString, jdbcClient);
Expand Down Expand Up @@ -183,7 +183,7 @@ private void adoptResult(BeakerParseResult queryLine, QueryResult queryResult, L
}
}

private QueryResult executeQuery(int currentIterationIndex, BeakerParseResult queryLine, Connection conn, BeakerClient namespaceClient) throws SQLException, ReadVariableException {
private QueryResult executeQuery(int currentIterationIndex, BeakerParseResult queryLine, Connection conn, BeakerXClient namespaceClient) throws SQLException, ReadVariableException {

QueryResult queryResult = new QueryResult();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.twosigma.beakerx.sql.autocomplete.db;

import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.BeakerxClientManager;
import com.twosigma.beakerx.sql.BeakerParser;
import com.twosigma.beakerx.sql.ConnectionStringHolder;
Expand All @@ -40,7 +40,7 @@ public class DbExplorerFactory {
public static DbInfo getDbInfo(String txt, JDBCClient jdbcClient, String sessionId,
ConnectionStringHolder defaultConnectionString, Map<String, ConnectionStringHolder> namedConnectionString) {

final BeakerClient namespaceClient = BeakerxClientManager.get();
final BeakerXClient namespaceClient = BeakerxClientManager.get();
final BeakerParser beakerParser;
try {
beakerParser = new BeakerParser(txt, namespaceClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.twosigma.beakerx.sql.evaluator;

import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.TryResult;
import com.twosigma.beakerx.jvm.object.SimpleEvaluationObject;
import com.twosigma.beakerx.sql.ReadVariableException;
Expand All @@ -33,9 +33,9 @@ class SQLCodeRunner implements Callable<TryResult> {

private SQLEvaluator sqlEvaluator;
private final SimpleEvaluationObject simpleEvaluationObject;
private final BeakerClient namespaceClient;
private final BeakerXClient namespaceClient;

SQLCodeRunner(SQLEvaluator sqlEvaluator, SimpleEvaluationObject seo, BeakerClient namespaceClient) {
SQLCodeRunner(SQLEvaluator sqlEvaluator, SimpleEvaluationObject seo, BeakerXClient namespaceClient) {
this.sqlEvaluator = sqlEvaluator;
this.simpleEvaluationObject = seo;
this.namespaceClient = namespaceClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.twosigma.beakerx.sql.evaluator;


import com.twosigma.beakerx.BeakerClient;
import com.twosigma.beakerx.BeakerXClient;
import com.twosigma.beakerx.TryResult;
import com.twosigma.beakerx.autocomplete.AutocompleteResult;
import com.twosigma.beakerx.autocomplete.ClasspathScanner;
Expand Down Expand Up @@ -68,11 +68,11 @@ public class SQLEvaluator extends BaseEvaluator {
private JDBCClient jdbcClient;
private DynamicClassLoaderSimple loader;

public SQLEvaluator(String id, String sId, EvaluatorParameters evaluatorParameters, BeakerClient beakerxClient) {
public SQLEvaluator(String id, String sId, EvaluatorParameters evaluatorParameters, BeakerXClient beakerxClient) {
this(id, sId, new BeakerCellExecutor("sql"), new TempFolderFactoryImpl(), evaluatorParameters, beakerxClient);
}

public SQLEvaluator(String id, String sId, CellExecutor cellExecutor, TempFolderFactory tempFolderFactory, EvaluatorParameters evaluatorParameters, BeakerClient beakerxClient) {
public SQLEvaluator(String id, String sId, CellExecutor cellExecutor, TempFolderFactory tempFolderFactory, EvaluatorParameters evaluatorParameters, BeakerXClient beakerxClient) {
super(id, sId, cellExecutor, tempFolderFactory, evaluatorParameters, beakerxClient);
packageId = "com.twosigma.beaker.sql.bkr" + shellId.split("-")[0];
cps = new ClasspathScanner();
Expand Down Expand Up @@ -241,7 +241,7 @@ public List<ConnectionStringBean> getListOfConnectiononWhoNeedDialog() {
return ret;
}

public Object executeQuery(String expression, BeakerClient namespaceClient, ConnectionStringHolder defaultConnectionString, Map<String, ConnectionStringHolder> namedConnectionString) throws SQLException, IOException, ReadVariableException {
public Object executeQuery(String expression, BeakerXClient namespaceClient, ConnectionStringHolder defaultConnectionString, Map<String, ConnectionStringHolder> namedConnectionString) throws SQLException, IOException, ReadVariableException {
return queryExecutor.executeQuery(expression, namespaceClient, defaultConnectionString, namedConnectionString);
}

Expand Down
Loading

0 comments on commit 3f05a8f

Please sign in to comment.