dynamic option is a string, not a boolean
This commit is contained in:
parent
c8aeb11fd6
commit
b9dd99636d
|
@ -35,6 +35,7 @@ import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.cluster.ClusterService;
|
import org.elasticsearch.cluster.ClusterService;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||||
|
import org.elasticsearch.common.Booleans;
|
||||||
import org.elasticsearch.common.SearchScrollIterator;
|
import org.elasticsearch.common.SearchScrollIterator;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.component.AbstractComponent;
|
import org.elasticsearch.common.component.AbstractComponent;
|
||||||
|
@ -91,12 +92,12 @@ public class PipelineStore extends AbstractComponent implements Closeable {
|
||||||
.startObject("processors")
|
.startObject("processors")
|
||||||
.field("type", "object")
|
.field("type", "object")
|
||||||
.field("enabled", false)
|
.field("enabled", false)
|
||||||
.field("dynamic", true)
|
.field("dynamic", "true")
|
||||||
.endObject()
|
.endObject()
|
||||||
.startObject("on_failure")
|
.startObject("on_failure")
|
||||||
.field("type", "object")
|
.field("type", "object")
|
||||||
.field("enabled", false)
|
.field("enabled", false)
|
||||||
.field("dynamic", true)
|
.field("dynamic", "true")
|
||||||
.endObject()
|
.endObject()
|
||||||
.startObject("description")
|
.startObject("description")
|
||||||
.field("type", "string")
|
.field("type", "string")
|
||||||
|
@ -359,8 +360,8 @@ public class PipelineStore extends AbstractComponent implements Closeable {
|
||||||
throw new IllegalStateException("illegal ingest mapping, processors field enabled option is [true] while [false] is expected");
|
throw new IllegalStateException("illegal ingest mapping, processors field enabled option is [true] while [false] is expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean processorsDynamic = (Boolean) XContentMapValues.extractValue("properties.processors.dynamic", pipelineMapping);
|
String processorsDynamic = (String) XContentMapValues.extractValue("properties.processors.dynamic", pipelineMapping);
|
||||||
if (Boolean.TRUE.equals(processorsDynamic) == false) {
|
if ("true".equals(processorsDynamic) == false) {
|
||||||
throw new IllegalStateException("illegal ingest mapping, processors field dynamic option is [false] while [true] is expected");
|
throw new IllegalStateException("illegal ingest mapping, processors field dynamic option is [false] while [true] is expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,8 +375,8 @@ public class PipelineStore extends AbstractComponent implements Closeable {
|
||||||
throw new IllegalStateException("illegal ingest mapping, on_failure field enabled option is [true] while [false] is expected");
|
throw new IllegalStateException("illegal ingest mapping, on_failure field enabled option is [true] while [false] is expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean onFailureDynamic = (Boolean) XContentMapValues.extractValue("properties.on_failure.dynamic", pipelineMapping);
|
String onFailureDynamic = (String) XContentMapValues.extractValue("properties.on_failure.dynamic", pipelineMapping);
|
||||||
if (Boolean.TRUE.equals(onFailureDynamic) == false) {
|
if ("true".equals(onFailureDynamic) == false) {
|
||||||
throw new IllegalStateException("illegal ingest mapping, on_failure field dynamic option is [false] while [true] is expected");
|
throw new IllegalStateException("illegal ingest mapping, on_failure field dynamic option is [false] while [true] is expected");
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -271,12 +271,12 @@ public class PipelineStoreTests extends ESTestCase {
|
||||||
.startObject("processors")
|
.startObject("processors")
|
||||||
.field("type", "object")
|
.field("type", "object")
|
||||||
.field("enabled", false)
|
.field("enabled", false)
|
||||||
.field("dynamic", true)
|
.field("dynamic", "true")
|
||||||
.endObject()
|
.endObject()
|
||||||
.startObject("on_failure")
|
.startObject("on_failure")
|
||||||
.field("type", "object")
|
.field("type", "object")
|
||||||
.field("enabled", false)
|
.field("enabled", false)
|
||||||
.field("dynamic", true)
|
.field("dynamic", "true")
|
||||||
.endObject()
|
.endObject()
|
||||||
.startObject("description")
|
.startObject("description")
|
||||||
.field("type", "string")
|
.field("type", "string")
|
||||||
|
@ -309,12 +309,12 @@ public class PipelineStoreTests extends ESTestCase {
|
||||||
.startObject("processors")
|
.startObject("processors")
|
||||||
.field("type", "nested")
|
.field("type", "nested")
|
||||||
.field("enabled", false)
|
.field("enabled", false)
|
||||||
.field("dynamic", true)
|
.field("dynamic", "true")
|
||||||
.endObject()
|
.endObject()
|
||||||
.startObject("on_failure")
|
.startObject("on_failure")
|
||||||
.field("type", "object")
|
.field("type", "object")
|
||||||
.field("enabled", false)
|
.field("enabled", false)
|
||||||
.field("dynamic", true)
|
.field("dynamic", "true")
|
||||||
.endObject()
|
.endObject()
|
||||||
.startObject("description")
|
.startObject("description")
|
||||||
.field("type", "string")
|
.field("type", "string")
|
||||||
|
@ -347,12 +347,12 @@ public class PipelineStoreTests extends ESTestCase {
|
||||||
.startObject("processors")
|
.startObject("processors")
|
||||||
.field("type", "object")
|
.field("type", "object")
|
||||||
.field("enabled", true)
|
.field("enabled", true)
|
||||||
.field("dynamic", true)
|
.field("dynamic", "true")
|
||||||
.endObject()
|
.endObject()
|
||||||
.startObject("on_failure")
|
.startObject("on_failure")
|
||||||
.field("type", "object")
|
.field("type", "object")
|
||||||
.field("enabled", false)
|
.field("enabled", false)
|
||||||
.field("dynamic", true)
|
.field("dynamic", "true")
|
||||||
.endObject()
|
.endObject()
|
||||||
.startObject("description")
|
.startObject("description")
|
||||||
.field("type", "string")
|
.field("type", "string")
|
||||||
|
@ -385,12 +385,12 @@ public class PipelineStoreTests extends ESTestCase {
|
||||||
.startObject("processors")
|
.startObject("processors")
|
||||||
.field("type", "object")
|
.field("type", "object")
|
||||||
.field("enabled", false)
|
.field("enabled", false)
|
||||||
.field("dynamic", false)
|
.field("dynamic", "false")
|
||||||
.endObject()
|
.endObject()
|
||||||
.startObject("on_failure")
|
.startObject("on_failure")
|
||||||
.field("type", "object")
|
.field("type", "object")
|
||||||
.field("enabled", false)
|
.field("enabled", false)
|
||||||
.field("dynamic", true)
|
.field("dynamic", "true")
|
||||||
.endObject()
|
.endObject()
|
||||||
.startObject("description")
|
.startObject("description")
|
||||||
.field("type", "string")
|
.field("type", "string")
|
||||||
|
|
Loading…
Reference in New Issue