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


Java Index.getName方法代码示例

本文整理汇总了Java中org.elasticsearch.index.Index.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Index.getName方法的具体用法?Java Index.getName怎么用?Java Index.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.index.Index的用法示例。


在下文中一共展示了Index.getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteIndexStore

import org.elasticsearch.index.Index; //导入方法依赖的package包/类
/**
 * Deletes the index store trying to acquire all shards locks for this index.
 * This method will delete the metadata for the index even if the actual shards can't be locked.
 *
 * Package private for testing
 */
void deleteIndexStore(String reason, IndexMetaData metaData, ClusterState clusterState) throws IOException {
    if (nodeEnv.hasNodeFile()) {
        synchronized (this) {
            Index index = metaData.getIndex();
            if (hasIndex(index)) {
                String localUUid = indexService(index).indexUUID();
                throw new IllegalStateException("Can't delete index store for [" + index.getName() + "] - it's still part of the indices service [" + localUUid + "] [" + metaData.getIndexUUID() + "]");
            }

            if (clusterState.metaData().hasIndex(index.getName()) && (clusterState.nodes().getLocalNode().isMasterNode() == true)) {
                // we do not delete the store if it is a master eligible node and the index is still in the cluster state
                // because we want to keep the meta data for indices around even if no shards are left here
                final IndexMetaData idxMeta = clusterState.metaData().index(index.getName());
                throw new IllegalStateException("Can't delete index store for [" + index.getName() + "] - it's still part of the " +
                                                "cluster state [" + idxMeta.getIndexUUID() + "] [" + metaData.getIndexUUID() + "], " +
                                                "we are master eligible, so will keep the index metadata even if no shards are left.");
            }
        }
        final IndexSettings indexSettings = buildIndexSettings(metaData);
        deleteIndexStore(reason, indexSettings.getIndex(), indexSettings);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:29,代码来源:IndicesService.java

示例2: GroupBy

import org.elasticsearch.index.Index; //导入方法依赖的package包/类
GroupBy(Throwable t) {
    if (t instanceof ElasticsearchException) {
        final Index index = ((ElasticsearchException) t).getIndex();
        if (index != null) {
            this.index = index.getName();
        } else {
            this.index = null;
        }
    } else {
        index = null;
    }
    reason = t.getMessage();
    causeType = t.getClass();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:ExceptionsHelper.java

示例3: PendingDelete

import org.elasticsearch.index.Index; //导入方法依赖的package包/类
/**
 * Creates a new pending delete of a shard
 */
public PendingDelete(Index index, Settings settings) {
    this.index = index.getName();
    this.shardId = -1;
    this.settings = settings;
    this.deleteIndex = true;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:IndicesService.java


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