Java Code Examples for org.elasticsearch.common.io.stream.StreamOutput#writeOptionalWriteable()

The following examples show how to use org.elasticsearch.common.io.stream.StreamOutput#writeOptionalWriteable() . 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: ShardStats.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    shardRouting.writeTo(out);
    commonStats.writeTo(out);
    out.writeOptionalWriteable(commitStats);
    out.writeString(statePath);
    out.writeString(dataPath);
    out.writeBoolean(isCustomDataPath);
    out.writeOptionalWriteable(seqNoStats);
}
 
Example 2
Source File: WindowDefinition.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(partitions.size());
    for (Symbol partition : partitions) {
        Symbols.toStream(partition, out);
    }
    out.writeOptionalWriteable(orderBy);
    windowFrameDefinition.writeTo(out);
}
 
Example 3
Source File: PutMappingRequest.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeStringArrayNullable(indices);
    indicesOptions.writeIndicesOptions(out);
    out.writeOptionalString(type);
    out.writeString(source);
    out.writeBoolean(updateAllTypes);
    out.writeOptionalWriteable(concreteIndex);
}
 
Example 4
Source File: UsersMetaData.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(users.size());
    for (Map.Entry<String, SecureHash> user : users.entrySet()) {
        out.writeString(user.getKey());
        out.writeOptionalWriteable(user.getValue());
    }
}
 
Example 5
Source File: ProcessStats.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(timestamp);
    out.writeLong(openFileDescriptors);
    out.writeLong(maxFileDescriptors);
    out.writeOptionalWriteable(cpu);
    out.writeOptionalWriteable(mem);
}
 
Example 6
Source File: AllocateUnassignedDecision.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeOptionalWriteable(allocationStatus);
    out.writeOptionalString(allocationId);
    out.writeBoolean(reuseStore);
    out.writeVLong(remainingDelayInMillis);
    out.writeVLong(configuredDelayInMillis);
}
 
Example 7
Source File: TransportBroadcastByNodeAction.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(nodeId);
    out.writeVInt(totalShards);
    out.writeVInt(results.size());
    for (ShardOperationResult result : results) {
        out.writeOptionalWriteable(result);
    }
    out.writeBoolean(exceptions != null);
    if (exceptions != null) {
        out.writeList(exceptions);
    }
}
 
Example 8
Source File: FsInfo.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(timestamp);
    out.writeOptionalWriteable(ioStats);
    out.writeVInt(paths.length);
    for (Path path : paths) {
        path.writeTo(out);
    }
    out.writeOptionalWriteable(this.leastDiskEstimate);
    out.writeOptionalWriteable(this.mostDiskEstimate);
}
 
Example 9
Source File: MultiValuesSourceAggregationBuilder.java    From elasticsearch-linear-regression with Apache License 2.0 5 votes vote down vote up
@Override
protected final void doWriteTo(StreamOutput out) throws IOException {
  if (serializeTargetValueType()) {
    out.writeOptionalWriteable(targetValueType);
  }
  out.writeGenericValue(fields);
  out.writeOptionalWriteable(valueType);
  out.writeOptionalString(format);
  out.writeMap(missingMap);
  innerWriteTo(out);
}
 
Example 10
Source File: ExtendedOsStats.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeLong(timestamp);
    out.writeLong(uptime);
    out.writeDoubleArray(loadAverage);
    out.writeOptionalWriteable(cpu);
    out.writeOptionalWriteable(osStats);
}
 
Example 11
Source File: ShardRouting.java    From crate with Apache License 2.0 5 votes vote down vote up
/**
 * Writes shard information to {@link StreamOutput} without writing index name and shard id
 *
 * @param out {@link StreamOutput} to write shard information to
 * @throws IOException if something happens during write
 */
public void writeToThin(StreamOutput out) throws IOException {
    out.writeOptionalString(currentNodeId);
    out.writeOptionalString(relocatingNodeId);
    out.writeBoolean(primary);
    out.writeByte(state.value());
    if (state == ShardRoutingState.UNASSIGNED || state == ShardRoutingState.INITIALIZING) {
        recoverySource.writeTo(out);
    }
    out.writeOptionalWriteable(unassignedInfo);
    out.writeOptionalWriteable(allocationId);
    if (state == ShardRoutingState.RELOCATING || state == ShardRoutingState.INITIALIZING) {
        out.writeLong(expectedShardSize);
    }
}
 
Example 12
Source File: CreateUserRequest.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(userName);
    out.writeOptionalWriteable(secureHash);
}
 
Example 13
Source File: RestoreSnapshotResponse.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeOptionalWriteable(restoreInfo);
}
 
Example 14
Source File: PeersResponse.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeOptionalWriteable(masterNode.orElse(null));
    out.writeList(knownPeers);
    out.writeLong(term);
}
 
Example 15
Source File: NodeStats.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVLong(timestamp);
    out.writeOptionalWriteable(fs);
}
 
Example 16
Source File: TransportService.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeOptionalWriteable(discoveryNode);
    clusterName.writeTo(out);
    Version.writeVersion(version, out);
}
 
Example 17
Source File: ConnectTransportException.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeOptionalWriteable(node);
}
 
Example 18
Source File: DiscoveryStats.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeOptionalWriteable(queueStats);
    out.writeOptionalWriteable(publishStats);
}
 
Example 19
Source File: WindowFrameDefinition.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeEnum(mode);
    start.writeTo(out);
    out.writeOptionalWriteable(end);
}
 
Example 20
Source File: AlterUserRequest.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(userName);
    out.writeOptionalWriteable(secureHash);
}