68
68
import com .rabbitmq .stream .impl .Client .StreamMetadata ;
69
69
import com .rabbitmq .stream .impl .Client .StreamStatsResponse ;
70
70
import com .rabbitmq .stream .impl .Client .SubscriptionOffset ;
71
+ import com .rabbitmq .stream .impl .Utils .MutableBoolean ;
71
72
import com .rabbitmq .stream .metrics .MetricsCollector ;
72
73
import io .netty .buffer .ByteBuf ;
73
74
import io .netty .buffer .ByteBufInputStream ;
85
86
import java .util .Map ;
86
87
import java .util .Objects ;
87
88
import java .util .concurrent .ConcurrentMap ;
88
- import java .util .concurrent .atomic .AtomicBoolean ;
89
89
import org .slf4j .Logger ;
90
90
import org .slf4j .LoggerFactory ;
91
91
@@ -345,7 +345,7 @@ static int handleMessage(
345
345
ByteBuf bb ,
346
346
int read ,
347
347
boolean filter ,
348
- AtomicBoolean messageFiltered ,
348
+ MutableBoolean messageFiltered ,
349
349
long offset ,
350
350
long offsetLimit ,
351
351
long chunkTimestamp ,
@@ -465,7 +465,6 @@ static int handleDeliver(
465
465
final boolean filter = offsetLimit != -1 ;
466
466
467
467
try {
468
- // TODO handle exception in exception handler
469
468
chunkChecksum .checksum (message , dataLength , crc );
470
469
} catch (ChunkChecksumValidationException e ) {
471
470
LOGGER .warn (
@@ -478,7 +477,7 @@ static int handleDeliver(
478
477
479
478
metricsCollector .chunk (numEntries );
480
479
long messagesRead = 0 ;
481
- AtomicBoolean messageFiltered = new AtomicBoolean (false );
480
+ MutableBoolean messageFiltered = new MutableBoolean (false );
482
481
483
482
while (numRecords != 0 ) {
484
483
byte entryType = message .readByte ();
@@ -539,7 +538,7 @@ static int handleDeliver(
539
538
ByteBuf outBb = client .channel .alloc ().heapBuffer (uncompressedDataSize );
540
539
ByteBuf slice = message .slice (message .readerIndex (), dataSize );
541
540
InputStream inputStream = compressionCodec .decompress (new ByteBufInputStream (slice ));
542
- byte [] inBuffer = new byte [uncompressedDataSize < 1024 ? uncompressedDataSize : 1024 ];
541
+ byte [] inBuffer = new byte [Math . min ( uncompressedDataSize , 1024 ) ];
543
542
int n ;
544
543
try {
545
544
while (-1 != (n = inputStream .read (inBuffer ))) {
0 commit comments