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

The following examples show how to use org.elasticsearch.common.io.stream.StreamInput#readOptionalVInt() . 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: PutIndexTemplateRequest.java    From crate with Apache License 2.0 6 votes vote down vote up
public PutIndexTemplateRequest(StreamInput in) throws IOException {
    super(in);
    cause = in.readString();
    name = in.readString();

    indexPatterns = in.readList(StreamInput::readString);
    order = in.readInt();
    create = in.readBoolean();
    settings = readSettingsFromStream(in);
    int size = in.readVInt();
    for (int i = 0; i < size; i++) {
        final String type = in.readString();
        String mappingSource = in.readString();
        mappings.put(type, mappingSource);
    }
    int aliasesSize = in.readVInt();
    for (int i = 0; i < aliasesSize; i++) {
        aliases.add(new Alias(in));
    }
    version = in.readOptionalVInt();
}
 
Example 2
Source File: TermVectorsRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public void readFrom(StreamInput in) throws IOException {
    maxNumTerms = in.readOptionalVInt();
    minTermFreq = in.readOptionalVInt();
    maxTermFreq = in.readOptionalVInt();
    minDocFreq = in.readOptionalVInt();
    maxDocFreq = in.readOptionalVInt();
    minWordLength = in.readOptionalVInt();
    maxWordLength = in.readOptionalVInt();
}
 
Example 3
Source File: PathHierarchyAggregationBuilder.java    From elasticsearch-aggregation-pathhierarchy with MIT License 5 votes vote down vote up
/**
 * Read from a stream
 *
 */
public PathHierarchyAggregationBuilder(StreamInput in) throws IOException {
    super(in, CoreValuesSourceType.ANY);
    bucketCountThresholds = new PathHierarchyAggregator.BucketCountThresholds(in);
    separator = in.readString();
    minDocCount = in.readVLong();
    minDepth = in.readOptionalVInt();
    maxDepth = in.readOptionalVInt();
    keepBlankPath = in.readOptionalBoolean();
    depth = in.readOptionalVInt();
    order = InternalOrder.Streams.readOrder(in);
}
 
Example 4
Source File: Reference.java    From crate with Apache License 2.0 5 votes vote down vote up
public Reference(StreamInput in) throws IOException {
    ident = new ReferenceIdent(in);
    position = in.readOptionalVInt();
    type = DataTypes.fromStream(in);
    granularity = RowGranularity.fromStream(in);

    columnPolicy = ColumnPolicy.values()[in.readVInt()];
    indexType = IndexType.values()[in.readVInt()];
    nullable = in.readBoolean();
    columnStoreDisabled = in.readBoolean();
    final boolean hasDefaultExpression = in.readBoolean();
    defaultExpression = hasDefaultExpression
        ? Symbols.fromStream(in)
        : null;
}
 
Example 5
Source File: NodeStatsContext.java    From crate with Apache License 2.0 5 votes vote down vote up
public NodeStatsContext(StreamInput in, boolean complete) throws IOException {
    this.complete = complete;
    this.id = DataTypes.STRING.readValueFrom(in);
    this.name = DataTypes.STRING.readValueFrom(in);
    this.hostname = DataTypes.STRING.readValueFrom(in);
    this.timestamp = in.readLong();
    this.version = in.readBoolean() ? Version.readVersion(in) : null;
    this.build = in.readBoolean() ? Build.readBuild(in) : null;
    this.restUrl = DataTypes.STRING.readValueFrom(in);
    this.pgPort = in.readOptionalVInt();
    this.httpPort = in.readOptionalVInt();
    this.transportPort = in.readOptionalVInt();
    this.jvmStats = in.readOptionalWriteable(JvmStats::new);
    this.osInfo = in.readOptionalWriteable(OsInfo::new);
    this.processStats = in.readOptionalWriteable(ProcessStats::new);
    this.osStats = in.readOptionalWriteable(OsStats::new);
    this.fsInfo = in.readOptionalWriteable(FsInfo::new);
    this.extendedOsStats = in.readOptionalWriteable(ExtendedOsStats::new);
    this.threadPools = in.readOptionalWriteable(ThreadPoolStats::new);
    this.httpStats = in.readOptionalWriteable(HttpStats::new);
    this.psqlStats = in.readOptionalWriteable(ConnectionStats::new);
    this.openTransportConnections = in.readLong();
    this.clusterStateVersion = in.readLong();

    this.osName = DataTypes.STRING.readValueFrom(in);
    this.osArch = DataTypes.STRING.readValueFrom(in);
    this.osVersion = DataTypes.STRING.readValueFrom(in);
    this.javaVersion = DataTypes.STRING.readValueFrom(in);
    this.jvmName = DataTypes.STRING.readValueFrom(in);
    this.jvmVendor = DataTypes.STRING.readValueFrom(in);
    this.jvmVersion = DataTypes.STRING.readValueFrom(in);
}
 
Example 6
Source File: LoggingSearchExtBuilder.java    From elasticsearch-learning-to-rank with Apache License 2.0 4 votes vote down vote up
private LogSpec(StreamInput input) throws IOException {
    loggerName = input.readOptionalString();
    namedQuery = input.readOptionalString();
    rescoreIndex = input.readOptionalVInt();
    missingAsZero = input.readBoolean();
}
 
Example 7
Source File: RoutedCollectPhase.java    From crate with Apache License 2.0 3 votes vote down vote up
public RoutedCollectPhase(StreamInput in) throws IOException {
    super(in);
    distributionInfo = new DistributionInfo(in);

    toCollect = Symbols.listFromStream(in);
    maxRowGranularity = RowGranularity.fromStream(in);

    routing = new Routing(in);

    where = Symbols.fromStream(in);

    nodePageSizeHint = in.readOptionalVInt();

    orderBy = in.readOptionalWriteable(OrderBy::new);
}