本文整理匯總了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);
}