public static Token newToken(Metadata metadata, ByteBuffer routingKey) {
        return metadata.tokenFactory().hash(routingKey);
    }
public static Token newToken ( Metadata metadata , ByteBuffer routingKey ) { return metadata . tokenFactory ( ) . hash ( routingKey ) ; }
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.