/** * Creates a new {@link RoutingAllocation} * @param deciders {@link AllocationDeciders} to used to make decisions for routing allocations * @param routingNodes Routing nodes in the current cluster * @param clusterState cluster state before rerouting * @param currentNanoTime the nano time to use for all delay allocation calculation (typically {@link System#nanoTime()}) */ public RoutingAllocation(AllocationDeciders deciders, RoutingNodes routingNodes, ClusterState clusterState, ClusterInfo clusterInfo, long currentNanoTime) { this.deciders = deciders; this.routingNodes = routingNodes; this.metaData = clusterState.metaData(); this.routingTable = clusterState.routingTable(); this.nodes = clusterState.nodes(); this.customs = clusterState.customs(); this.clusterInfo = clusterInfo; this.currentNanoTime = currentNanoTime; }
public ClusterState(long version, String stateUUID, ClusterState state) { this(state.clusterName, version, stateUUID, state.metaData(), state.routingTable(), state.nodes(), state.blocks(), state.customs(), false); }
/** * For interoperability with transport clients older than 6.3, we need to strip customs * from the cluster state that the client might not be able to deserialize * * @param clusterState the cluster state to filter the customs from * @return the adapted cluster state */ public static ClusterState filterCustomsForPre63Clients(ClusterState clusterState) { final ClusterState.Builder builder = ClusterState.builder(clusterState); clusterState.customs().keysIt().forEachRemaining(name -> { if (PRE_6_3_CLUSTER_CUSTOMS_WHITE_LIST.contains(name) == false) { builder.removeCustom(name); } }); final MetaData.Builder metaBuilder = MetaData.builder(clusterState.metaData()); clusterState.metaData().customs().keysIt().forEachRemaining(name -> { if (PRE_6_3_METADATA_CUSTOMS_WHITE_LIST.contains(name) == false) { metaBuilder.removeCustom(name); } }); return builder.metaData(metaBuilder).build(); }
public Builder(ClusterState state) { this.clusterName = state.clusterName; this.version = state.version(); this.uuid = state.stateUUID(); this.nodes = state.nodes(); this.routingTable = state.routingTable(); this.metaData = state.metaData(); this.blocks = state.blocks(); this.customs = ImmutableOpenMap.builder(state.customs()); this.fromDiff = false; }
for (ObjectObjectCursor<String, ClusterState.Custom> custom : currentState.customs()) { if (custom.value.isPrivate() == false) { builder.putCustom(custom.key, custom.value);
/** * Creates a new {@link RoutingAllocation} * @param deciders {@link AllocationDeciders} to used to make decisions for routing allocations * @param routingNodes Routing nodes in the current cluster * @param clusterState cluster state before rerouting * @param currentNanoTime the nano time to use for all delay allocation calculation (typically {@link System#nanoTime()}) */ public RoutingAllocation(AllocationDeciders deciders, RoutingNodes routingNodes, ClusterState clusterState, ClusterInfo clusterInfo, long currentNanoTime) { this.deciders = deciders; this.routingNodes = routingNodes; this.metaData = clusterState.metaData(); this.routingTable = clusterState.routingTable(); this.nodes = clusterState.nodes(); this.customs = clusterState.customs(); this.clusterInfo = clusterInfo; this.currentNanoTime = currentNanoTime; }
/** * Creates a new {@link RoutingAllocation} * @param deciders {@link AllocationDeciders} to used to make decisions for routing allocations * @param routingNodes Routing nodes in the current cluster * @param clusterState cluster state before rerouting * @param currentNanoTime the nano time to use for all delay allocation calculation (typically {@link System#nanoTime()}) */ public RoutingAllocation(AllocationDeciders deciders, RoutingNodes routingNodes, ClusterState clusterState, ClusterInfo clusterInfo, long currentNanoTime) { this.deciders = deciders; this.routingNodes = routingNodes; this.metaData = clusterState.metaData(); this.routingTable = clusterState.routingTable(); this.nodes = clusterState.nodes(); this.customs = clusterState.customs(); this.clusterInfo = clusterInfo; this.currentNanoTime = currentNanoTime; }
/** * Creates a new {@link RoutingAllocation} * @param deciders {@link AllocationDeciders} to used to make decisions for routing allocations * @param routingNodes Routing nodes in the current cluster * @param clusterState cluster state before rerouting * @param currentNanoTime the nano time to use for all delay allocation calculation (typically {@link System#nanoTime()}) */ public RoutingAllocation(AllocationDeciders deciders, RoutingNodes routingNodes, ClusterState clusterState, ClusterInfo clusterInfo, long currentNanoTime, boolean retryFailed) { this.deciders = deciders; this.routingNodes = routingNodes; this.metaData = clusterState.metaData(); this.routingTable = clusterState.routingTable(); this.nodes = clusterState.nodes(); this.customs = clusterState.customs(); this.clusterInfo = clusterInfo; this.currentNanoTime = currentNanoTime; this.retryFailed = retryFailed; }
public ClusterState(long version, String stateUUID, ClusterState state) { this(state.clusterName, version, stateUUID, state.metaData(), state.routingTable(), state.nodes(), state.blocks(), state.customs(), false); }
public ClusterState(long version, String stateUUID, ClusterState state) { this(state.clusterName, version, stateUUID, state.metaData(), state.routingTable(), state.nodes(), state.blocks(), state.customs(), false); }
public ClusterState(long version, String stateUUID, ClusterState state) { this(state.clusterName, version, stateUUID, state.metaData(), state.routingTable(), state.nodes(), state.blocks(), state.customs(), false); }
public ClusterState(long version, String stateUUID, ClusterState state) { this(state.clusterName, version, stateUUID, state.metaData(), state.routingTable(), state.nodes(), state.blocks(), state.customs(), false); }
/** * For interoperability with transport clients older than 6.3, we need to strip customs * from the cluster state that the client might not be able to deserialize * * @param clusterState the cluster state to filter the customs from * @return the adapted cluster state */ public static ClusterState filterCustomsForPre63Clients(ClusterState clusterState) { final ClusterState.Builder builder = ClusterState.builder(clusterState); clusterState.customs().keysIt().forEachRemaining(name -> { if (PRE_6_3_CLUSTER_CUSTOMS_WHITE_LIST.contains(name) == false) { builder.removeCustom(name); } }); final MetaData.Builder metaBuilder = MetaData.builder(clusterState.metaData()); clusterState.metaData().customs().keysIt().forEachRemaining(name -> { if (PRE_6_3_METADATA_CUSTOMS_WHITE_LIST.contains(name) == false) { metaBuilder.removeCustom(name); } }); return builder.metaData(metaBuilder).build(); }
/** * For interoperability with transport clients older than 6.3, we need to strip customs * from the cluster state that the client might not be able to deserialize * * @param clusterState the cluster state to filter the customs from * @return the adapted cluster state */ public static ClusterState filterCustomsForPre63Clients(ClusterState clusterState) { final ClusterState.Builder builder = ClusterState.builder(clusterState); clusterState.customs().keysIt().forEachRemaining(name -> { if (PRE_6_3_CLUSTER_CUSTOMS_WHITE_LIST.contains(name) == false) { builder.removeCustom(name); } }); final MetaData.Builder metaBuilder = MetaData.builder(clusterState.metaData()); clusterState.metaData().customs().keysIt().forEachRemaining(name -> { if (PRE_6_3_METADATA_CUSTOMS_WHITE_LIST.contains(name) == false) { metaBuilder.removeCustom(name); } }); return builder.metaData(metaBuilder).build(); }
public Builder(ClusterState state) { this.clusterName = state.clusterName; this.version = state.version(); this.uuid = state.stateUUID(); this.nodes = state.nodes(); this.routingTable = state.routingTable(); this.metaData = state.metaData(); this.blocks = state.blocks(); this.customs = ImmutableOpenMap.builder(state.customs()); this.fromDiff = false; }
public Builder(ClusterState state) { this.clusterName = state.clusterName; this.version = state.version(); this.uuid = state.stateUUID(); this.nodes = state.nodes(); this.routingTable = state.routingTable(); this.metaData = state.metaData(); this.blocks = state.blocks(); this.customs = ImmutableOpenMap.builder(state.customs()); this.fromDiff = false; }
public Builder(ClusterState state) { this.clusterName = state.clusterName; this.version = state.version(); this.uuid = state.stateUUID(); this.nodes = state.nodes(); this.routingTable = state.routingTable(); this.metaData = state.metaData(); this.blocks = state.blocks(); this.customs = ImmutableOpenMap.builder(state.customs()); this.fromDiff = false; }
public Builder(ClusterState state) { this.clusterName = state.clusterName; this.version = state.version(); this.uuid = state.stateUUID(); this.nodes = state.nodes(); this.routingTable = state.routingTable(); this.metaData = state.metaData(); this.blocks = state.blocks(); this.customs = ImmutableOpenMap.builder(state.customs()); this.fromDiff = false; }
builder.customs(currentState.customs());
builder.customs(currentState.customs());