Java Code Examples for org.elasticsearch.common.io.stream.StreamInput#readString()

The following examples show how to use org.elasticsearch.common.io.stream.StreamInput#readString() . 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: ClusterHealthRequest.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    int size = in.readVInt();
    if (size == 0) {
        indices = Strings.EMPTY_ARRAY;
    } else {
        indices = new String[size];
        for (int i = 0; i < indices.length; i++) {
            indices[i] = in.readString();
        }
    }
    timeout = readTimeValue(in);
    if (in.readBoolean()) {
        waitForStatus = ClusterHealthStatus.fromValue(in.readByte());
    }
    waitForRelocatingShards = in.readInt();
    waitForActiveShards = in.readInt();
    waitForNodes = in.readString();
    if (in.readBoolean()) {
        waitForEvents = Priority.readFrom(in);
    }
}
 
Example 2
Source File: ExtendedAnalyzeResponse.java    From elasticsearch-extended-analyze with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    int size = in.readVInt();
    tokens = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        tokens.add(ExtendedAnalyzeToken.readExtendedAnalyzeToken(in));
    }
}
 
Example 3
Source File: PercolateShardRequest.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);
    documentType = in.readString();
    source = in.readBytesReference();
    docSource = in.readBytesReference();
    onlyCount = in.readBoolean();
    numberOfShards = in.readVInt();
    startTime = in.readLong(); // no vlong, this can be negative!
}
 
Example 4
Source File: PutRepositoryRequest.java    From crate with Apache License 2.0 5 votes vote down vote up
public PutRepositoryRequest(StreamInput in) throws IOException {
    super(in);
    name = in.readString();
    type = in.readString();
    settings = readSettingsFromStream(in);
    verify = in.readBoolean();
}
 
Example 5
Source File: DeleteIndexedScriptRequest.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);
    scriptLang = in.readString();
    id = in.readString();
    version = in.readLong();
    versionType = VersionType.fromValue(in.readByte());
}
 
Example 6
Source File: ShardRouting.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public void readFromThin(StreamInput in) throws IOException {
    version = in.readLong();
    if (in.readBoolean()) {
        currentNodeId = in.readString();
    }

    if (in.readBoolean()) {
        relocatingNodeId = in.readString();
    }

    primary = in.readBoolean();
    state = ShardRoutingState.fromValue(in.readByte());

    restoreSource = RestoreSource.readOptionalRestoreSource(in);
    if (in.readBoolean()) {
        unassignedInfo = new UnassignedInfo(in);
    }
    if (in.readBoolean()) {
        allocationId = new AllocationId(in);
    }
    if (relocating() || initializing()) {
        expectedShardSize = in.readLong();
    } else {
        expectedShardSize = UNAVAILABLE_EXPECTED_SHARD_SIZE;
    }
    freeze();
}
 
Example 7
Source File: AnomalyResultResponse.java    From anomaly-detection with Apache License 2.0 5 votes vote down vote up
public AnomalyResultResponse(StreamInput in) throws IOException {
    super(in);
    anomalyGrade = in.readDouble();
    confidence = in.readDouble();
    anomalyScore = in.readDouble();
    int size = in.readVInt();
    features = new ArrayList<FeatureData>();
    for (int i = 0; i < size; i++) {
        String featureId = in.readString();
        String featureName = in.readString();
        double featureValue = in.readDouble();
        features.add(new FeatureData(featureId, featureName, featureValue));
    }
    error = in.readOptionalString();
}
 
Example 8
Source File: CircuitBreakerStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    // limit is the maximum from the old circuit breaker stats for backwards compatibility
    limit = in.readLong();
    estimated = in.readLong();
    overhead = in.readDouble();
    this.trippedCount = in.readLong();
    this.name = in.readString();
}
 
Example 9
Source File: JvmInfo.java    From elasticsearch-helper with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    pid = in.readLong();
    version = in.readString();
    vmName = in.readString();
    vmVersion = in.readString();
    vmVendor = in.readString();
    startTime = in.readLong();
    inputArguments = new String[in.readInt()];
    for (int i = 0; i < inputArguments.length; i++) {
        inputArguments[i] = in.readString();
    }
    bootClassPath = in.readString();
    classPath = in.readString();
    systemProperties = new HashMap<>();
    int size = in.readInt();
    for (int i = 0; i < size; i++) {
        systemProperties.put(in.readString(), in.readString());
    }
    stats.timestamp = in.readVLong();
    stats.uptime = in.readVLong();

    stats.threads = Threads.readThreads(in);
    memoryPools = in.readStringArray();
    stats.mem = Mem.readMem(in);
    gcCollectors = in.readStringArray();
    stats.gc = GarbageCollectors.readGarbageCollectors(in);

    if (in.readBoolean()) {
        size = in.readVInt();
        stats.bufferPools = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            BufferPool bufferPool = new BufferPool();
            bufferPool.readFrom(in);
            stats.bufferPools.add(bufferPool);
        }
    }
}
 
Example 10
Source File: RecoveryResponse.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);
    int size = in.readVInt();
    for (int i = 0; i < size; i++) {
        String s = in.readString();
        int listSize = in.readVInt();
        List<RecoveryState> list = new ArrayList<>(listSize);
        for (int j = 0; j < listSize; j++) {
            list.add(RecoveryState.readRecoveryState(in));
        }
        shardRecoveryStates.put(s, list);
    }
}
 
Example 11
Source File: RecoveryState.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    length = in.readVLong();
    recovered = in.readVLong();
    reused = in.readBoolean();
}
 
Example 12
Source File: RecoveryResponse.java    From crate with Apache License 2.0 5 votes vote down vote up
public RecoveryResponse(StreamInput in) throws IOException {
    super(in);
    int size = in.readVInt();
    shardRecoveryStates = new HashMap<>();
    for (int i = 0; i < size; i++) {
        String s = in.readString();
        int listSize = in.readVInt();
        List<RecoveryState> list = new ArrayList<>(listSize);
        for (int j = 0; j < listSize; j++) {
            list.add(new RecoveryState(in));
        }
        shardRecoveryStates.put(s, list);
    }
}
 
Example 13
Source File: TypeSignature.java    From crate with Apache License 2.0 5 votes vote down vote up
public TypeSignature(StreamInput in) throws IOException {
    baseTypeName = in.readString();
    int numParams = in.readVInt();
    parameters = new ArrayList<>(numParams);
    for (int i = 0; i < numParams; i++) {
        parameters.add(fromStream(in));
    }
}
 
Example 14
Source File: ActionWriteResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    index = in.readString();
    shardId = in.readVInt();
    nodeId = in.readOptionalString();
    cause = in.readThrowable();
    status = RestStatus.readFrom(in);
    primary = in.readBoolean();
}
 
Example 15
Source File: InternalSearchHitField.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    int size = in.readVInt();
    values = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        values.add(in.readGenericValue());
    }
}
 
Example 16
Source File: AllocationId.java    From crate with Apache License 2.0 4 votes vote down vote up
AllocationId(StreamInput in) throws IOException {
    this.id = in.readString();
    this.relocationId = in.readOptionalString();
}
 
Example 17
Source File: NodeIndexDeletedAction.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    index = in.readString();
    nodeId = in.readString();
}
 
Example 18
Source File: ParameterTypeSignature.java    From crate with Apache License 2.0 4 votes vote down vote up
public ParameterTypeSignature(StreamInput in) throws IOException {
    super(in);
    parameterName = in.readString();
}
 
Example 19
Source File: StoredFeatureSet.java    From elasticsearch-learning-to-rank with Apache License 2.0 4 votes vote down vote up
public StoredFeatureSet(StreamInput input) throws IOException {
    this(input.readString(), input.readList(StoredFeature::new));
}
 
Example 20
Source File: DeleteModelRequest.java    From anomaly-detection with Apache License 2.0 4 votes vote down vote up
public DeleteModelRequest(StreamInput in) throws IOException {
    super(in);
    this.adID = in.readString();
}