java 驱动程序显示一致性级别为 null
java driver showing consistency level as null
在我的 Cassandra Java 驱动程序代码中,我正在创建一个查询,然后打印查询的一致性级别
val whereClause = whereConditions(tablename, id); cassandraRepositoryLogger.trace("getRowsByPartitionKeyId: looking in table "+tablename+" with partition key "+partitionKeyColumns +" and values "+whereClause +" fetch size "+fetchSize)
cassandraRepositoryLogger.trace("where clause is "+whereClause)
cassandraRepositoryLogger.trace(s"consistency level ${whereClause.getConsistencyLevel}")
但打印显示一致性级别为空。为什么?默认不应该是一吗?
2020-06-10 07:16:44,146 [TRACE] from repository.UsersRepository in scala-execution-context-global-115 - where clause is SELECT * FROM users WHERE bucket=109 AND email='manu.chadha@hotmail.com';
2020-06-10 07:16:44,146 [TRACE] from repository.UsersRepository in scala-execution-context-global-115 - getOneRowByPartitionKeyId: looking in table users with partition key List(bucket, email) and values SELECT * FROM users WHERE bucket=109 AND email='manu.chadha@hotmail.com';
2020-06-10 07:16:44,146 [TRACE] from repository.UsersRepository in scala-execution-context-global-115 - consistency level null <-- Why is this null?
查询是否构建如下
def whereConditions(tableName:String,id: UserKeys):Where= {
QueryBuilder.select().from(tableName).where(QueryBuilder.eq("bucket", id.bucket))
.and(QueryBuilder.eq("email", id.email))
}
getConsistencyLevel 方法是这样实现的。此方法 returns 查询的一致性级别,如果未使用 setConsistencyLevel 设置一致性级别,则为 null。
在我的 Cassandra Java 驱动程序代码中,我正在创建一个查询,然后打印查询的一致性级别
val whereClause = whereConditions(tablename, id); cassandraRepositoryLogger.trace("getRowsByPartitionKeyId: looking in table "+tablename+" with partition key "+partitionKeyColumns +" and values "+whereClause +" fetch size "+fetchSize)
cassandraRepositoryLogger.trace("where clause is "+whereClause)
cassandraRepositoryLogger.trace(s"consistency level ${whereClause.getConsistencyLevel}")
但打印显示一致性级别为空。为什么?默认不应该是一吗?
2020-06-10 07:16:44,146 [TRACE] from repository.UsersRepository in scala-execution-context-global-115 - where clause is SELECT * FROM users WHERE bucket=109 AND email='manu.chadha@hotmail.com';
2020-06-10 07:16:44,146 [TRACE] from repository.UsersRepository in scala-execution-context-global-115 - getOneRowByPartitionKeyId: looking in table users with partition key List(bucket, email) and values SELECT * FROM users WHERE bucket=109 AND email='manu.chadha@hotmail.com';
2020-06-10 07:16:44,146 [TRACE] from repository.UsersRepository in scala-execution-context-global-115 - consistency level null <-- Why is this null?
查询是否构建如下
def whereConditions(tableName:String,id: UserKeys):Where= {
QueryBuilder.select().from(tableName).where(QueryBuilder.eq("bucket", id.bucket))
.and(QueryBuilder.eq("email", id.email))
}
getConsistencyLevel 方法是这样实现的。此方法 returns 查询的一致性级别,如果未使用 setConsistencyLevel 设置一致性级别,则为 null。