Watcher: Remove pre 2.0 compatibility code
This code is not needed anymore in any 2.x version. Original commit: elastic/x-pack-elasticsearch@8346b0120e
This commit is contained in:
parent
996a9a9891
commit
9108001c73
|
@ -205,12 +205,7 @@ public class WatchStore extends AbstractComponent {
|
||||||
|
|
||||||
IndexRequest createIndexRequest(String id, BytesReference source, long version) {
|
IndexRequest createIndexRequest(String id, BytesReference source, long version) {
|
||||||
IndexRequest indexRequest = new IndexRequest(INDEX, DOC_TYPE, id);
|
IndexRequest indexRequest = new IndexRequest(INDEX, DOC_TYPE, id);
|
||||||
// TODO (2.0 upgrade): move back to BytesReference instead of dealing with the array directly
|
indexRequest.source(source.toBytes());
|
||||||
if (source.hasArray()) {
|
|
||||||
indexRequest.source(source.array(), source.arrayOffset(), source.length());
|
|
||||||
} else {
|
|
||||||
indexRequest.source(source.toBytes());
|
|
||||||
}
|
|
||||||
indexRequest.version(version);
|
indexRequest.version(version);
|
||||||
return indexRequest;
|
return indexRequest;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue