Skip to content

Commit

Permalink
review: rename CleanUp
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Schneider <johannes.schneider@bosch.io>
  • Loading branch information
jokraehe committed Sep 10, 2021
1 parent 69f3dc5 commit c6358b5
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,11 @@ private ConnectivityRootActor(final ConnectivityConfig connectivityConfig,
ConnectionPersistenceOperationsActor.props(pubSubMediator, connectivityConfig.getMongoDbConfig(),
actorSystem.settings().config(), connectivityConfig.getPersistenceOperationsConfig()));

final var cleanUpActorProps =
PersistenceCleanupActor.props(connectivityConfig.getConnectionConfig().getCleanupConfig(),
mongoReadJournal, CLUSTER_ROLE);
startChildActor(PersistenceCleanupActor.NAME, cleanUpActorProps);
final var cleanupConfig = connectivityConfig.getConnectionConfig().getCleanupConfig();
final var cleanupActorProps = PersistenceCleanupActor.props(cleanupConfig, mongoReadJournal, CLUSTER_ROLE);
startChildActor(PersistenceCleanupActor.NAME, cleanupActorProps);

final ActorRef healthCheckingActor = getHealthCheckingActor(connectivityConfig, pubSubMediator);
final ActorRef healthCheckingActor = getHealthCheckingActor(connectivityConfig);
bindHttpStatusRoute(connectivityConfig.getHttpConfig(), healthCheckingActor);
}

Expand Down Expand Up @@ -189,8 +188,7 @@ private void startClusterSingletonActor(final Props props, final String name) {
ClusterUtil.startSingleton(getContext(), CLUSTER_ROLE, name, props);
}

private ActorRef getHealthCheckingActor(final ConnectivityConfig connectivityConfig,
final ActorRef pubSubMediator) {
private ActorRef getHealthCheckingActor(final ConnectivityConfig connectivityConfig) {
final HealthCheckConfig healthCheckConfig = connectivityConfig.getHealthCheckConfig();
final HealthCheckingActorOptions.Builder hcBuilder =
HealthCheckingActorOptions.getBuilder(healthCheckConfig.isEnabled(), healthCheckConfig.getInterval());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public final class DefaultConnectionConfig implements ConnectionConfig {
private final SupervisorConfig supervisorConfig;
private final SnapshotConfig snapshotConfig;
private final DefaultAcknowledgementConfig acknowledgementConfig;
private final CleanupConfig cleanUpConfig;
private final CleanupConfig cleanupConfig;
private final Amqp10Config amqp10Config;
private final Amqp091Config amqp091Config;
private final MqttConfig mqttConfig;
Expand All @@ -73,7 +73,7 @@ private DefaultConnectionConfig(final ConfigWithFallback config) {
supervisorConfig = DefaultSupervisorConfig.of(config);
snapshotConfig = DefaultSnapshotConfig.of(config);
acknowledgementConfig = DefaultAcknowledgementConfig.of(config);
cleanUpConfig = CleanupConfig.of(config);
cleanupConfig = CleanupConfig.of(config);
amqp10Config = DefaultAmqp10Config.of(config);
amqp091Config = DefaultAmqp091Config.of(config);
mqttConfig = DefaultMqttConfig.of(config);
Expand Down Expand Up @@ -211,7 +211,7 @@ public ActivityCheckConfig getActivityCheckConfig() {

@Override
public CleanupConfig getCleanupConfig() {
return cleanUpConfig;
return cleanupConfig;
}

@Override
Expand All @@ -232,7 +232,7 @@ public boolean equals(final Object o) {
Objects.equals(supervisorConfig, that.supervisorConfig) &&
Objects.equals(snapshotConfig, that.snapshotConfig) &&
Objects.equals(acknowledgementConfig, that.acknowledgementConfig) &&
Objects.equals(cleanUpConfig, that.cleanUpConfig) &&
Objects.equals(cleanupConfig, that.cleanupConfig) &&
Objects.equals(amqp10Config, that.amqp10Config) &&
Objects.equals(amqp091Config, that.amqp091Config) &&
Objects.equals(mqttConfig, that.mqttConfig) &&
Expand All @@ -250,7 +250,7 @@ public boolean equals(final Object o) {
public int hashCode() {
return Objects.hash(clientActorAskTimeout, clientActorRestartsBeforeEscalation, allowedHostnames,
blockedHostnames, blockedSubnets, blockedHostRegex, supervisorConfig, snapshotConfig,
acknowledgementConfig, cleanUpConfig, maxNumberOfTargets, maxNumberOfSources, activityCheckConfig,
acknowledgementConfig, cleanupConfig, maxNumberOfTargets, maxNumberOfSources, activityCheckConfig,
amqp10Config, amqp091Config, mqttConfig, kafkaConfig, httpPushConfig, ackLabelDeclareInterval,
priorityUpdateInterval, allClientActorsOnOneNode);
}
Expand All @@ -267,7 +267,7 @@ public String toString() {
", supervisorConfig=" + supervisorConfig +
", snapshotConfig=" + snapshotConfig +
", acknowledgementConfig=" + acknowledgementConfig +
", cleanUpConfig=" + cleanUpConfig +
", cleanUpConfig=" + cleanupConfig +
", amqp10Config=" + amqp10Config +
", amqp091Config=" + amqp091Config +
", mqttConfig=" + mqttConfig +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ Connectivity instance has an actor coordinating a portion of the background clea
piggyback-commands to query its state and configuration, modify its configuration, and restart the background cleanup
process.

Each command is sent to the actor selection `/user/<SERVICE_NAME>Root/persistenceCleanUp`, where
Each command is sent to the actor selection `/user/<SERVICE_NAME>Root/persistenceCleanup`, where
`SERVICE_NAME` is `things`, `policies` or `connectivity`:

`POST /devops/piggygack/<SERVICE_NAME>?timeout=10s`
Expand All @@ -527,7 +527,7 @@ Each command is sent to the actor selection `/user/<SERVICE_NAME>Root/persistenc

```json
{
"targetActorSelection": "/user/<SERVICE_NAME>Root/persistenceCleanUp",
"targetActorSelection": "/user/<SERVICE_NAME>Root/persistenceCleanup",
"headers": {},
"piggybackCommand": {
"type": "status.commands:retrieveHealth"
Expand Down Expand Up @@ -568,7 +568,7 @@ The response has the following details:

```json
{
"targetActorSelection": "/user/<SERVICE_NAME>Root/persistenceCleanUp",
"targetActorSelection": "/user/<SERVICE_NAME>Root/persistenceCleanup",
"headers": {},
"piggybackCommand": {
"type": "common.commands:retrieveConfig"
Expand Down Expand Up @@ -610,7 +610,7 @@ Set the special key `last-pid` to set the lower bound of PIDs to clean up in the

```json
{
"targetActorSelection": "/user/<SERVICE_NAME>Root/persistenceCleanUp",
"targetActorSelection": "/user/<SERVICE_NAME>Root/persistenceCleanup",
"headers": {
"aggregate": false,
"is-grouped-topic": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public final class DefaultPolicyConfig implements PolicyConfig {
private final Duration policySubjectDeletionAnnouncementGranularity;
private final String subjectIdResolver;
private final PolicyAnnouncementConfig policyAnnouncementConfig;
private final CleanupConfig cleanUpConfig;
private final CleanupConfig cleanupConfig;

private DefaultPolicyConfig(final ScopedConfig scopedConfig) {
supervisorConfig = DefaultSupervisorConfig.of(scopedConfig);
Expand All @@ -57,7 +57,7 @@ private DefaultPolicyConfig(final ScopedConfig scopedConfig) {
PolicyConfigValue.SUBJECT_DELETION_ANNOUNCEMENT_GRANULARITY);
subjectIdResolver = scopedConfig.getString(PolicyConfigValue.SUBJECT_ID_RESOLVER.getConfigPath());
policyAnnouncementConfig = PolicyAnnouncementConfig.of(scopedConfig);
cleanUpConfig = CleanupConfig.of(scopedConfig);
cleanupConfig = CleanupConfig.of(scopedConfig);
}

/**
Expand Down Expand Up @@ -111,7 +111,7 @@ public PolicyAnnouncementConfig getPolicyAnnouncementConfig() {

@Override
public CleanupConfig getCleanupConfig() {
return cleanUpConfig;
return cleanupConfig;
}

@Override
Expand All @@ -131,14 +131,14 @@ public boolean equals(final Object o) {
that.policySubjectDeletionAnnouncementGranularity) &&
Objects.equals(subjectIdResolver, that.subjectIdResolver) &&
Objects.equals(policyAnnouncementConfig, that.policyAnnouncementConfig) &&
Objects.equals(cleanUpConfig, that.cleanUpConfig);
Objects.equals(cleanupConfig, that.cleanupConfig);
}

@Override
public int hashCode() {
return Objects.hash(supervisorConfig, activityCheckConfig, snapshotConfig, policySubjectExpiryGranularity,
policySubjectDeletionAnnouncementGranularity, subjectIdResolver, policyAnnouncementConfig,
cleanUpConfig);
cleanupConfig);
}

@Override
Expand All @@ -151,7 +151,7 @@ public String toString() {
", policySubjectDeletionAnnouncementGranularity=" + policySubjectDeletionAnnouncementGranularity +
", subjectIdResolver=" + subjectIdResolver +
", policyAnnouncementConfig=" + policyAnnouncementConfig +
", cleanUpConfig=" + cleanUpConfig +
", cleanUpConfig=" + cleanupConfig +
"]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@ private PoliciesRootActor(final PoliciesConfig policiesConfig,
retrieveStatisticsDetailsResponseSupplier = RetrieveStatisticsDetailsResponseSupplier.of(policiesShardRegion,
PoliciesMessagingConstants.SHARD_REGION, log);

final var cleanUpActorProps =
PersistenceCleanupActor.props(policiesConfig.getPolicyConfig().getCleanupConfig(), mongoReadJournal,
CLUSTER_ROLE);
startChildActor(PersistenceCleanupActor.NAME, cleanUpActorProps);
final var cleanupConfig = policiesConfig.getPolicyConfig().getCleanupConfig();
final var cleanupActorProps = PersistenceCleanupActor.props(cleanupConfig, mongoReadJournal, CLUSTER_ROLE);
startChildActor(PersistenceCleanupActor.NAME, cleanupActorProps);

final var healthCheckConfig = policiesConfig.getHealthCheckConfig();
final var hcBuilder =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ public final class DefaultThingConfig implements ThingConfig {
private final SupervisorConfig supervisorConfig;
private final ActivityCheckConfig activityCheckConfig;
private final SnapshotConfig snapshotConfig;
private final CleanupConfig cleanUpConfig;
private final CleanupConfig cleanupConfig;

private DefaultThingConfig(final ScopedConfig scopedConfig) {
supervisorConfig = DefaultSupervisorConfig.of(scopedConfig);
activityCheckConfig = DefaultActivityCheckConfig.of(scopedConfig);
snapshotConfig = DefaultSnapshotConfig.of(scopedConfig);
cleanUpConfig = CleanupConfig.of(scopedConfig);
cleanupConfig = CleanupConfig.of(scopedConfig);
}

/**
Expand Down Expand Up @@ -86,12 +86,12 @@ public boolean equals(final Object o) {
return Objects.equals(supervisorConfig, that.supervisorConfig) &&
Objects.equals(activityCheckConfig, that.activityCheckConfig) &&
Objects.equals(snapshotConfig, that.snapshotConfig) &&
Objects.equals(cleanUpConfig, that.cleanUpConfig);
Objects.equals(cleanupConfig, that.cleanupConfig);
}

@Override
public int hashCode() {
return Objects.hash(supervisorConfig, activityCheckConfig, snapshotConfig, cleanUpConfig);
return Objects.hash(supervisorConfig, activityCheckConfig, snapshotConfig, cleanupConfig);
}

@Override
Expand All @@ -100,12 +100,12 @@ public String toString() {
"supervisorConfig=" + supervisorConfig +
", activityCheckConfig=" + activityCheckConfig +
", snapshotConfig=" + snapshotConfig +
", cleanUpConfig=" + cleanUpConfig +
", cleanupConfig=" + cleanupConfig +
"]";
}

@Override
public CleanupConfig getCleanupConfig() {
return cleanUpConfig;
return cleanupConfig;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ private ThingsRootActor(final ThingsConfig thingsConfig,
final ActorRef snapshotStreamingActor =
ThingsPersistenceStreamingActorCreator.startSnapshotStreamingActor(this::startChildActor);

final Props cleanUpActorProps = PersistenceCleanupActor.props(thingsConfig.getThingConfig().getCleanupConfig(),
newMongoReadJournal(thingsConfig.getMongoDbConfig(), actorSystem), CLUSTER_ROLE);
startChildActor(PersistenceCleanupActor.NAME, cleanUpActorProps);
final var cleanupConfig = thingsConfig.getThingConfig().getCleanupConfig();
final var mongoReadJournal = newMongoReadJournal(thingsConfig.getMongoDbConfig(), actorSystem);
final Props cleanupActorProps = PersistenceCleanupActor.props(cleanupConfig, mongoReadJournal, CLUSTER_ROLE);
startChildActor(PersistenceCleanupActor.NAME, cleanupActorProps);

pubSubMediator.tell(DistPubSubAccess.put(getSelf()), getSelf());
pubSubMediator.tell(DistPubSubAccess.put(eventStreamingActor), getSelf());
Expand Down

0 comments on commit c6358b5

Please sign in to comment.