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 globalBlockedException(ClusterBlockLevel level) { if (globalBlocked(level) == false) { return null; } return new ClusterBlockException(global(level)); }
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 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 globalBlockedException(ClusterBlockLevel level) { if (globalBlocked(level) == false) { return null; } return new ClusterBlockException(global(level)); }
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 globalBlockedException(ClusterBlockLevel level) { if (globalBlocked(level) == false) { return null; } return new ClusterBlockException(global(level)); }
public ClusterBlockException globalBlockedException(ClusterBlockLevel level) { if (globalBlocked(level) == false) { return null; } return new ClusterBlockException(global(level)); }
public ClusterBlockException globalBlockedException(ClusterBlockLevel level) { if (globalBlocked(level) == false) { return null; } return new ClusterBlockException(ImmutableSet.copyOf(global(level))); }
public ClusterBlockException indexBlockedException(ClusterBlockLevel level, String index) { if (!indexBlocked(level, index)) { return null; } ImmutableSet.Builder<ClusterBlock> builder = ImmutableSet.builder(); builder.addAll(global(level)); ImmutableSet<ClusterBlock> indexBlocks = indices(level).get(index); if (indexBlocks != null) { builder.addAll(indexBlocks); } return new ClusterBlockException(builder.build()); }
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; } ImmutableSet.Builder<ClusterBlock> builder = ImmutableSet.builder(); builder.addAll(global(level)); for (String index : indices) { ImmutableSet<ClusterBlock> indexBlocks = indices(level).get(index); if (indexBlocks != null) { builder.addAll(indexBlocks); } } return new ClusterBlockException(builder.build()); }
switch (type) { case 0: actualException = new ClusterBlockException(singleton(DiscoverySettings.NO_MASTER_BLOCK_WRITES)); expectedException = new ElasticsearchException("Elasticsearch exception [type=cluster_block_exception, " + "reason=blocked by: [SERVICE_UNAVAILABLE/2/no master];]");