当前位置: 首页>>代码示例>>Java>>正文


Java ThriftClientState.hasColumnFamilyAccess方法代码示例

本文整理汇总了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;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:18,代码来源:DeleteStatement.java

示例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;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:31,代码来源:UpdateStatement.java

示例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;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:DeleteStatement.java

示例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;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:33,代码来源:UpdateStatement.java


注:本文中的org.apache.cassandra.thrift.ThriftClientState.hasColumnFamilyAccess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。