public static class ClusterState.Builder extends Object
Constructor and Description |
---|
Builder(ClusterName clusterName) |
Builder(ClusterState state) |
public Builder(ClusterState state)
public Builder(ClusterName clusterName)
public ClusterState.Builder nodes(DiscoveryNodes.Builder nodesBuilder)
public ClusterState.Builder nodes(DiscoveryNodes nodes)
public ClusterState.Builder routingTable(RoutingTable.Builder routingTable)
public ClusterState.Builder routingResult(RoutingAllocation.Result routingResult)
public ClusterState.Builder routingTable(RoutingTable routingTable)
public ClusterState.Builder metaData(MetaData.Builder metaDataBuilder)
public ClusterState.Builder metaData(MetaData metaData)
public ClusterState.Builder blocks(ClusterBlocks.Builder blocksBuilder)
public ClusterState.Builder blocks(ClusterBlocks blocks)
public ClusterState.Builder version(long version)
public ClusterState.Custom getCustom(String type)
public ClusterState.Builder putCustom(String type, ClusterState.Custom custom)
public ClusterState.Builder removeCustom(String type)
public ClusterState build()
public static byte[] toBytes(ClusterState state) throws IOException
IOException
public static ClusterState fromBytes(byte[] data, DiscoveryNode localNode, ClusterName defaultClusterName) throws IOException
data
- input byteslocalNode
- used to set the local node in the cluster state.defaultClusterName
- this cluster name will be used of if the deserialized cluster state does not have a name set
(which is only introduced in version 1.1.1)IOException
public static void writeTo(ClusterState state, StreamOutput out) throws IOException
IOException
public static ClusterState readFrom(StreamInput in, @Nullable DiscoveryNode localNode, @Nullable ClusterName defaultClusterName) throws IOException
in
- input streamlocalNode
- used to set the local node in the cluster state. can be null.defaultClusterName
- this cluster name will be used of receiving a cluster state from a node on version older than 1.1.1
or if the sending node did not set a cluster nameIOException
Copyright © 2009–2015. All rights reserved.