Java Code Examples for org.elasticsearch.common.io.stream.StreamOutput#writeVInt()

The following examples show how to use org.elasticsearch.common.io.stream.StreamOutput#writeVInt() . 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: DoubleTerms.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta1)) {
        out.writeLong(docCountError);
    }
    InternalOrder.Streams.writeOrder(order, out);
    ValueFormatterStreams.writeOptional(formatter, out);
    writeSize(requiredSize, out);
    writeSize(shardSize, out);
    out.writeBoolean(showTermDocCountError);
    out.writeVLong(minDocCount);
    out.writeVLong(otherDocCount);
    out.writeVInt(buckets.size());
    for (InternalTerms.Bucket bucket : buckets) {
        bucket.writeTo(out);
    }
}
 
Example 2
Source File: ShardDeleteRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    writeItems(out);
    if (skipFromLocation > -1) {
        out.writeBoolean(true);
        out.writeVInt(skipFromLocation);
    } else {
        out.writeBoolean(false);
    }
}
 
Example 3
Source File: SearchIntoResponse.java    From elasticsearch-inout-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVLong(totalWrites);
    out.writeVLong(succeededWrites);
    out.writeVLong(failedWrites);
    out.writeVInt(responses.size());
    for (ShardSearchIntoResponse response : responses) {
        response.writeTo(out);
    }
}
 
Example 4
Source File: InternalGeoHashGrid.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    writeSize(requiredSize, out);
    out.writeVInt(buckets.size());
    for (Bucket bucket : buckets) {
        bucket.writeTo(out);
    }
}
 
Example 5
Source File: FieldStatsResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(indicesMergedFieldStats.size());
    for (Map.Entry<String, Map<String, FieldStats>> entry1 : indicesMergedFieldStats.entrySet()) {
        out.writeString(entry1.getKey());
        out.writeVInt(entry1.getValue().size());
        for (Map.Entry<String, FieldStats> entry2 : entry1.getValue().entrySet()) {
            out.writeString(entry2.getKey());
            entry2.getValue().writeTo(out);
        }
    }
}
 
Example 6
Source File: AbstractIndexWriterProjection.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    tableIdent.writeTo(out);
    out.writeOptionalString(partitionIdent);

    Symbol.toStream(idSymbols, out);
    out.writeVInt(primaryKeys.size());
    for (ColumnIdent primaryKey : primaryKeys) {
        primaryKey.writeTo(out);
    }
    Symbol.toStream(partitionedBySymbols, out);
    if (clusteredBySymbol == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        Symbol.toStream(clusteredBySymbol, out);
    }

    if (clusteredByColumn == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        clusteredByColumn.writeTo(out);
    }
    out.writeVInt(bulkActions);
    out.writeBoolean(autoCreateIndices);
}
 
Example 7
Source File: FsInfo.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(majorDeviceNumber);
    out.writeVInt(minorDeviceNumber);
    out.writeString(deviceName);
    out.writeLong(currentReadsCompleted);
    out.writeLong(previousReadsCompleted);
    out.writeLong(currentWritesCompleted);
    out.writeLong(previousWritesCompleted);
    out.writeLong(currentSectorsRead);
    out.writeLong(previousSectorsRead);
    out.writeLong(currentSectorsWritten);
    out.writeLong(previousSectorsWritten);
}
 
Example 8
Source File: IngestRequest.java    From elasticsearch-helper with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    timeout.writeTo(out);
    out.writeLong(ingestId);
    out.writeVInt(requests.size());
    for (ActionRequest<?> request : requests) {
        if (request instanceof IndexRequest) {
            out.writeByte((byte) 0);
        } else if (request instanceof DeleteRequest) {
            out.writeByte((byte) 1);
        }
        request.writeTo(out);
    }
}
 
Example 9
Source File: MultiTermVectorsResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(responses.length);
    for (MultiTermVectorsItemResponse response : responses) {
        response.writeTo(out);
    }
}
 
Example 10
Source File: InternalRange.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    ValueFormatterStreams.writeOptional(formatter, out);
    out.writeBoolean(keyed);
    out.writeVInt(ranges.size());
    for (B bucket : ranges) {
        out.writeOptionalString(((Bucket) bucket).key);
        out.writeDouble(((Bucket) bucket).from);
        out.writeDouble(((Bucket) bucket).to);
        out.writeVLong(((Bucket) bucket).docCount);
        bucket.aggregations.writeTo(out);
    }
}
 
Example 11
Source File: CommitStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(userData.size());
    for (Map.Entry<String, String> entry : userData.entrySet()) {
        out.writeString(entry.getKey());
        out.writeString(entry.getValue());
    }
    out.writeLong(generation);
    out.writeOptionalString(id);
    out.writeInt(numDocs);
}
 
Example 12
Source File: SnapshotsStatusResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(snapshots.size());
    for (SnapshotStatus snapshotInfo : snapshots) {
        snapshotInfo.writeTo(out);
    }
}
 
Example 13
Source File: PhraseCountQueryBuilder.java    From pyramid with Apache License 2.0 5 votes vote down vote up
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeString(fieldName);
    out.writeString(value);
    out.writeVInt(slop);
    out.writeBoolean(inOrder);
    out.writeBoolean(weightedCount);
    out.writeOptionalString(analyzer);
}
 
Example 14
Source File: JoinPhase.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);

    distributionInfo.writeTo(out);

    if (executionNodes == null) {
        out.writeVInt(0);
    } else {
        out.writeVInt(executionNodes.size());
        for (String node : executionNodes) {
            out.writeString(node);
        }
    }

    out.writeOptionalWriteable(leftMergePhase);
    out.writeOptionalWriteable(rightMergePhase);
    out.writeVInt(numLeftOutputs);
    out.writeVInt(numRightOutputs);

    if (joinCondition == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        Symbols.toStream(joinCondition, out);
    }

    out.writeVInt(joinType.ordinal());
}
 
Example 15
Source File: SnapshotStatus.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    snapshotId.writeTo(out);
    out.writeByte(state.value());
    out.writeVInt(shards.size());
    for (SnapshotIndexShardStatus shard : shards) {
        shard.writeTo(out);
    }
}
 
Example 16
Source File: PercolateResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVLong(tookInMillis);
    out.writeVLong(count);
    if (matches == null) {
        out.writeVInt(-1);
    } else {
        out.writeVInt(matches.length);
        for (Match match : matches) {
            match.writeTo(out);
        }
    }
    out.writeOptionalStreamable(aggregations);
}
 
Example 17
Source File: ProfileRequest.java    From anomaly-detection with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(profilesToBeRetrieved.size());
    for (ProfileName profile : profilesToBeRetrieved) {
        out.writeEnum(profile);
    }
    out.writeString(detectorId);
}
 
Example 18
Source File: Symbol.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public static void toStream(Symbol symbol, StreamOutput out) throws IOException {
    out.writeVInt(symbol.symbolType().ordinal());
    symbol.writeTo(out);
}
 
Example 19
Source File: SyncedFlushService.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(opCount);
}
 
Example 20
Source File: CoordinateSearchMetadata.java    From siren-join with GNU Affero General Public License v3.0 4 votes vote down vote up
public void writeTo(StreamOutput out) throws IOException {
  out.writeVInt(this.actions.size());
  for (Action action : this.actions) {
    action.writeTo(out);
  }
}