本文整理汇总了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);
}
示例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());
}
示例3: setup
@Before
public void setup() {
Settings settings = ImmutableSettings.EMPTY;
se = new NashornScriptEngineService(settings);
}
示例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()]));
}
示例5: setUp
@Before
public void setUp() throws Exception {
service = new TestWebdavService(ImmutableSettings.EMPTY);
service.doStart();
}
示例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;
}