本文整理汇总了Java中org.apache.cassandra.thrift.ThriftClientState.hasColumnFamilyAccess方法的典型用法代码示例。如果您正苦于以下问题:Java ThriftClientState.hasColumnFamilyAccess方法的具体用法?Java ThriftClientState.hasColumnFamilyAccess怎么用?Java ThriftClientState.hasColumnFamilyAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.thrift.ThriftClientState
的用法示例。
在下文中一共展示了ThriftClientState.hasColumnFamilyAccess方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareRowMutations
import org.apache.cassandra.thrift.ThriftClientState; //导入方法依赖的package包/类
public List<IMutation> prepareRowMutations(String keyspace, ThriftClientState clientState, Long timestamp, List<ByteBuffer> variables)
throws InvalidRequestException, UnauthorizedException
{
CFMetaData metadata = validateColumnFamily(keyspace, columnFamily);
clientState.hasColumnFamilyAccess(keyspace, columnFamily, Permission.MODIFY);
AbstractType<?> keyType = Schema.instance.getCFMetaData(keyspace, columnFamily).getKeyValidator();
List<IMutation> rowMutations = new ArrayList<IMutation>(keys.size());
for (Term key : keys)
{
rowMutations.add(mutationForKey(key.getByteBuffer(keyType, variables), keyspace, timestamp, clientState, variables, metadata));
}
return rowMutations;
}
示例2: prepareRowMutations
import org.apache.cassandra.thrift.ThriftClientState; //导入方法依赖的package包/类
/** {@inheritDoc} */
public List<IMutation> prepareRowMutations(String keyspace, ThriftClientState clientState, Long timestamp, List<ByteBuffer> variables)
throws InvalidRequestException, UnauthorizedException
{
boolean hasCommutativeOperation = false;
for (Map.Entry<Term, Operation> column : getColumns().entrySet())
{
if (!column.getValue().isUnary())
hasCommutativeOperation = true;
if (hasCommutativeOperation && column.getValue().isUnary())
throw new InvalidRequestException("Mix of commutative and non-commutative operations is not allowed.");
}
CFMetaData metadata = validateColumnFamily(keyspace, columnFamily, hasCommutativeOperation);
if (hasCommutativeOperation)
getConsistencyLevel().validateCounterForWrite(metadata);
QueryProcessor.validateKeyAlias(metadata, keyName);
clientState.hasColumnFamilyAccess(keyspace, columnFamily, Permission.MODIFY);
List<IMutation> mutations = new LinkedList<>();
for (Term key: keys)
mutations.add(mutationForKey(keyspace, key.getByteBuffer(getKeyType(keyspace),variables), metadata, timestamp, clientState, variables));
return mutations;
}
示例3: prepareRowMutations
import org.apache.cassandra.thrift.ThriftClientState; //导入方法依赖的package包/类
public List<IMutation> prepareRowMutations(String keyspace, ThriftClientState clientState, Long timestamp, List<ByteBuffer> variables)
throws InvalidRequestException, UnauthorizedException
{
CFMetaData metadata = validateColumnFamily(keyspace, columnFamily);
clientState.hasColumnFamilyAccess(keyspace, columnFamily, Permission.MODIFY);
AbstractType<?> keyType = Schema.instance.getCFMetaData(keyspace, columnFamily).getKeyValidator();
List<IMutation> mutations = new ArrayList<IMutation>(keys.size());
for (Term key : keys)
mutations.add(mutationForKey(key.getByteBuffer(keyType, variables), keyspace, timestamp, clientState, variables, metadata));
return mutations;
}
示例4: prepareRowMutations
import org.apache.cassandra.thrift.ThriftClientState; //导入方法依赖的package包/类
/** {@inheritDoc} */
public List<IMutation> prepareRowMutations(String keyspace, ThriftClientState clientState, Long timestamp, List<ByteBuffer> variables)
throws InvalidRequestException, UnauthorizedException
{
boolean hasCommutativeOperation = false;
for (Map.Entry<Term, Operation> column : getColumns().entrySet())
{
if (!column.getValue().isUnary())
hasCommutativeOperation = true;
if (hasCommutativeOperation && column.getValue().isUnary())
throw new InvalidRequestException("Mix of commutative and non-commutative operations is not allowed.");
}
CFMetaData metadata = validateColumnFamily(keyspace, columnFamily, hasCommutativeOperation);
if (hasCommutativeOperation)
getConsistencyLevel().validateCounterForWrite(metadata);
QueryProcessor.validateKeyAlias(metadata, keyName);
clientState.hasColumnFamilyAccess(keyspace, columnFamily, Permission.MODIFY);
List<IMutation> rowMutations = new LinkedList<IMutation>();
for (Term key: keys)
{
rowMutations.add(mutationForKey(keyspace, key.getByteBuffer(getKeyType(keyspace),variables), metadata, timestamp, clientState, variables));
}
return rowMutations;
}