Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ public class LifecycleSettings {
public static final String LIFECYCLE_STEP_INFO = "index.lifecycle.step_info";
public static final String LIFECYCLE_SKIP = "index.lifecycle.skip";

// NORELEASE: we should probably change the default to something other than three seconds for initial release
public static final Setting<TimeValue> LIFECYCLE_POLL_INTERVAL_SETTING = Setting.positiveTimeSetting(LIFECYCLE_POLL_INTERVAL,
TimeValue.timeValueSeconds(3), Setting.Property.Dynamic, Setting.Property.NodeScope);
TimeValue.timeValueMinutes(10), Setting.Property.Dynamic, Setting.Property.NodeScope);
public static final Setting<String> LIFECYCLE_NAME_SETTING = Setting.simpleString(LIFECYCLE_NAME,
Setting.Property.Dynamic, Setting.Property.IndexScope, Setting.Property.InternalIndex);
public static final Setting<String> LIFECYCLE_PHASE_SETTING = Setting.simpleString(LIFECYCLE_PHASE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public void testSchedulerInitializationAndUpdate() {
indexLifecycleService.clusterChanged(noChangeEvent);
assertThat(indexLifecycleService.getScheduler().jobCount(), equalTo(1));
assertThat(((TimeValueSchedule) indexLifecycleService.getScheduledJob().getSchedule()).getInterval(),
equalTo(TimeValue.timeValueSeconds(3)));
equalTo(LifecycleSettings.LIFECYCLE_POLL_INTERVAL_SETTING.getDefault(previousState.metaData().settings())));
indexLifecycleService.applyClusterState(event);
indexLifecycleService.clusterChanged(event);
assertThat(indexLifecycleService.getScheduler().jobCount(), equalTo(1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.xpack.core.indexlifecycle.AllocateAction;
import org.elasticsearch.xpack.core.indexlifecycle.DeleteAction;
Expand Down Expand Up @@ -47,9 +48,20 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
private String policy;

@Before
public void refreshIndex() {
public void refreshIndex() throws IOException {
index = randomAlphaOfLength(10).toLowerCase(Locale.ROOT);
policy = randomAlphaOfLength(5);
Request request = new Request("PUT", "/_cluster/settings");
XContentBuilder pollIntervalEntity = JsonXContent.contentBuilder();
pollIntervalEntity.startObject();
{
pollIntervalEntity.startObject("transient");
{
pollIntervalEntity.field(LifecycleSettings.LIFECYCLE_POLL_INTERVAL, "1s");
}pollIntervalEntity.endObject();
} pollIntervalEntity.endObject();
request.setJsonEntity(Strings.toString(pollIntervalEntity));
assertOK(adminClient().performRequest(request));
}

public static void updatePolicy(String indexName, String policy) throws IOException {
Expand Down