Fix Eclipse compile problem in ModelLoadingService (#54670)

Current Eclipse 4.14.0 cannot deal with the direct lambda notation, changing to
an exlicite one.
This commit is contained in:
Christoph Büscher 2020-04-03 11:48:17 +02:00
parent ec0bbda52f
commit 9f22c0d37c
1 changed files with 2 additions and 1 deletions

View File

@ -108,7 +108,8 @@ public class ModelLoadingService implements ClusterStateListener {
this.localModelCache = CacheBuilder.<String, LocalModel<? extends InferenceConfig>>builder() this.localModelCache = CacheBuilder.<String, LocalModel<? extends InferenceConfig>>builder()
.setMaximumWeight(this.maxCacheSize.getBytes()) .setMaximumWeight(this.maxCacheSize.getBytes())
.weigher((id, localModel) -> localModel.ramBytesUsed()) .weigher((id, localModel) -> localModel.ramBytesUsed())
.removalListener(this::cacheEvictionListener) // explicit declaration of the listener lambda necessary for Eclipse IDE 4.14
.removalListener(notification -> cacheEvictionListener(notification))
.setExpireAfterAccess(INFERENCE_MODEL_CACHE_TTL.get(settings)) .setExpireAfterAccess(INFERENCE_MODEL_CACHE_TTL.get(settings))
.build(); .build();
clusterService.addListener(this); clusterService.addListener(this);