Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ public boolean hasGlobalBlock(ClusterBlock block) {
return global.contains(block);
}

public boolean hasGlobalBlock(ProjectId projectId, ClusterBlock block) {
return global(projectId).contains(block);
}

public boolean hasGlobalBlockWithId(final int blockId) {
for (ClusterBlock clusterBlock : global) {
if (clusterBlock.id() == blockId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ public void testProjectGlobal() {
assertThat(clusterBlocks.global(project1).size(), equalTo(2));
assertThat(clusterBlocks.global(project2).size(), equalTo(1));
assertTrue(clusterBlocks.indexBlocked(project1, randomFrom(projectGlobalBlock.levels()), project1Index));
assertTrue(clusterBlocks.hasGlobalBlock(project1, projectGlobalBlock));
}

private static ClusterBlock randomClusterBlock(TransportVersion version) {
Expand Down