@Override public RoutingTable apply(RoutingTable part) { return new RoutingTable(version, indicesRouting.apply(part.indicesRouting)); }
/** * Builds the routing table. Note that once this is called the builder * must be thrown away. If you need to build a new RoutingTable as a * copy of this one you'll need to build a new RoutingTable.Builder. */ public RoutingTable build() { if (indicesRouting == null) { throw new IllegalStateException("once build is called the builder cannot be reused"); } RoutingTable table = new RoutingTable(version, indicesRouting.build()); indicesRouting = null; return table; } }
@Override public RoutingTable apply(RoutingTable part) { return new RoutingTable(version, indicesRouting.apply(part.indicesRouting)); }
@Override public RoutingTable apply(RoutingTable part) { return new RoutingTable(version, indicesRouting.apply(part.indicesRouting)); }
@Override public RoutingTable apply(RoutingTable part) { return new RoutingTable(version, indicesRouting.apply(part.indicesRouting)); }
/** * Builds the routing table. Note that once this is called the builder * must be thrown away. If you need to build a new RoutingTable as a * copy of this one you'll need to build a new RoutingTable.Builder. */ public RoutingTable build() { if (indicesRouting == null) { throw new IllegalStateException("once build is called the builder cannot be reused"); } RoutingTable table = new RoutingTable(version, indicesRouting.build()); indicesRouting = null; return table; } }
@Override public RoutingTable apply(RoutingTable part) { return new RoutingTable(version, indicesRouting.apply(part.indicesRouting)); }
/** * Builds the routing table. Note that once this is called the builder * must be thrown away. If you need to build a new RoutingTable as a * copy of this one you'll need to build a new RoutingTable.Builder. */ public RoutingTable build() { if (indicesRouting == null) { throw new IllegalStateException("once build is called the builder cannot be reused"); } RoutingTable table = new RoutingTable(version, indicesRouting.build()); indicesRouting = null; return table; } }
/** * Builds the routing table. Note that once this is called the builder * must be thrown away. If you need to build a new RoutingTable as a * copy of this one you'll need to build a new RoutingTable.Builder. */ public RoutingTable build() { if (indicesRouting == null) { throw new IllegalStateException("once build is called the builder cannot be reused"); } RoutingTable table = new RoutingTable(version, indicesRouting.build()); indicesRouting = null; return table; } }
public RoutingTable build() { // normalize the versions right before we build it... for (IndexRoutingTable indexRoutingTable : indicesRouting.values()) { indicesRouting.put(indexRoutingTable.index(), indexRoutingTable.normalizeVersions()); } return new RoutingTable(version, indicesRouting); }
public static RoutingTable build(ClusterService clusterService, ClusterState clusterState) { ImmutableOpenMap.Builder<String, IndexRoutingTable> indicesRoutingMap = new ImmutableOpenMap.Builder<>(); for(ObjectObjectCursor<String, IndexMetaData> entry : clusterState.metaData().getIndices()) { IndexRoutingTable.Builder indexRoutingTableBuilder = new IndexRoutingTable.Builder(entry.value.getIndex(), clusterService, clusterState); if (indexRoutingTableBuilder.shards.size() > 0) indicesRoutingMap.put(indexRoutingTableBuilder.index.getName(), indexRoutingTableBuilder.build()); } return new RoutingTable(clusterState.routingTable().version(), indicesRoutingMap.build()); }
public static RoutingTable build(ClusterService clusterService, ClusterState clusterState, Index index) { ImmutableOpenMap.Builder<String, IndexRoutingTable> indicesRoutingMap = new ImmutableOpenMap.Builder<>(); for(ObjectObjectCursor<String, IndexRoutingTable> entry : clusterState.routingTable().indicesRouting()) { if (!entry.key.equals(index)) indicesRoutingMap.put(entry.value.getIndex().getName(), entry.value); } // may update the routing table for the specified index IndexMetaData indexMetaData = clusterState.metaData().index(index); if (indexMetaData != null) { IndexRoutingTable.Builder indexRoutingTableBuilder = new IndexRoutingTable.Builder(index, clusterService, clusterState); if (indexRoutingTableBuilder.shards.size() > 0) indicesRoutingMap.put(index.getName(), indexRoutingTableBuilder.build()); } return new RoutingTable(clusterState.routingTable().version(), indicesRoutingMap.build()); }