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

The following examples show how to use org.elasticsearch.common.io.stream.StreamInput#readMap() . 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: JvmInfo.java    From crate with Apache License 2.0 6 votes vote down vote up
public JvmInfo(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 = in.readMap(StreamInput::readString, StreamInput::readString);
    mem = new Mem(in);
    gcCollectors = in.readStringArray();
    memoryPools = in.readStringArray();
    useCompressedOops = in.readString();
    //the following members are only used locally for bootstrap checks, never serialized nor printed out
    this.configuredMaxHeapSize = -1;
    this.configuredInitialHeapSize = -1;
    this.onError = null;
    this.onOutOfMemoryError = null;
    this.useG1GC = "unknown";
    this.useSerialGC = "unknown";
}
 
Example 2
Source File: ClusteringAction.java    From elasticsearch-carrot2 with Apache License 2.0 6 votes vote down vote up
public ClusteringActionRequest(StreamInput in) throws IOException {
   SearchRequest searchRequest = new SearchRequest(in);

   this.searchRequest = searchRequest;
   this.queryHint = in.readOptionalString();
   this.algorithm = in.readOptionalString();
   this.maxHits = in.readInt();
   this.createUngroupedDocumentsCluster = in.readBoolean();
   this.defaultLanguage = in.readString();

   int count = in.readVInt();
   while (count-- > 0) {
      FieldMappingSpec spec = new FieldMappingSpec(in);
      fieldMapping.add(spec);
   }

   boolean hasAttributes = in.readBoolean();
   if (hasAttributes) {
      attributes = in.readMap();
   }
}
 
Example 3
Source File: InternalAggregation.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public final void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    metaData = in.readMap();
    int size = in.readVInt();
    if (size == 0) {
        pipelineAggregators = Collections.emptyList();
    } else {
        pipelineAggregators = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            BytesReference type = in.readBytesReference();
            PipelineAggregator pipelineAggregator = PipelineAggregatorStreams.stream(type).readResult(in);
            pipelineAggregators.add(pipelineAggregator);
        }
    }
    doReadFrom(in);
}
 
Example 4
Source File: StoredLtrQueryBuilder.java    From elasticsearch-learning-to-rank with Apache License 2.0 5 votes vote down vote up
public StoredLtrQueryBuilder(FeatureStoreLoader storeLoader, StreamInput input) throws IOException {
    super(input);
    this.storeLoader = Objects.requireNonNull(storeLoader);
    modelName = input.readOptionalString();
    featureSetName = input.readOptionalString();
    params = input.readMap();
    if (input.getVersion().onOrAfter(Version.V_6_2_4)) {
        String[] activeFeat = input.readOptionalStringArray();
        activeFeatures = activeFeat == null ? null : Arrays.asList(activeFeat);
    }
    storeName = input.readOptionalString();
}
 
Example 5
Source File: ClusterInfo.java    From crate with Apache License 2.0 5 votes vote down vote up
public ClusterInfo(StreamInput in) throws IOException {
    Map<String, DiskUsage> leastMap = in.readMap(StreamInput::readString, DiskUsage::new);
    Map<String, DiskUsage> mostMap = in.readMap(StreamInput::readString, DiskUsage::new);
    Map<String, Long> sizeMap = in.readMap(StreamInput::readString, StreamInput::readLong);
    final Map<ShardRouting, String> routingMap = in.readMap(ShardRouting::new, StreamInput::readString);

    ImmutableOpenMap.Builder<String, DiskUsage> leastBuilder = ImmutableOpenMap.builder();
    this.leastAvailableSpaceUsage = leastBuilder.putAll(leastMap).build();
    ImmutableOpenMap.Builder<String, DiskUsage> mostBuilder = ImmutableOpenMap.builder();
    this.mostAvailableSpaceUsage = mostBuilder.putAll(mostMap).build();
    ImmutableOpenMap.Builder<String, Long> sizeBuilder = ImmutableOpenMap.builder();
    this.shardSizes = sizeBuilder.putAll(sizeMap).build();
    ImmutableOpenMap.Builder<ShardRouting, String> routingBuilder = ImmutableOpenMap.builder();
    this.routingToDataPath = routingBuilder.putAll(routingMap).build();
}
 
Example 6
Source File: MultiValuesSourceAggregationBuilder.java    From elasticsearch-linear-regression with Apache License 2.0 5 votes vote down vote up
/**
 * Read from a stream.
 */
@SuppressWarnings("unchecked")
private void read(StreamInput in) throws IOException {
  fields = (ArrayList<String>) in.readGenericValue();
  valueType = in.readOptionalWriteable(ValueType::readFromStream);
  format = in.readOptionalString();
  missingMap = in.readMap();
}
 
Example 7
Source File: PipelineAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public final void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    bucketsPaths = in.readStringArray();
    metaData = in.readMap();
    doReadFrom(in);
}
 
Example 8
Source File: Script.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public final void readFrom(StreamInput in) throws IOException {
    script = in.readString();
    if (in.readBoolean()) {
        type = ScriptType.readFrom(in);
    }
    lang = in.readOptionalString();
    if (in.readBoolean()) {
        params = in.readMap();
    }
    doReadFrom(in);
}
 
Example 9
Source File: BucketStreamContext.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    formatter = ValueFormatterStreams.readOptional(in);
    keyed = in.readBoolean();
    attributes = in.readMap();
}
 
Example 10
Source File: TransportMessage.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    headers = in.readBoolean() ? in.readMap() : null;
}
 
Example 11
Source File: FeatureValidation.java    From elasticsearch-learning-to-rank with Apache License 2.0 4 votes vote down vote up
public FeatureValidation(StreamInput input) throws IOException {
    this.index = input.readString();
    this.params = input.readMap();
}
 
Example 12
Source File: CachesStatsAction.java    From elasticsearch-learning-to-rank with Apache License 2.0 4 votes vote down vote up
public CachesStatsNodesResponse(StreamInput in) throws IOException {
    super(in);
    allStores = new StatDetails(in);
    byStore = in.readMap(StreamInput::readString, StatDetails::new);
}
 
Example 13
Source File: CachesStatsAction.java    From elasticsearch-learning-to-rank with Apache License 2.0 4 votes vote down vote up
CachesStatsNodeResponse(StreamInput in) throws IOException {
    super(in);
    allStores = new StatDetails(in);
    byStore = in.readMap(StreamInput::readString, StatDetails::new);
}
 
Example 14
Source File: ListStoresAction.java    From elasticsearch-learning-to-rank with Apache License 2.0 4 votes vote down vote up
ListStoresActionResponse(StreamInput in) throws IOException {
    super(in);
    stores = in.readMap(StreamInput::readString, IndexStoreInfo::new);
}
 
Example 15
Source File: GeoShapeType.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public Map<String, Object> readValueFrom(StreamInput in) throws IOException {
    return in.readMap();
}
 
Example 16
Source File: NodeCollectProfileResponse.java    From crate with Apache License 2.0 4 votes vote down vote up
public NodeCollectProfileResponse(StreamInput in) throws IOException {
    durationByContextIdent = in.readMap();
}
 
Example 17
Source File: GeoShapeType.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public Map<String, Object> readValueFrom(StreamInput in) throws IOException {
    return in.readMap();
}
 
Example 18
Source File: DiffableStringMap.java    From crate with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
DiffableStringMap(final StreamInput in) throws IOException {
    this((Map<String, String>) (Map) in.readMap());
}
 
Example 19
Source File: ProfileNodeResponse.java    From anomaly-detection with Apache License 2.0 2 votes vote down vote up
/**
 * Constructor
 *
 * @param in StreamInput
 * @throws IOException throws an IO exception if the StreamInput cannot be read from
 */
public ProfileNodeResponse(StreamInput in) throws IOException {
    super(in);
    modelSize = in.readMap(StreamInput::readString, StreamInput::readLong);
    shingleSize = in.readInt();
}
 
Example 20
Source File: ADStatsNodeResponse.java    From anomaly-detection with Apache License 2.0 2 votes vote down vote up
/**
 * Constructor
 *
 * @param in StreamInput
 * @throws IOException throws an IO exception if the StreamInput cannot be read from
 */
public ADStatsNodeResponse(StreamInput in) throws IOException {
    super(in);
    this.statsMap = in.readMap(StreamInput::readString, StreamInput::readGenericValue);
}