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

The following examples show how to use org.elasticsearch.common.io.stream.StreamInput#readLong() . 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: StringTerms.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
protected void doReadFrom(StreamInput in) throws IOException {
    this.docCountError = in.readLong();
    this.order = InternalOrder.Streams.readOrder(in);
    this.requiredSize = readSize(in);
    this.shardSize = readSize(in);
    this.showTermDocCountError = in.readBoolean();
    this.minDocCount = in.readVLong();
    this.otherDocCount = in.readVLong();
    int size = in.readVInt();
    List<InternalTerms.Bucket> buckets = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        Bucket bucket = new Bucket(showTermDocCountError);
        bucket.readFrom(in);
        buckets.add(bucket);
    }
    this.buckets = buckets;
    this.bucketMap = null;
}
 
Example 2
Source File: IndexingStats.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    indexCount = in.readVLong();
    indexTimeInMillis = in.readVLong();
    indexCurrent = in.readVLong();

    if(in.getVersion().onOrAfter(Version.V_2_1_0)){
        indexFailedCount = in.readVLong();
    }

    deleteCount = in.readVLong();
    deleteTimeInMillis = in.readVLong();
    deleteCurrent = in.readVLong();
    noopUpdateCount = in.readVLong();
    isThrottled = in.readBoolean();
    throttleTimeInMillis = in.readLong();
}
 
Example 3
Source File: AbstractProjectionsPhase.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    jobId = new UUID(in.readLong(), in.readLong());
    executionPhaseId = in.readVInt();

    int numCols = in.readVInt();
    if (numCols > 0) {
        outputTypes = new ArrayList<>(numCols);
        for (int i = 0; i < numCols; i++) {
            outputTypes.add(DataTypes.fromStream(in));
        }
    }

    int numProjections = in.readVInt();
    if (numProjections > 0) {
        projections = new ArrayList<>(numProjections);
        for (int i = 0; i < numProjections; i++) {
            projections.add(Projection.fromStream(in));
        }
    }

}
 
Example 4
Source File: GetResult.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    index = in.readString();
    type = in.readOptionalString();
    id = in.readString();
    version = in.readLong();
    exists = in.readBoolean();
    if (exists) {
        source = in.readBytesReference();
        if (source.length() == 0) {
            source = null;
        }
        int size = in.readVInt();
        if (size == 0) {
            fields = ImmutableMap.of();
        } else {
            fields = newHashMapWithExpectedSize(size);
            for (int i = 0; i < size; i++) {
                GetField field = readGetField(in);
                fields.put(field.getName(), field);
            }
        }
    }
}
 
Example 5
Source File: RecoveryCleanFilesRequest.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);
    recoveryId = in.readLong();
    shardId = ShardId.readShardId(in);
    snapshotFiles = new Store.MetadataSnapshot(in);
    totalTranslogOps = in.readVInt();
}
 
Example 6
Source File: IndicesStore.java    From crate with Apache License 2.0 5 votes vote down vote up
public ShardActiveRequest(StreamInput in) throws IOException {
    super(in);
    clusterName = new ClusterName(in);
    indexUUID = in.readString();
    shardId = new ShardId(in);
    timeout = new TimeValue(in.readLong(), TimeUnit.MILLISECONDS);
}
 
Example 7
Source File: CreatePartitionsRequest.java    From crate with Apache License 2.0 5 votes vote down vote up
public CreatePartitionsRequest(StreamInput in) throws IOException {
    super(in);
    jobId = new UUID(in.readLong(), in.readLong());
    int numIndices = in.readVInt();
    List<String> indicesList = new ArrayList<>(numIndices);
    for (int i = 0; i < numIndices; i++) {
        indicesList.add(in.readString());
    }
    this.indices = indicesList;
}
 
Example 8
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 9
Source File: ProcessStats.java    From crate with Apache License 2.0 5 votes vote down vote up
public ProcessStats(StreamInput in) throws IOException {
    timestamp = in.readVLong();
    openFileDescriptors = in.readLong();
    maxFileDescriptors = in.readLong();
    cpu = in.readOptionalWriteable(Cpu::new);
    mem = in.readOptionalWriteable(Mem::new);
}
 
Example 10
Source File: StartRecoveryRequest.java    From crate with Apache License 2.0 5 votes vote down vote up
public StartRecoveryRequest(StreamInput in) throws IOException {
    super(in);
    recoveryId = in.readLong();
    shardId = new ShardId(in);
    targetAllocationId = in.readString();
    sourceNode = new DiscoveryNode(in);
    targetNode = new DiscoveryNode(in);
    metadataSnapshot = new Store.MetadataSnapshot(in);
    primaryRelocation = in.readBoolean();
    startingSeqNo = in.readLong();
}
 
Example 11
Source File: Stats.java    From crate with Apache License 2.0 5 votes vote down vote up
public Stats(StreamInput in) throws IOException {
    this.numDocs = in.readLong();
    this.sizeInBytes = in.readLong();
    int numColumnStats = in.readVInt();
    this.statsByColumn = new HashMap<>();
    for (int i = 0; i < numColumnStats; i++) {
        statsByColumn.put(new ColumnIdent(in), new ColumnStats(in));
    }
}
 
Example 12
Source File: TimeTZType.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public TimeTZ readValueFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        return null;
    }
    return new TimeTZ(in.readLong(), in.readInt());
}
 
Example 13
Source File: RecoveryTranslogOperationsRequest.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);
    recoveryId = in.readLong();
    shardId = ShardId.readShardId(in);
    operations = Translog.readOperations(in);
    totalTranslogOps = in.readVInt();
}
 
Example 14
Source File: ClusterStatsNodes.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    availableProcessors = in.readVInt();
    if (in.getVersion().onOrAfter(Version.V_2_1_0)) {
        allocatedProcessors = in.readVInt();
    }

    availableMemory = in.readLong();
    int size = in.readVInt();
    names.clear();
    for (int i = 0; i < size; i++) {
        names.addTo(in.readString(), in.readVInt());
    }
}
 
Example 15
Source File: LongTerms.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    term = in.readLong();
    docCount = in.readVLong();
    docCountError = -1;
    if (showDocCountError) {
        docCountError = in.readLong();
    }
    aggregations = InternalAggregations.readAggregations(in);
}
 
Example 16
Source File: NodesFaultDetection.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);
    nodeId = in.readString();
    clusterName = ClusterName.readClusterName(in);
    masterNode = DiscoveryNode.readNode(in);
    clusterStateVersion = in.readLong();
}
 
Example 17
Source File: InternalGeoHashGrid.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    geohashAsLong = in.readLong();
    docCount = in.readVLong();
    aggregations = InternalAggregations.readAggregations(in);
}
 
Example 18
Source File: BlobRecoveryRequest.java    From crate with Apache License 2.0 4 votes vote down vote up
public BlobRecoveryRequest(StreamInput in) throws IOException {
    super(in);
    recoveryId = in.readLong();
}
 
Example 19
Source File: SearchServiceTransportAction.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);
    id = in.readLong();
}
 
Example 20
Source File: ProcessStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    percent = in.readShort();
    total = in.readLong();
}