本文整理汇总了Java中org.apache.cassandra.db.SystemKeyspace.isIndexBuilt方法的典型用法代码示例。如果您正苦于以下问题:Java SystemKeyspace.isIndexBuilt方法的具体用法?Java SystemKeyspace.isIndexBuilt怎么用?Java SystemKeyspace.isIndexBuilt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.db.SystemKeyspace
的用法示例。
在下文中一共展示了SystemKeyspace.isIndexBuilt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInitializationTask
import org.apache.cassandra.db.SystemKeyspace; //导入方法依赖的package包/类
public Callable<?> getInitializationTask() {
logger.info("Getting initialization task of {}", name);
if (table.isEmpty() || SystemKeyspace.isIndexBuilt(table.keyspace.getName(), config.name)) {
logger.info("Index {} doesn't need (re)building", name);
return null;
} else {
logger.info("Index {} needs (re)building", name);
return () -> {
table.forceBlockingFlush();
service.truncate();
table.indexManager.buildIndexBlocking(this);
return null;
};
}
}
示例2: buildIndexAsync
import org.apache.cassandra.db.SystemKeyspace; //导入方法依赖的package包/类
/**
* Builds the index using the data in the underlying CF, non blocking
*
*
* @return A future object which the caller can block on (optional)
*/
public Future<?> buildIndexAsync()
{
// if we're just linking in the index to indexedColumns on an already-built index post-restart, we're done
boolean allAreBuilt = true;
for (ColumnDefinition cdef : columnDefs)
{
if (!SystemKeyspace.isIndexBuilt(baseCfs.keyspace.getName(), getNameForSystemKeyspace(cdef.name)))
{
allAreBuilt = false;
break;
}
}
if (allAreBuilt)
return null;
// build it asynchronously; addIndex gets called by CFS open and schema update, neither of which
// we want to block for a long period. (actual build is serialized on CompactionManager.)
Runnable runnable = new Runnable()
{
public void run()
{
baseCfs.forceBlockingFlush();
buildIndexBlocking();
}
};
FutureTask<?> f = new FutureTask<Object>(runnable, null);
new Thread(f, "Creating index: " + getIndexName()).start();
return f;
}
示例3: buildIndexAsync
import org.apache.cassandra.db.SystemKeyspace; //导入方法依赖的package包/类
/**
* Builds the index using the data in the underlying CF, non blocking
*
*
* @return A future object which the caller can block on (optional)
*/
public Future<?> buildIndexAsync()
{
// if we're just linking in the index to indexedColumns on an already-built index post-restart, we're done
boolean allAreBuilt = true;
for (ColumnDefinition cdef : columnDefs)
{
if (!SystemKeyspace.isIndexBuilt(baseCfs.keyspace.getName(), getNameForSystemKeyspace(cdef.name.bytes)))
{
allAreBuilt = false;
break;
}
}
if (allAreBuilt)
return null;
// build it asynchronously; addIndex gets called by CFS open and schema update, neither of which
// we want to block for a long period. (actual build is serialized on CompactionManager.)
Runnable runnable = new Runnable()
{
public void run()
{
baseCfs.forceBlockingFlush();
buildIndexBlocking();
}
};
FutureTask<?> f = new FutureTask<Object>(runnable, null);
new Thread(f, "Creating index: " + getIndexName()).start();
return f;
}
示例4: isIndexBuilt
import org.apache.cassandra.db.SystemKeyspace; //导入方法依赖的package包/类
/**
* Checks if the index for specified column is fully built
*
* @param columnName the column
* @return true if the index is fully built
*/
public boolean isIndexBuilt(ByteBuffer columnName)
{
return SystemKeyspace.isIndexBuilt(baseCfs.keyspace.getName(), getNameForSystemKeyspace(columnName));
}