Skip to content

Commit

Permalink
stage 10: bugfix indexDirs for ConvertToInterleavedStorageCommand (#3409
Browse files Browse the repository at this point in the history
)

Co-authored-by: lushiji <[email protected]>
  • Loading branch information
StevenLuMT and lushiji authored Jul 19, 2022
1 parent fcb7149 commit c687524
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.bookkeeper.bookie.Bookie;
import org.apache.bookkeeper.bookie.BookieResources;
import org.apache.bookkeeper.bookie.CheckpointSource;
import org.apache.bookkeeper.bookie.Checkpointer;
import org.apache.bookkeeper.bookie.InterleavedLedgerStorage;
Expand Down Expand Up @@ -88,10 +89,10 @@ public boolean apply(ServerConfiguration conf, CTISFlags cmdFlags) {
private boolean handle(ServerConfiguration bkConf) throws Exception {
LOG.info("=== Converting DbLedgerStorage ===");
ServerConfiguration conf = new ServerConfiguration(bkConf);
LedgerDirsManager ledgerDirsManager = new LedgerDirsManager(bkConf, bkConf.getLedgerDirs(),
new DiskChecker(bkConf.getDiskUsageThreshold(), bkConf.getDiskUsageWarnThreshold()));
LedgerDirsManager ledgerIndexManager = new LedgerDirsManager(bkConf, bkConf.getLedgerDirs(),
new DiskChecker(bkConf.getDiskUsageThreshold(), bkConf.getDiskUsageWarnThreshold()));
DiskChecker diskChecker = new DiskChecker(bkConf.getDiskUsageThreshold(), bkConf.getDiskUsageWarnThreshold());
LedgerDirsManager ledgerDirsManager = new LedgerDirsManager(bkConf, bkConf.getLedgerDirs(), diskChecker);
LedgerDirsManager indexDirsManager = BookieResources.createIndexDirsManager(
conf, diskChecker, NullStatsLogger.INSTANCE, ledgerDirsManager);

DbLedgerStorage dbStorage = new DbLedgerStorage();
InterleavedLedgerStorage interleavedStorage = new InterleavedLedgerStorage();
Expand All @@ -117,11 +118,11 @@ public void start() {
}
};

dbStorage.initialize(conf, null, ledgerDirsManager, ledgerIndexManager,
dbStorage.initialize(conf, null, ledgerDirsManager, indexDirsManager,
NullStatsLogger.INSTANCE, PooledByteBufAllocator.DEFAULT);
dbStorage.setCheckpointSource(checkpointSource);
dbStorage.setCheckpointer(checkpointer);
interleavedStorage.initialize(conf, null, ledgerDirsManager, ledgerIndexManager,
interleavedStorage.initialize(conf, null, ledgerDirsManager, indexDirsManager,
NullStatsLogger.INSTANCE, PooledByteBufAllocator.DEFAULT);
interleavedStorage.setCheckpointSource(checkpointSource);
interleavedStorage.setCheckpointer(checkpointer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ public class ConvertToInterleavedStorageCommandTest extends BookieCommandTestBas
private LedgerCache interleavedLedgerCache;


// create multi ledger dirs and multi index dirs
public ConvertToInterleavedStorageCommandTest() {
super(3, 0);
super(3, 3);
}

@Override
Expand Down

0 comments on commit c687524

Please sign in to comment.