本文整理汇总了Java中org.apache.cassandra.cql.hooks.PostPreparationHook类的典型用法代码示例。如果您正苦于以下问题:Java PostPreparationHook类的具体用法?Java PostPreparationHook怎么用?Java PostPreparationHook使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PostPreparationHook类属于org.apache.cassandra.cql.hooks包,在下文中一共展示了PostPreparationHook类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepare
import org.apache.cassandra.cql.hooks.PostPreparationHook; //导入依赖的package包/类
public static CqlPreparedResult prepare(String queryString, ThriftClientState clientState)
throws RequestValidationException
{
logger.trace("CQL QUERY: {}", queryString);
CQLStatement statement = getStatement(queryString);
int statementId = makeStatementId(queryString);
logger.trace("Discovered "+ statement.boundTerms + " bound variables.");
clientState.getPrepared().put(statementId, statement);
logger.trace(String.format("Stored prepared statement #%d with %d bind markers",
statementId,
statement.boundTerms));
if (!postPreparationHooks.isEmpty())
{
PreparationContext context = new PreparationContext(clientState, queryString, statement);
for (PostPreparationHook hook : postPreparationHooks)
hook.processStatement(statement, context);
}
return new CqlPreparedResult(statementId, statement.boundTerms);
}
示例2: addPostPreparationHook
import org.apache.cassandra.cql.hooks.PostPreparationHook; //导入依赖的package包/类
public static void addPostPreparationHook(PostPreparationHook hook)
{
postPreparationHooks.add(hook);
}
示例3: removePostPreparationHook
import org.apache.cassandra.cql.hooks.PostPreparationHook; //导入依赖的package包/类
public static void removePostPreparationHook(PostPreparationHook hook)
{
postPreparationHooks.remove(hook);
}