Skip to content

Commit

Permalink
Updated StorageService constructor and initializer [modified]
Browse files Browse the repository at this point in the history
  • Loading branch information
kristyelee committed Sep 27, 2024
1 parent 6c50513 commit 06dd6c2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public InternalLocalBootstrappingVeniceChangelogConsumer(
true,
true,
functionToCheckWhetherStorageEngineShouldBeKeptOrNot(),
functionToCheckWhetherStoragePartitionShouldBeKeptOrNot());
functionToCheckWhetherStoragePartitionsShouldBeKeptOrNot());
storageMetadataService =
new StorageEngineMetadataService(storageService.getStorageEngineRepository(), partitionStateSerializer);
}
Expand Down Expand Up @@ -177,7 +177,7 @@ private Function<String, Boolean> functionToCheckWhetherStorageEngineShouldBeKep
};
}

private Function<AbstractStorageEngine, Void> functionToCheckWhetherStoragePartitionShouldBeKeptOrNot() {
private Function<AbstractStorageEngine, Void> functionToCheckWhetherStoragePartitionsShouldBeKeptOrNot() {
return storageEngine -> null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class StorageService extends AbstractVeniceService {
* @param restoreDataPartitions indicates if store data needs to be restored.
* @param restoreMetadataPartitions indicates if meta data needs to be restored.
* @param checkWhetherStorageEngineShouldBeKeptOrNot check whether the local storage engine should be kept or not.
* @param checkWhetherStoragePartitionShouldBeKeptOrNot check whether the partition is assigned and thus should be kept or not.
* @param checkWhetherStoragePartitionsShouldBeKeptOrNot check whether the partition is assigned and thus should be kept or not.
*/
StorageService(
VeniceConfigLoader configLoader,
Expand All @@ -89,7 +89,7 @@ public class StorageService extends AbstractVeniceService {
boolean restoreDataPartitions,
boolean restoreMetadataPartitions,
Function<String, Boolean> checkWhetherStorageEngineShouldBeKeptOrNot,
Function<AbstractStorageEngine, Void> checkWhetherStoragePartitionShouldBeKeptOrNot,
Function<AbstractStorageEngine, Void> checkWhetherStoragePartitionsShouldBeKeptOrNot,
Optional<Map<PersistenceType, StorageEngineFactory>> persistenceTypeToStorageEngineFactoryMapOptional) {
String dataPath = configLoader.getVeniceServerConfig().getDataBasePath();
if (!Utils.directoryExists(dataPath)) {
Expand Down Expand Up @@ -125,7 +125,7 @@ public class StorageService extends AbstractVeniceService {
restoreDataPartitions,
restoreMetadataPartitions,
checkWhetherStorageEngineShouldBeKeptOrNot,
checkWhetherStoragePartitionShouldBeKeptOrNot);
checkWhetherStoragePartitionsShouldBeKeptOrNot);
}
}

Expand All @@ -139,7 +139,7 @@ public StorageService(
boolean restoreDataPartitions,
boolean restoreMetadataPartitions,
Function<String, Boolean> checkWhetherStorageEngineShouldBeKeptOrNot,
Function<AbstractStorageEngine, Void> checkWhetherStoragePartitionShouldBeKeptOrNot) {
Function<AbstractStorageEngine, Void> checkWhetherStoragePartitionsShouldBeKeptOrNot) {
this(
configLoader,
storageEngineStats,
Expand All @@ -150,7 +150,7 @@ public StorageService(
restoreDataPartitions,
restoreMetadataPartitions,
checkWhetherStorageEngineShouldBeKeptOrNot,
checkWhetherStoragePartitionShouldBeKeptOrNot,
checkWhetherStoragePartitionsShouldBeKeptOrNot,
Optional.empty());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ private List<AbstractVeniceService> createServices() {
whetherToRestoreDataPartitions,
true,
functionToCheckWhetherStorageEngineShouldBeKeptOrNot(),
functionToCheckWhetherStoragePartitionShouldBeKeptOrNot());
functionToCheckWhetherStoragePartitionsShouldBeKeptOrNot());
storageEngineMetadataService =
new StorageEngineMetadataService(storageService.getStorageEngineRepository(), partitionStateSerializer);
services.add(storageEngineMetadataService);
Expand Down Expand Up @@ -715,7 +715,7 @@ private Function<String, Boolean> functionToCheckWhetherStorageEngineShouldBeKep
return storageEngineName -> true;
}

private Function<AbstractStorageEngine, Void> functionToCheckWhetherStoragePartitionShouldBeKeptOrNot() {
private Function<AbstractStorageEngine, Void> functionToCheckWhetherStoragePartitionsShouldBeKeptOrNot() {
return storageEngine -> {
String storageEngineName = storageEngine.toString();
String storeName = Version.parseStoreFromKafkaTopicName(storageEngineName);
Expand Down

0 comments on commit 06dd6c2

Please sign in to comment.