Skip to content

Commit

Permalink
remove synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnvg committed Oct 7, 2021
1 parent e91f474 commit 3d816a0
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public interface NonRestorableCustom extends Custom {
private final String[] allClosedIndices;
private final String[] visibleClosedIndices;

private volatile SortedMap<String, IndexAbstraction> indicesLookup;
private SortedMap<String, IndexAbstraction> indicesLookup;

Metadata(String clusterUUID, boolean clusterUUIDCommitted, long version, CoordinationMetadata coordinationMetadata,
Settings transientSettings, Settings persistentSettings, DiffableStringMap hashesOfConsistentSettings,
Expand Down Expand Up @@ -306,12 +306,11 @@ public boolean equalsAliases(Metadata other) {
public SortedMap<String, IndexAbstraction> getIndicesLookup() {
if (indicesLookup != null) {
return indicesLookup;
}
synchronized (this) {
} else {
DataStreamMetadata dataStreamMetadata = custom(DataStreamMetadata.TYPE);
indicesLookup = Collections.unmodifiableSortedMap(Builder.buildIndicesLookup(dataStreamMetadata, indices));
return indicesLookup;
}
return indicesLookup;
}

/**
Expand Down

0 comments on commit 3d816a0

Please sign in to comment.