本文整理汇总了Java中org.apache.cassandra.cql3.functions.Function类的典型用法代码示例。如果您正苦于以下问题:Java Function类的具体用法?Java Function怎么用?Java Function使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Function类属于org.apache.cassandra.cql3.functions包,在下文中一共展示了Function类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:24,代码来源:ModificationStatement.java
示例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);
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:17,代码来源:SelectStatement.java
示例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);
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:8,代码来源:Attributes.java
示例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));
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:8,代码来源:QueryProcessor.java
示例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);
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:9,代码来源:TermSlice.java
示例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);
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:9,代码来源:SingleColumnRestriction.java
示例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);
}
}
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:15,代码来源:RestrictionSet.java
示例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();
}
});
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:17,代码来源:SelectorFactories.java
示例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();
}
});
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:16,代码来源:SelectorFactories.java
示例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);
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:8,代码来源:ModificationStatement.java
示例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);
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:9,代码来源:SelectStatement.java
示例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;
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:8,代码来源:FunctionExecutionException.java
示例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()));
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:15,代码来源:ClientState.java
示例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());
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:15,代码来源:UFAuthTest.java
示例15: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
@Override
public void addFunctionsTo(List<Function> functions)
{
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:5,代码来源:Json.java
示例16: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
public void addFunctionsTo(List<Function> functions)
{
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:4,代码来源:Term.java
示例17: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
public void addFunctionsTo(List<Function> functions)
{
Terms.addFunctions(elements, functions);
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:5,代码来源:Tuples.java
示例18: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
public void addFunctionsTo(List<Function> functions)
{
if (t != null)
t.addFunctionsTo(functions);
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:6,代码来源:Operation.java
示例19: addFunctionsTo
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
public void addFunctionsTo(List<Function> functions)
{
Terms.addFunctions(values, functions);
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:5,代码来源:UserTypes.java
示例20: getFunctions
import org.apache.cassandra.cql3.functions.Function; //导入依赖的package包/类
public Iterable<Function> getFunctions()
{
return Collections.emptyList();
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:5,代码来源:ParsedStatement.java
注:本文中的org.apache.cassandra.cql3.functions.Function类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论