@@ -885,7 +885,7 @@ public void testMaybeEvictLeastUsed() throws Exception {
885885 var entry = cacheService .get (cacheKey , regionSize , 0 );
886886 entry .populate (
887887 ByteRange .of (0L , regionSize ),
888- (channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
888+ () -> ( channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
889889 completionListener ,
890890 () -> progressUpdater .accept (length )
891891 ),
@@ -983,7 +983,7 @@ public void execute(Runnable command) {
983983 cacheKey ,
984984 0 ,
985985 blobLength ,
986- (channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
986+ () -> ( channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
987987 completionListener ,
988988 () -> {
989989 assert streamFactory == null : streamFactory ;
@@ -1017,14 +1017,18 @@ public void execute(Runnable command) {
10171017 cacheKey ,
10181018 region ,
10191019 blobLength ,
1020- (channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
1021- completionListener ,
1022- () -> {
1020+ () -> (
1021+ channel ,
1022+ channelPos ,
1023+ streamFactory ,
1024+ relativePos ,
1025+ length ,
1026+ progressUpdater ,
1027+ completionListener ) -> completeWith (completionListener , () -> {
10231028 assert streamFactory == null : streamFactory ;
10241029 bytesRead .addAndGet (length );
10251030 progressUpdater .accept (length );
1026- }
1027- ),
1031+ }),
10281032 bulkExecutor ,
10291033 listener
10301034 );
@@ -1045,7 +1049,7 @@ public void execute(Runnable command) {
10451049 cacheKey ,
10461050 randomIntBetween (0 , 10 ),
10471051 randomLongBetween (1L , regionSize ),
1048- (channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
1052+ () -> ( channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
10491053 completionListener ,
10501054 () -> {
10511055 throw new AssertionError ("should not be executed" );
@@ -1070,7 +1074,7 @@ public void execute(Runnable command) {
10701074 cacheKey ,
10711075 0 ,
10721076 blobLength ,
1073- (channel , channelPos , ignore , relativePos , length , progressUpdater , completionListener ) -> completeWith (
1077+ () -> ( channel , channelPos , ignore , relativePos , length , progressUpdater , completionListener ) -> completeWith (
10741078 completionListener ,
10751079 () -> {
10761080 assert ignore == null : ignore ;
@@ -1151,7 +1155,7 @@ public void execute(Runnable command) {
11511155 region ,
11521156 range ,
11531157 blobLength ,
1154- (channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
1158+ () -> ( channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
11551159 completionListener ,
11561160 () -> {
11571161 assertThat (range .start () + relativePos , equalTo (cacheService .getRegionStart (region ) + regionRange .start ()));
@@ -1194,10 +1198,14 @@ public void execute(Runnable command) {
11941198 region ,
11951199 ByteRange .of (0L , blobLength ),
11961200 blobLength ,
1197- (channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
1198- completionListener ,
1199- () -> bytesCopied .addAndGet (length )
1200- ),
1201+ () -> (
1202+ channel ,
1203+ channelPos ,
1204+ streamFactory ,
1205+ relativePos ,
1206+ length ,
1207+ progressUpdater ,
1208+ completionListener ) -> completeWith (completionListener , () -> bytesCopied .addAndGet (length )),
12011209 bulkExecutor ,
12021210 listener
12031211 );
@@ -1220,7 +1228,7 @@ public void execute(Runnable command) {
12201228 randomIntBetween (0 , 10 ),
12211229 ByteRange .of (0L , blobLength ),
12221230 blobLength ,
1223- (channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
1231+ () -> ( channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
12241232 completionListener ,
12251233 () -> {
12261234 throw new AssertionError ("should not be executed" );
@@ -1246,7 +1254,7 @@ public void execute(Runnable command) {
12461254 0 ,
12471255 ByteRange .of (0L , blobLength ),
12481256 blobLength ,
1249- (channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
1257+ () -> ( channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
12501258 completionListener ,
12511259 () -> bytesCopied .addAndGet (length )
12521260 ),
@@ -1292,7 +1300,7 @@ public void testPopulate() throws Exception {
12921300 final PlainActionFuture <Boolean > future1 = new PlainActionFuture <>();
12931301 entry .populate (
12941302 ByteRange .of (0 , regionSize - 1 ),
1295- (channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
1303+ () -> ( channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
12961304 completionListener ,
12971305 () -> {
12981306 bytesWritten .addAndGet (length );
@@ -1311,7 +1319,7 @@ public void testPopulate() throws Exception {
13111319 final PlainActionFuture <Boolean > future2 = new PlainActionFuture <>();
13121320 entry .populate (
13131321 ByteRange .of (0 , regionSize - 1 ),
1314- (channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
1322+ () -> ( channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
13151323 completionListener ,
13161324 () -> {
13171325 bytesWritten .addAndGet (length );
@@ -1327,7 +1335,7 @@ public void testPopulate() throws Exception {
13271335 final PlainActionFuture <Boolean > future3 = new PlainActionFuture <>();
13281336 entry .populate (
13291337 ByteRange .of (0 , regionSize - 1 ),
1330- (channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
1338+ () -> ( channel , channelPos , streamFactory , relativePos , length , progressUpdater , completionListener ) -> completeWith (
13311339 completionListener ,
13321340 () -> {
13331341 bytesWritten .addAndGet (length );
@@ -1531,7 +1539,7 @@ public void fillCacheRange(
15311539 assertThat (safeGet (future ).longValue (), equalTo (regionSizeInBytes ));
15321540 } else {
15331541 final PlainActionFuture <Boolean > future = new PlainActionFuture <>();
1534- region .populate (range , rangeMissingHandler , threadPool .generic (), future );
1542+ region .populate (range , () -> rangeMissingHandler , threadPool .generic (), future );
15351543 assertThat (safeGet (future ), equalTo (true ));
15361544 }
15371545 assertThat (invocationCounter .get (), equalTo (numberGaps ));
0 commit comments