• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java QueryState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.calcite.avatica.QueryState的典型用法代码示例。如果您正苦于以下问题:Java QueryState类的具体用法?Java QueryState怎么用?Java QueryState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



QueryState类属于org.apache.calcite.avatica包,在下文中一共展示了QueryState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: syncResults

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
public boolean syncResults(StatementHandle sh, QueryState state, long offset)
    throws NoSuchStatementException {
  try {
    final Connection conn = getConnection(sh.connectionId);
    final StatementInfo info = statementCache.getIfPresent(sh.id);
    if (null == info) {
      throw new NoSuchStatementException(sh);
    }
    final Statement statement = info.statement;
    // Let the state recreate the necessary ResultSet on the Statement
    info.setResultSet(state.invoke(conn, statement));

    if (null != info.getResultSet()) {
      // If it is non-null, try to advance to the requested offset.
      return info.advanceResultSetToOffset(info.getResultSet(), offset);
    }

    // No results, nothing to do. Client can move on.
    return false;
  } catch (SQLException e) {
    throw propagate(e);
  }
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:24,代码来源:JdbcMeta.java


示例2: create

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
@Override public ResultSet create(AvaticaType elementType, Iterable<Object> elements) {
  // The ColumnMetaData for offset "1" in the ResultSet for an Array.
  ScalarType arrayOffsetType = ColumnMetaData.scalar(Types.INTEGER, "INTEGER", Rep.PRIMITIVE_INT);
  // Two columns (types) in the ResultSet we will create
  List<ColumnMetaData> types = Arrays.asList(ColumnMetaData.dummy(arrayOffsetType, false),
      ColumnMetaData.dummy(elementType, true));
  List<List<Object>> rows = createResultSetRowsForArrayData(elements);
  // `(List<Object>) rows` is a compile error.
  @SuppressWarnings({ "unchecked", "rawtypes" })
  List<Object> untypedRows = (List<Object>) ((List) rows);
  try (ListIteratorCursor cursor = new ListIteratorCursor(rows.iterator())) {
    final String sql = "MOCKED";
    QueryState state = new QueryState(sql);
    Meta.Signature signature = new Meta.Signature(types, sql,
        Collections.<AvaticaParameter>emptyList(), Collections.<String, Object>emptyMap(),
        Meta.CursorFactory.LIST, Meta.StatementType.SELECT);
    AvaticaResultSetMetaData resultSetMetaData = new AvaticaResultSetMetaData(null, sql,
        signature);
    Meta.Frame frame = new Meta.Frame(0, true, untypedRows);
    AvaticaResultSet resultSet = new AvaticaResultSet(null, state, signature, resultSetMetaData,
        timeZone, frame);
    resultSet.execute2(cursor, types);
    return resultSet;
  }
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:26,代码来源:ArrayFactoryImpl.java


示例3: syncResults

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
@Override public boolean syncResults(final StatementHandle h, final QueryState state,
    final long offset) throws NoSuchStatementException {
  try {
    return connection.invokeWithRetries(
        new CallableWithoutException<Boolean>() {
          public Boolean call() {
            final Service.SyncResultsResponse response =
                service.apply(
                    new Service.SyncResultsRequest(h.connectionId, h.id, state, offset));
            if (response.missingStatement) {
              throw new RuntimeException(new NoSuchStatementException(h));
            }
            return response.moreResults;
          }
        });
  } catch (RuntimeException e) {
    Throwable cause = e.getCause();
    if (cause instanceof NoSuchStatementException) {
      throw (NoSuchStatementException) cause;
    }
    throw e;
  }
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:24,代码来源:RemoteMeta.java


示例4: SyncResultsRequest

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
public SyncResultsRequest(@JsonProperty("connectionId") String connectionId,
    @JsonProperty("statementId") int statementId, @JsonProperty("state") QueryState state,
    @JsonProperty("offset") long offset) {
  this.connectionId = connectionId;
  this.statementId = statementId;
  this.state = state;
  this.offset = offset;
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:9,代码来源:Service.java


示例5: deserialize

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
Request deserialize(Message genericMsg) {
  final Requests.SyncResultsRequest msg = ProtobufService.castProtobufMessage(genericMsg,
      Requests.SyncResultsRequest.class);

  String connectionId = null;
  if (msg.hasField(CONNECTION_ID_DESCRIPTOR)) {
    connectionId = msg.getConnectionId();
  }

  int statementId = 0;
  if (msg.hasField(STATEMENT_ID_DESCRIPTOR)) {
    statementId = msg.getStatementId();
  }

  Common.QueryState state = null;
  if (msg.hasField(STATE_DESCRIPTOR)) {
    state = msg.getState();
  }

  long offset = 0;
  if (msg.hasField(OFFSET_DESCRIPTOR)) {
    offset = msg.getOffset();
  }

  return new SyncResultsRequest(connectionId, statementId,
      null == state ? null : QueryState.fromProto(msg.getState()), offset);
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:28,代码来源:Service.java


示例6: getMetadataQueryState1

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
private static QueryState getMetadataQueryState1() {
  return new QueryState(MetaDataOperation.GET_COLUMNS, new Object[] {
    "",
    null,
    "%",
    "%"
  });
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:9,代码来源:ProtobufTranslationImplTest.java


示例7: DremioResultSetImpl

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
DremioResultSetImpl(AvaticaStatement statement, QueryState state,
                   Meta.Signature signature, ResultSetMetaData resultSetMetaData,
                   TimeZone timeZone, Meta.Frame firstFrame) {
  super(statement, state, signature, resultSetMetaData, timeZone, firstFrame);
  connection = (DremioConnectionImpl) statement.getConnection();
  client = connection.getClient();
  final int batchQueueThrottlingThreshold =
      client.getConfig().getInt(
          ExecConstants.JDBC_BATCH_QUEUE_THROTTLING_THRESHOLD );
  resultsListener = new ResultsListener(batchQueueThrottlingThreshold);
  batchLoader = new RecordBatchLoader(client.getAllocator());
  cursor = new DremioCursor(connection, statement, signature);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:14,代码来源:DremioResultSetImpl.java


示例8: newResultSet

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
@Override
public DremioResultSetImpl newResultSet(AvaticaStatement statement,
                                       QueryState state,
                                       Meta.Signature signature,
                                       TimeZone timeZone,
                                       Meta.Frame firstFrame) {
  final ResultSetMetaData metaData =
      newResultSetMetaData(statement, signature);
  return new DremioResultSetImpl(statement, state, signature, metaData, timeZone, firstFrame);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:11,代码来源:DremioJdbc41Factory.java


示例9: AtsdResultSet

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
public AtsdResultSet(AvaticaStatement statement, QueryState state, Signature signature,
					 ResultSetMetaData resultSetMetaData, TimeZone timeZone, Frame firstFrame) {
	super(statement, state, signature, resultSetMetaData, timeZone, firstFrame);
	final AtsdConnection connection = (AtsdConnection) statement.connection;
	this.meta = connection.getMeta();
	this.handle = statement.handle;
	this.context = meta.getContextFromMap(statement.handle);
	logger.trace("[ctor] {}", this.handle.id);
}
 
开发者ID:axibase,项目名称:atsd-jdbc,代码行数:10,代码来源:AtsdResultSet.java


示例10: newResultSet

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
public CalciteResultSet newResultSet(AvaticaStatement statement, QueryState state,
                                     Meta.Signature signature, TimeZone timeZone, Meta.Frame firstFrame) {
    final ResultSetMetaData metaData =
            newResultSetMetaData(statement, signature);
    final CalcitePrepare.CalciteSignature calciteSignature =
            (CalcitePrepare.CalciteSignature) signature;
    return new CalciteResultSet(statement, calciteSignature, metaData, timeZone,
            firstFrame);
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:10,代码来源:CalciteJdbc41Factory.java


示例11: newResultSet

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
@Override
public AvaticaResultSet newResultSet(AvaticaStatement statement,
                                     QueryState state,
                                     Meta.Signature signature,
                                     TimeZone timeZone,
                                     Meta.Frame firstFrame) {
  final ResultSetMetaData metaData =
      newResultSetMetaData(statement, signature);
  return new QuarkResultSet(statement, signature, metaData, timeZone,
      firstFrame);
}
 
开发者ID:qubole,项目名称:quark,代码行数:12,代码来源:QuarkJdbc41Factory.java


示例12: newResultSet

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
public CalciteResultSet newResultSet(AvaticaStatement statement, QueryState state,
    Meta.Signature signature, TimeZone timeZone, Meta.Frame firstFrame) {
  final ResultSetMetaData metaData =
      newResultSetMetaData(statement, signature);
  final CalcitePrepare.CalciteSignature calciteSignature =
      (CalcitePrepare.CalciteSignature) signature;
  return new CalciteResultSet(statement, calciteSignature, metaData, timeZone,
      firstFrame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:CalciteJdbc41Factory.java


示例13: createIterable

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
public Iterable<Object> createIterable(StatementHandle handle, QueryState state,
    Signature signature, List<TypedValue> parameterValues, Frame firstFrame) {
  return null;
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:5,代码来源:JdbcMeta.java


示例14: getSqlQueryState

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
private static QueryState getSqlQueryState() {
  return new QueryState("SELECT * from TABLE");
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:4,代码来源:ProtobufTranslationImplTest.java


示例15: getMetadataQueryState2

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
private static QueryState getMetadataQueryState2() {
  return new QueryState(MetaDataOperation.GET_CATALOGS, new Object[0]);
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:4,代码来源:ProtobufTranslationImplTest.java


示例16: syncResults

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
@Override
public boolean syncResults(StatementHandle sh, QueryState state, long offset) throws NoSuchStatementException {
  throw new UnsupportedOperationException();
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:5,代码来源:DremioMetaImpl.java


示例17: queryCompleted

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
@Override
public void queryCompleted(QueryResult.QueryState state) {
  logger.debug( "[#{}] Received query completion: {}.", instanceId, state );
  releaseIfFirst();
  completed = true;
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:7,代码来源:DremioResultSetImpl.java


示例18: createIterable

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
@Override
public Iterable<Object> createIterable(StatementHandle handle, QueryState state,
                                       Signature signature, List<TypedValue> parameterValues, Frame firstFrame) {
    // Drop QueryState
    return createIterableImpl(handle, signature, parameterValues, firstFrame);
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:7,代码来源:CalciteMetaImpl.java


示例19: syncResults

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
public boolean syncResults(StatementHandle h, QueryState state, long offset)
        throws NoSuchStatementException {
    // Doesn't have application in Calcite itself.
    throw new UnsupportedOperationException();
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:6,代码来源:CalciteMetaImpl.java


示例20: syncResults

import org.apache.calcite.avatica.QueryState; //导入依赖的package包/类
public boolean syncResults(StatementHandle h, QueryState state, long offset)
    throws NoSuchStatementException {
  // Doesn't have application in Calcite itself.
  throw new UnsupportedOperationException();
}
 
开发者ID:qubole,项目名称:quark,代码行数:6,代码来源:QuarkMetaImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RemoteConnection类代码示例发布时间:2022-05-23
下一篇:
Java Enumerator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap