@@ -325,22 +325,25 @@ public ByteBuffer read(long position, int length) {
325325
326326 public CompletableFuture <ByteBuffer > readAsync (long position , int length ) {
327327 CompletableFuture <ByteBuffer > future = new CompletableFuture <>();
328+
328329 if (position < 0 || position >= commitPosition ) {
329- future .completeExceptionally (new TieredStoreException (
330- TieredStoreErrorCode .ILLEGAL_PARAM , "FileSegment read position is illegal position" ));
330+ future .completeExceptionally (new TieredStoreException (TieredStoreErrorCode .ILLEGAL_PARAM ,
331+ String .format ("FileSegment read position illegal, filePath=%s, fileType=%s, position=%d, length=%d, commit=%d" ,
332+ filePath , fileType , position , length , commitPosition )));
331333 return future ;
332334 }
333335
334336 if (length <= 0 ) {
335- future .completeExceptionally (new TieredStoreException (
336- TieredStoreErrorCode .ILLEGAL_PARAM , "FileSegment read length illegal" ));
337+ future .completeExceptionally (new TieredStoreException (TieredStoreErrorCode .ILLEGAL_PARAM ,
338+ String .format ("FileSegment read length illegal, filePath=%s, fileType=%s, position=%d, length=%d, commit=%d" ,
339+ filePath , fileType , position , length , commitPosition )));
337340 return future ;
338341 }
339342
340343 int readableBytes = (int ) (commitPosition - position );
341344 if (readableBytes < length ) {
342345 length = readableBytes ;
343- log .debug ("FileSegment#readAsync, expect request position is greater than commit position, " +
346+ log .debug ("FileSegment expect request position is greater than commit position, " +
344347 "file: {}, request position: {}, commit position: {}, change length from {} to {}" ,
345348 getPath (), position , commitPosition , length , readableBytes );
346349 }
0 commit comments