Fixing issues after master rebase

Original commit: elastic/x-pack-elasticsearch@d3dfa53483
This commit is contained in:
uboness 2015-05-22 15:10:41 +02:00
parent 33bc0761e7
commit 2f48d980b3
5 changed files with 4 additions and 25 deletions

View File

@ -14,13 +14,6 @@ import org.elasticsearch.watcher.execution.WatchExecutionContext;
*/
public interface Throttler {
Throttler NO_THROTTLE = new Throttler() {
@Override
public Result throttle(String actionId, WatchExecutionContext ctx) {
return Result.NO;
}
};
Result throttle(String actionId, WatchExecutionContext ctx);
class Result {

View File

@ -10,7 +10,7 @@ import org.elasticsearch.common.joda.time.DateTime;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.watcher.condition.Condition;
import org.elasticsearch.watcher.support.WatcherDateUtils;
import org.elasticsearch.watcher.support.WatcherDateTimeUtils;
import org.elasticsearch.watcher.support.xcontent.WatcherXContentUtils;
import java.io.IOException;
@ -282,7 +282,7 @@ public class CompareCondition implements Condition {
}
if (v1 instanceof String) {
try {
v1 = WatcherDateUtils.parseDate((String) v1);
v1 = WatcherDateTimeUtils.parseDate((String) v1);
} catch (Exception e) {
return null;
}

View File

@ -6,12 +6,10 @@
package org.elasticsearch.watcher.condition.compare;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.joda.DateMathParser;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.watcher.condition.ConditionFactory;
import org.elasticsearch.watcher.support.WatcherDateUtils;
import org.elasticsearch.watcher.support.clock.Clock;
import java.io.IOException;

View File

@ -9,7 +9,7 @@ import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.watcher.condition.ExecutableCondition;
import org.elasticsearch.watcher.execution.WatchExecutionContext;
import org.elasticsearch.watcher.support.Variables;
import org.elasticsearch.watcher.support.WatcherDateUtils;
import org.elasticsearch.watcher.support.WatcherDateTimeUtils;
import org.elasticsearch.watcher.support.clock.Clock;
import org.elasticsearch.watcher.support.xcontent.MapPath;
@ -48,7 +48,7 @@ public class ExecutableCompareCondition extends ExecutableCondition<CompareCondi
Matcher matcher = DATE_MATH_PATTERN.matcher((String) configuredValue);
if (matcher.matches()) {
String dateMath = matcher.group(1);
configuredValue = WatcherDateUtils.parseDateMath(dateMath, UTC, clock);
configuredValue = WatcherDateTimeUtils.parseDateMath(dateMath, UTC, clock);
} else {
// checking if the given value is a path expression
matcher = PATH_PATTERN.matcher((String) configuredValue);

View File

@ -75,18 +75,6 @@ public class BootStrapTests extends AbstractWatcherIntegrationTests {
.endObject())
.get();
// no actions field:
client().prepareIndex(WatchStore.INDEX, WatchStore.DOC_TYPE, "_id1")
.setSource(jsonBuilder().startObject()
.startObject(Watch.Field.TRIGGER.getPreferredName())
.startObject("schedule")
.field("interval", "1s")
.endObject()
.endObject()
.endObject())
.get();
// invalid interval
client().prepareIndex(WatchStore.INDEX, WatchStore.DOC_TYPE, "_id2")
.setSource(jsonBuilder().startObject()