org.apache.cassandra.cql3.QueryProcessor.processStatement()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(53)

本文整理了Java中org.apache.cassandra.cql3.QueryProcessor.processStatement方法的一些代码示例,展示了QueryProcessor.processStatement的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryProcessor.processStatement方法的具体详情如下:
包路径:org.apache.cassandra.cql3.QueryProcessor
类名称:QueryProcessor
方法名:processStatement

QueryProcessor.processStatement介绍

暂无

代码示例

代码示例来源:origin: jsevellec/cassandra-unit

public ResultMessage processPrepared(CQLStatement statement, QueryState queryState, QueryOptions options, long queryStartNanoTime)
throws RequestExecutionException, RequestValidationException
{
  List<ByteBuffer> variables = options.getValues();
  // Check to see if there are any bound variables to verify
  if (!(variables.isEmpty() && (statement.getBoundTerms() == 0)))
  {
    if (variables.size() != statement.getBoundTerms())
      throw new InvalidRequestException(String.format("there were %d markers(?) in CQL but %d bound variables",
                              statement.getBoundTerms(),
                              variables.size()));
    // at this point there is a match in count between markers and variables that is non-zero
    if (logger.isTraceEnabled())
      for (int i = 0; i < variables.size(); i++)
        logger.trace("[{}] '{}'", i+1, variables.get(i));
  }
  metrics.preparedStatementsExecuted.inc();
  return processStatement(statement, queryState, options, queryStartNanoTime);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public ResultMessage processPrepared(CQLStatement statement, QueryState queryState, QueryOptions options, long queryStartNanoTime)
throws RequestExecutionException, RequestValidationException
{
  List<ByteBuffer> variables = options.getValues();
  // Check to see if there are any bound variables to verify
  if (!(variables.isEmpty() && (statement.getBoundTerms() == 0)))
  {
    if (variables.size() != statement.getBoundTerms())
      throw new InvalidRequestException(String.format("there were %d markers(?) in CQL but %d bound variables",
                              statement.getBoundTerms(),
                              variables.size()));
    // at this point there is a match in count between markers and variables that is non-zero
    if (logger.isTraceEnabled())
      for (int i = 0; i < variables.size(); i++)
        logger.trace("[{}] '{}'", i+1, variables.get(i));
  }
  metrics.preparedStatementsExecuted.inc();
  return processStatement(statement, queryState, options, queryStartNanoTime);
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public ResultMessage processPrepared(CQLStatement statement, QueryState queryState, QueryOptions options, long queryStartNanoTime)
throws RequestExecutionException, RequestValidationException
{
  List<ByteBuffer> variables = options.getValues();
  // Check to see if there are any bound variables to verify
  if (!(variables.isEmpty() && (statement.getBoundTerms() == 0)))
  {
    if (variables.size() != statement.getBoundTerms())
      throw new InvalidRequestException(String.format("there were %d markers(?) in CQL but %d bound variables",
                              statement.getBoundTerms(),
                              variables.size()));
    // at this point there is a match in count between markers and variables that is non-zero
    if (logger.isTraceEnabled())
      for (int i = 0; i < variables.size(); i++)
        logger.trace("[{}] '{}'", i+1, variables.get(i));
  }
  metrics.preparedStatementsExecuted.inc();
  return processStatement(statement, queryState, options, queryStartNanoTime);
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

public ResultMessage processPrepared(CQLStatement statement, QueryState queryState, QueryOptions options)
throws RequestExecutionException, RequestValidationException
{
  List<ByteBuffer> variables = options.getValues();
  // Check to see if there are any bound variables to verify
  if (!(variables.isEmpty() && (statement.getBoundTerms() == 0)))
  {
    if (variables.size() != statement.getBoundTerms())
      throw new InvalidRequestException(String.format("there were %d markers(?) in CQL but %d bound variables",
                              statement.getBoundTerms(),
                              variables.size()));
    // at this point there is a match in count between markers and variables that is non-zero
    if (logger.isTraceEnabled())
      for (int i = 0; i < variables.size(); i++)
        logger.trace("[{}] '{}'", i+1, variables.get(i));
  }
  metrics.preparedStatementsExecuted.inc();
  return processStatement(statement, queryState, options);
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public ResultMessage process(String queryString, QueryState queryState, QueryOptions options, long queryStartNanoTime)
throws RequestExecutionException, RequestValidationException
{
  ParsedStatement.Prepared p = getStatement(queryString, queryState.getClientState());
  options.prepare(p.boundNames);
  CQLStatement prepared = p.statement;
  if (prepared.getBoundTerms() != options.getValues().size())
    throw new InvalidRequestException("Invalid amount of bind variables");
  if (!queryState.getClientState().isInternal)
    metrics.regularStatementsExecuted.inc();
  return processStatement(prepared, queryState, options, queryStartNanoTime);
}

代码示例来源:origin: jsevellec/cassandra-unit

public ResultMessage process(String queryString, QueryState queryState, QueryOptions options, long queryStartNanoTime)
throws RequestExecutionException, RequestValidationException
{
  ParsedStatement.Prepared p = getStatement(queryString, queryState.getClientState());
  options.prepare(p.boundNames);
  CQLStatement prepared = p.statement;
  if (prepared.getBoundTerms() != options.getValues().size())
    throw new InvalidRequestException("Invalid amount of bind variables");
  if (!queryState.getClientState().isInternal)
    metrics.regularStatementsExecuted.inc();
  return processStatement(prepared, queryState, options, queryStartNanoTime);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public ResultMessage process(String queryString, QueryState queryState, QueryOptions options, long queryStartNanoTime)
throws RequestExecutionException, RequestValidationException
{
  ParsedStatement.Prepared p = getStatement(queryString, queryState.getClientState());
  options.prepare(p.boundNames);
  CQLStatement prepared = p.statement;
  if (prepared.getBoundTerms() != options.getValues().size())
    throw new InvalidRequestException("Invalid amount of bind variables");
  if (!queryState.getClientState().isInternal)
    metrics.regularStatementsExecuted.inc();
  return processStatement(prepared, queryState, options, queryStartNanoTime);
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

public ResultMessage process(String queryString, QueryState queryState, QueryOptions options)
throws RequestExecutionException, RequestValidationException
{
  ParsedStatement.Prepared p = getStatement(queryString, queryState.getClientState());
  options.prepare(p.boundNames);
  CQLStatement prepared = p.statement;
  if (prepared.getBoundTerms() != options.getValues().size())
    throw new InvalidRequestException("Invalid amount of bind variables");
  if (!queryState.getClientState().isInternal)
    metrics.regularStatementsExecuted.inc();
  return processStatement(prepared, queryState, options);
}

相关文章

微信公众号

最新文章

更多