Skip to content

Commit

Permalink
Review: minor code formatting change
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Maute <stefan.maute@bosch.io>
  • Loading branch information
Stefan Maute committed Aug 29, 2022
1 parent 0d7d569 commit 2293086
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@
import akka.actor.Props;

/**
* Supervisor for {@link org.eclipse.ditto.policies.service.persistence.actors.PolicyPersistenceActor} which means it will create, start and watch it as child actor.
* Supervisor for {@link org.eclipse.ditto.policies.service.persistence.actors.PolicyPersistenceActor} which means
* it will create, start and watch it as child actor.
* <p>
* If the child terminates, it will wait for the calculated exponential back-off time and restart it afterwards.
* Between the termination of the child and the restart, this actor answers to all requests with a {@link
* PolicyUnavailableException} as fail fast strategy.
* Between the termination of the child and the restart, this actor answers to all requests with a
* {@link PolicyUnavailableException} as fail fast strategy.
*/
public final class PolicySupervisorActor extends AbstractPersistenceSupervisor<PolicyId, PolicyCommand<?>> {

Expand Down Expand Up @@ -87,7 +88,6 @@ private PolicySupervisorActor(final ActorRef pubSubMediator,
public static Props props(final ActorRef pubSubMediator,
final DistributedPub<PolicyAnnouncement<?>> policyAnnouncementPub,
@Nullable final BlockedNamespaces blockedNamespaces) {

return Props.create(PolicySupervisorActor.class, () -> new PolicySupervisorActor(pubSubMediator,
policyAnnouncementPub, blockedNamespaces));
}
Expand All @@ -112,6 +112,7 @@ protected ExponentialBackOffConfig getExponentialBackOffConfig() {
final DittoPoliciesConfig policiesConfig = DittoPoliciesConfig.of(
DefaultScopedConfig.dittoScoped(getContext().getSystem().settings().config())
);

return policiesConfig.getPolicyConfig().getSupervisorConfig().getExponentialBackOffConfig();
}

Expand All @@ -123,6 +124,7 @@ protected ShutdownBehaviour getShutdownBehaviour(final PolicyId entityId) {
@Override
protected DittoRuntimeExceptionBuilder<?> getUnavailableExceptionBuilder(@Nullable final PolicyId entityId) {
final PolicyId policyId = entityId != null ? entityId : PolicyId.of("UNKNOWN:ID");

return PolicyUnavailableException.newBuilder(policyId);
}

Expand All @@ -135,6 +137,7 @@ private Props getAnnouncementManagerProps(final DistributedPub<PolicyAnnouncemen
} catch (final Exception e) {
log.error(e, "Failed to determine entity ID; becoming corrupted.");
becomeCorrupted();

return null;
}
}
Expand Down

0 comments on commit 2293086

Please sign in to comment.