当前位置: 首页>>代码示例>>Java>>正文


Java Interpreter.open方法代码示例

本文整理汇总了Java中org.apache.zeppelin.interpreter.Interpreter.open方法的典型用法代码示例。如果您正苦于以下问题:Java Interpreter.open方法的具体用法?Java Interpreter.open怎么用?Java Interpreter.open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.zeppelin.interpreter.Interpreter的用法示例。


在下文中一共展示了Interpreter.open方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: should_describe_aggregate

import org.apache.zeppelin.interpreter.Interpreter; //导入方法依赖的package包/类
@Test
@Ignore
//TODO activate test when using Java 8 and C* 3.x
public void should_describe_aggregate() throws Exception {
    //Given
    Properties properties = new Properties();
    properties.setProperty(CASSANDRA_HOSTS, "127.0.0.1");
    properties.setProperty(CASSANDRA_PORT,  "9042");
    Interpreter interpreter = new CassandraInterpreter(properties);
    interpreter.open();

    final String query = "DESCRIBE AGGREGATES;";

    //When
    final InterpreterResult actual = interpreter.interpret(query, intrContext);

    //Then
    assertThat(actual.code()).isEqualTo(Code.SUCCESS);

}
 
开发者ID:apache,项目名称:zeppelin,代码行数:21,代码来源:CassandraInterpreterTest.java

示例2: should_describe_materialized_view

import org.apache.zeppelin.interpreter.Interpreter; //导入方法依赖的package包/类
@Test
@Ignore
//TODO activate test when using Java 8 and C* 3.x
public void should_describe_materialized_view() throws Exception {
    //Given
    Properties properties = new Properties();
    properties.setProperty(CASSANDRA_HOSTS, "127.0.0.1");
    properties.setProperty(CASSANDRA_PORT,  "9042");
    Interpreter interpreter = new CassandraInterpreter(properties);
    interpreter.open();

    final String query = "DESCRIBE MATERIALIZED VIEWS;";

    //When
    final InterpreterResult actual = interpreter.interpret(query, intrContext);

    //Then
    assertThat(actual.code()).isEqualTo(Code.SUCCESS);
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:20,代码来源:CassandraInterpreterTest.java

示例3: open

import org.apache.zeppelin.interpreter.Interpreter; //导入方法依赖的package包/类
@Override
public void open(String sessionId, String className) throws TException {
  logger.info(String.format("Open Interpreter %s for session %s ", className, sessionId));
  Interpreter intp = getInterpreter(sessionId, className);
  try {
    intp.open();
  } catch (InterpreterException e) {
    throw new TException("Fail to open interpreter", e);
  }
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:11,代码来源:RemoteInterpreterServer.java

示例4: should_describe_function

import org.apache.zeppelin.interpreter.Interpreter; //导入方法依赖的package包/类
@Test
@Ignore
//TODO activate test when using Java 8 and C* 3.x
public void should_describe_function() throws Exception {
    //Given
    Properties properties = new Properties();
    properties.setProperty(CASSANDRA_HOSTS, "127.0.0.1");
    properties.setProperty(CASSANDRA_PORT,  "9042");
    Interpreter interpreter = new CassandraInterpreter(properties);
    interpreter.open();

    String createFunction = "CREATE FUNCTION zeppelin.maxof(val1 int,val2 int) " +
            "RETURNS NULL ON NULL INPUT " +
            "RETURNS int " +
            "LANGUAGE java " +
            "AS $$" +
            "    return Math.max(val1, val2);\n" +
            "$$;";
    interpreter.interpret(createFunction, intrContext);
    String query = "DESCRIBE FUNCTION zeppelin.maxOf;";

    //When
    final InterpreterResult actual = interpreter.interpret(query, intrContext);

    //Then
    assertThat(actual.code()).isEqualTo(Code.SUCCESS);
    assertThat(actual.message()).isEqualTo("xxxxx");
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:29,代码来源:CassandraInterpreterTest.java

示例5: open

import org.apache.zeppelin.interpreter.Interpreter; //导入方法依赖的package包/类
@Override
public void open(String className) throws TException {
  Interpreter intp = getInterpreter(className);
  intp.open();
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:6,代码来源:RemoteInterpreterServer.java


注:本文中的org.apache.zeppelin.interpreter.Interpreter.open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。