当前位置: 首页>>代码示例>>Java>>正文


Java ImmutableSettings.EMPTY属性代码示例

本文整理汇总了Java中org.elasticsearch.common.settings.ImmutableSettings.EMPTY属性的典型用法代码示例。如果您正苦于以下问题:Java ImmutableSettings.EMPTY属性的具体用法?Java ImmutableSettings.EMPTY怎么用?Java ImmutableSettings.EMPTY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.elasticsearch.common.settings.ImmutableSettings的用法示例。


在下文中一共展示了ImmutableSettings.EMPTY属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testConstructorNoContainer

@Test(expected = RepositoryException.class)
public void testConstructorNoContainer(){
    new CloudFilesRepository("test", new RepositorySettings(ImmutableSettings.EMPTY, ImmutableSettings.EMPTY), indexShardRepository, cloudFilesService);
}
 
开发者ID:jlinn,项目名称:elasticsearch-cloud-rackspace,代码行数:4,代码来源:CloudFilesRepositoryTest.java

示例2: testConstructor

@Test
public void testConstructor(){
    String name = "testRepo";
    String region = "DFW";
    String container = "testContainer";

    // Omit the region setting. Should default to "ORD"
    Settings settings = ImmutableSettings.builder()
            .put("container", container)
            .build();

    CloudFilesRepository repository = new CloudFilesRepository(name, new RepositorySettings(ImmutableSettings.EMPTY, settings), indexShardRepository, cloudFilesService);
    assertEquals("ORD", ((CloudFilesBlobStore) repository.blobStore()).getLocation().getId());

    // include the region setting this time
    settings = ImmutableSettings.builder()
            .put("container", container)
            .put("region", region)
            .build();

    repository = new CloudFilesRepository(name, new RepositorySettings(ImmutableSettings.EMPTY, settings), indexShardRepository, cloudFilesService);
    assertEquals(region, ((CloudFilesBlobStore) repository.blobStore()).getLocation().getId());

    Settings globalSettings = ImmutableSettings.builder()
            .put("repositories.cloudfiles.region", "IAD")
            .build();
    settings = ImmutableSettings.builder()
            .put("container", container)
            .build();

    repository = new CloudFilesRepository(name, new RepositorySettings(globalSettings, settings), indexShardRepository, cloudFilesService);
    // the region setting from the global settings should be used
    assertEquals("IAD", ((CloudFilesBlobStore) repository.blobStore()).getLocation().getId());

    globalSettings = ImmutableSettings.builder()
            .put("repositories.cloudfiles.region", "IAD")
            .build();
    settings = ImmutableSettings.builder()
            .put("container", container)
            .put("region", "DFW")
            .build();

    repository = new CloudFilesRepository(name, new RepositorySettings(globalSettings, settings), indexShardRepository, cloudFilesService);
    // the region setting from the global settings should be overridden
    assertEquals("DFW", ((CloudFilesBlobStore) repository.blobStore()).getLocation().getId());
}
 
开发者ID:jlinn,项目名称:elasticsearch-cloud-rackspace,代码行数:46,代码来源:CloudFilesRepositoryTest.java

示例3: setup

@Before
public void setup() {
    Settings settings = ImmutableSettings.EMPTY;
    se = new NashornScriptEngineService(settings);
}
 
开发者ID:jprante,项目名称:elasticsearch-lang-javascript-nashorn,代码行数:5,代码来源:NashornScriptEngineTests.java

示例4: fromXContent

@Override
public RiverStatesMetaData fromXContent(XContentParser parser) throws IOException {
    XContentParser.Token token;
    List<RiverState> river = new LinkedList<RiverState>();
    while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
        if (token == XContentParser.Token.FIELD_NAME) {
            String name = parser.currentName();
            if (parser.nextToken() != XContentParser.Token.START_OBJECT) {
                throw new ElasticsearchParseException("failed to parse river [" + name + "], expected object");
            }
            String type = null;
            Settings settings = ImmutableSettings.EMPTY;
            Map<String,Object> map = newHashMap();
            while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
                if (token == XContentParser.Token.FIELD_NAME) {
                    String currentFieldName = parser.currentName();
                    switch (currentFieldName) {
                        case "type":
                            if (parser.nextToken() != XContentParser.Token.VALUE_STRING) {
                                throw new ElasticsearchParseException("failed to parse river [" + name + "], unknown type");
                            }
                            type = parser.text();
                            break;
                        case "settings":
                            if (parser.nextToken() != XContentParser.Token.START_OBJECT) {
                                throw new ElasticsearchParseException("failed to parse river [" + name + "], incompatible params");
                            }
                            settings = ImmutableSettings.settingsBuilder().put(SettingsLoader.Helper.loadNestedFromMap(parser.mapOrdered())).build();
                            break;
                        case "map":
                            if (parser.nextToken() != XContentParser.Token.START_OBJECT) {
                                throw new ElasticsearchParseException("failed to parse river [" + name + "], incompatible params");
                            }
                            map = parser.mapOrdered();
                            break;
                        default:
                            throw new ElasticsearchParseException("failed to parse river [" + name + "], unknown field [" + currentFieldName + "]");
                    }
                } else {
                    throw new ElasticsearchParseException("failed to parse river [" + name + "]");
                }
            }
            if (type == null) {
                throw new ElasticsearchParseException("failed to parse river [" + name + "], missing river type");
            }
            river.add(new RiverState(name, type).setSettings(settings).setMap(map));
        } else {
            throw new ElasticsearchParseException("failed to parse rivers");
        }
    }
    return new RiverStatesMetaData(river.toArray(new RiverState[river.size()]));
}
 
开发者ID:szwork2013,项目名称:elasticsearch-sentiment,代码行数:52,代码来源:RiverStatesMetaData.java

示例5: setUp

@Before
public void setUp() throws Exception {
    service = new TestWebdavService(ImmutableSettings.EMPTY);
    service.doStart();
}
 
开发者ID:mitallast,项目名称:elasticsearch-webdav-plugin,代码行数:5,代码来源:TestWebdavServiceTest.java

示例6: transportClientSettings

/**
 * This method is used to obtain additional settings for clients created by the internal cluster.
 * These settings will be applied on the client in addition to some randomized settings defined in
 * the cluster. These setttings will also override any other settings the internal cluster might
 * add by default.
 */
protected Settings transportClientSettings() {
    return ImmutableSettings.EMPTY;
}
 
开发者ID:salyh,项目名称:elasticsearch-sample-plugin-audit,代码行数:9,代码来源:ElasticsearchIntegrationTest.java


注:本文中的org.elasticsearch.common.settings.ImmutableSettings.EMPTY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。