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

x33g5p2x  于2022-01-24 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(141)

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

Metadata.tokenFactory介绍

暂无

代码示例

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

(session == null) ? null : session.getCluster().manager.metadata.tokenFactory();

代码示例来源:origin: com.datastax.spark/spark-cassandra-connector_2.10

/**
   * Builds a new {@link Token} from a partition key, according to the partitioner reported by the Cassandra nodes.
   *
   * @param metadata               the original driver's metadata.
   * @param routingKey             the routing key of the bound partition key
   * @return the token.
   * @throws IllegalStateException if the token factory was not initialized. This would typically
   *                               happen if metadata was explicitly disabled with {@link QueryOptions#setMetadataEnabled(boolean)}
   *                               before startup.
   */
  public static Token newToken(Metadata metadata, ByteBuffer routingKey) {
    return metadata.tokenFactory().hash(routingKey);
  }
}

代码示例来源:origin: com.datastax.spark/spark-cassandra-connector

/**
   * Builds a new {@link Token} from a partition key, according to the partitioner reported by the Cassandra nodes.
   *
   * @param metadata               the original driver's metadata.
   * @param routingKey             the routing key of the bound partition key
   * @return the token.
   * @throws IllegalStateException if the token factory was not initialized. This would typically
   *                               happen if metadata was explicitly disabled with {@link QueryOptions#setMetadataEnabled(boolean)}
   *                               before startup.
   */
  public static Token newToken(Metadata metadata, ByteBuffer routingKey) {
    return metadata.tokenFactory().hash(routingKey);
  }
}

代码示例来源:origin: com.datastax.spark/spark-cassandra-connector-unshaded

/**
   * Builds a new {@link Token} from a partition key, according to the partitioner reported by the Cassandra nodes.
   *
   * @param metadata               the original driver's metadata.
   * @param routingKey             the routing key of the bound partition key
   * @return the token.
   * @throws IllegalStateException if the token factory was not initialized. This would typically
   *                               happen if metadata was explicitly disabled with {@link QueryOptions#setMetadataEnabled(boolean)}
   *                               before startup.
   */
  public static Token newToken(Metadata metadata, ByteBuffer routingKey) {
    return metadata.tokenFactory().hash(routingKey);
  }
}

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

: session.getCluster().manager.metadata.tokenFactory();

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

: session.getCluster().manager.metadata.tokenFactory();

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

: session.getCluster().manager.metadata.tokenFactory();

相关文章