当前位置: 首页>>代码示例>>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;未经允许,请勿转载。