Skip to content

Commit

Permalink
Fix Cache backward compatibility breaking change (#16238)
Browse files Browse the repository at this point in the history
* Fix Cache breaking change

Signed-off-by: Sagar Upadhyaya <[email protected]>

* Empty commit to trigger build

Signed-off-by: Sagar Upadhyaya <[email protected]>

---------

Signed-off-by: Sagar Upadhyaya <[email protected]>
  • Loading branch information
sgup432 authored Oct 9, 2024
1 parent 2ed8ff0 commit 62b1537
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/main/java/org/opensearch/common/cache/Cache.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ public class Cache<K, V> {
private RemovalListener<K, V> removalListener = notification -> {};

private final int numberOfSegments;
private static final int NUMBER_OF_SEGMENTS_DEFAULT = 256;
public static final int NUMBER_OF_SEGMENTS = 256;

Cache(final int numberOfSegments) {
if (numberOfSegments != -1) {
this.numberOfSegments = numberOfSegments;
} else {
this.numberOfSegments = NUMBER_OF_SEGMENTS_DEFAULT;
this.numberOfSegments = NUMBER_OF_SEGMENTS;
}
this.segments = new CacheSegment[this.numberOfSegments];
for (int i = 0; i < this.numberOfSegments; i++) {
Expand Down

0 comments on commit 62b1537

Please sign in to comment.