本文整理汇总了Java中org.elasticsearch.cluster.metadata.MetaData.ALL属性的典型用法代码示例。如果您正苦于以下问题:Java MetaData.ALL属性的具体用法?Java MetaData.ALL怎么用?Java MetaData.ALL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.elasticsearch.cluster.metadata.MetaData
的用法示例。
在下文中一共展示了MetaData.ALL属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRandomTypes
private static String[] getRandomTypes() {
String[] types;
if (currentTypes.length > 0 && randomBoolean()) {
int numberOfQueryTypes = randomIntBetween(1, currentTypes.length);
types = new String[numberOfQueryTypes];
for (int i = 0; i < numberOfQueryTypes; i++) {
types[i] = randomFrom(currentTypes);
}
} else {
if (randomBoolean()) {
types = new String[]{MetaData.ALL};
} else {
types = new String[0];
}
}
return types;
}
示例2: getRandomTypes
protected String[] getRandomTypes() {
String[] types;
if (currentTypes.length > 0 && randomBoolean()) {
int numberOfQueryTypes = randomIntBetween(1, currentTypes.length);
types = new String[numberOfQueryTypes];
for (int i = 0; i < numberOfQueryTypes; i++) {
types[i] = randomFrom(currentTypes);
}
} else {
if (randomBoolean()) {
types = new String[]{MetaData.ALL};
} else {
types = new String[0];
}
}
return types;
}
示例3: doCreateTestQueryBuilder
@Override
protected ExistsQueryBuilder doCreateTestQueryBuilder() {
String fieldPattern;
if (randomBoolean()) {
fieldPattern = randomFrom(MAPPED_FIELD_NAMES);
} else {
fieldPattern = randomAsciiOfLengthBetween(1, 10);
}
// also sometimes test wildcard patterns
if (randomBoolean()) {
if (randomBoolean()) {
fieldPattern = fieldPattern + "*";
} else {
fieldPattern = MetaData.ALL;
}
}
return new ExistsQueryBuilder(fieldPattern);
}
示例4: doCreateTestQueryBuilder
@Override
protected IdsQueryBuilder doCreateTestQueryBuilder() {
String[] types;
if (getCurrentTypes().length > 0 && randomBoolean()) {
int numberOfTypes = randomIntBetween(1, getCurrentTypes().length);
types = new String[numberOfTypes];
for (int i = 0; i < numberOfTypes; i++) {
if (frequently()) {
types[i] = randomFrom(getCurrentTypes());
} else {
types[i] = randomAsciiOfLengthBetween(1, 10);
}
}
} else {
if (randomBoolean()) {
types = new String[]{MetaData.ALL};
} else {
types = new String[0];
}
}
int numberOfIds = randomIntBetween(0, 10);
String[] ids = new String[numberOfIds];
for (int i = 0; i < numberOfIds; i++) {
ids[i] = randomAsciiOfLengthBetween(1, 10);
}
IdsQueryBuilder query;
if (types.length > 0 || randomBoolean()) {
query = new IdsQueryBuilder().types(types);
query.addIds(ids);
} else {
query = new IdsQueryBuilder();
query.addIds(ids);
}
return query;
}
示例5: testClusterHealth
public void testClusterHealth() throws IOException {
ClusterState clusterState = ClusterState.builder(ClusterName.CLUSTER_NAME_SETTING.getDefault(Settings.EMPTY)).build();
int pendingTasks = randomIntBetween(0, 200);
int inFlight = randomIntBetween(0, 200);
int delayedUnassigned = randomIntBetween(0, 200);
TimeValue pendingTaskInQueueTime = TimeValue.timeValueMillis(randomIntBetween(1000, 100000));
ClusterHealthResponse clusterHealth = new ClusterHealthResponse("bla", new String[] {MetaData.ALL}, clusterState, pendingTasks, inFlight, delayedUnassigned, pendingTaskInQueueTime);
clusterHealth = maybeSerialize(clusterHealth);
assertClusterHealth(clusterHealth);
assertThat(clusterHealth.getNumberOfPendingTasks(), Matchers.equalTo(pendingTasks));
assertThat(clusterHealth.getNumberOfInFlightFetch(), Matchers.equalTo(inFlight));
assertThat(clusterHealth.getDelayedUnassignedShards(), Matchers.equalTo(delayedUnassigned));
assertThat(clusterHealth.getTaskMaxWaitingTime().millis(), is(pendingTaskInQueueTime.millis()));
assertThat(clusterHealth.getActiveShardsPercent(), is(allOf(greaterThanOrEqualTo(0.0), lessThanOrEqualTo(100.0))));
}
示例6: getRandomType
protected static String getRandomType() {
return (currentTypes.length == 0) ? MetaData.ALL : randomFrom(currentTypes);
}