fix all kinds of crazy test failures
This commit is contained in:
parent
ceef6d7a42
commit
a8eedd0457
|
@ -44,7 +44,7 @@ public final class AutoCreateIndex {
|
||||||
@Inject
|
@Inject
|
||||||
public AutoCreateIndex(Settings settings, IndexNameExpressionResolver resolver) {
|
public AutoCreateIndex(Settings settings, IndexNameExpressionResolver resolver) {
|
||||||
this.resolver = resolver;
|
this.resolver = resolver;
|
||||||
dynamicMappingDisabled = !settings.getAsBoolean(MapperService.INDEX_MAPPER_DYNAMIC_SETTING, MapperService.INDEX_MAPPER_DYNAMIC_DEFAULT);
|
dynamicMappingDisabled = !MapperService.INDEX_MAPPER_DYNAMIC_SETTING.get(settings);
|
||||||
String value = settings.get("action.auto_create_index");
|
String value = settings.get("action.auto_create_index");
|
||||||
if (value == null || Booleans.isExplicitTrue(value)) {
|
if (value == null || Booleans.isExplicitTrue(value)) {
|
||||||
needToCheck = true;
|
needToCheck = true;
|
||||||
|
|
|
@ -46,10 +46,14 @@ import org.elasticsearch.index.IndexingSlowLog;
|
||||||
import org.elasticsearch.index.MergePolicyConfig;
|
import org.elasticsearch.index.MergePolicyConfig;
|
||||||
import org.elasticsearch.index.MergeSchedulerConfig;
|
import org.elasticsearch.index.MergeSchedulerConfig;
|
||||||
import org.elasticsearch.index.SearchSlowLog;
|
import org.elasticsearch.index.SearchSlowLog;
|
||||||
|
import org.elasticsearch.index.cache.bitset.BitsetFilterCache;
|
||||||
import org.elasticsearch.index.fielddata.IndexFieldDataService;
|
import org.elasticsearch.index.fielddata.IndexFieldDataService;
|
||||||
import org.elasticsearch.index.mapper.FieldMapper;
|
import org.elasticsearch.index.mapper.FieldMapper;
|
||||||
|
import org.elasticsearch.index.mapper.MapperService;
|
||||||
|
import org.elasticsearch.index.percolator.PercolatorQueriesRegistry;
|
||||||
import org.elasticsearch.index.store.IndexStore;
|
import org.elasticsearch.index.store.IndexStore;
|
||||||
import org.elasticsearch.index.store.IndexStoreConfig;
|
import org.elasticsearch.index.store.IndexStoreConfig;
|
||||||
|
import org.elasticsearch.index.store.Store;
|
||||||
import org.elasticsearch.indices.breaker.HierarchyCircuitBreakerService;
|
import org.elasticsearch.indices.breaker.HierarchyCircuitBreakerService;
|
||||||
import org.elasticsearch.indices.cache.request.IndicesRequestCache;
|
import org.elasticsearch.indices.cache.request.IndicesRequestCache;
|
||||||
import org.elasticsearch.indices.recovery.RecoverySettings;
|
import org.elasticsearch.indices.recovery.RecoverySettings;
|
||||||
|
@ -135,6 +139,11 @@ public final class IndexScopeSettings extends AbstractScopedSettings {
|
||||||
IndexFieldDataService.INDEX_FIELDDATA_CACHE_KEY,
|
IndexFieldDataService.INDEX_FIELDDATA_CACHE_KEY,
|
||||||
FieldMapper.IGNORE_MALFORMED_SETTING,
|
FieldMapper.IGNORE_MALFORMED_SETTING,
|
||||||
FieldMapper.COERCE_SETTING,
|
FieldMapper.COERCE_SETTING,
|
||||||
|
Store.INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING,
|
||||||
|
PercolatorQueriesRegistry.INDEX_MAP_UNMAPPED_FIELDS_AS_STRING_SETTING,
|
||||||
|
MapperService.INDEX_MAPPER_DYNAMIC_SETTING,
|
||||||
|
BitsetFilterCache.INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING,
|
||||||
|
PrimaryShardAllocator.INDEX_RECOVERY_INITIAL_SHARDS_SETTING,
|
||||||
// this sucks but we can't really validate all the analyzers/similarity in here
|
// this sucks but we can't really validate all the analyzers/similarity in here
|
||||||
Setting.groupSetting("index.similarity.", false, Setting.Scope.INDEX), // this allows similarity settings to be passed
|
Setting.groupSetting("index.similarity.", false, Setting.Scope.INDEX), // this allows similarity settings to be passed
|
||||||
Setting.groupSetting("index.analysis.", false, Setting.Scope.INDEX) // this allows analysis settings to be passed
|
Setting.groupSetting("index.analysis.", false, Setting.Scope.INDEX) // this allows analysis settings to be passed
|
||||||
|
|
|
@ -78,7 +78,7 @@ public final class IndexSettings {
|
||||||
* This setting is realtime updateable
|
* This setting is realtime updateable
|
||||||
*/
|
*/
|
||||||
public static final TimeValue DEFAULT_GC_DELETES = TimeValue.timeValueSeconds(60);
|
public static final TimeValue DEFAULT_GC_DELETES = TimeValue.timeValueSeconds(60);
|
||||||
public static final Setting<TimeValue> INDEX_GC_DELETES_SETTING = Setting.timeSetting("index.gc_deletes", DEFAULT_GC_DELETES, new TimeValue(-1, TimeUnit.MICROSECONDS), true, Setting.Scope.INDEX);
|
public static final Setting<TimeValue> INDEX_GC_DELETES_SETTING = Setting.timeSetting("index.gc_deletes", DEFAULT_GC_DELETES, new TimeValue(-1, TimeUnit.MILLISECONDS), true, Setting.Scope.INDEX);
|
||||||
|
|
||||||
private final String uuid;
|
private final String uuid;
|
||||||
private final Index index;
|
private final Index index;
|
||||||
|
|
|
@ -134,7 +134,7 @@ public final class MergePolicyConfig {
|
||||||
public static final Setting<ByteSizeValue> INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING = Setting.byteSizeSetting("index.merge.policy.max_merged_segment", DEFAULT_MAX_MERGED_SEGMENT, true, Setting.Scope.INDEX);
|
public static final Setting<ByteSizeValue> INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING = Setting.byteSizeSetting("index.merge.policy.max_merged_segment", DEFAULT_MAX_MERGED_SEGMENT, true, Setting.Scope.INDEX);
|
||||||
public static final Setting<Double> INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING = Setting.doubleSetting("index.merge.policy.segments_per_tier", DEFAULT_SEGMENTS_PER_TIER, 2.0d, true, Setting.Scope.INDEX);
|
public static final Setting<Double> INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING = Setting.doubleSetting("index.merge.policy.segments_per_tier", DEFAULT_SEGMENTS_PER_TIER, 2.0d, true, Setting.Scope.INDEX);
|
||||||
public static final Setting<Double> INDEX_MERGE_POLICY_RECLAIM_DELETES_WEIGHT_SETTING = Setting.doubleSetting("index.merge.policy.reclaim_deletes_weight", DEFAULT_RECLAIM_DELETES_WEIGHT, 0.0d, true, Setting.Scope.INDEX);
|
public static final Setting<Double> INDEX_MERGE_POLICY_RECLAIM_DELETES_WEIGHT_SETTING = Setting.doubleSetting("index.merge.policy.reclaim_deletes_weight", DEFAULT_RECLAIM_DELETES_WEIGHT, 0.0d, true, Setting.Scope.INDEX);
|
||||||
public static final String INDEX_MERGE_ENABLED = "index.merge.enabled";
|
public static final String INDEX_MERGE_ENABLED = "index.merge.enabled"; // don't convert to Setting<> and register... we only set this in tests and register via a plugin
|
||||||
|
|
||||||
|
|
||||||
MergePolicyConfig(ESLogger logger, IndexSettings indexSettings) {
|
MergePolicyConfig(ESLogger logger, IndexSettings indexSettings) {
|
||||||
|
|
|
@ -38,6 +38,7 @@ import org.elasticsearch.common.cache.CacheBuilder;
|
||||||
import org.elasticsearch.common.cache.RemovalListener;
|
import org.elasticsearch.common.cache.RemovalListener;
|
||||||
import org.elasticsearch.common.cache.RemovalNotification;
|
import org.elasticsearch.common.cache.RemovalNotification;
|
||||||
import org.elasticsearch.common.lucene.search.Queries;
|
import org.elasticsearch.common.lucene.search.Queries;
|
||||||
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.index.AbstractIndexComponent;
|
import org.elasticsearch.index.AbstractIndexComponent;
|
||||||
import org.elasticsearch.index.IndexSettings;
|
import org.elasticsearch.index.IndexSettings;
|
||||||
|
@ -69,7 +70,7 @@ import java.util.concurrent.Executor;
|
||||||
*/
|
*/
|
||||||
public final class BitsetFilterCache extends AbstractIndexComponent implements LeafReader.CoreClosedListener, RemovalListener<Object, Cache<Query, BitsetFilterCache.Value>>, Closeable {
|
public final class BitsetFilterCache extends AbstractIndexComponent implements LeafReader.CoreClosedListener, RemovalListener<Object, Cache<Query, BitsetFilterCache.Value>>, Closeable {
|
||||||
|
|
||||||
public static final String LOAD_RANDOM_ACCESS_FILTERS_EAGERLY = "index.load_fixed_bitset_filters_eagerly";
|
public static final Setting<Boolean> INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING = Setting.boolSetting("index.load_fixed_bitset_filters_eagerly", true, false, Setting.Scope.INDEX);
|
||||||
|
|
||||||
private final boolean loadRandomAccessFiltersEagerly;
|
private final boolean loadRandomAccessFiltersEagerly;
|
||||||
private final Cache<Object, Cache<Query, Value>> loadedFilters;
|
private final Cache<Object, Cache<Query, Value>> loadedFilters;
|
||||||
|
@ -82,7 +83,7 @@ public final class BitsetFilterCache extends AbstractIndexComponent implements L
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
throw new IllegalArgumentException("listener must not be null");
|
throw new IllegalArgumentException("listener must not be null");
|
||||||
}
|
}
|
||||||
this.loadRandomAccessFiltersEagerly = this.indexSettings.getSettings().getAsBoolean(LOAD_RANDOM_ACCESS_FILTERS_EAGERLY, true);
|
this.loadRandomAccessFiltersEagerly = this.indexSettings.getValue(INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING);
|
||||||
this.loadedFilters = CacheBuilder.<Object, Cache<Query, Value>>builder().removalListener(this).build();
|
this.loadedFilters = CacheBuilder.<Object, Cache<Query, Value>>builder().removalListener(this).build();
|
||||||
this.warmer = new BitSetProducerWarmer();
|
this.warmer = new BitSetProducerWarmer();
|
||||||
this.indicesWarmer = indicesWarmer;
|
this.indicesWarmer = indicesWarmer;
|
||||||
|
|
|
@ -38,6 +38,7 @@ import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.compress.CompressedXContent;
|
import org.elasticsearch.common.compress.CompressedXContent;
|
||||||
import org.elasticsearch.common.lucene.search.Queries;
|
import org.elasticsearch.common.lucene.search.Queries;
|
||||||
import org.elasticsearch.common.regex.Regex;
|
import org.elasticsearch.common.regex.Regex;
|
||||||
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.index.AbstractIndexComponent;
|
import org.elasticsearch.index.AbstractIndexComponent;
|
||||||
import org.elasticsearch.index.IndexSettings;
|
import org.elasticsearch.index.IndexSettings;
|
||||||
import org.elasticsearch.index.analysis.AnalysisService;
|
import org.elasticsearch.index.analysis.AnalysisService;
|
||||||
|
@ -79,8 +80,8 @@ import static org.elasticsearch.common.collect.MapBuilder.newMapBuilder;
|
||||||
public class MapperService extends AbstractIndexComponent implements Closeable {
|
public class MapperService extends AbstractIndexComponent implements Closeable {
|
||||||
|
|
||||||
public static final String DEFAULT_MAPPING = "_default_";
|
public static final String DEFAULT_MAPPING = "_default_";
|
||||||
public static final String INDEX_MAPPER_DYNAMIC_SETTING = "index.mapper.dynamic";
|
|
||||||
public static final boolean INDEX_MAPPER_DYNAMIC_DEFAULT = true;
|
public static final boolean INDEX_MAPPER_DYNAMIC_DEFAULT = true;
|
||||||
|
public static final Setting<Boolean> INDEX_MAPPER_DYNAMIC_SETTING = Setting.boolSetting("index.mapper.dynamic", INDEX_MAPPER_DYNAMIC_DEFAULT, false, Setting.Scope.INDEX);
|
||||||
private static ObjectHashSet<String> META_FIELDS = ObjectHashSet.from(
|
private static ObjectHashSet<String> META_FIELDS = ObjectHashSet.from(
|
||||||
"_uid", "_id", "_type", "_all", "_parent", "_routing", "_index",
|
"_uid", "_id", "_type", "_all", "_parent", "_routing", "_index",
|
||||||
"_size", "_timestamp", "_ttl"
|
"_size", "_timestamp", "_ttl"
|
||||||
|
@ -128,7 +129,7 @@ public class MapperService extends AbstractIndexComponent implements Closeable {
|
||||||
this.searchQuoteAnalyzer = new MapperAnalyzerWrapper(analysisService.defaultSearchQuoteAnalyzer(), p -> p.searchQuoteAnalyzer());
|
this.searchQuoteAnalyzer = new MapperAnalyzerWrapper(analysisService.defaultSearchQuoteAnalyzer(), p -> p.searchQuoteAnalyzer());
|
||||||
this.mapperRegistry = mapperRegistry;
|
this.mapperRegistry = mapperRegistry;
|
||||||
|
|
||||||
this.dynamic = this.indexSettings.getSettings().getAsBoolean(INDEX_MAPPER_DYNAMIC_SETTING, INDEX_MAPPER_DYNAMIC_DEFAULT);
|
this.dynamic = this.indexSettings.getValue(INDEX_MAPPER_DYNAMIC_SETTING);
|
||||||
defaultPercolatorMappingSource = "{\n" +
|
defaultPercolatorMappingSource = "{\n" +
|
||||||
"\"_default_\":{\n" +
|
"\"_default_\":{\n" +
|
||||||
"\"properties\" : {\n" +
|
"\"properties\" : {\n" +
|
||||||
|
|
|
@ -119,7 +119,7 @@ public class PercolatorFieldMapper extends FieldMapper {
|
||||||
this.queryShardContext = queryShardContext;
|
this.queryShardContext = queryShardContext;
|
||||||
this.queryTermsField = queryTermsField;
|
this.queryTermsField = queryTermsField;
|
||||||
this.unknownQueryField = unknownQueryField;
|
this.unknownQueryField = unknownQueryField;
|
||||||
this.mapUnmappedFieldAsString = indexSettings.getAsBoolean(PercolatorQueriesRegistry.MAP_UNMAPPED_FIELDS_AS_STRING, false);
|
this.mapUnmappedFieldAsString = PercolatorQueriesRegistry.INDEX_MAP_UNMAPPED_FIELDS_AS_STRING_SETTING.get(indexSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -30,6 +30,7 @@ import org.elasticsearch.common.ParsingException;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.metrics.CounterMetric;
|
import org.elasticsearch.common.metrics.CounterMetric;
|
||||||
import org.elasticsearch.common.metrics.MeanMetric;
|
import org.elasticsearch.common.metrics.MeanMetric;
|
||||||
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
|
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
|
||||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
|
@ -60,7 +61,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
*/
|
*/
|
||||||
public final class PercolatorQueriesRegistry extends AbstractIndexShardComponent implements Closeable {
|
public final class PercolatorQueriesRegistry extends AbstractIndexShardComponent implements Closeable {
|
||||||
|
|
||||||
public final static String MAP_UNMAPPED_FIELDS_AS_STRING = "index.percolator.map_unmapped_fields_as_string";
|
public final static Setting<Boolean> INDEX_MAP_UNMAPPED_FIELDS_AS_STRING_SETTING = Setting.boolSetting("index.percolator.map_unmapped_fields_as_string", false, false, Setting.Scope.INDEX);
|
||||||
|
|
||||||
private final ConcurrentMap<BytesRef, Query> percolateQueries = ConcurrentCollections.newConcurrentMapWithAggressiveConcurrency();
|
private final ConcurrentMap<BytesRef, Query> percolateQueries = ConcurrentCollections.newConcurrentMapWithAggressiveConcurrency();
|
||||||
private final QueryShardContext queryShardContext;
|
private final QueryShardContext queryShardContext;
|
||||||
|
@ -72,7 +73,7 @@ public final class PercolatorQueriesRegistry extends AbstractIndexShardComponent
|
||||||
public PercolatorQueriesRegistry(ShardId shardId, IndexSettings indexSettings, QueryShardContext queryShardContext) {
|
public PercolatorQueriesRegistry(ShardId shardId, IndexSettings indexSettings, QueryShardContext queryShardContext) {
|
||||||
super(shardId, indexSettings);
|
super(shardId, indexSettings);
|
||||||
this.queryShardContext = queryShardContext;
|
this.queryShardContext = queryShardContext;
|
||||||
this.mapUnmappedFieldsAsString = this.indexSettings.getSettings().getAsBoolean(MAP_UNMAPPED_FIELDS_AS_STRING, false);
|
this.mapUnmappedFieldsAsString = indexSettings.getValue(INDEX_MAP_UNMAPPED_FIELDS_AS_STRING_SETTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConcurrentMap<BytesRef, Query> getPercolateQueries() {
|
public ConcurrentMap<BytesRef, Query> getPercolateQueries() {
|
||||||
|
|
|
@ -61,6 +61,7 @@ import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.lucene.Lucene;
|
import org.elasticsearch.common.lucene.Lucene;
|
||||||
import org.elasticsearch.common.lucene.store.ByteArrayIndexInput;
|
import org.elasticsearch.common.lucene.store.ByteArrayIndexInput;
|
||||||
import org.elasticsearch.common.lucene.store.InputStreamIndexInput;
|
import org.elasticsearch.common.lucene.store.InputStreamIndexInput;
|
||||||
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.util.Callback;
|
import org.elasticsearch.common.util.Callback;
|
||||||
|
@ -81,6 +82,7 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.file.NoSuchFileException;
|
import java.nio.file.NoSuchFileException;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
import java.sql.Time;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
@ -126,7 +128,7 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
|
||||||
static final int VERSION_START = 0;
|
static final int VERSION_START = 0;
|
||||||
static final int VERSION = VERSION_WRITE_THROWABLE;
|
static final int VERSION = VERSION_WRITE_THROWABLE;
|
||||||
static final String CORRUPTED = "corrupted_";
|
static final String CORRUPTED = "corrupted_";
|
||||||
public static final String INDEX_STORE_STATS_REFRESH_INTERVAL = "index.store.stats_refresh_interval";
|
public static final Setting<TimeValue> INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING = Setting.timeSetting("index.store.stats_refresh_interval", TimeValue.timeValueSeconds(10), false, Setting.Scope.INDEX);
|
||||||
|
|
||||||
private final AtomicBoolean isClosed = new AtomicBoolean(false);
|
private final AtomicBoolean isClosed = new AtomicBoolean(false);
|
||||||
private final StoreDirectory directory;
|
private final StoreDirectory directory;
|
||||||
|
@ -154,7 +156,7 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
|
||||||
this.directory = new StoreDirectory(directoryService.newDirectory(), Loggers.getLogger("index.store.deletes", settings, shardId));
|
this.directory = new StoreDirectory(directoryService.newDirectory(), Loggers.getLogger("index.store.deletes", settings, shardId));
|
||||||
this.shardLock = shardLock;
|
this.shardLock = shardLock;
|
||||||
this.onClose = onClose;
|
this.onClose = onClose;
|
||||||
final TimeValue refreshInterval = settings.getAsTime(INDEX_STORE_STATS_REFRESH_INTERVAL, TimeValue.timeValueSeconds(10));
|
final TimeValue refreshInterval = indexSettings.getValue(INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING);
|
||||||
this.statsCache = new StoreStatsCache(refreshInterval, directory, directoryService);
|
this.statsCache = new StoreStatsCache(refreshInterval, directory, directoryService);
|
||||||
logger.debug("store stats are refreshed with refresh_interval [{}]", refreshInterval);
|
logger.debug("store stats are refreshed with refresh_interval [{}]", refreshInterval);
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class ClusterStatsIT extends ESIntegTestCase {
|
||||||
public void testValuesSmokeScreen() throws IOException {
|
public void testValuesSmokeScreen() throws IOException {
|
||||||
internalCluster().ensureAtMostNumDataNodes(5);
|
internalCluster().ensureAtMostNumDataNodes(5);
|
||||||
internalCluster().ensureAtLeastNumDataNodes(1);
|
internalCluster().ensureAtLeastNumDataNodes(1);
|
||||||
assertAcked(prepareCreate("test1").setSettings(settingsBuilder().put(Store.INDEX_STORE_STATS_REFRESH_INTERVAL, 0).build()));
|
assertAcked(prepareCreate("test1").setSettings(settingsBuilder().put(Store.INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING.getKey(), 0).build()));
|
||||||
index("test1", "type", "1", "f", "f");
|
index("test1", "type", "1", "f", "f");
|
||||||
/*
|
/*
|
||||||
* Ensure at least one shard is allocated otherwise the FS stats might
|
* Ensure at least one shard is allocated otherwise the FS stats might
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.elasticsearch.index.MergePolicyConfig;
|
||||||
import org.elasticsearch.indices.IndexClosedException;
|
import org.elasticsearch.indices.IndexClosedException;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -38,7 +38,7 @@ public class IndicesSegmentsRequestTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
|
|
@ -35,10 +35,15 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.index.IndexService;
|
import org.elasticsearch.index.IndexService;
|
||||||
import org.elasticsearch.index.shard.IndexShard;
|
import org.elasticsearch.index.shard.IndexShard;
|
||||||
import org.elasticsearch.indices.IndicesService;
|
import org.elasticsearch.indices.IndicesService;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
import org.elasticsearch.test.MockIndexEventListener;
|
||||||
import org.elasticsearch.test.junit.annotations.TestLogging;
|
import org.elasticsearch.test.junit.annotations.TestLogging;
|
||||||
import org.elasticsearch.test.store.MockFSIndexStore;
|
import org.elasticsearch.test.store.MockFSIndexStore;
|
||||||
|
import org.elasticsearch.test.transport.MockTransportService;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -57,6 +62,12 @@ import static org.hamcrest.Matchers.nullValue;
|
||||||
|
|
||||||
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST)
|
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST)
|
||||||
public class IndicesShardStoreRequestIT extends ESIntegTestCase {
|
public class IndicesShardStoreRequestIT extends ESIntegTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
return pluginList( MockFSIndexStore.TestPlugin.class);
|
||||||
|
}
|
||||||
|
|
||||||
public void testEmpty() {
|
public void testEmpty() {
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
IndicesShardStoresResponse rsp = client().admin().indices().prepareShardStores().get();
|
IndicesShardStoresResponse rsp = client().admin().indices().prepareShardStores().get();
|
||||||
|
@ -148,7 +159,7 @@ public class IndicesShardStoreRequestIT extends ESIntegTestCase {
|
||||||
internalCluster().ensureAtLeastNumDataNodes(2);
|
internalCluster().ensureAtLeastNumDataNodes(2);
|
||||||
assertAcked(prepareCreate(index).setSettings(Settings.builder()
|
assertAcked(prepareCreate(index).setSettings(Settings.builder()
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, "5")
|
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, "5")
|
||||||
.put(MockFSIndexStore.CHECK_INDEX_ON_CLOSE, false)
|
.put(MockFSIndexStore.INDEX_CHECK_INDEX_ON_CLOSE_SETTING.getKey(), false)
|
||||||
));
|
));
|
||||||
indexRandomData(index);
|
indexRandomData(index);
|
||||||
ensureGreen(index);
|
ensureGreen(index);
|
||||||
|
|
|
@ -443,7 +443,7 @@ public class IndexAliasesIT extends ESIntegTestCase {
|
||||||
|
|
||||||
public void testWaitForAliasCreationSingleShard() throws Exception {
|
public void testWaitForAliasCreationSingleShard() throws Exception {
|
||||||
logger.info("--> creating index [test]");
|
logger.info("--> creating index [test]");
|
||||||
assertAcked(admin().indices().create(createIndexRequest("test").settings(settingsBuilder().put("index.numberOfReplicas", 0).put("index.numberOfShards", 1))).get());
|
assertAcked(admin().indices().create(createIndexRequest("test").settings(settingsBuilder().put("index.number_of_replicas", 0).put("index.number_of_shards", 1))).get());
|
||||||
|
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class ClusterInfoServiceIT extends ESIntegTestCase {
|
||||||
public void testClusterInfoServiceCollectsInformation() throws Exception {
|
public void testClusterInfoServiceCollectsInformation() throws Exception {
|
||||||
internalCluster().startNodesAsync(2).get();
|
internalCluster().startNodesAsync(2).get();
|
||||||
assertAcked(prepareCreate("test").setSettings(settingsBuilder()
|
assertAcked(prepareCreate("test").setSettings(settingsBuilder()
|
||||||
.put(Store.INDEX_STORE_STATS_REFRESH_INTERVAL, 0)
|
.put(Store.INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING.getKey(), 0)
|
||||||
.put(EnableAllocationDecider.INDEX_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), EnableAllocationDecider.Rebalance.NONE).build()));
|
.put(EnableAllocationDecider.INDEX_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), EnableAllocationDecider.Rebalance.NONE).build()));
|
||||||
ensureGreen("test");
|
ensureGreen("test");
|
||||||
InternalTestCluster internalTestCluster = internalCluster();
|
InternalTestCluster internalTestCluster = internalCluster();
|
||||||
|
|
|
@ -123,7 +123,7 @@ public class DelayedAllocationIT extends ESIntegTestCase {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
assertThat(client().admin().cluster().prepareHealth().get().getDelayedUnassignedShards(), equalTo(1));
|
assertThat(client().admin().cluster().prepareHealth().get().getDelayedUnassignedShards(), equalTo(1));
|
||||||
assertAcked(client().admin().indices().prepareUpdateSettings("test").setSettings(Settings.builder().put(UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING, TimeValue.timeValueMillis(100))).get());
|
assertAcked(client().admin().indices().prepareUpdateSettings("test").setSettings(Settings.builder().put(UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), TimeValue.timeValueMillis(100))).get());
|
||||||
ensureGreen("test");
|
ensureGreen("test");
|
||||||
assertThat(client().admin().cluster().prepareHealth().get().getDelayedUnassignedShards(), equalTo(0));
|
assertThat(client().admin().cluster().prepareHealth().get().getDelayedUnassignedShards(), equalTo(0));
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,7 +265,7 @@ public class ClusterSettingsIT extends ESIntegTestCase {
|
||||||
.get();
|
.get();
|
||||||
fail("bogus value");
|
fail("bogus value");
|
||||||
} catch (IllegalArgumentException ex) {
|
} catch (IllegalArgumentException ex) {
|
||||||
assertEquals(ex.getMessage(), "Failed to parse setting [discovery.zen.commit_timeout] with value [whatever] as a time value: unit is missing or unrecognized");
|
assertEquals(ex.getMessage(), "Failed to parse setting [discovery.zen.publish_timeout] with value [whatever] as a time value: unit is missing or unrecognized");
|
||||||
}
|
}
|
||||||
|
|
||||||
assertThat(discoverySettings.getPublishTimeout().seconds(), equalTo(1l));
|
assertThat(discoverySettings.getPublishTimeout().seconds(), equalTo(1l));
|
||||||
|
|
|
@ -23,8 +23,10 @@ import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
|
||||||
import org.elasticsearch.common.inject.AbstractModule;
|
import org.elasticsearch.common.inject.AbstractModule;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.inject.Module;
|
import org.elasticsearch.common.inject.Module;
|
||||||
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.settings.SettingsFilter;
|
import org.elasticsearch.common.settings.SettingsFilter;
|
||||||
|
import org.elasticsearch.common.settings.SettingsModule;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
|
@ -62,6 +64,10 @@ public class SettingsFilteringIT extends ESIntegTestCase {
|
||||||
return "Settings Filtering Plugin";
|
return "Settings Filtering Plugin";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onModule(SettingsModule module) {
|
||||||
|
module.registerSetting(Setting.groupSetting("index.filter_test.", false, Setting.Scope.INDEX));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Module> nodeModules() {
|
public Collection<Module> nodeModules() {
|
||||||
return Collections.<Module>singletonList(new SettingsFilteringModule());
|
return Collections.<Module>singletonList(new SettingsFilteringModule());
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.elasticsearch.index.mapper.DocumentMapperParser;
|
||||||
import org.elasticsearch.index.mapper.MapperParsingException;
|
import org.elasticsearch.index.mapper.MapperParsingException;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ public class CodecTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAcceptPostingsFormat() throws IOException {
|
public void testAcceptPostingsFormat() throws IOException {
|
||||||
|
|
|
@ -31,6 +31,7 @@ import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.index.engine.Engine;
|
import org.elasticsearch.index.engine.Engine;
|
||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
import org.elasticsearch.indices.recovery.RecoveryState;
|
import org.elasticsearch.indices.recovery.RecoveryState;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import org.elasticsearch.test.ESIntegTestCase.Scope;
|
import org.elasticsearch.test.ESIntegTestCase.Scope;
|
||||||
|
@ -39,6 +40,8 @@ import org.elasticsearch.test.junit.annotations.TestLogging;
|
||||||
import org.elasticsearch.test.store.MockFSDirectoryService;
|
import org.elasticsearch.test.store.MockFSDirectoryService;
|
||||||
import org.elasticsearch.test.store.MockFSIndexStore;
|
import org.elasticsearch.test.store.MockFSIndexStore;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_REPLICAS;
|
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_REPLICAS;
|
||||||
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_SHARDS;
|
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_SHARDS;
|
||||||
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
||||||
|
@ -54,6 +57,12 @@ import static org.hamcrest.Matchers.notNullValue;
|
||||||
|
|
||||||
@ClusterScope(numDataNodes = 0, scope = Scope.TEST)
|
@ClusterScope(numDataNodes = 0, scope = Scope.TEST)
|
||||||
public class RecoveryFromGatewayIT extends ESIntegTestCase {
|
public class RecoveryFromGatewayIT extends ESIntegTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
return pluginList(MockFSIndexStore.TestPlugin.class);
|
||||||
|
}
|
||||||
|
|
||||||
public void testOneNodeRecoverFromGateway() throws Exception {
|
public void testOneNodeRecoverFromGateway() throws Exception {
|
||||||
|
|
||||||
internalCluster().startNode();
|
internalCluster().startNode();
|
||||||
|
@ -322,7 +331,7 @@ public class RecoveryFromGatewayIT extends ESIntegTestCase {
|
||||||
public void testReusePeerRecovery() throws Exception {
|
public void testReusePeerRecovery() throws Exception {
|
||||||
final Settings settings = settingsBuilder()
|
final Settings settings = settingsBuilder()
|
||||||
.put("action.admin.cluster.node.shutdown.delay", "10ms")
|
.put("action.admin.cluster.node.shutdown.delay", "10ms")
|
||||||
.put(MockFSIndexStore.CHECK_INDEX_ON_CLOSE, false)
|
.put(MockFSIndexStore.INDEX_CHECK_INDEX_ON_CLOSE_SETTING, false)
|
||||||
.put("gateway.recover_after_nodes", 4)
|
.put("gateway.recover_after_nodes", 4)
|
||||||
.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_INCOMING_RECOVERIES_SETTING, 4)
|
.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_INCOMING_RECOVERIES_SETTING, 4)
|
||||||
.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING, 4)
|
.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING, 4)
|
||||||
|
|
|
@ -40,10 +40,13 @@ import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.index.engine.VersionConflictEngineException;
|
import org.elasticsearch.index.engine.VersionConflictEngineException;
|
||||||
import org.elasticsearch.index.mapper.internal.TimestampFieldMapper;
|
import org.elasticsearch.index.mapper.internal.TimestampFieldMapper;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.junit.annotations.TestLogging;
|
import org.elasticsearch.test.junit.annotations.TestLogging;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -62,6 +65,12 @@ import static org.hamcrest.Matchers.nullValue;
|
||||||
import static org.hamcrest.Matchers.startsWith;
|
import static org.hamcrest.Matchers.startsWith;
|
||||||
|
|
||||||
public class GetActionIT extends ESIntegTestCase {
|
public class GetActionIT extends ESIntegTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
return pluginList(InternalSettingsPlugin.class); // uses index.version.created
|
||||||
|
}
|
||||||
|
|
||||||
public void testSimpleGet() {
|
public void testSimpleGet() {
|
||||||
assertAcked(prepareCreate("test")
|
assertAcked(prepareCreate("test")
|
||||||
.setSettings(Settings.settingsBuilder().put("index.refresh_interval", -1))
|
.setSettings(Settings.settingsBuilder().put("index.refresh_interval", -1))
|
||||||
|
|
|
@ -252,13 +252,8 @@ public class IndexSettingsTests extends ESTestCase {
|
||||||
TimeValue newGCDeleteSetting = new TimeValue(Math.abs(randomInt()), TimeUnit.MILLISECONDS);
|
TimeValue newGCDeleteSetting = new TimeValue(Math.abs(randomInt()), TimeUnit.MILLISECONDS);
|
||||||
settings.updateIndexMetaData(newIndexMeta("index", Settings.builder().put(IndexSettings.INDEX_GC_DELETES_SETTING.getKey(), newGCDeleteSetting.getStringRep()).build()));
|
settings.updateIndexMetaData(newIndexMeta("index", Settings.builder().put(IndexSettings.INDEX_GC_DELETES_SETTING.getKey(), newGCDeleteSetting.getStringRep()).build()));
|
||||||
assertEquals(TimeValue.parseTimeValue(newGCDeleteSetting.getStringRep(), new TimeValue(1, TimeUnit.DAYS), IndexSettings.INDEX_GC_DELETES_SETTING.getKey()).getMillis(), settings.getGcDeletesInMillis());
|
assertEquals(TimeValue.parseTimeValue(newGCDeleteSetting.getStringRep(), new TimeValue(1, TimeUnit.DAYS), IndexSettings.INDEX_GC_DELETES_SETTING.getKey()).getMillis(), settings.getGcDeletesInMillis());
|
||||||
|
settings.updateIndexMetaData(newIndexMeta("index", Settings.builder().put(IndexSettings.INDEX_GC_DELETES_SETTING.getKey(), randomBoolean() ? -1 : new TimeValue(-1, TimeUnit.MILLISECONDS)).build()));
|
||||||
try {
|
assertEquals(-1, settings.getGcDeletesInMillis());
|
||||||
settings.updateIndexMetaData(newIndexMeta("index", Settings.builder().put(IndexSettings.INDEX_GC_DELETES_SETTING.getKey(), new TimeValue(-1, TimeUnit.MILLISECONDS)).build()));
|
|
||||||
fail();
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
// expected
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testIsTTLPurgeDisabled() {
|
public void testIsTTLPurgeDisabled() {
|
||||||
|
|
|
@ -29,7 +29,7 @@ import org.elasticsearch.index.mapper.FieldMapper;
|
||||||
import org.elasticsearch.indices.analysis.PreBuiltAnalyzers;
|
import org.elasticsearch.indices.analysis.PreBuiltAnalyzers;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -46,7 +46,7 @@ public class PreBuiltAnalyzerTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testThatDefaultAndStandardAnalyzerAreTheSameInstance() {
|
public void testThatDefaultAndStandardAnalyzerAreTheSameInstance() {
|
||||||
|
|
|
@ -51,7 +51,7 @@ import org.elasticsearch.index.shard.ShardId;
|
||||||
import org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache;
|
import org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -89,7 +89,7 @@ public abstract class AbstractFieldDataTestCase extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <IFD extends IndexFieldData<?>> IFD getForField(FieldDataType type, String fieldName, boolean docValues) {
|
public <IFD extends IndexFieldData<?>> IFD getForField(FieldDataType type, String fieldName, boolean docValues) {
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class DynamicMappingDisabledTests extends ESSingleNodeTestCase {
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
settings = Settings.builder()
|
settings = Settings.builder()
|
||||||
.put(MapperService.INDEX_MAPPER_DYNAMIC_SETTING, false)
|
.put(MapperService.INDEX_MAPPER_DYNAMIC_SETTING.getKey(), false)
|
||||||
.build();
|
.build();
|
||||||
clusterService = new TestClusterService(THREAD_POOL);
|
clusterService = new TestClusterService(THREAD_POOL);
|
||||||
transport = new LocalTransport(settings, THREAD_POOL, Version.CURRENT, new NamedWriteableRegistry());
|
transport = new LocalTransport(settings, THREAD_POOL, Version.CURRENT, new NamedWriteableRegistry());
|
||||||
|
|
|
@ -43,12 +43,11 @@ import org.elasticsearch.index.mapper.DocumentMapper;
|
||||||
import org.elasticsearch.index.mapper.DocumentMapperParser;
|
import org.elasticsearch.index.mapper.DocumentMapperParser;
|
||||||
import org.elasticsearch.index.mapper.MapperParsingException;
|
import org.elasticsearch.index.mapper.MapperParsingException;
|
||||||
import org.elasticsearch.index.mapper.ParseContext.Document;
|
import org.elasticsearch.index.mapper.ParseContext.Document;
|
||||||
import org.elasticsearch.index.mapper.ParsedDocument;
|
|
||||||
import org.elasticsearch.index.mapper.internal.AllFieldMapper;
|
import org.elasticsearch.index.mapper.internal.AllFieldMapper;
|
||||||
import org.elasticsearch.index.mapper.internal.TimestampFieldMapper;
|
import org.elasticsearch.index.mapper.internal.TimestampFieldMapper;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.hamcrest.Matchers;
|
import org.hamcrest.Matchers;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -73,7 +72,7 @@ public class SimpleAllMapperTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimpleAllMappers() throws Exception {
|
public void testSimpleAllMappers() throws Exception {
|
||||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.index.mapper.DocumentMapper;
|
||||||
import org.elasticsearch.index.mapper.ParsedDocument;
|
import org.elasticsearch.index.mapper.ParsedDocument;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ public class CustomBoostMappingTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testBackCompatCustomBoostValues() throws Exception {
|
public void testBackCompatCustomBoostValues() throws Exception {
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.elasticsearch.index.mapper.MapperParsingException;
|
||||||
import org.elasticsearch.index.mapper.ParseContext.Document;
|
import org.elasticsearch.index.mapper.ParseContext.Document;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class FieldLevelBoostTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testBackCompatFieldLevelBoost() throws Exception {
|
public void testBackCompatFieldLevelBoost() throws Exception {
|
||||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.index.mapper.DocumentMapper;
|
||||||
import org.elasticsearch.index.mapper.ParsedDocument;
|
import org.elasticsearch.index.mapper.ParsedDocument;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public class CompoundTypesTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Settings BW_SETTINGS = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.V_2_0_0).build();
|
private static final Settings BW_SETTINGS = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.V_2_0_0).build();
|
||||||
|
|
|
@ -34,7 +34,7 @@ import org.elasticsearch.index.mapper.core.StringFieldMapper;
|
||||||
import org.elasticsearch.indices.mapper.MapperRegistry;
|
import org.elasticsearch.indices.mapper.MapperRegistry;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -51,7 +51,7 @@ public class SimpleExternalMappingTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testExternalValues() throws Exception {
|
public void testExternalValues() throws Exception {
|
||||||
|
|
|
@ -38,7 +38,7 @@ import org.elasticsearch.index.mapper.ParsedDocument;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.search.SearchHitField;
|
import org.elasticsearch.search.SearchHitField;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
import org.elasticsearch.test.geo.RandomGeoGenerator;
|
import org.elasticsearch.test.geo.RandomGeoGenerator;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public class GeoPointFieldMapperTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testLatLonValues() throws Exception {
|
public void testLatLonValues() throws Exception {
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.elasticsearch.index.mapper.FieldMapper;
|
||||||
import org.elasticsearch.index.mapper.ParsedDocument;
|
import org.elasticsearch.index.mapper.ParsedDocument;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -49,7 +49,7 @@ public class GeohashMappingGeoPointTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testLatLonValues() throws Exception {
|
public void testLatLonValues() throws Exception {
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.index.mapper.DocumentMapper;
|
import org.elasticsearch.index.mapper.DocumentMapper;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public class TypeFieldMapperTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDocValues() throws Exception {
|
public void testDocValues() throws Exception {
|
||||||
|
|
|
@ -43,7 +43,7 @@ import org.elasticsearch.index.mapper.core.StringFieldMapper;
|
||||||
import org.elasticsearch.index.mapper.string.SimpleStringMappingTests;
|
import org.elasticsearch.index.mapper.string.SimpleStringMappingTests;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -62,7 +62,7 @@ public class SimpleNumericTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNumericDetectionEnabled() throws Exception {
|
public void testNumericDetectionEnabled() throws Exception {
|
||||||
|
|
|
@ -35,7 +35,7 @@ import org.elasticsearch.index.mapper.MapperService;
|
||||||
import org.elasticsearch.index.mapper.ParsedDocument;
|
import org.elasticsearch.index.mapper.ParsedDocument;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -49,7 +49,7 @@ public class DefaultSourceMappingTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNoFormat() throws Exception {
|
public void testNoFormat() throws Exception {
|
||||||
|
|
|
@ -36,7 +36,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.index.mapper.DocumentMapper;
|
import org.elasticsearch.index.mapper.DocumentMapper;
|
||||||
import org.elasticsearch.index.mapper.DocumentMapperParser;
|
import org.elasticsearch.index.mapper.DocumentMapperParser;
|
||||||
import org.elasticsearch.index.mapper.MappedFieldType;
|
|
||||||
import org.elasticsearch.index.mapper.MapperParsingException;
|
import org.elasticsearch.index.mapper.MapperParsingException;
|
||||||
import org.elasticsearch.index.mapper.MapperService;
|
import org.elasticsearch.index.mapper.MapperService;
|
||||||
import org.elasticsearch.index.mapper.ParsedDocument;
|
import org.elasticsearch.index.mapper.ParsedDocument;
|
||||||
|
@ -44,7 +43,7 @@ import org.elasticsearch.index.mapper.SourceToParse;
|
||||||
import org.elasticsearch.index.mapper.internal.TimestampFieldMapper;
|
import org.elasticsearch.index.mapper.internal.TimestampFieldMapper;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
@ -68,7 +67,7 @@ public class TimestampMappingTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimpleDisabled() throws Exception {
|
public void testSimpleDisabled() throws Exception {
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.elasticsearch.index.mapper.MapperService;
|
||||||
import org.elasticsearch.index.mapper.core.LongFieldMapper;
|
import org.elasticsearch.index.mapper.core.LongFieldMapper;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -46,7 +46,7 @@ import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
public class UpdateMappingTests extends ESSingleNodeTestCase {
|
public class UpdateMappingTests extends ESSingleNodeTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAllEnabledAfterDisabled() throws Exception {
|
public void testAllEnabledAfterDisabled() throws Exception {
|
||||||
|
|
|
@ -93,7 +93,7 @@ import org.elasticsearch.test.DummyShardLock;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.FieldMaskingReader;
|
import org.elasticsearch.test.FieldMaskingReader;
|
||||||
import org.elasticsearch.test.IndexSettingsModule;
|
import org.elasticsearch.test.IndexSettingsModule;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -132,7 +132,7 @@ public class IndexShardTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testWriteShardState() throws Exception {
|
public void testWriteShardState() throws Exception {
|
||||||
|
|
|
@ -41,7 +41,7 @@ import org.elasticsearch.index.mapper.DocumentMapperParser;
|
||||||
import org.elasticsearch.index.mapper.MapperParsingException;
|
import org.elasticsearch.index.mapper.MapperParsingException;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -54,7 +54,7 @@ public class SimilarityTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testResolveDefaultSimilarities() {
|
public void testResolveDefaultSimilarities() {
|
||||||
|
|
|
@ -62,6 +62,7 @@ import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.snapshots.SnapshotState;
|
import org.elasticsearch.snapshots.SnapshotState;
|
||||||
import org.elasticsearch.test.CorruptionUtils;
|
import org.elasticsearch.test.CorruptionUtils;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.InternalTestCluster;
|
import org.elasticsearch.test.InternalTestCluster;
|
||||||
import org.elasticsearch.test.MockIndexEventListener;
|
import org.elasticsearch.test.MockIndexEventListener;
|
||||||
import org.elasticsearch.test.store.MockFSIndexStore;
|
import org.elasticsearch.test.store.MockFSIndexStore;
|
||||||
|
@ -107,6 +108,7 @@ import static org.hamcrest.Matchers.notNullValue;
|
||||||
|
|
||||||
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.SUITE)
|
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.SUITE)
|
||||||
public class CorruptedFileIT extends ESIntegTestCase {
|
public class CorruptedFileIT extends ESIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
return Settings.builder()
|
return Settings.builder()
|
||||||
|
@ -121,7 +123,8 @@ public class CorruptedFileIT extends ESIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
return pluginList(MockTransportService.TestPlugin.class, MockIndexEventListener.TestPlugin.class);
|
return pluginList(MockTransportService.TestPlugin.class, MockIndexEventListener.TestPlugin.class, MockFSIndexStore.TestPlugin.class,
|
||||||
|
InternalSettingsPlugin.class); // uses index.version.created
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -141,9 +144,8 @@ public class CorruptedFileIT extends ESIntegTestCase {
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, "1")
|
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, "1")
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, "1")
|
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, "1")
|
||||||
.put(MergePolicyConfig.INDEX_MERGE_ENABLED, false)
|
.put(MergePolicyConfig.INDEX_MERGE_ENABLED, false)
|
||||||
.put(MockFSIndexStore.CHECK_INDEX_ON_CLOSE, false) // no checkindex - we corrupt shards on purpose
|
.put(MockFSIndexStore.INDEX_CHECK_INDEX_ON_CLOSE_SETTING.getKey(), false) // no checkindex - we corrupt shards on purpose
|
||||||
.put(IndexSettings.INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTTING.getKey(), new ByteSizeValue(1, ByteSizeUnit.PB)) // no translog based flush - it might change the .liv / segments.N files
|
.put(IndexSettings.INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTTING.getKey(), new ByteSizeValue(1, ByteSizeUnit.PB)) // no translog based flush - it might change the .liv / segments.N files
|
||||||
.put("indices.recovery.concurrent_streams", 10)
|
|
||||||
));
|
));
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
disableAllocation("test");
|
disableAllocation("test");
|
||||||
|
@ -246,9 +248,8 @@ public class CorruptedFileIT extends ESIntegTestCase {
|
||||||
assertAcked(prepareCreate("test").setSettings(Settings.builder()
|
assertAcked(prepareCreate("test").setSettings(Settings.builder()
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, "0")
|
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, "0")
|
||||||
.put(MergePolicyConfig.INDEX_MERGE_ENABLED, false)
|
.put(MergePolicyConfig.INDEX_MERGE_ENABLED, false)
|
||||||
.put(MockFSIndexStore.CHECK_INDEX_ON_CLOSE, false) // no checkindex - we corrupt shards on purpose
|
.put(MockFSIndexStore.INDEX_CHECK_INDEX_ON_CLOSE_SETTING.getKey(), false) // no checkindex - we corrupt shards on purpose
|
||||||
.put(IndexSettings.INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTTING.getKey(), new ByteSizeValue(1, ByteSizeUnit.PB)) // no translog based flush - it might change the .liv / segments.N files
|
.put(IndexSettings.INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTTING.getKey(), new ByteSizeValue(1, ByteSizeUnit.PB)) // no translog based flush - it might change the .liv / segments.N files
|
||||||
.put("indices.recovery.concurrent_streams", 10)
|
|
||||||
));
|
));
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
IndexRequestBuilder[] builders = new IndexRequestBuilder[numDocs];
|
IndexRequestBuilder[] builders = new IndexRequestBuilder[numDocs];
|
||||||
|
@ -391,7 +392,7 @@ public class CorruptedFileIT extends ESIntegTestCase {
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, "0")
|
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, "0")
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, between(1, 4)) // don't go crazy here it must recovery fast
|
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, between(1, 4)) // don't go crazy here it must recovery fast
|
||||||
// This does corrupt files on the replica, so we can't check:
|
// This does corrupt files on the replica, so we can't check:
|
||||||
.put(MockFSIndexStore.CHECK_INDEX_ON_CLOSE, false)
|
.put(MockFSIndexStore.INDEX_CHECK_INDEX_ON_CLOSE_SETTING.getKey(), false)
|
||||||
.put("index.routing.allocation.include._name", primariesNode.getNode().name())
|
.put("index.routing.allocation.include._name", primariesNode.getNode().name())
|
||||||
.put(EnableAllocationDecider.INDEX_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), EnableAllocationDecider.Rebalance.NONE)
|
.put(EnableAllocationDecider.INDEX_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), EnableAllocationDecider.Rebalance.NONE)
|
||||||
));
|
));
|
||||||
|
@ -472,9 +473,8 @@ public class CorruptedFileIT extends ESIntegTestCase {
|
||||||
assertAcked(prepareCreate("test").setSettings(Settings.builder()
|
assertAcked(prepareCreate("test").setSettings(Settings.builder()
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, "0") // no replicas for this test
|
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, "0") // no replicas for this test
|
||||||
.put(MergePolicyConfig.INDEX_MERGE_ENABLED, false)
|
.put(MergePolicyConfig.INDEX_MERGE_ENABLED, false)
|
||||||
.put(MockFSIndexStore.CHECK_INDEX_ON_CLOSE, false) // no checkindex - we corrupt shards on purpose
|
.put(MockFSIndexStore.INDEX_CHECK_INDEX_ON_CLOSE_SETTING.getKey(), false) // no checkindex - we corrupt shards on purpose
|
||||||
.put(IndexSettings.INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTTING.getKey(), new ByteSizeValue(1, ByteSizeUnit.PB)) // no translog based flush - it might change the .liv / segments.N files
|
.put(IndexSettings.INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTTING.getKey(), new ByteSizeValue(1, ByteSizeUnit.PB)) // no translog based flush - it might change the .liv / segments.N files
|
||||||
.put("indices.recovery.concurrent_streams", 10)
|
|
||||||
));
|
));
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
IndexRequestBuilder[] builders = new IndexRequestBuilder[numDocs];
|
IndexRequestBuilder[] builders = new IndexRequestBuilder[numDocs];
|
||||||
|
@ -527,9 +527,8 @@ public class CorruptedFileIT extends ESIntegTestCase {
|
||||||
.put(PrimaryShardAllocator.INDEX_RECOVERY_INITIAL_SHARDS_SETTING.getKey(), "one")
|
.put(PrimaryShardAllocator.INDEX_RECOVERY_INITIAL_SHARDS_SETTING.getKey(), "one")
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, cluster().numDataNodes() - 1)
|
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, cluster().numDataNodes() - 1)
|
||||||
.put(MergePolicyConfig.INDEX_MERGE_ENABLED, false)
|
.put(MergePolicyConfig.INDEX_MERGE_ENABLED, false)
|
||||||
.put(MockFSIndexStore.CHECK_INDEX_ON_CLOSE, false) // no checkindex - we corrupt shards on purpose
|
.put(MockFSIndexStore.INDEX_CHECK_INDEX_ON_CLOSE_SETTING.getKey(), false) // no checkindex - we corrupt shards on purpose
|
||||||
.put(IndexSettings.INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTTING.getKey(), new ByteSizeValue(1, ByteSizeUnit.PB)) // no translog based flush - it might change the .liv / segments.N files
|
.put(IndexSettings.INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTTING.getKey(), new ByteSizeValue(1, ByteSizeUnit.PB)) // no translog based flush - it might change the .liv / segments.N files
|
||||||
.put("indices.recovery.concurrent_streams", 10)
|
|
||||||
));
|
));
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
IndexRequestBuilder[] builders = new IndexRequestBuilder[numDocs];
|
IndexRequestBuilder[] builders = new IndexRequestBuilder[numDocs];
|
||||||
|
|
|
@ -1154,7 +1154,7 @@ public class StoreTests extends ESTestCase {
|
||||||
DirectoryService directoryService = new LuceneManagedDirectoryService(random());
|
DirectoryService directoryService = new LuceneManagedDirectoryService(random());
|
||||||
Settings settings = Settings.builder()
|
Settings settings = Settings.builder()
|
||||||
.put(IndexMetaData.SETTING_VERSION_CREATED, org.elasticsearch.Version.CURRENT)
|
.put(IndexMetaData.SETTING_VERSION_CREATED, org.elasticsearch.Version.CURRENT)
|
||||||
.put(Store.INDEX_STORE_STATS_REFRESH_INTERVAL, TimeValue.timeValueMinutes(0)).build();
|
.put(Store.INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING.getKey(), TimeValue.timeValueMinutes(0)).build();
|
||||||
Store store = new Store(shardId, IndexSettingsModule.newIndexSettings(new Index("index"), settings), directoryService, new DummyShardLock(shardId));
|
Store store = new Store(shardId, IndexSettingsModule.newIndexSettings(new Index("index"), settings), directoryService, new DummyShardLock(shardId));
|
||||||
long initialStoreSize = 0;
|
long initialStoreSize = 0;
|
||||||
for (String extraFiles : store.directory().listAll()) {
|
for (String extraFiles : store.directory().listAll()) {
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class IndicesLifecycleListenerIT extends ESIntegTestCase {
|
||||||
@Override
|
@Override
|
||||||
public void beforeIndexAddedToCluster(Index index, Settings indexSettings) {
|
public void beforeIndexAddedToCluster(Index index, Settings indexSettings) {
|
||||||
beforeAddedCount.incrementAndGet();
|
beforeAddedCount.incrementAndGet();
|
||||||
if (indexSettings.getAsBoolean("index.fail", false)) {
|
if (MockIndexEventListener.TestPlugin.INDEX_FAIL.get(indexSettings)) {
|
||||||
throw new ElasticsearchException("failing on purpose");
|
throw new ElasticsearchException("failing on purpose");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESBackcompatTestCase;
|
import org.elasticsearch.test.ESBackcompatTestCase;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -46,7 +47,7 @@ import static org.hamcrest.Matchers.notNullValue;
|
||||||
public class PreBuiltAnalyzerIntegrationIT extends ESIntegTestCase {
|
public class PreBuiltAnalyzerIntegrationIT extends ESIntegTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
return pluginList(DummyAnalysisPlugin.class);
|
return pluginList(DummyAnalysisPlugin.class, InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testThatPreBuiltAnalyzersAreNotClosedOnIndexClose() throws Exception {
|
public void testThatPreBuiltAnalyzersAreNotClosedOnIndexClose() throws Exception {
|
||||||
|
|
|
@ -497,7 +497,7 @@ public class IndexRecoveryIT extends ESIntegTestCase {
|
||||||
|
|
||||||
logger.info("--> creating test index: {}", name);
|
logger.info("--> creating test index: {}", name);
|
||||||
assertAcked(prepareCreate(name, nodeCount, settingsBuilder().put("number_of_shards", shardCount)
|
assertAcked(prepareCreate(name, nodeCount, settingsBuilder().put("number_of_shards", shardCount)
|
||||||
.put("number_of_replicas", replicaCount).put(Store.INDEX_STORE_STATS_REFRESH_INTERVAL, 0)));
|
.put("number_of_replicas", replicaCount).put(Store.INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING.getKey(), 0)));
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
|
|
||||||
logger.info("--> indexing sample data");
|
logger.info("--> indexing sample data");
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class GetSettingsBlocksIT extends ESIntegTestCase {
|
||||||
.setSettings(Settings.settingsBuilder()
|
.setSettings(Settings.settingsBuilder()
|
||||||
.put("index.refresh_interval", -1)
|
.put("index.refresh_interval", -1)
|
||||||
.put("index.merge.policy.expunge_deletes_allowed", "30")
|
.put("index.merge.policy.expunge_deletes_allowed", "30")
|
||||||
.put(MapperService.INDEX_MAPPER_DYNAMIC_SETTING, false)));
|
.put(MapperService.INDEX_MAPPER_DYNAMIC_SETTING.getKey(), false)));
|
||||||
|
|
||||||
for (String block : Arrays.asList(SETTING_BLOCKS_READ, SETTING_BLOCKS_WRITE, SETTING_READ_ONLY)) {
|
for (String block : Arrays.asList(SETTING_BLOCKS_READ, SETTING_BLOCKS_WRITE, SETTING_READ_ONLY)) {
|
||||||
try {
|
try {
|
||||||
|
@ -50,7 +50,7 @@ public class GetSettingsBlocksIT extends ESIntegTestCase {
|
||||||
assertThat(response.getIndexToSettings().size(), greaterThanOrEqualTo(1));
|
assertThat(response.getIndexToSettings().size(), greaterThanOrEqualTo(1));
|
||||||
assertThat(response.getSetting("test", "index.refresh_interval"), equalTo("-1"));
|
assertThat(response.getSetting("test", "index.refresh_interval"), equalTo("-1"));
|
||||||
assertThat(response.getSetting("test", "index.merge.policy.expunge_deletes_allowed"), equalTo("30"));
|
assertThat(response.getSetting("test", "index.merge.policy.expunge_deletes_allowed"), equalTo("30"));
|
||||||
assertThat(response.getSetting("test", MapperService.INDEX_MAPPER_DYNAMIC_SETTING), equalTo("false"));
|
assertThat(response.getSetting("test", MapperService.INDEX_MAPPER_DYNAMIC_SETTING.getKey()), equalTo("false"));
|
||||||
} finally {
|
} finally {
|
||||||
disableIndexBlock("test", block);
|
disableIndexBlock("test", block);
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ public class UpdateSettingsIT extends ESIntegTestCase {
|
||||||
.put(MergePolicyConfig.INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING.getKey(), "2")
|
.put(MergePolicyConfig.INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING.getKey(), "2")
|
||||||
.put(MergeSchedulerConfig.MAX_THREAD_COUNT_SETTING.getKey(), "1")
|
.put(MergeSchedulerConfig.MAX_THREAD_COUNT_SETTING.getKey(), "1")
|
||||||
.put(MergeSchedulerConfig.MAX_MERGE_COUNT_SETTING.getKey(), "2")
|
.put(MergeSchedulerConfig.MAX_MERGE_COUNT_SETTING.getKey(), "2")
|
||||||
.put(Store.INDEX_STORE_STATS_REFRESH_INTERVAL, 0) // get stats all the time - no caching
|
.put(Store.INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING.getKey(), 0) // get stats all the time - no caching
|
||||||
));
|
));
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
long termUpto = 0;
|
long termUpto = 0;
|
||||||
|
|
|
@ -139,7 +139,8 @@ public class SimpleIndexStateIT extends ESIntegTestCase {
|
||||||
try {
|
try {
|
||||||
client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("number_of_shards", "bad")).get();
|
client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("number_of_shards", "bad")).get();
|
||||||
fail();
|
fail();
|
||||||
} catch (SettingsException ex) {
|
} catch (IllegalArgumentException ex) {
|
||||||
|
assertEquals("Failed to parse value [bad] for setting [index.number_of_shards]", ex.getMessage());
|
||||||
// Expected
|
// Expected
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -316,7 +316,6 @@ public class IndexStatsIT extends ESIntegTestCase {
|
||||||
.put(MergePolicyConfig.INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING.getKey(), "2")
|
.put(MergePolicyConfig.INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING.getKey(), "2")
|
||||||
.put(MergeSchedulerConfig.MAX_THREAD_COUNT_SETTING.getKey(), "1")
|
.put(MergeSchedulerConfig.MAX_THREAD_COUNT_SETTING.getKey(), "1")
|
||||||
.put(MergeSchedulerConfig.MAX_MERGE_COUNT_SETTING.getKey(), "1")
|
.put(MergeSchedulerConfig.MAX_MERGE_COUNT_SETTING.getKey(), "1")
|
||||||
.put("index.merge.policy.type", "tiered")
|
|
||||||
.put(IndexSettings.INDEX_TRANSLOG_DURABILITY_SETTING.getKey(), Translog.Durability.ASYNC.name())
|
.put(IndexSettings.INDEX_TRANSLOG_DURABILITY_SETTING.getKey(), Translog.Durability.ASYNC.name())
|
||||||
));
|
));
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed to Elasticsearch under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.elasticsearch.recovery;
|
|
||||||
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class SmallTranslogOpsRecoveryIT extends SimpleRecoveryIT {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Settings recoverySettings() {
|
|
||||||
return Settings.settingsBuilder().put("index.shard.recovery.translog_ops", 1).build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed to Elasticsearch under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.elasticsearch.recovery;
|
|
||||||
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class SmallTranslogSizeRecoveryIT extends SimpleRecoveryIT {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Settings recoverySettings() {
|
|
||||||
return Settings.settingsBuilder().put("index.shard.recovery.translog_size", "3b").build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -25,17 +25,20 @@ import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.DistanceUnit;
|
import org.elasticsearch.common.unit.DistanceUnit;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode;
|
import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode;
|
||||||
import org.elasticsearch.search.aggregations.bucket.histogram.Histogram;
|
import org.elasticsearch.search.aggregations.bucket.histogram.Histogram;
|
||||||
import org.elasticsearch.search.aggregations.bucket.range.Range;
|
import org.elasticsearch.search.aggregations.bucket.range.Range;
|
||||||
import org.elasticsearch.search.aggregations.bucket.range.Range.Bucket;
|
import org.elasticsearch.search.aggregations.bucket.range.Range.Bucket;
|
||||||
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
|
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
import org.hamcrest.Matchers;
|
import org.hamcrest.Matchers;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -57,6 +60,12 @@ import static org.hamcrest.core.IsNull.nullValue;
|
||||||
*/
|
*/
|
||||||
@ESIntegTestCase.SuiteScopeTestCase
|
@ESIntegTestCase.SuiteScopeTestCase
|
||||||
public class GeoDistanceIT extends ESIntegTestCase {
|
public class GeoDistanceIT extends ESIntegTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
return pluginList(InternalSettingsPlugin.class); // uses index.version.created
|
||||||
|
}
|
||||||
|
|
||||||
private Version version = VersionUtils.randomVersionBetween(random(), Version.V_1_0_0, Version.CURRENT);
|
private Version version = VersionUtils.randomVersionBetween(random(), Version.V_1_0_0, Version.CURRENT);
|
||||||
|
|
||||||
private IndexRequestBuilder indexCity(String idx, String name, String... latLons) throws Exception {
|
private IndexRequestBuilder indexCity(String idx, String name, String... latLons) throws Exception {
|
||||||
|
|
|
@ -30,15 +30,18 @@ import org.elasticsearch.common.geo.GeoPoint;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.index.query.GeoBoundingBoxQueryBuilder;
|
import org.elasticsearch.index.query.GeoBoundingBoxQueryBuilder;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.search.aggregations.AggregationBuilders;
|
import org.elasticsearch.search.aggregations.AggregationBuilders;
|
||||||
import org.elasticsearch.search.aggregations.bucket.filter.Filter;
|
import org.elasticsearch.search.aggregations.bucket.filter.Filter;
|
||||||
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGrid;
|
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGrid;
|
||||||
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGrid.Bucket;
|
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGrid.Bucket;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
@ -53,6 +56,12 @@ import static org.hamcrest.Matchers.greaterThanOrEqualTo;
|
||||||
|
|
||||||
@ESIntegTestCase.SuiteScopeTestCase
|
@ESIntegTestCase.SuiteScopeTestCase
|
||||||
public class GeoHashGridIT extends ESIntegTestCase {
|
public class GeoHashGridIT extends ESIntegTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
return pluginList(InternalSettingsPlugin.class); // uses index.version.created
|
||||||
|
}
|
||||||
|
|
||||||
private Version version = VersionUtils.randomVersionBetween(random(), Version.V_1_0_0, Version.CURRENT);
|
private Version version = VersionUtils.randomVersionBetween(random(), Version.V_1_0_0, Version.CURRENT);
|
||||||
|
|
||||||
static ObjectIntMap<String> expectedDocCountsForGeoHash = null;
|
static ObjectIntMap<String> expectedDocCountsForGeoHash = null;
|
||||||
|
|
|
@ -28,8 +28,10 @@ import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
|
||||||
import org.elasticsearch.action.index.IndexResponse;
|
import org.elasticsearch.action.index.IndexResponse;
|
||||||
import org.elasticsearch.action.search.SearchPhaseExecutionException;
|
import org.elasticsearch.action.search.SearchPhaseExecutionException;
|
||||||
import org.elasticsearch.action.search.SearchResponse;
|
import org.elasticsearch.action.search.SearchResponse;
|
||||||
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.settings.Settings.Builder;
|
import org.elasticsearch.common.settings.Settings.Builder;
|
||||||
|
import org.elasticsearch.common.settings.SettingsModule;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.index.MockEngineFactoryPlugin;
|
import org.elasticsearch.index.MockEngineFactoryPlugin;
|
||||||
|
@ -52,7 +54,7 @@ public class SearchWithRandomExceptionsIT extends ESIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
return pluginList(RandomExceptionDirectoryReaderWrapper.TestPlugin.class);
|
return pluginList(RandomExceptionDirectoryReaderWrapper.TestPlugin.class, MockEngineFactoryPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testRandomExceptions() throws IOException, InterruptedException, ExecutionException {
|
public void testRandomExceptions() throws IOException, InterruptedException, ExecutionException {
|
||||||
|
@ -151,10 +153,16 @@ public class SearchWithRandomExceptionsIT extends ESIntegTestCase {
|
||||||
public static class RandomExceptionDirectoryReaderWrapper extends MockEngineSupport.DirectoryReaderWrapper {
|
public static class RandomExceptionDirectoryReaderWrapper extends MockEngineSupport.DirectoryReaderWrapper {
|
||||||
|
|
||||||
public static class TestPlugin extends Plugin {
|
public static class TestPlugin extends Plugin {
|
||||||
|
public static final Setting<Double> EXCEPTION_TOP_LEVEL_RATIO_SETTING = Setting.doubleSetting(EXCEPTION_TOP_LEVEL_RATIO_KEY, 0.1d, 0.0d, false, Setting.Scope.INDEX);
|
||||||
|
public static final Setting<Double> EXCEPTION_LOW_LEVEL_RATIO_SETTING = Setting.doubleSetting(EXCEPTION_LOW_LEVEL_RATIO_KEY, 0.1d, 0.0d, false, Setting.Scope.INDEX);
|
||||||
@Override
|
@Override
|
||||||
public String name() {
|
public String name() {
|
||||||
return "random-exception-reader-wrapper";
|
return "random-exception-reader-wrapper";
|
||||||
}
|
}
|
||||||
|
public void onModule(SettingsModule module) {
|
||||||
|
module.registerSetting(EXCEPTION_TOP_LEVEL_RATIO_SETTING);
|
||||||
|
module.registerSetting(EXCEPTION_LOW_LEVEL_RATIO_SETTING);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public String description() {
|
public String description() {
|
||||||
return "a mock reader wrapper that throws random exceptions for testing";
|
return "a mock reader wrapper that throws random exceptions for testing";
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class SearchWithRandomIOExceptionsIT extends ESIntegTestCase {
|
||||||
} else {
|
} else {
|
||||||
Settings.Builder settings = settingsBuilder()
|
Settings.Builder settings = settingsBuilder()
|
||||||
.put("index.number_of_replicas", randomIntBetween(0, 1))
|
.put("index.number_of_replicas", randomIntBetween(0, 1))
|
||||||
.put(MockFSIndexStore.CHECK_INDEX_ON_CLOSE, false)
|
.put(MockFSIndexStore.INDEX_CHECK_INDEX_ON_CLOSE_SETTING.getKey(), false)
|
||||||
.put(MockFSDirectoryService.RANDOM_IO_EXCEPTION_RATE, exceptionRate)
|
.put(MockFSDirectoryService.RANDOM_IO_EXCEPTION_RATE, exceptionRate)
|
||||||
.put(MockFSDirectoryService.RANDOM_IO_EXCEPTION_RATE_ON_OPEN, exceptionOnOpenRate); // we cannot expect that the index will be valid
|
.put(MockFSDirectoryService.RANDOM_IO_EXCEPTION_RATE_ON_OPEN, exceptionOnOpenRate); // we cannot expect that the index will be valid
|
||||||
logger.info("creating index: [test] using settings: [{}]", settings.build().getAsMap());
|
logger.info("creating index: [test] using settings: [{}]", settings.build().getAsMap());
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class TransportSearchFailuresIT extends ESIntegTestCase {
|
||||||
|
|
||||||
public void testFailedSearchWithWrongQuery() throws Exception {
|
public void testFailedSearchWithWrongQuery() throws Exception {
|
||||||
logger.info("Start Testing failed search with wrong query");
|
logger.info("Start Testing failed search with wrong query");
|
||||||
assertAcked(prepareCreate("test", 1, settingsBuilder().put("routing.hash.type", "simple")));
|
assertAcked(prepareCreate("test", 1));
|
||||||
ensureYellow();
|
ensureYellow();
|
||||||
|
|
||||||
NumShards test = getNumShards("test");
|
NumShards test = getNumShards("test");
|
||||||
|
|
|
@ -82,8 +82,7 @@ public class TransportTwoNodesSearchIT extends ESIntegTestCase {
|
||||||
Set<String> fullExpectedIds = new TreeSet<>();
|
Set<String> fullExpectedIds = new TreeSet<>();
|
||||||
|
|
||||||
Settings.Builder settingsBuilder = settingsBuilder()
|
Settings.Builder settingsBuilder = settingsBuilder()
|
||||||
.put(indexSettings())
|
.put(indexSettings());
|
||||||
.put("routing.hash.type", "simple");
|
|
||||||
|
|
||||||
if (numShards > 0) {
|
if (numShards > 0) {
|
||||||
settingsBuilder.put(SETTING_NUMBER_OF_SHARDS, numShards);
|
settingsBuilder.put(SETTING_NUMBER_OF_SHARDS, numShards);
|
||||||
|
@ -122,8 +121,7 @@ public class TransportTwoNodesSearchIT extends ESIntegTestCase {
|
||||||
|
|
||||||
public void testDfsQueryThenFetch() throws Exception {
|
public void testDfsQueryThenFetch() throws Exception {
|
||||||
Settings.Builder settingsBuilder = settingsBuilder()
|
Settings.Builder settingsBuilder = settingsBuilder()
|
||||||
.put(indexSettings())
|
.put(indexSettings());
|
||||||
.put("routing.hash.type", "simple");
|
|
||||||
client().admin().indices().create(createIndexRequest("test")
|
client().admin().indices().create(createIndexRequest("test")
|
||||||
.settings(settingsBuilder))
|
.settings(settingsBuilder))
|
||||||
.actionGet();
|
.actionGet();
|
||||||
|
|
|
@ -33,9 +33,12 @@ import org.elasticsearch.index.mapper.MappedFieldType;
|
||||||
import org.elasticsearch.index.mapper.MapperService;
|
import org.elasticsearch.index.mapper.MapperService;
|
||||||
import org.elasticsearch.index.MergePolicyConfig;
|
import org.elasticsearch.index.MergePolicyConfig;
|
||||||
import org.elasticsearch.indices.IndicesService;
|
import org.elasticsearch.indices.IndicesService;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||||
|
@ -44,6 +47,11 @@ import static org.hamcrest.Matchers.greaterThan;
|
||||||
|
|
||||||
public class ParentFieldLoadingIT extends ESIntegTestCase {
|
public class ParentFieldLoadingIT extends ESIntegTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
return pluginList(InternalSettingsPlugin.class); // uses index.merge.enabled
|
||||||
|
}
|
||||||
|
|
||||||
private final Settings indexSettings = Settings.builder()
|
private final Settings indexSettings = Settings.builder()
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
|
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0)
|
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0)
|
||||||
|
|
|
@ -33,14 +33,17 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder;
|
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.search.MultiValueMode;
|
import org.elasticsearch.search.MultiValueMode;
|
||||||
import org.elasticsearch.search.SearchHits;
|
import org.elasticsearch.search.SearchHits;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.joda.time.DateTimeZone;
|
import org.joda.time.DateTimeZone;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
@ -66,6 +69,11 @@ import static org.hamcrest.Matchers.isOneOf;
|
||||||
import static org.hamcrest.Matchers.lessThan;
|
import static org.hamcrest.Matchers.lessThan;
|
||||||
|
|
||||||
public class DecayFunctionScoreIT extends ESIntegTestCase {
|
public class DecayFunctionScoreIT extends ESIntegTestCase {
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
return pluginList(InternalSettingsPlugin.class); // uses index.version.created
|
||||||
|
}
|
||||||
|
|
||||||
public void testDistanceScoreGeoLinGaussExp() throws Exception {
|
public void testDistanceScoreGeoLinGaussExp() throws Exception {
|
||||||
assertAcked(prepareCreate("test").addMapping(
|
assertAcked(prepareCreate("test").addMapping(
|
||||||
"type1",
|
"type1",
|
||||||
|
|
|
@ -26,10 +26,14 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.index.query.GeoValidationMethod;
|
import org.elasticsearch.index.query.GeoValidationMethod;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.search.SearchHit;
|
import org.elasticsearch.search.SearchHit;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
||||||
import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
|
import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
|
||||||
import static org.elasticsearch.index.query.QueryBuilders.geoBoundingBoxQuery;
|
import static org.elasticsearch.index.query.QueryBuilders.geoBoundingBoxQuery;
|
||||||
|
@ -42,6 +46,11 @@ import static org.hamcrest.Matchers.equalTo;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class GeoBoundingBoxIT extends ESIntegTestCase {
|
public class GeoBoundingBoxIT extends ESIntegTestCase {
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
return pluginList(InternalSettingsPlugin.class); // uses index.version.created
|
||||||
|
}
|
||||||
|
|
||||||
public void testSimpleBoundingBoxTest() throws Exception {
|
public void testSimpleBoundingBoxTest() throws Exception {
|
||||||
Version version = VersionUtils.randomVersionBetween(random(), Version.V_2_0_0, Version.CURRENT);
|
Version version = VersionUtils.randomVersionBetween(random(), Version.V_2_0_0, Version.CURRENT);
|
||||||
Settings settings = Settings.settingsBuilder().put(IndexMetaData.SETTING_VERSION_CREATED, version).build();
|
Settings settings = Settings.settingsBuilder().put(IndexMetaData.SETTING_VERSION_CREATED, version).build();
|
||||||
|
|
|
@ -52,8 +52,10 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.index.query.GeohashCellQuery;
|
import org.elasticsearch.index.query.GeohashCellQuery;
|
||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.search.SearchHit;
|
import org.elasticsearch.search.SearchHit;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
|
||||||
|
@ -91,6 +93,11 @@ import static org.hamcrest.Matchers.lessThanOrEqualTo;
|
||||||
*/
|
*/
|
||||||
public class GeoFilterIT extends ESIntegTestCase {
|
public class GeoFilterIT extends ESIntegTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
return pluginList(InternalSettingsPlugin.class); // uses index.version.created
|
||||||
|
}
|
||||||
|
|
||||||
private static boolean intersectSupport;
|
private static boolean intersectSupport;
|
||||||
private static boolean disjointSupport;
|
private static boolean disjointSupport;
|
||||||
private static boolean withinSupport;
|
private static boolean withinSupport;
|
||||||
|
|
|
@ -26,11 +26,14 @@ import org.elasticsearch.common.geo.GeoPoint;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.search.SearchHit;
|
import org.elasticsearch.search.SearchHit;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
||||||
|
@ -44,6 +47,11 @@ import static org.hamcrest.Matchers.equalTo;
|
||||||
@ESIntegTestCase.SuiteScopeTestCase
|
@ESIntegTestCase.SuiteScopeTestCase
|
||||||
public class GeoPolygonIT extends ESIntegTestCase {
|
public class GeoPolygonIT extends ESIntegTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
return pluginList(InternalSettingsPlugin.class); // uses index.version.created
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setupSuiteScopeCluster() throws Exception {
|
protected void setupSuiteScopeCluster() throws Exception {
|
||||||
Version version = VersionUtils.randomVersionBetween(random(), Version.V_2_0_0, Version.CURRENT);
|
Version version = VersionUtils.randomVersionBetween(random(), Version.V_2_0_0, Version.CURRENT);
|
||||||
|
|
|
@ -40,6 +40,7 @@ import org.elasticsearch.search.highlight.HighlightBuilder;
|
||||||
import org.elasticsearch.search.sort.SortBuilders;
|
import org.elasticsearch.search.sort.SortBuilders;
|
||||||
import org.elasticsearch.search.sort.SortOrder;
|
import org.elasticsearch.search.sort.SortOrder;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -72,7 +73,7 @@ import static org.hamcrest.Matchers.nullValue;
|
||||||
public class InnerHitsIT extends ESIntegTestCase {
|
public class InnerHitsIT extends ESIntegTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
return Collections.singleton(MockScriptEngine.TestPlugin.class);
|
return pluginList(MockScriptEngine.TestPlugin.class, InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimpleNested() throws Exception {
|
public void testSimpleNested() throws Exception {
|
||||||
|
|
|
@ -235,7 +235,7 @@ public class SimpleNestedIT extends ESIntegTestCase {
|
||||||
// This IncludeNestedDocsQuery also needs to be aware of the filter from alias
|
// This IncludeNestedDocsQuery also needs to be aware of the filter from alias
|
||||||
public void testDeleteNestedDocsWithAlias() throws Exception {
|
public void testDeleteNestedDocsWithAlias() throws Exception {
|
||||||
assertAcked(prepareCreate("test")
|
assertAcked(prepareCreate("test")
|
||||||
.setSettings(settingsBuilder().put(indexSettings()).put("index.referesh_interval", -1).build())
|
.setSettings(settingsBuilder().put(indexSettings()).put("index.refresh_interval", -1).build())
|
||||||
.addMapping("type1", jsonBuilder().startObject().startObject("type1").startObject("properties")
|
.addMapping("type1", jsonBuilder().startObject().startObject("type1").startObject("properties")
|
||||||
.startObject("field1")
|
.startObject("field1")
|
||||||
.field("type", "string")
|
.field("type", "string")
|
||||||
|
@ -412,7 +412,7 @@ public class SimpleNestedIT extends ESIntegTestCase {
|
||||||
assertAcked(prepareCreate("test")
|
assertAcked(prepareCreate("test")
|
||||||
.setSettings(settingsBuilder()
|
.setSettings(settingsBuilder()
|
||||||
.put(indexSettings())
|
.put(indexSettings())
|
||||||
.put("index.referesh_interval", -1))
|
.put("index.refresh_interval", -1))
|
||||||
.addMapping("type1", jsonBuilder().startObject().startObject("type1").startObject("properties")
|
.addMapping("type1", jsonBuilder().startObject().startObject("type1").startObject("properties")
|
||||||
.startObject("nested1")
|
.startObject("nested1")
|
||||||
.field("type", "nested")
|
.field("type", "nested")
|
||||||
|
|
|
@ -47,6 +47,7 @@ import org.elasticsearch.script.ScriptService;
|
||||||
import org.elasticsearch.script.SearchScript;
|
import org.elasticsearch.script.SearchScript;
|
||||||
import org.elasticsearch.search.lookup.SearchLookup;
|
import org.elasticsearch.search.lookup.SearchLookup;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -453,7 +454,9 @@ public class UpdateIT extends ESIntegTestCase {
|
||||||
PutFieldValuesScriptPlugin.class,
|
PutFieldValuesScriptPlugin.class,
|
||||||
FieldIncrementScriptPlugin.class,
|
FieldIncrementScriptPlugin.class,
|
||||||
ScriptedUpsertScriptPlugin.class,
|
ScriptedUpsertScriptPlugin.class,
|
||||||
ExtractContextInSourceScriptPlugin.class);
|
ExtractContextInSourceScriptPlugin.class,
|
||||||
|
InternalSettingsPlugin.class // uses index.merge.enabled
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createTestIndex() throws Exception {
|
private void createTestIndex() throws Exception {
|
||||||
|
|
|
@ -40,14 +40,13 @@ import org.elasticsearch.search.SearchHit;
|
||||||
import org.elasticsearch.search.sort.SortBuilders;
|
import org.elasticsearch.search.sort.SortBuilders;
|
||||||
import org.elasticsearch.search.sort.SortOrder;
|
import org.elasticsearch.search.sort.SortOrder;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
||||||
|
@ -73,7 +72,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||||
public class GeoDistanceTests extends ESIntegTestCase {
|
public class GeoDistanceTests extends ESIntegTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
return pluginList(GroovyPlugin.class, InternalSettingsPluging.class);
|
return pluginList(GroovyPlugin.class, InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimpleDistance() throws Exception {
|
public void testSimpleDistance() throws Exception {
|
||||||
|
|
|
@ -53,7 +53,7 @@ import org.elasticsearch.search.sort.ScriptSortBuilder;
|
||||||
import org.elasticsearch.search.sort.SortBuilders;
|
import org.elasticsearch.search.sort.SortBuilders;
|
||||||
import org.elasticsearch.search.sort.SortOrder;
|
import org.elasticsearch.search.sort.SortOrder;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.elasticsearch.test.VersionUtils;
|
import org.elasticsearch.test.VersionUtils;
|
||||||
import org.elasticsearch.test.junit.annotations.TestLogging;
|
import org.elasticsearch.test.junit.annotations.TestLogging;
|
||||||
import org.hamcrest.Matchers;
|
import org.hamcrest.Matchers;
|
||||||
|
@ -106,7 +106,7 @@ import static org.hamcrest.Matchers.nullValue;
|
||||||
public class SimpleSortTests extends ESIntegTestCase {
|
public class SimpleSortTests extends ESIntegTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
return pluginList(GroovyPlugin.class, InternalSettingsPluging.class);
|
return pluginList(GroovyPlugin.class, InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestLogging("action.search.type:TRACE")
|
@TestLogging("action.search.type:TRACE")
|
||||||
|
|
|
@ -35,7 +35,7 @@ import org.elasticsearch.index.mapper.ParsedDocument;
|
||||||
import org.elasticsearch.indices.mapper.MapperRegistry;
|
import org.elasticsearch.indices.mapper.MapperRegistry;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.elasticsearch.test.InternalSettingsPluging;
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -46,7 +46,7 @@ public class Murmur3FieldMapperTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
return pluginList(InternalSettingsPluging.class);
|
return pluginList(InternalSettingsPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
MapperRegistry mapperRegistry;
|
MapperRegistry mapperRegistry;
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.SettingsModule;
|
import org.elasticsearch.common.settings.SettingsModule;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
|
|
||||||
public final class InternalSettingsPluging extends Plugin {
|
public final class InternalSettingsPlugin extends Plugin {
|
||||||
@Override
|
@Override
|
||||||
public String name() {
|
public String name() {
|
||||||
return "internal-settings-plugin";
|
return "internal-settings-plugin";
|
|
@ -21,7 +21,9 @@ package org.elasticsearch.test;
|
||||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.inject.Module;
|
import org.elasticsearch.common.inject.Module;
|
||||||
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
import org.elasticsearch.common.settings.SettingsModule;
|
||||||
import org.elasticsearch.index.Index;
|
import org.elasticsearch.index.Index;
|
||||||
import org.elasticsearch.index.IndexModule;
|
import org.elasticsearch.index.IndexModule;
|
||||||
import org.elasticsearch.index.IndexService;
|
import org.elasticsearch.index.IndexService;
|
||||||
|
@ -58,6 +60,14 @@ public final class MockIndexEventListener {
|
||||||
return "a mock index listener for testing only";
|
return "a mock index listener for testing only";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For tests to pass in to fail on listener invocation
|
||||||
|
*/
|
||||||
|
public static final Setting<Boolean> INDEX_FAIL = Setting.boolSetting("index.fail", false, false, Setting.Scope.INDEX);
|
||||||
|
public void onModule(SettingsModule module) {
|
||||||
|
module.registerSetting(INDEX_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onIndexModule(IndexModule module) {
|
public void onIndexModule(IndexModule module) {
|
||||||
module.addIndexEventListener(listener);
|
module.addIndexEventListener(listener);
|
||||||
|
|
|
@ -22,7 +22,9 @@ package org.elasticsearch.test.store;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.logging.ESLogger;
|
import org.elasticsearch.common.logging.ESLogger;
|
||||||
import org.elasticsearch.common.logging.Loggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
import org.elasticsearch.common.settings.SettingsModule;
|
||||||
import org.elasticsearch.index.IndexModule;
|
import org.elasticsearch.index.IndexModule;
|
||||||
import org.elasticsearch.index.IndexSettings;
|
import org.elasticsearch.index.IndexSettings;
|
||||||
import org.elasticsearch.index.shard.IndexEventListener;
|
import org.elasticsearch.index.shard.IndexEventListener;
|
||||||
|
@ -42,7 +44,7 @@ import java.util.Map;
|
||||||
|
|
||||||
public class MockFSIndexStore extends IndexStore {
|
public class MockFSIndexStore extends IndexStore {
|
||||||
|
|
||||||
public static final String CHECK_INDEX_ON_CLOSE = "index.store.mock.check_index_on_close";
|
public static final Setting<Boolean> INDEX_CHECK_INDEX_ON_CLOSE_SETTING = Setting.boolSetting("index.store.mock.check_index_on_close", true, false, Setting.Scope.INDEX);
|
||||||
|
|
||||||
public static class TestPlugin extends Plugin {
|
public static class TestPlugin extends Plugin {
|
||||||
@Override
|
@Override
|
||||||
|
@ -58,11 +60,15 @@ public class MockFSIndexStore extends IndexStore {
|
||||||
return Settings.builder().put(IndexModule.STORE_TYPE, "mock").build();
|
return Settings.builder().put(IndexModule.STORE_TYPE, "mock").build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onModule(SettingsModule module) {
|
||||||
|
module.registerSetting(INDEX_CHECK_INDEX_ON_CLOSE_SETTING);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onIndexModule(IndexModule indexModule) {
|
public void onIndexModule(IndexModule indexModule) {
|
||||||
Settings indexSettings = indexModule.getSettings();
|
Settings indexSettings = indexModule.getSettings();
|
||||||
if ("mock".equals(indexSettings.get(IndexModule.STORE_TYPE))) {
|
if ("mock".equals(indexSettings.get(IndexModule.STORE_TYPE))) {
|
||||||
if (indexSettings.getAsBoolean(CHECK_INDEX_ON_CLOSE, true)) {
|
if (INDEX_CHECK_INDEX_ON_CLOSE_SETTING.get(indexSettings)) {
|
||||||
indexModule.addIndexEventListener(new Listener());
|
indexModule.addIndexEventListener(new Listener());
|
||||||
}
|
}
|
||||||
indexModule.addIndexStore("mock", MockFSIndexStore::new);
|
indexModule.addIndexStore("mock", MockFSIndexStore::new);
|
||||||
|
|
Loading…
Reference in New Issue