ClusterBlocks.Builder blocks = ClusterBlocks.builder().blocks(currentState.blocks())
.removeIndexBlock(request.index, INDEX_CLOSED_BLOCK);
ClusterState updatedState = ClusterState.builder().state(currentState).metaData(mdBuilder).blocks(blocks).build();
RoutingTable.Builder rtBuilder = RoutingTable.builder().routingTable(updatedState.routingTable());
IndexRoutingTable.Builder indexRoutingBuilder = new IndexRoutingTable.Builder(request.index)
.initializeEmpty(updatedState.metaData().index(request.index), false);
rtBuilder.add(indexRoutingBuilder);
RoutingAllocation.Result routingResult = shardsAllocation.reroute(newClusterStateBuilder().state(updatedState).routingTable(rtBuilder).build());