本文整理汇总了Java中org.apache.cassandra.cql3.functions.Function类的典型用法代码示例。如果您正苦于以下问题:Java Function类的具体用法?Java Function怎么用?Java Function使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Function类属于org.apache.cassandra.cql3.functions包,在下文中一共展示了Function类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkAccess
import org.apache.cassandra.cql3.functions.Function; //导入依赖的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);
}
示例2: checkAccess
import org.apache.cassandra.cql3.functions.Function; //导入依赖的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);
}
示例3: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
public void addFunctionsTo(List<Function> functions)
{
if (timestamp != null)
timestamp.addFunctionsTo(functions);
if (timeToLive != null)
timeToLive.addFunctionsTo(functions);
}
示例4: removeInvalidPreparedStatementsForFunction
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
private static void removeInvalidPreparedStatementsForFunction(Iterator<ParsedStatement.Prepared> statements,
final String ksName,
final String functionName)
{
Predicate<Function> matchesFunction = f -> ksName.equals(f.name().keyspace) && functionName.equals(f.name().name);
Iterators.removeIf(statements, statement -> Iterables.any(statement.statement.getFunctions(), matchesFunction));
}
示例5: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
public void addFunctionsTo(List<Function> functions)
{
if (hasBound(Bound.START))
bound(Bound.START).addFunctionsTo(functions);
if (hasBound(Bound.END))
bound(Bound.END).addFunctionsTo(functions);
}
示例6: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
@Override
public void addFunctionsTo(List<Function> functions)
{
Terms.addFunctions(values, functions);
Terms.addFunctions(keys, functions);
Terms.addFunctions(entryKeys, functions);
Terms.addFunctions(entryValues, functions);
}
示例7: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
@Override
public void addFunctionsTo(List<Function> functions)
{
Restriction previous = null;
for (Restriction restriction : restrictions.values())
{
// For muti-column restriction, we can have multiple time the same restriction.
if (!restriction.equals(previous))
{
previous = restriction;
restriction.addFunctionsTo(functions);
}
}
}
示例8: getColumnNames
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
/**
* Returns the names of the columns corresponding to the output values of the selector instances created by
* these factories.
*
* @return a list of column names
*/
public List<String> getColumnNames()
{
return Lists.transform(factories, new com.google.common.base.Function<Selector.Factory, String>()
{
public String apply(Selector.Factory factory)
{
return factory.getColumnName();
}
});
}
示例9: getReturnTypes
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
/**
* Returns a list of the return types of the selector instances created by these factories.
*
* @return a list of types
*/
public List<AbstractType<?>> getReturnTypes()
{
return Lists.transform(factories, new com.google.common.base.Function<Selector.Factory, AbstractType<?>>()
{
public AbstractType<?> apply(Selector.Factory factory)
{
return factory.getReturnType();
}
});
}
示例10: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
public void addFunctionsTo(List<Function> functions)
{
attrs.addFunctionsTo(functions);
restrictions.addFunctionsTo(functions);
operations.addFunctionsTo(functions);
conditions.addFunctionsTo(functions);
}
示例11: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
private void addFunctionsTo(List<Function> functions)
{
selection.addFunctionsTo(functions);
restrictions.addFunctionsTo(functions);
if (limit != null)
limit.addFunctionsTo(functions);
}
示例12: create
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
public static FunctionExecutionException create(Function function, Throwable cause)
{
List<String> cqlTypes = AbstractType.asCQLTypeStringList(function.argTypes());
FunctionExecutionException fee = new FunctionExecutionException(function.name(), cqlTypes, cause.toString());
fee.initCause(cause);
return fee;
}
示例13: ensureHasPermission
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
public void ensureHasPermission(Permission permission, Function function)
{
// Save creating a FunctionResource is we don't need to
if (DatabaseDescriptor.getAuthorizer() instanceof AllowAllAuthorizer)
return;
// built in functions are always available to all
if (function.isNative())
return;
checkPermissionOnResourceChain(permission, FunctionResource.function(function.name().keyspace,
function.name().name,
function.argTypes()));
}
示例14: functionResource
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
private FunctionResource functionResource(String functionName)
{
// Note that this is somewhat brittle as it assumes that function names are
// truly unique. As such, it will break in the face of overloading.
// It is here to avoid having to duplicate the functionality of CqlParser
// for transforming cql types into AbstractTypes
FunctionName fn = parseFunctionName(functionName);
Collection<Function> functions = Schema.instance.getFunctions(fn);
assertEquals(String.format("Expected a single function definition for %s, but found %s",
functionName,
functions.size()),
1, functions.size());
return FunctionResource.function(fn.keyspace, fn.name, functions.iterator().next().argTypes());
}
示例15: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
@Override
public void addFunctionsTo(List<Function> functions)
{
}