lordcheng10 opened a new pull request, #3680:
URL: https://github.com/apache/bookkeeper/pull/3680
### Motivation
When building the EntryLogIdsImpl object, the ledgerDirsManager variable is
used. When the EntryLogIdsImpl object is used to generate an id, all ledger
directories will be scanned in the findLargestGap method. for example:
We configured three ledger directories:
/data1/bk-data1
/data1/bk-data2
/data1/bk-data3
The findLargestGap method scans these three data directories to generate
ids, but actually only needs to scan one data directory corresponding to the
EntryLogIdsImpl object:
https://github.com/apache/bookkeeper/blob/01232c94c91759a175345e8c055951e5cc6091dd/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/DbLedgerStorage.java#L225-L236
### Changes
When building the EntryLogIdsImpl object, use the variable ldm instead of
the variable ledgerDirsManager:
```
lDirs[0] = ledgerDir.getParentFile();
LedgerDirsManager ldm = new LedgerDirsManager(conf, lDirs,
ledgerDirsManager.getDiskChecker(),
NullStatsLogger.INSTANCE);
```
```
entrylogger = new DirectEntryLogger(ledgerDir, new EntryLogIdsImpl(ldm,
slog),
new NativeIOImpl(),
allocator, entryLoggerWriteExecutor,
entryLoggerFlushExecutor,
conf.getEntryLogSizeLimit(),
conf.getNettyMaxFrameSizeBytes() - 500,
perDirectoryTotalWriteBufferSize,
perDirectoryTotalReadBufferSize,
readBufferSize,
numReadThreads,
maxFdCacheTimeSeconds,
slog, statsLogger);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]