Skip to content

Commit

Permalink
Merge pull request #13563 from mikemccand/remove_index_buffer_size
Browse files Browse the repository at this point in the history
Remove index.buffer_size setting
  • Loading branch information
Michael McCandless authored and mikemccand committed Sep 15, 2015
1 parent 3836e51 commit 1b7bc11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
Expand Up @@ -26,7 +26,6 @@
import org.elasticsearch.cluster.routing.HashFunction;
import org.elasticsearch.cluster.routing.SimpleHashFunction;
import org.elasticsearch.cluster.routing.UnassignedInfo;
import org.elasticsearch.common.Classes;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
Expand Down Expand Up @@ -219,7 +218,6 @@ private IndexMetaData upgradeLegacyRoutingSettings(IndexMetaData indexMetaData)

/** All known byte-sized settings for an index. */
public static final Set<String> INDEX_BYTES_SIZE_SETTINGS = ImmutableSet.of(
"index.buffer_size",
"index.merge.policy.floor_segment",
"index.merge.policy.max_merged_segment",
"index.merge.policy.max_merge_size",
Expand Down
Expand Up @@ -93,15 +93,6 @@ public final class EngineConfig {
*/
public static final String INDEX_GC_DELETES_SETTING = "index.gc_deletes";

/**
* Index setting to control the initial index buffer size. NOTE: this setting is somewhat
* useless, since IndexingMemoryController will take over quickly and partition the
* indices.memory.index_buffer_size for this node across all shards.
*
* <p>This setting is <b>not</b> realtime updateable.
*/
public static final String INDEX_BUFFER_SIZE_SETTING = "index.buffer_size";

/**
* Index setting to change the low level lucene codec used for writing new segments.
* This setting is <b>not</b> realtime updateable.
Expand Down Expand Up @@ -155,7 +146,7 @@ public EngineConfig(ShardId shardId, ThreadPool threadPool, ShardIndexingService
this.optimizeAutoGenerateId = indexSettings.getAsBoolean(EngineConfig.INDEX_OPTIMIZE_AUTOGENERATED_ID_SETTING, false);
this.compoundOnFlush = indexSettings.getAsBoolean(EngineConfig.INDEX_COMPOUND_ON_FLUSH, compoundOnFlush);
codecName = indexSettings.get(EngineConfig.INDEX_CODEC_SETTING, EngineConfig.DEFAULT_CODEC_NAME);
indexingBufferSize = indexSettings.getAsBytesSize(INDEX_BUFFER_SIZE_SETTING, DEFAULT_INDEX_BUFFER_SIZE);
indexingBufferSize = DEFAULT_INDEX_BUFFER_SIZE;
gcDeletesInMillis = indexSettings.getAsTime(INDEX_GC_DELETES_SETTING, EngineConfig.DEFAULT_GC_DELETES).millis();
versionMapSizeSetting = indexSettings.get(INDEX_VERSION_MAP_SIZE, DEFAULT_VERSION_MAP_SIZE);
updateVersionMapSize();
Expand All @@ -170,7 +161,7 @@ public EngineConfig(ShardId shardId, ThreadPool threadPool, ShardIndexingService
private void updateVersionMapSize() {
if (versionMapSizeSetting.endsWith("%")) {
double percent = Double.parseDouble(versionMapSizeSetting.substring(0, versionMapSizeSetting.length() - 1));
versionMapSize = new ByteSizeValue((long) (((double) indexingBufferSize.bytes() * (percent / 100))));
versionMapSize = new ByteSizeValue((long) ((double) indexingBufferSize.bytes() * (percent / 100)));
} else {
versionMapSize = ByteSizeValue.parseBytesSizeValue(versionMapSizeSetting, INDEX_VERSION_MAP_SIZE);
}
Expand Down
Expand Up @@ -20,6 +20,7 @@
package org.elasticsearch.index.engine;

import com.google.common.collect.ImmutableMap;

import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
Expand Down Expand Up @@ -52,6 +53,8 @@
import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.lucene.uid.Versions;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.util.BigArrays;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.VersionType;
Expand Down Expand Up @@ -1637,12 +1640,10 @@ public void testRetryWithAutogeneratedIdsAndWrongOrderWorksAndNoDuplicateDocs()
// #10312
@Test
public void testDeletesAloneCanTriggerRefresh() throws Exception {
// Tiny indexing buffer:
Settings indexSettings = Settings.builder().put(defaultSettings)
.put(EngineConfig.INDEX_BUFFER_SIZE_SETTING, "1kb").build();
try (Store store = createStore();
Engine engine = new InternalEngine(config(indexSettings, store, createTempDir(), new MergeSchedulerConfig(defaultSettings), newMergePolicy()),
Engine engine = new InternalEngine(config(defaultSettings, store, createTempDir(), new MergeSchedulerConfig(defaultSettings), newMergePolicy()),
false)) {
engine.config().setIndexingBufferSize(new ByteSizeValue(1, ByteSizeUnit.KB));
for (int i = 0; i < 100; i++) {
String id = Integer.toString(i);
ParsedDocument doc = testParsedDocument(id, id, "test", null, -1, -1, testDocument(), B_1, null);
Expand Down

0 comments on commit 1b7bc11

Please sign in to comment.