Skip to content

Commit

Permalink
Fallback to opendistro. settings for backwards compatibility.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed May 6, 2021
1 parent b500313 commit e201d6f
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,32 @@

public class JobSchedulerSettings {
public static final Setting<TimeValue> REQUEST_TIMEOUT = Setting.positiveTimeSetting(
"opendistro.jobscheduler.request_timeout",
TimeValue.timeValueSeconds(10),
"opensearch.jobscheduler.request_timeout",
LegacyOpenDistroJobSchedulerSettings.REQUEST_TIMEOUT,
Setting.Property.NodeScope, Setting.Property.Dynamic);

public static final Setting<TimeValue> SWEEP_BACKOFF_MILLIS = Setting.positiveTimeSetting(
"opendistro.jobscheduler.sweeper.backoff_millis",
TimeValue.timeValueMillis(50),
"opensearch.jobscheduler.sweeper.backoff_millis",
LegacyOpenDistroJobSchedulerSettings.SWEEP_BACKOFF_MILLIS,
Setting.Property.NodeScope, Setting.Property.Dynamic);

public static final Setting<Integer> SWEEP_BACKOFF_RETRY_COUNT = Setting.intSetting(
"opendistro.jobscheduler.retry_count",
3,
"opensearch.jobscheduler.retry_count",
LegacyOpenDistroJobSchedulerSettings.SWEEP_BACKOFF_RETRY_COUNT,
Setting.Property.NodeScope, Setting.Property.Dynamic);

public static final Setting<TimeValue> SWEEP_PERIOD = Setting.positiveTimeSetting(
"opendistro.jobscheduler.sweeper.period",
TimeValue.timeValueMinutes(5),
"opensearch.jobscheduler.sweeper.period",
LegacyOpenDistroJobSchedulerSettings.SWEEP_PERIOD,
Setting.Property.NodeScope, Setting.Property.Dynamic);

public static final Setting<Integer> SWEEP_PAGE_SIZE = Setting.intSetting(
"opendistro.jobscheduler.sweeper.page_size",
100,
"opensearch.jobscheduler.sweeper.page_size",
LegacyOpenDistroJobSchedulerSettings.SWEEP_PAGE_SIZE,
Setting.Property.NodeScope, Setting.Property.Dynamic);

public static final Setting<Double> JITTER_LIMIT = Setting.doubleSetting(
"opendistro.jobscheduler.jitter_limit",
0.60, 0, 0.95,
"opensearch.jobscheduler.jitter_limit",
LegacyOpenDistroJobSchedulerSettings.JITTER_LIMIT,
Setting.Property.NodeScope, Setting.Property.Dynamic);


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file 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 com.amazon.opendistroforelasticsearch.jobscheduler;

import org.opensearch.common.settings.Setting;
import org.opensearch.common.unit.TimeValue;

public class LegacyOpenDistroJobSchedulerSettings {
public static final Setting<TimeValue> REQUEST_TIMEOUT = Setting.positiveTimeSetting(
"opendistro.jobscheduler.request_timeout",
TimeValue.timeValueSeconds(10),
Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated);

public static final Setting<TimeValue> SWEEP_BACKOFF_MILLIS = Setting.positiveTimeSetting(
"opendistro.jobscheduler.sweeper.backoff_millis",
TimeValue.timeValueMillis(50),
Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated);

public static final Setting<Integer> SWEEP_BACKOFF_RETRY_COUNT = Setting.intSetting(
"opendistro.jobscheduler.retry_count",
3,
Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated);

public static final Setting<TimeValue> SWEEP_PERIOD = Setting.positiveTimeSetting(
"opendistro.jobscheduler.sweeper.period",
TimeValue.timeValueMinutes(5),
Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated);

public static final Setting<Integer> SWEEP_PAGE_SIZE = Setting.intSetting(
"opendistro.jobscheduler.sweeper.page_size",
100,
Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated);

public static final Setting<Double> JITTER_LIMIT = Setting.doubleSetting(
"opendistro.jobscheduler.jitter_limit",
0.60, 0, 0.95,
Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated);
}

0 comments on commit e201d6f

Please sign in to comment.