当前位置: 首页>>代码示例>>Java>>正文


Java SystemKeyspace.isIndexBuilt方法代码示例

本文整理汇总了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;
		};
	}
}
 
开发者ID:jmiddleton,项目名称:cassandra-fhir-index,代码行数:16,代码来源:FhirIndex.java

示例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;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:38,代码来源:SecondaryIndex.java

示例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;
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:38,代码来源:SecondaryIndex.java

示例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));
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:11,代码来源:SecondaryIndex.java


注:本文中的org.apache.cassandra.db.SystemKeyspace.isIndexBuilt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。