當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。