當前位置: 首頁>>代碼示例>>Java>>正文


Java MetaData.ALL屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:17,代碼來源:AbstractQueryTestCase.java

示例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;
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:17,代碼來源:BasePipelineAggregationTestCase.java

示例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);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:18,代碼來源:ExistsQueryBuilderTests.java

示例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;
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:35,代碼來源:IdsQueryBuilderTests.java

示例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))));
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:15,代碼來源:ClusterHealthResponsesTests.java

示例6: getRandomType

protected static String getRandomType() {
    return (currentTypes.length == 0) ? MetaData.ALL : randomFrom(currentTypes);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:3,代碼來源:AbstractQueryTestCase.java


注:本文中的org.elasticsearch.cluster.metadata.MetaData.ALL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。