public User(final StreamInput in) throws IOException { super(); name = in.readString(); roles.addAll(in.readList(StreamInput::readString)); requestedTenant = in.readString(); attributes = in.readMap(StreamInput::readString, StreamInput::readString); }
@SuppressWarnings("unchecked") DiffableStringMap(final StreamInput in) throws IOException { this((Map<String, String>) (Map) in.readMap()); }
private static Map<String, FieldCapabilities> readField(StreamInput in) throws IOException { return in.readMap(StreamInput::readString, FieldCapabilities::new); }
public PersistentTasksCustomMetaData(StreamInput in) throws IOException { lastAllocationId = in.readLong(); tasks = in.readMap(StreamInput::readString, PersistentTask::new); }
WriteableIngestDocument(StreamInput in) throws IOException { Map<String, Object> sourceAndMetadata = in.readMap(); Map<String, Object> ingestMetadata = in.readMap(); if (in.getVersion().before(Version.V_6_0_0_beta1)) { ingestMetadata.computeIfPresent("timestamp", (k, o) -> { Date date = (Date) o; return date.toInstant().atZone(ZoneId.systemDefault()); }); } this.ingestDocument = new IngestDocument(sourceAndMetadata, ingestMetadata); }
/** * Read from a stream. */ protected AbstractAggregationBuilder(StreamInput in) throws IOException { super(in.readString()); factoriesBuilder = new AggregatorFactories.Builder(in); metaData = in.readMap(); }
/** * Read from a stream. */ @SuppressWarnings("unchecked") private void read(StreamInput in) throws IOException { fields = in.readMap(StreamInput::readString, MultiValuesSourceFieldConfig::new); valueType = in.readOptionalWriteable(ValueType::readFromStream); format = in.readOptionalString(); }
/** * Read from a stream. */ protected PipelineAggregator(StreamInput in) throws IOException { name = in.readString(); bucketsPaths = in.readStringArray(); metaData = in.readMap(); }
public PrimaryContext(StreamInput in) throws IOException { clusterStateVersion = in.readVLong(); checkpoints = in.readMap(StreamInput::readString, CheckpointState::new); routingTable = IndexShardRoutingTable.Builder.readFrom(in); }
/** * Read from a stream. */ protected InternalAggregation(StreamInput in) throws IOException { name = in.readString(); metaData = in.readMap(); pipelineAggregators = in.readNamedWriteableList(PipelineAggregator.class); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); this.indexName = in.readString(); this.responseMap = in.readMap(StreamInput::readString, FieldCapabilities::new); }
@Override public void readFrom(StreamInput in) throws IOException { totalStats = Stats.readStats(in); if (in.readBoolean()) { typeStats = in.readMap(StreamInput::readString, Stats::readStats); } }
/** * Read from a stream. */ protected AbstractPipelineAggregationBuilder(StreamInput in, String type) throws IOException { this(in.readString(), type, in.readStringArray()); metaData = in.readMap(); }
public CompositeAggregationBuilder(StreamInput in) throws IOException { super(in); int num = in.readVInt(); this.sources = new ArrayList<>(num); for (int i = 0; i < num; i++) { CompositeValuesSourceBuilder<?> builder = CompositeValuesSourceParserHelper.readFrom(in); sources.add(builder); } this.size = in.readVInt(); if (in.readBoolean()) { this.after = in.readMap(); } }
public SearchStats(StreamInput in) throws IOException { totalStats = Stats.readStats(in); openContexts = in.readVLong(); if (in.readBoolean()) { groupStats = in.readMap(StreamInput::readString, Stats::readStats); } }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); this.responseMap = in.readMap(StreamInput::readString, FieldCapabilitiesResponse::readField); if (in.getVersion().onOrAfter(Version.V_5_5_0)) { indexResponses = in.readList(FieldCapabilitiesIndexResponse::new); } else { indexResponses = Collections.emptyList(); } }
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); 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(); }
/** * Read from a stream. */ public ScriptedMetricAggregationBuilder(StreamInput in) throws IOException { super(in); initScript = in.readOptionalWriteable(Script::new); mapScript = in.readOptionalWriteable(Script::new); combineScript = in.readOptionalWriteable(Script::new); reduceScript = in.readOptionalWriteable(Script::new); if (in.readBoolean()) { params = in.readMap(); } }
/** * Reads a {@link StoredScriptSource} from a stream. Version 5.3+ will read * all of the lang, source, and options parameters. For versions prior to 5.3, * only the source parameter will be read in as a bytes reference. */ public StoredScriptSource(StreamInput in) throws IOException { if (in.getVersion().onOrAfter(Version.V_5_3_0)) { this.lang = in.readString(); this.source = in.readString(); @SuppressWarnings("unchecked") Map<String, String> options = (Map<String, String>)(Map)in.readMap(); this.options = options; } else { this.lang = null; this.source = in.readBytesReference().utf8ToString(); this.options = null; } }