cutover to getClass().getSimpleName() for settings names
This commit is contained in:
parent
0247846e89
commit
3724756a1a
|
@ -83,7 +83,7 @@ public class ClusterHealthRequest extends MasterNodeReadOperationRequest<Cluster
|
|||
}
|
||||
|
||||
public ClusterHealthRequest timeout(String timeout) {
|
||||
return this.timeout(TimeValue.parseTimeValue(timeout, null, "ClusterHealthRequest.timeout"));
|
||||
return this.timeout(TimeValue.parseTimeValue(timeout, null, getClass().getSimpleName() + ".timeout"));
|
||||
}
|
||||
|
||||
public ClusterHealthStatus waitForStatus() {
|
||||
|
|
|
@ -120,7 +120,7 @@ public class DeleteIndexRequest extends MasterNodeOperationRequest<DeleteIndexRe
|
|||
* to <tt>10s</tt>.
|
||||
*/
|
||||
public DeleteIndexRequest timeout(String timeout) {
|
||||
return timeout(TimeValue.parseTimeValue(timeout, null, "DeleteIndexRequest.timeout"));
|
||||
return timeout(TimeValue.parseTimeValue(timeout, null, getClass().getSimpleName() + ".timeout"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -417,7 +417,7 @@ public class BulkRequest extends ActionRequest<BulkRequest> implements Composite
|
|||
* A timeout to wait if the index operation can't be performed immediately. Defaults to <tt>1m</tt>.
|
||||
*/
|
||||
public final BulkRequest timeout(String timeout) {
|
||||
return timeout(TimeValue.parseTimeValue(timeout, null, "BulkRequest.timeout"));
|
||||
return timeout(TimeValue.parseTimeValue(timeout, null, getClass().getSimpleName() + ".timeout"));
|
||||
}
|
||||
|
||||
public TimeValue timeout() {
|
||||
|
|
|
@ -476,7 +476,7 @@ public class SearchRequest extends ActionRequest<SearchRequest> implements Indic
|
|||
* If set, will enable scrolling of the search request for the specified timeout.
|
||||
*/
|
||||
public SearchRequest scroll(String keepAlive) {
|
||||
return scroll(new Scroll(TimeValue.parseTimeValue(keepAlive, null, "SearchRequest.Scroll.keepAlive")));
|
||||
return scroll(new Scroll(TimeValue.parseTimeValue(keepAlive, null, getClass().getSimpleName() + ".Scroll.keepAlive")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -93,7 +93,7 @@ public class SearchScrollRequest extends ActionRequest<SearchScrollRequest> {
|
|||
* If set, will enable scrolling of the search request for the specified timeout.
|
||||
*/
|
||||
public SearchScrollRequest scroll(String keepAlive) {
|
||||
return scroll(new Scroll(TimeValue.parseTimeValue(keepAlive, null, "SearchScrollRequest.keepAlive")));
|
||||
return scroll(new Scroll(TimeValue.parseTimeValue(keepAlive, null, getClass().getSimpleName() + ".keepAlive")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -51,7 +51,7 @@ public abstract class AdapterActionFuture<T, L> extends BaseFuture<T> implements
|
|||
|
||||
@Override
|
||||
public T actionGet(String timeout) {
|
||||
return actionGet(TimeValue.parseTimeValue(timeout, null, "AdapterActionFuture.actionGet.timeout"));
|
||||
return actionGet(TimeValue.parseTimeValue(timeout, null, getClass().getSimpleName() + ".actionGet.timeout"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -53,7 +53,7 @@ public abstract class AcknowledgedRequest<T extends MasterNodeOperationRequest>
|
|||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final T timeout(String timeout) {
|
||||
this.timeout = TimeValue.parseTimeValue(timeout, this.timeout, "AcknowledgedRequest.timeout");
|
||||
this.timeout = TimeValue.parseTimeValue(timeout, this.timeout, getClass().getSimpleName() + ".timeout");
|
||||
return (T)this;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ public abstract class MasterNodeOperationRequest<T extends MasterNodeOperationRe
|
|||
* A timeout value in case the master has not been discovered yet or disconnected.
|
||||
*/
|
||||
public final T masterNodeTimeout(String timeout) {
|
||||
return masterNodeTimeout(TimeValue.parseTimeValue(timeout, null, "MasterNodeOperationRequest.masterNodeTimeout"));
|
||||
return masterNodeTimeout(TimeValue.parseTimeValue(timeout, null, getClass().getSimpleName() + ".masterNodeTimeout"));
|
||||
}
|
||||
|
||||
public final TimeValue masterNodeTimeout() {
|
||||
|
|
|
@ -74,7 +74,7 @@ public abstract class NodesOperationRequest<T extends NodesOperationRequest> ext
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
public final T timeout(String timeout) {
|
||||
this.timeout = TimeValue.parseTimeValue(timeout, null, "NodesOperationRequest.timeout");
|
||||
this.timeout = TimeValue.parseTimeValue(timeout, null, getClass().getSimpleName() + ".timeout");
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ public abstract class ReplicationRequest<T extends ReplicationRequest> extends A
|
|||
* A timeout to wait if the index operation can't be performed immediately. Defaults to <tt>1m</tt>.
|
||||
*/
|
||||
public final T timeout(String timeout) {
|
||||
return timeout(TimeValue.parseTimeValue(timeout, null, "ShardReplicatoinOperationRequest.timeout"));
|
||||
return timeout(TimeValue.parseTimeValue(timeout, null, getClass().getSimpleName() + ".timeout"));
|
||||
}
|
||||
|
||||
public TimeValue timeout() {
|
||||
|
|
|
@ -97,7 +97,7 @@ public abstract class InstanceShardOperationRequest<T extends InstanceShardOpera
|
|||
* A timeout to wait if the index operation can't be performed immediately. Defaults to <tt>1m</tt>.
|
||||
*/
|
||||
public final T timeout(String timeout) {
|
||||
return timeout(TimeValue.parseTimeValue(timeout, null, "InstanceShardOperationRequest.timeout"));
|
||||
return timeout(TimeValue.parseTimeValue(timeout, null, getClass().getSimpleName() + ".timeout"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -377,7 +377,7 @@ public class XContentMapValues {
|
|||
if (node instanceof Number) {
|
||||
return TimeValue.timeValueMillis(((Number) node).longValue());
|
||||
}
|
||||
return TimeValue.parseTimeValue(node.toString(), null, "XContentMapValues.nodeTimeValue");
|
||||
return TimeValue.parseTimeValue(node.toString(), null, XContentMapValues.class.getSimpleName() + ".nodeTimeValue");
|
||||
}
|
||||
|
||||
public static Map<String, Object> nodeMapValue(Object node, String desc) {
|
||||
|
|
|
@ -269,9 +269,9 @@ public abstract class DecayFunctionParser implements ScoreFunctionParser {
|
|||
if (scaleString == null) {
|
||||
throw new ElasticsearchParseException(DecayFunctionBuilder.SCALE + " must be set for date fields.");
|
||||
}
|
||||
TimeValue val = TimeValue.parseTimeValue(scaleString, TimeValue.timeValueHours(24), "DecayFunctionParser.scale");
|
||||
TimeValue val = TimeValue.parseTimeValue(scaleString, TimeValue.timeValueHours(24), getClass().getSimpleName() + ".scale");
|
||||
double scale = val.getMillis();
|
||||
val = TimeValue.parseTimeValue(offsetString, TimeValue.timeValueHours(24), "DecayFunctionParser.offset");
|
||||
val = TimeValue.parseTimeValue(offsetString, TimeValue.timeValueHours(24), getClass().getSimpleName() + ".offset");
|
||||
double offset = val.getMillis();
|
||||
IndexNumericFieldData numericFieldData = parseContext.getForField(dateFieldMapper);
|
||||
return new NumericFieldDataScoreFunction(origin, scale, decay, offset, getDecayFunction(), numericFieldData, mode);
|
||||
|
|
|
@ -189,7 +189,7 @@ public class DateHistogramParser implements Aggregator.Parser {
|
|||
tzRoundingBuilder = TimeZoneRounding.builder(dateTimeUnit);
|
||||
} else {
|
||||
// the interval is a time value?
|
||||
tzRoundingBuilder = TimeZoneRounding.builder(TimeValue.parseTimeValue(interval, null, "DateHistogramParser.interval"));
|
||||
tzRoundingBuilder = TimeZoneRounding.builder(TimeValue.parseTimeValue(interval, null, getClass().getSimpleName() + ".interval"));
|
||||
}
|
||||
|
||||
Rounding rounding = tzRoundingBuilder
|
||||
|
@ -217,9 +217,9 @@ public class DateHistogramParser implements Aggregator.Parser {
|
|||
|
||||
private long parseOffset(String offset) throws IOException {
|
||||
if (offset.charAt(0) == '-') {
|
||||
return -TimeValue.parseTimeValue(offset.substring(1), null, "DateHistogramParser.parseOffset").millis();
|
||||
return -TimeValue.parseTimeValue(offset.substring(1), null, getClass().getSimpleName() + ".parseOffset").millis();
|
||||
}
|
||||
int beginIndex = offset.charAt(0) == '+' ? 1 : 0;
|
||||
return TimeValue.parseTimeValue(offset.substring(beginIndex), null, "DateHistogramParser.parseOffset").millis();
|
||||
return TimeValue.parseTimeValue(offset.substring(beginIndex), null, getClass().getSimpleName() + ".parseOffset").millis();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public class DerivativeParser implements PipelineAggregator.Parser {
|
|||
if (dateTimeUnit != null) {
|
||||
xAxisUnits = dateTimeUnit.field().getDurationField().getUnitMillis();
|
||||
} else {
|
||||
TimeValue timeValue = TimeValue.parseTimeValue(units, null, "DerivativeParser.unit");
|
||||
TimeValue timeValue = TimeValue.parseTimeValue(units, null, getClass().getSimpleName() + ".unit");
|
||||
if (timeValue != null) {
|
||||
xAxisUnits = timeValue.getMillis();
|
||||
}
|
||||
|
|
|
@ -315,7 +315,7 @@ public class SearchSourceBuilder extends ToXContentToBytes {
|
|||
* An optional timeout to control how long search is allowed to take.
|
||||
*/
|
||||
public SearchSourceBuilder timeout(String timeout) {
|
||||
this.timeoutInMillis = TimeValue.parseTimeValue(timeout, null, "SearchSourceBuilder.timeout").millis();
|
||||
this.timeoutInMillis = TimeValue.parseTimeValue(timeout, null, getClass().getSimpleName() + ".timeout").millis();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue