com.datastax.driver.core.RegularStatement.getRoutingKey()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(85)

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

RegularStatement.getRoutingKey介绍

暂无

代码示例

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

/**
 * Returns the first non-null routing key of the statements in this batch or null otherwise.
 *
 * @return the routing key for this batch statement.
 */
@Override
public ByteBuffer getRoutingKey(ProtocolVersion protocolVersion, CodecRegistry codecRegistry) {
 for (RegularStatement statement : statements) {
  ByteBuffer routingKey = statement.getRoutingKey(protocolVersion, codecRegistry);
  if (routingKey != null) {
   return routingKey;
  }
 }
 return null;
}

代码示例来源:origin: com.yugabyte/cassandra-driver-core

/**
 * Returns the first non-null routing key of the statements in this batch
 * or null otherwise.
 *
 * @return the routing key for this batch statement.
 */
@Override
public ByteBuffer getRoutingKey(ProtocolVersion protocolVersion, CodecRegistry codecRegistry) {
  for (RegularStatement statement : statements) {
    ByteBuffer routingKey = statement.getRoutingKey(protocolVersion, codecRegistry);
    if (routingKey != null) {
      return routingKey;
    }
  }
  return null;
}

代码示例来源:origin: io.prestosql.cassandra/cassandra-driver

/**
 * Returns the first non-null routing key of the statements in this batch
 * or null otherwise.
 *
 * @return the routing key for this batch statement.
 */
@Override
public ByteBuffer getRoutingKey(ProtocolVersion protocolVersion, CodecRegistry codecRegistry) {
  for (RegularStatement statement : statements) {
    ByteBuffer routingKey = statement.getRoutingKey(protocolVersion, codecRegistry);
    if (routingKey != null) {
      return routingKey;
    }
  }
  return null;
}

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

/**
 * Returns the first non-null routing key of the statements in this batch
 * or null otherwise.
 *
 * @return the routing key for this batch statement.
 */
@Override
public ByteBuffer getRoutingKey(ProtocolVersion protocolVersion, CodecRegistry codecRegistry) {
  for (RegularStatement statement : statements) {
    ByteBuffer routingKey = statement.getRoutingKey(protocolVersion, codecRegistry);
    if (routingKey != null) {
      return routingKey;
    }
  }
  return null;
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

@Override
 public PreparedStatement apply(PreparedStatement prepared) {
  ProtocolVersion protocolVersion =
    getCluster().getConfiguration().getProtocolOptions().getProtocolVersion();
  ByteBuffer routingKey = statement.getRoutingKey(protocolVersion, codecRegistry);
  if (routingKey != null) prepared.setRoutingKey(routingKey);
  if (statement.getConsistencyLevel() != null)
   prepared.setConsistencyLevel(statement.getConsistencyLevel());
  if (statement.getSerialConsistencyLevel() != null)
   prepared.setSerialConsistencyLevel(statement.getSerialConsistencyLevel());
  if (statement.isTracing()) prepared.enableTracing();
  prepared.setRetryPolicy(statement.getRetryPolicy());
  prepared.setOutgoingPayload(statement.getOutgoingPayload());
  prepared.setIdempotent(statement.isIdempotent());
  return prepared;
 }
});

代码示例来源:origin: com.stratio.cassandra/cassandra-driver-core

/**
 * Adds a new statement to this batch.
 *
 * @param statement the new statement to add.
 * @return this batch.
 *
 * @throws IllegalArgumentException if counter and non-counter operations
 * are mixed.
 */
public Batch add(RegularStatement statement) {
  boolean isCounterOp = statement instanceof BuiltStatement && ((BuiltStatement) statement).isCounterOp();
  if (this.isCounterOp == null)
    setCounterOp(isCounterOp);
  else if (isCounterOp() != isCounterOp)
    throw new IllegalArgumentException("Cannot mix counter operations and non-counter operations in a batch statement");
  this.statements.add(statement);
  if (statement instanceof BuiltStatement)
    this.hasBindMarkers = ((BuiltStatement)statement).hasBindMarkers;
  else
    // For non-BuiltStatement, we cannot know if it includes a bind makers. So we assume it does.
    this.hasBindMarkers = true;
  checkForBindMarkers(null);
  if (routingKey == null && statement.getRoutingKey() != null)
    routingKey = statement.getRoutingKey();
  return this;
}

代码示例来源:origin: com.stratio.cassandra/cassandra-driver-core

@Override
  public PreparedStatement apply(PreparedStatement prepared) {
    ByteBuffer routingKey = statement.getRoutingKey();
    if (routingKey != null)
      prepared.setRoutingKey(routingKey);
    prepared.setConsistencyLevel(statement.getConsistencyLevel());
    if (statement.isTracing())
      prepared.enableTracing();
    prepared.setRetryPolicy(statement.getRetryPolicy());
    return prepared;
  }
});

代码示例来源:origin: io.prestosql.cassandra/cassandra-driver

@Override
  public PreparedStatement apply(PreparedStatement prepared) {
    ProtocolVersion protocolVersion = getCluster().getConfiguration().getProtocolOptions().getProtocolVersion();
    ByteBuffer routingKey = statement.getRoutingKey(protocolVersion, codecRegistry);
    if (routingKey != null)
      prepared.setRoutingKey(routingKey);
    if (statement.getConsistencyLevel() != null)
      prepared.setConsistencyLevel(statement.getConsistencyLevel());
    if (statement.getSerialConsistencyLevel() != null)
      prepared.setSerialConsistencyLevel(statement.getSerialConsistencyLevel());
    if (statement.isTracing())
      prepared.enableTracing();
    prepared.setRetryPolicy(statement.getRetryPolicy());
    prepared.setOutgoingPayload(statement.getOutgoingPayload());
    prepared.setIdempotent(statement.isIdempotent());
    return prepared;
  }
});

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

@Override
  public PreparedStatement apply(PreparedStatement prepared) {
    ProtocolVersion protocolVersion = getCluster().getConfiguration().getProtocolOptions().getProtocolVersion();
    ByteBuffer routingKey = statement.getRoutingKey(protocolVersion, codecRegistry);
    if (routingKey != null)
      prepared.setRoutingKey(routingKey);
    if (statement.getConsistencyLevel() != null)
      prepared.setConsistencyLevel(statement.getConsistencyLevel());
    if (statement.getSerialConsistencyLevel() != null)
      prepared.setSerialConsistencyLevel(statement.getSerialConsistencyLevel());
    if (statement.isTracing())
      prepared.enableTracing();
    prepared.setRetryPolicy(statement.getRetryPolicy());
    prepared.setOutgoingPayload(statement.getOutgoingPayload());
    prepared.setIdempotent(statement.isIdempotent());
    return prepared;
  }
});

代码示例来源:origin: com.yugabyte/cassandra-driver-core

@Override
  public PreparedStatement apply(PreparedStatement prepared) {
    ProtocolVersion protocolVersion = getCluster().getConfiguration().getProtocolOptions().getProtocolVersion();
    ByteBuffer routingKey = statement.getRoutingKey(protocolVersion, codecRegistry);
    if (routingKey != null)
      prepared.setRoutingKey(routingKey);
    if (statement.getConsistencyLevel() != null)
      prepared.setConsistencyLevel(statement.getConsistencyLevel());
    if (statement.getSerialConsistencyLevel() != null)
      prepared.setSerialConsistencyLevel(statement.getSerialConsistencyLevel());
    if (statement.isTracing())
      prepared.enableTracing();
    prepared.setRetryPolicy(statement.getRetryPolicy());
    prepared.setOutgoingPayload(statement.getOutgoingPayload());
    prepared.setIdempotent(statement.isIdempotent());
    return prepared;
  }
});

相关文章