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


Java ClientState.hasColumnFamilyAccess方法代码示例

本文整理汇总了Java中org.apache.cassandra.service.ClientState.hasColumnFamilyAccess方法的典型用法代码示例。如果您正苦于以下问题:Java ClientState.hasColumnFamilyAccess方法的具体用法?Java ClientState.hasColumnFamilyAccess怎么用?Java ClientState.hasColumnFamilyAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.service.ClientState的用法示例。


在下文中一共展示了ClientState.hasColumnFamilyAccess方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkAccess

import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException
{
    if (cfm.isView())
    {
        CFMetaData baseTable = View.findBaseTable(keyspace(), columnFamily());
        if (baseTable != null)
            state.hasColumnFamilyAccess(keyspace(), baseTable.cfName, Permission.SELECT);
    }
    else
    {
        state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.SELECT);
    }

    for (Function function : getFunctions())
        state.ensureHasPermission(Permission.EXECUTE, function);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:17,代码来源:SelectStatement.java

示例2: checkAccess

import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException
{
    state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.MODIFY);

    // CAS updates can be used to simulate a SELECT query, so should require Permission.SELECT as well.
    if (hasConditions())
        state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.SELECT);

    // MV updates need to get the current state from the table, and might update the views
    // Require Permission.SELECT on the base table, and Permission.MODIFY on the views
    Iterator<ViewDefinition> views = View.findAll(keyspace(), columnFamily()).iterator();
    if (views.hasNext())
    {
        state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.SELECT);
        do
        {
            state.hasColumnFamilyAccess(keyspace(), views.next().viewName, Permission.MODIFY);
        } while (views.hasNext());
    }

    for (Function function : getFunctions())
        state.ensureHasPermission(Permission.EXECUTE, function);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:24,代码来源:ModificationStatement.java

示例3: checkAccess

import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
{
    try
    {
        state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.DROP);
    }
    catch (InvalidRequestException e)
    {
        if (!ifExists)
            throw e;
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:13,代码来源:DropTableStatement.java

示例4: checkAccess

import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
{
    CFMetaData cfm = findIndexedCF();
    if (cfm == null)
        return;

    state.hasColumnFamilyAccess(cfm.ksName, cfm.cfName, Permission.ALTER);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:9,代码来源:DropIndexStatement.java

示例5: multiget_slice

import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice(List<ByteBuffer> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level)
throws InvalidRequestException, UnavailableException, TimedOutException
{
    if (startSessionIfRequested())
    {
        List<String> keysList = Lists.newArrayList();
        for (ByteBuffer key : keys)
            keysList.add(ByteBufferUtil.bytesToHex(key));
        Map<String, String> traceParameters = ImmutableMap.of("keys", keysList.toString(),
                                                              "column_parent", column_parent.toString(),
                                                              "predicate", predicate.toString(),
                                                              "consistency_level", consistency_level.name());
        Tracing.instance.begin("multiget_slice", traceParameters);
    }
    else
    {
        logger.debug("multiget_slice");
    }

    try
    {
        ClientState cState = state();
        String keyspace = cState.getKeyspace();
        cState.hasColumnFamilyAccess(keyspace, column_parent.column_family, Permission.SELECT);
        return multigetSliceInternal(keyspace, keys, column_parent, System.currentTimeMillis(), predicate, consistency_level, cState);
    }
    catch (RequestValidationException e)
    {
        throw ThriftConversion.toThrift(e);
    }
    finally
    {
        Tracing.instance.stopSession();
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:36,代码来源:CassandraServer.java

示例6: multiget_slice

import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice(List<ByteBuffer> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level)
throws InvalidRequestException, UnavailableException, TimedOutException
{
    if (startSessionIfRequested())
    {
        List<String> keysList = Lists.newArrayList();
        for (ByteBuffer key : keys)
            keysList.add(ByteBufferUtil.bytesToHex(key));
        Map<String, String> traceParameters = ImmutableMap.of("keys", keysList.toString(),
                                                              "column_parent", column_parent.toString(),
                                                              "predicate", predicate.toString(),
                                                              "consistency_level", consistency_level.name());
        Tracing.instance.begin("multiget_slice", traceParameters);
    }
    else
    {
        logger.debug("multiget_slice");
    }

    try
    {
        ClientState cState = state();
        String keyspace = cState.getKeyspace();
        cState.hasColumnFamilyAccess(keyspace, column_parent.column_family, Permission.SELECT);
        return multigetSliceInternal(keyspace, keys, column_parent, System.currentTimeMillis(), predicate, consistency_level);
    }
    catch (RequestValidationException e)
    {
        throw ThriftConversion.toThrift(e);
    }
    finally
    {
        Tracing.instance.stopSession();
    }
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:36,代码来源:CassandraServer.java

示例7: checkAccess

import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
{
    state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.ALTER);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:CreateIndexStatement.java

示例8: checkAccess

import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException
{
    state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.MODIFY);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:TruncateStatement.java

示例9: checkAccess

import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException
{
    state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.SELECT);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:SelectStatement.java

示例10: checkAccess

import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
{
    state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.DROP);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:5,代码来源:DropTableStatement.java

示例11: checkAccess

import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
{
    CFMetaData baseTable = View.findBaseTable(keyspace(), columnFamily());
    if (baseTable != null)
        state.hasColumnFamilyAccess(keyspace(), baseTable.cfName, Permission.ALTER);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:7,代码来源:DropViewStatement.java


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