Skip to content

Commit

Permalink
Removed init() method from StoreFileTrakcerBase.
Browse files Browse the repository at this point in the history
Added check in FileBasedStoreFileTracker constructor to ignore null StoreContext
or StoreContext instances that don't have store dir info.
  • Loading branch information
wchevreuil committed Oct 6, 2021
1 parent ea2b45e commit 8cf2119
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ public DefaultStoreFileTracker(Configuration conf, boolean isPrimaryReplica, Sto
super(conf, isPrimaryReplica, ctx);
}

@Override
void init() {
// NOOP
}

@Override
public List<StoreFileInfo> load() throws IOException {
List<StoreFileInfo> files =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ class FileBasedStoreFileTracker extends StoreFileTrackerBase {

public FileBasedStoreFileTracker(Configuration conf, boolean isPrimaryReplica, StoreContext ctx) {
super(conf, isPrimaryReplica, ctx);
}

@Override
void init() {
backedFile = new StoreFileListFile(ctx);
if (ctx != null && ctx.getFamilyStoreDirectoryPath() != null) {
backedFile = new StoreFileListFile(ctx);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,8 @@ public MigrationStoreFileTracker(Configuration conf, boolean isPrimaryReplica, S
super(conf, isPrimaryReplica, ctx);
this.src = StoreFileTrackerFactory.createForMigration(conf, SRC_IMPL, isPrimaryReplica, ctx);
this.dst = StoreFileTrackerFactory.createForMigration(conf, DST_IMPL, isPrimaryReplica, ctx);
}

@Override
void init() {
Preconditions.checkArgument(!src.getClass().equals(dst.getClass()),
"src and dst is the same: %s", src.getClass());
this.src.init();
this.dst.init();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ protected StoreFileTrackerBase(Configuration conf, boolean isPrimaryReplica, Sto
this.ctx = ctx;
}

abstract void init();

@Override
public final void add(Collection<StoreFileInfo> newFiles) throws IOException {
if (isPrimaryReplica) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ private static StoreFileTracker getInstance(Configuration conf, boolean isPrimar
public static StoreFileTracker create(Configuration conf, boolean isPrimaryReplica,
StoreContext ctx) {
StoreFileTracker trackerImpl = getInstance(conf, isPrimaryReplica, ctx);
((StoreFileTrackerBase)trackerImpl).init();
return trackerImpl;
}

Expand Down

0 comments on commit 8cf2119

Please sign in to comment.