Java Code Examples for org.elasticsearch.script.Script#readScript()

The following examples show how to use org.elasticsearch.script.Script#readScript() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InternalScriptedMetric.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
protected void doReadFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        reduceScript = Script.readScript(in);
    }
    aggregation = in.readGenericValue();
}
 
Example 2
Source File: BucketSelectorPipelineAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected void doReadFrom(StreamInput in) throws IOException {
    script = Script.readScript(in);
    gapPolicy = GapPolicy.readFrom(in);
    bucketsPathsMap = (Map<String, String>) in.readGenericValue();
}
 
Example 3
Source File: BucketScriptPipelineAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected void doReadFrom(StreamInput in) throws IOException {
    script = Script.readScript(in);
    formatter = ValueFormatterStreams.readOptional(in);
    gapPolicy = GapPolicy.readFrom(in);
    bucketsPathsMap = (Map<String, String>) in.readGenericValue();
}
 
Example 4
Source File: UpdateRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    consistencyLevel = WriteConsistencyLevel.fromId(in.readByte());
    type = in.readString();
    id = in.readString();
    routing = in.readOptionalString();
    parent = in.readOptionalString();
    if (in.readBoolean()) {
        script = Script.readScript(in);
    }
    retryOnConflict = in.readVInt();
    refresh = in.readBoolean();
    if (in.readBoolean()) {
        doc = new IndexRequest();
        doc.readFrom(in);
    }
    int size = in.readInt();
    if (size >= 0) {
        fields = new String[size];
        for (int i = 0; i < size; i++) {
            fields[i] = in.readString();
        }
    }
    if (in.readBoolean()) {
        upsertRequest = new IndexRequest();
        upsertRequest.readFrom(in);
    }
    docAsUpsert = in.readBoolean();
    version = in.readLong();
    versionType = VersionType.fromValue(in.readByte());
    detectNoop = in.readBoolean();
    scriptedUpsert = in.readBoolean();
}
 
Example 5
Source File: ScriptHeuristic.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public SignificanceHeuristic readResult(StreamInput in) throws IOException {
    Script script = Script.readScript(in);
    return new ScriptHeuristic(null, script);
}