File tree Expand file tree Collapse file tree 3 files changed +5
-15
lines changed
resources/org/elasticsearch/transport Expand file tree Collapse file tree 3 files changed +5
-15
lines changed Original file line number Diff line number Diff line change 2323import java .util .Map ;
2424import java .util .ServiceLoader ;
2525import java .util .function .Function ;
26+ import java .util .function .IntFunction ;
2627import java .util .stream .Collectors ;
2728import java .util .stream .Stream ;
2829
@@ -177,7 +178,7 @@ public boolean isPatchFrom(TransportVersion version) {
177178 * if applicable for this deployment, otherwise the raw version number.
178179 */
179180 public String toReleaseVersion () {
180- return TransportVersions .VERSION_LOOKUP .apply (id );
181+ return VersionsHolder .VERSION_LOOKUP .apply (id );
181182 }
182183
183184 @ Override
@@ -186,6 +187,7 @@ public String toString() {
186187 }
187188
188189 private static class VersionsHolder {
190+ private static final IntFunction <String > VERSION_LOOKUP ;
189191 private static final List <TransportVersion > ALL_VERSIONS ;
190192 private static final Map <Integer , TransportVersion > ALL_VERSIONS_MAP ;
191193 private static final TransportVersion CURRENT ;
@@ -204,6 +206,7 @@ private static class VersionsHolder {
204206
205207 ALL_VERSIONS_MAP = ALL_VERSIONS .stream ().collect (Collectors .toUnmodifiableMap (TransportVersion ::id , Function .identity ()));
206208 CURRENT = ALL_VERSIONS .stream ().max (TransportVersion ::compareTo ).get ();
209+ VERSION_LOOKUP = ReleaseVersions .generateVersionsLookup (TransportVersions .class , CURRENT .id ());
207210 }
208211 }
209212}
Original file line number Diff line number Diff line change 1919import java .util .Map ;
2020import java .util .Set ;
2121import java .util .TreeSet ;
22- import java .util .function .IntFunction ;
2322
2423/**
2524 * <p>Transport version is used to coordinate compatible wire protocol communication between nodes, at a fine-grained level. This replaces
@@ -383,16 +382,6 @@ static TransportVersion def(int id) {
383382 */
384383 static final List <TransportVersion > DEFINED_VERSIONS = collectAllVersionIdsDefinedInClass (TransportVersions .class );
385384
386- // the highest transport version constant defined
387- static final TransportVersion LATEST_DEFINED ;
388- static {
389- LATEST_DEFINED = DEFINED_VERSIONS .getLast ();
390-
391- // see comment on IDS field
392- // now we're registered all the transport versions, we can clear the map
393- IDS = null ;
394- }
395-
396385 public static List <TransportVersion > collectAllVersionIdsDefinedInClass (Class <?> cls ) {
397386 Map <Integer , String > versionIdFields = new HashMap <>();
398387 List <TransportVersion > definedTransportVersions = new ArrayList <>();
@@ -434,8 +423,6 @@ public static List<TransportVersion> collectAllVersionIdsDefinedInClass(Class<?>
434423 return List .copyOf (definedTransportVersions );
435424 }
436425
437- static final IntFunction <String > VERSION_LOOKUP = ReleaseVersions .generateVersionsLookup (TransportVersions .class , LATEST_DEFINED .id ());
438-
439426 // no instance
440427 private TransportVersions () {}
441428}
Original file line number Diff line number Diff line change 11{
22 "name" : " esql-fixed-index-like" ,
33 "ids" : [
4- 9190000 ,
4+ 9119000 ,
55 9112002 ,
66 8841064
77 ]
You can’t perform that action at this time.
0 commit comments