本文整理了Java中com.datastax.driver.core.Metadata.tokenFactory()
方法的一些代码示例,展示了Metadata.tokenFactory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Metadata.tokenFactory()
方法的具体详情如下:
包路径:com.datastax.driver.core.Metadata
类名称: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();
内容来源于网络,如有侵权,请联系作者删除!