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

The following examples show how to use org.elasticsearch.common.io.stream.StreamInput#readBoolean() . 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: ClusteringAction.java    From elasticsearch-carrot2 with Apache License 2.0 6 votes vote down vote up
ClusteringActionResponse(StreamInput in) throws IOException {
   boolean hasSearchResponse = in.readBoolean();
   if (hasSearchResponse) {
      this.searchResponse = new SearchResponse(in);
   }

   int documentGroupsCount = in.readVInt();
   topGroups = new DocumentGroup[documentGroupsCount];
   for (int i = 0; i < documentGroupsCount; i++) {
      DocumentGroup group = new DocumentGroup(in);
      topGroups[i] = group;
   }

   int entries = in.readVInt();
   info = new LinkedHashMap<>();
   for (int i = 0; i < entries; i++) {
      info.put(in.readOptionalString(), in.readOptionalString());
   }
}
 
Example 2
Source File: SQLResponse.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);

    boolean negative = in.readBoolean();
    rowCount = in.readVLong();
    if (negative) {
        rowCount = -rowCount;
    }

    int numCols = cols().length;
    int numRows = in.readInt();
    rows = new Object[numRows][numCols];
    for (int i = 0; i < numRows; i++) {
        for (int j = 0; j < numCols; j++) {
            rows[i][j] = in.readGenericValue();
        }
    }
}
 
Example 3
Source File: AbstractIndexWriterProjection.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    tableIdent = TableIdent.fromStream(in);

    partitionIdent = in.readOptionalString();
    idSymbols = Symbol.listFromStream(in);

    int numPks = in.readVInt();
    primaryKeys = new ArrayList<>(numPks);
    for (int i = 0; i < numPks; i++) {
        primaryKeys.add(ColumnIdent.fromStream(in));
    }

    partitionedBySymbols = Symbol.listFromStream(in);
    if (in.readBoolean()) {
        clusteredBySymbol = Symbol.fromStream(in);
    } else {
        clusteredBySymbol = null;
    }
    if (in.readBoolean()) {
        clusteredByColumn = ColumnIdent.fromStream(in);
    }
    bulkActions = in.readVInt();
    autoCreateIndices = in.readBoolean();
}
 
Example 4
Source File: RecoveryFileChunkRequest.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);
    recoveryId = in.readLong();
    shardId = ShardId.readShardId(in);
    String name = in.readString();
    position = in.readVLong();
    long length = in.readVLong();
    String checksum = in.readOptionalString();
    content = in.readBytesReference();
    Version writtenBy = null;
    String versionString = in.readOptionalString();
    writtenBy = Lucene.parseVersionLenient(versionString, null);
    metaData = new StoreFileMetaData(name, length, checksum, writtenBy);
    lastChunk = in.readBoolean();
    totalTranslogOps = in.readVInt();
    sourceThrottleTimeInNanos = in.readLong();
}
 
Example 5
Source File: PercolateShardResponse.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);
    percolatorTypeId = in.readByte();
    requestedSize = in.readVInt();
    count = in.readVLong();
    matches = new BytesRef[in.readVInt()];
    for (int i = 0; i < matches.length; i++) {
        matches[i] = in.readBytesRef();
    }
    scores = new float[in.readVInt()];
    for (int i = 0; i < scores.length; i++) {
        scores[i] = in.readFloat();
    }
    int size = in.readVInt();
    for (int i = 0; i < size; i++) {
        int mSize = in.readVInt();
        Map<String, HighlightField> fields = new HashMap<>();
        for (int j = 0; j < mSize; j++) {
            fields.put(in.readString(), HighlightField.readHighlightField(in));
        }
        hls.add(fields);
    }
    aggregations = InternalAggregations.readOptionalAggregations(in);
    if (in.readBoolean()) {
        int pipelineAggregatorsSize = in.readVInt();
        List<SiblingPipelineAggregator> pipelineAggregators = new ArrayList<>(pipelineAggregatorsSize);
        for (int i = 0; i < pipelineAggregatorsSize; i++) {
            BytesReference type = in.readBytesReference();
            PipelineAggregator pipelineAggregator = PipelineAggregatorStreams.stream(type).readResult(in);
            pipelineAggregators.add((SiblingPipelineAggregator) pipelineAggregator);
        }
        this.pipelineAggregators = pipelineAggregators;
    }
}
 
Example 6
Source File: FetchSourceContext.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    fetchSource = in.readBoolean();
    includes = in.readStringArray();
    excludes = in.readStringArray();
    transformSource = in.readBoolean();
}
 
Example 7
Source File: GetSnapshotsRequest.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);
    repository = in.readString();
    snapshots = in.readStringArray();
    if (in.getVersion().onOrAfter(Version.V_2_2_0)) {
        ignoreUnavailable = in.readBoolean();
    }
}
 
Example 8
Source File: StoredLtrModel.java    From elasticsearch-learning-to-rank with Apache License 2.0 5 votes vote down vote up
public LtrModelDefinition(StreamInput in) throws IOException {
    type = in.readString();
    definition = in.readString();
    modelAsString = in.readBoolean();
    if (in.getVersion().onOrAfter(Version.V_7_7_0)) {
        this.featureNormalizers = new StoredFeatureNormalizers(in);
    } else {
        this.featureNormalizers = new StoredFeatureNormalizers();
    }
}
 
Example 9
Source File: MetaData.java    From crate with Apache License 2.0 5 votes vote down vote up
MetaDataDiff(StreamInput in) throws IOException {
    clusterUUID = in.readString();
    clusterUUIDCommitted = in.readBoolean();
    version = in.readLong();
    coordinationMetaData = new CoordinationMetaData(in);
    transientSettings = Settings.readSettingsFromStream(in);
    persistentSettings = Settings.readSettingsFromStream(in);
    indices = DiffableUtils.readImmutableOpenMapDiff(in, DiffableUtils.getStringKeySerializer(), IndexMetaData::readFrom,
        IndexMetaData::readDiffFrom);
    templates = DiffableUtils.readImmutableOpenMapDiff(in, DiffableUtils.getStringKeySerializer(), IndexTemplateMetaData::readFrom,
        IndexTemplateMetaData::readDiffFrom);
    customs = DiffableUtils.readImmutableOpenMapDiff(in, DiffableUtils.getStringKeySerializer(), CUSTOM_VALUE_SERIALIZER);
}
 
Example 10
Source File: ClusterBlock.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    id = in.readVInt();
    description = in.readString();
    final int len = in.readVInt();
    ArrayList<ClusterBlockLevel> levels = new ArrayList<>();
    for (int i = 0; i < len; i++) {
        levels.add(ClusterBlockLevel.fromId(in.readVInt()));
    }
    this.levels = EnumSet.copyOf(levels);
    retryable = in.readBoolean();
    disableStatePersistence = in.readBoolean();
    status = RestStatus.readFrom(in);
}
 
Example 11
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 12
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 13
Source File: MultiGetItemResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        failure = MultiGetResponse.Failure.readFailure(in);
    } else {
        response = new GetResponse();
        response.readFrom(in);
    }
}
 
Example 14
Source File: ActionTransportException.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public ActionTransportException(StreamInput in) throws IOException {
    super(in);
    if (in.readBoolean()) {
        address = TransportAddressSerializers.addressFromStream(in);
    } else {
        address = null;
    }
    action = in.readOptionalString();
}
 
Example 15
Source File: DocumentGroup.java    From elasticsearch-carrot2 with Apache License 2.0 5 votes vote down vote up
DocumentGroup(StreamInput in) throws IOException {
    id = in.readVInt();
    score = in.readDouble();
    phrases = in.readStringArray();
    ungroupedDocuments = in.readBoolean();
    documentReferences = in.readStringArray();

    int max = in.readVInt();
    subgroups = new DocumentGroup[max];
    for (int i = 0; i < max; i++) {
        subgroups[i] = new DocumentGroup(in);
    }
}
 
Example 16
Source File: StartRecoveryRequest.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);
    sourceNode = DiscoveryNode.readNode(in);
    targetNode = DiscoveryNode.readNode(in);
    markAsRelocated = in.readBoolean();
    metadataSnapshot = new Store.MetadataSnapshot(in);
    recoveryType = RecoveryState.Type.fromId(in.readByte());

}
 
Example 17
Source File: FieldDataStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    memorySize = in.readVLong();
    evictions = in.readVLong();
    if (in.readBoolean()) {
        int size = in.readVInt();
        fields = new ObjectLongHashMap<>(size);
        for (int i = 0; i < size; i++) {
            fields.put(in.readString(), in.readVLong());
        }
    }
}
 
Example 18
Source File: ForceMergeRequest.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);
    maxNumSegments = in.readInt();
    onlyExpungeDeletes = in.readBoolean();
    flush = in.readBoolean();
}
 
Example 19
Source File: IntegerType.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public Integer readValueFrom(StreamInput in) throws IOException {
    return in.readBoolean() ? null : in.readInt();
}
 
Example 20
Source File: Scroll.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        keepAlive = readTimeValue(in);
    }
}