本文整理汇总了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);
}
示例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);
}
示例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;
}
}
示例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);
}
示例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();
}
}
示例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();
}
}
示例7: checkAccess
import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
{
state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.ALTER);
}
示例8: checkAccess
import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException
{
state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.MODIFY);
}
示例9: checkAccess
import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException
{
state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.SELECT);
}
示例10: checkAccess
import org.apache.cassandra.service.ClientState; //导入方法依赖的package包/类
public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
{
state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.DROP);
}
示例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);
}