本文整理汇总了Java中org.elasticsearch.common.hppc.cursors.ObjectObjectCursor类的典型用法代码示例。如果您正苦于以下问题:Java ObjectObjectCursor类的具体用法?Java ObjectObjectCursor怎么用?Java ObjectObjectCursor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectObjectCursor类属于org.elasticsearch.common.hppc.cursors包,在下文中一共展示了ObjectObjectCursor类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findMatchingIndices
import org.elasticsearch.common.hppc.cursors.ObjectObjectCursor; //导入依赖的package包/类
private List<String> findMatchingIndices(String regex) {
List<String> result = new ArrayList<String>();
ImmutableOpenMap<String, IndexMetaData> indices = client.admin()
.cluster().prepareState().execute().actionGet().getState()
.getMetaData().indices();
Iterator<ObjectObjectCursor<String, IndexMetaData>> iter = indices
.iterator();
while (iter.hasNext()) {
ObjectObjectCursor<String, IndexMetaData> i = iter.next();
if (i.key.matches(regex)) {
result.add(i.key);
}
}
return result;
}
示例2: testSwitchAlias
import org.elasticsearch.common.hppc.cursors.ObjectObjectCursor; //导入依赖的package包/类
@Test
public void testSwitchAlias() {
createIndex(INDEX_2);
client().admin().indices().aliases(Requests.indexAliasesRequest().addAlias(ALIAS, INDEX)).actionGet();
operations.switchAlias(ALIAS, INDEX, INDEX_2).actionGet();
GetAliasesResponse response = client().admin().indices().getAliases(new GetAliasesRequest(ALIAS)).actionGet();
Assertions.assertThat(response.getAliases().size()).isEqualTo(1);
ObjectObjectCursor<String, List<AliasMetaData>> cursor = response.getAliases().iterator().next();
Assertions.assertThat(cursor.key).isEqualTo(INDEX_2);
Assertions.assertThat(cursor.value.size()).isEqualTo(1);
Assertions.assertThat(cursor.value.iterator().next().alias()).isEqualTo(ALIAS);
}