public boolean indexBlocked(ClusterBlockLevel level, String index) { return globalBlocked(level) || blocksForIndex(level, index).isEmpty() == false; }
public ClusterBlockException indexBlockedException(ClusterBlockLevel level, String index) { if (!indexBlocked(level, index)) { return null; } Stream<ClusterBlock> blocks = concat( global(level).stream(), blocksForIndex(level, index).stream()); return new ClusterBlockException(unmodifiableSet(blocks.collect(toSet()))); }
/** * Returns <code>true</code> iff non of the given have a {@link ClusterBlockLevel#METADATA_WRITE} in place where the * {@link ClusterBlock#isAllowReleaseResources()} returns <code>false</code>. This is used in places where resources will be released * like the deletion of an index to free up resources on nodes. * @param indices the indices to check */ public ClusterBlockException indicesAllowReleaseResources(String[] indices) { final Function<String, Stream<ClusterBlock>> blocksForIndexAtLevel = index -> blocksForIndex(ClusterBlockLevel.METADATA_WRITE, index).stream(); Stream<ClusterBlock> blocks = concat( global(ClusterBlockLevel.METADATA_WRITE).stream(), Stream.of(indices).flatMap(blocksForIndexAtLevel)).filter(clusterBlock -> clusterBlock.isAllowReleaseResources() == false); Set<ClusterBlock> clusterBlocks = unmodifiableSet(blocks.collect(toSet())); if (clusterBlocks.isEmpty()) { return null; } return new ClusterBlockException(clusterBlocks); }
public ClusterBlockException indicesBlockedException(ClusterBlockLevel level, String[] indices) { boolean indexIsBlocked = false; for (String index : indices) { if (indexBlocked(level, index)) { indexIsBlocked = true; } } if (globalBlocked(level) == false && indexIsBlocked == false) { return null; } Function<String, Stream<ClusterBlock>> blocksForIndexAtLevel = index -> blocksForIndex(level, index).stream(); Stream<ClusterBlock> blocks = concat( global(level).stream(), Stream.of(indices).flatMap(blocksForIndexAtLevel)); return new ClusterBlockException(unmodifiableSet(blocks.collect(toSet()))); }
public boolean indexBlocked(ClusterBlockLevel level, String index) { return globalBlocked(level) || blocksForIndex(level, index).isEmpty() == false; }
public boolean indexBlocked(ClusterBlockLevel level, String index) { return globalBlocked(level) || blocksForIndex(level, index).isEmpty() == false; }
public boolean indexBlocked(ClusterBlockLevel level, String index) { return globalBlocked(level) || blocksForIndex(level, index).isEmpty() == false; }
public ClusterBlockException indexBlockedException(ClusterBlockLevel level, String index) { if (!indexBlocked(level, index)) { return null; } Stream<ClusterBlock> blocks = concat( global(level).stream(), blocksForIndex(level, index).stream()); return new ClusterBlockException(unmodifiableSet(blocks.collect(toSet()))); }
public ClusterBlockException indexBlockedException(ClusterBlockLevel level, String index) { if (!indexBlocked(level, index)) { return null; } Stream<ClusterBlock> blocks = concat( global(level).stream(), blocksForIndex(level, index).stream()); return new ClusterBlockException(unmodifiableSet(blocks.collect(toSet()))); }
public ClusterBlockException indexBlockedException(ClusterBlockLevel level, String index) { if (!indexBlocked(level, index)) { return null; } Stream<ClusterBlock> blocks = concat( global(level).stream(), blocksForIndex(level, index).stream()); return new ClusterBlockException(unmodifiableSet(blocks.collect(toSet()))); }
/** * Returns <code>true</code> iff non of the given have a {@link ClusterBlockLevel#METADATA_WRITE} in place where the * {@link ClusterBlock#isAllowReleaseResources()} returns <code>false</code>. This is used in places where resources will be released * like the deletion of an index to free up resources on nodes. * @param indices the indices to check */ public ClusterBlockException indicesAllowReleaseResources(String[] indices) { final Function<String, Stream<ClusterBlock>> blocksForIndexAtLevel = index -> blocksForIndex(ClusterBlockLevel.METADATA_WRITE, index).stream(); Stream<ClusterBlock> blocks = concat( global(ClusterBlockLevel.METADATA_WRITE).stream(), Stream.of(indices).flatMap(blocksForIndexAtLevel)).filter(clusterBlock -> clusterBlock.isAllowReleaseResources() == false); Set<ClusterBlock> clusterBlocks = unmodifiableSet(blocks.collect(toSet())); if (clusterBlocks.isEmpty()) { return null; } return new ClusterBlockException(clusterBlocks); }
/** * Returns <code>true</code> iff non of the given have a {@link ClusterBlockLevel#METADATA_WRITE} in place where the * {@link ClusterBlock#isAllowReleaseResources()} returns <code>false</code>. This is used in places where resources will be released * like the deletion of an index to free up resources on nodes. * @param indices the indices to check */ public ClusterBlockException indicesAllowReleaseResources(String[] indices) { final Function<String, Stream<ClusterBlock>> blocksForIndexAtLevel = index -> blocksForIndex(ClusterBlockLevel.METADATA_WRITE, index).stream(); Stream<ClusterBlock> blocks = concat( global(ClusterBlockLevel.METADATA_WRITE).stream(), Stream.of(indices).flatMap(blocksForIndexAtLevel)).filter(clusterBlock -> clusterBlock.isAllowReleaseResources() == false); Set<ClusterBlock> clusterBlocks = unmodifiableSet(blocks.collect(toSet())); if (clusterBlocks.isEmpty()) { return null; } return new ClusterBlockException(clusterBlocks); }
/** * Returns <code>true</code> iff non of the given have a {@link ClusterBlockLevel#METADATA_WRITE} in place where the * {@link ClusterBlock#isAllowReleaseResources()} returns <code>false</code>. This is used in places where resources will be released * like the deletion of an index to free up resources on nodes. * @param indices the indices to check */ public ClusterBlockException indicesAllowReleaseResources(String[] indices) { final Function<String, Stream<ClusterBlock>> blocksForIndexAtLevel = index -> blocksForIndex(ClusterBlockLevel.METADATA_WRITE, index).stream(); Stream<ClusterBlock> blocks = concat( global(ClusterBlockLevel.METADATA_WRITE).stream(), Stream.of(indices).flatMap(blocksForIndexAtLevel)).filter(clusterBlock -> clusterBlock.isAllowReleaseResources() == false); Set<ClusterBlock> clusterBlocks = unmodifiableSet(blocks.collect(toSet())); if (clusterBlocks.isEmpty()) { return null; } return new ClusterBlockException(clusterBlocks); }
public ClusterBlockException indicesBlockedException(ClusterBlockLevel level, String[] indices) { boolean indexIsBlocked = false; for (String index : indices) { if (indexBlocked(level, index)) { indexIsBlocked = true; } } if (globalBlocked(level) == false && indexIsBlocked == false) { return null; } Function<String, Stream<ClusterBlock>> blocksForIndexAtLevel = index -> blocksForIndex(level, index).stream(); Stream<ClusterBlock> blocks = concat( global(level).stream(), Stream.of(indices).flatMap(blocksForIndexAtLevel)); return new ClusterBlockException(unmodifiableSet(blocks.collect(toSet()))); }
public ClusterBlockException indicesBlockedException(ClusterBlockLevel level, String[] indices) { boolean indexIsBlocked = false; for (String index : indices) { if (indexBlocked(level, index)) { indexIsBlocked = true; } } if (globalBlocked(level) == false && indexIsBlocked == false) { return null; } Function<String, Stream<ClusterBlock>> blocksForIndexAtLevel = index -> blocksForIndex(level, index).stream(); Stream<ClusterBlock> blocks = concat( global(level).stream(), Stream.of(indices).flatMap(blocksForIndexAtLevel)); return new ClusterBlockException(unmodifiableSet(blocks.collect(toSet()))); }
public ClusterBlockException indicesBlockedException(ClusterBlockLevel level, String[] indices) { boolean indexIsBlocked = false; for (String index : indices) { if (indexBlocked(level, index)) { indexIsBlocked = true; } } if (globalBlocked(level) == false && indexIsBlocked == false) { return null; } Function<String, Stream<ClusterBlock>> blocksForIndexAtLevel = index -> blocksForIndex(level, index).stream(); Stream<ClusterBlock> blocks = concat( global(level).stream(), Stream.of(indices).flatMap(blocksForIndexAtLevel)); return new ClusterBlockException(unmodifiableSet(blocks.collect(toSet()))); }