Skip to content

Commit 28b7d85

Browse files
authored
[hotfix] Add a log of download file time for RemoteLogDownloader (#1052)
1 parent 3b96888 commit 28b7d85

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

fluss-client/src/main/java/com/alibaba/fluss/client/table/scanner/batch/KvSnapshotBatchScanner.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,15 @@ private void initReaderAsynchronously() {
195195
LOG.info(
196196
"Start to download kv snapshot files to local directory for bucket {}.",
197197
tableBucket);
198+
long startTime = System.currentTimeMillis();
198199
remoteFileDownloader.transferAllToDirectory(
199200
fsPathAndFileNames,
200201
snapshotLocalDirectory,
201202
closeableRegistry);
203+
LOG.info(
204+
"Download kv snapshot files to local directory for bucket {} cost {} ms.",
205+
tableBucket,
206+
System.currentTimeMillis() - startTime);
202207
snapshotFilesReader =
203208
new SnapshotFilesReader(
204209
kvFormat,

fluss-client/src/main/java/com/alibaba/fluss/client/table/scanner/log/RemoteLogDownloader.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,15 @@ void fetchOnce() throws Exception {
158158
LOG.info(
159159
"Start to download remote log segment file {} to local.",
160160
fsPathAndFileName.getFileName());
161+
long startTime = System.currentTimeMillis();
161162
remoteFileDownloader.transferAllToDirectory(
162163
Collections.singletonList(fsPathAndFileName),
163164
segmentPath,
164165
new CloseableRegistry());
166+
LOG.info(
167+
"Download remote log segment file {} to local cost {} ms.",
168+
fsPathAndFileName.getFileName(),
169+
System.currentTimeMillis() - startTime);
165170
File localFile = new File(segmentPath.toFile(), fsPathAndFileName.getFileName());
166171
scannerMetricGroup.remoteFetchBytes().inc(localFile.length());
167172
String segmentId = request.segment.remoteLogSegmentId().toString();

0 commit comments

Comments
 (0)