/** as {@link #newEnricherFromChildren()} but only publishing service problems, * listening to children and members, ignoring service up, * and using the same logic * (viz looking at children and members and requiring none are on fire) by default */ public static ComputeServiceIndicatorsFromChildrenAndMembersSpec newEnricherFromChildrenState() { return newEnricherFromChildren() .configure(ComputeServiceIndicatorsFromChildrenAndMembers.DERIVE_SERVICE_NOT_UP, false); }
/** as {@link #newEnricherFromChildren()} but only publishing service not-up indicators, * using a different unique tag ({@link ComputeServiceIndicatorsFromChildrenAndMembers#DEFAULT_UNIQUE_TAG_UP}), * listening to children only, ignoring lifecycle/service-state, * and using the same logic * (viz looking only at children (not members) and requiring either no children or at least one child up) by default */ public static ComputeServiceIndicatorsFromChildrenAndMembersSpec newEnricherFromChildrenUp() { return newEnricherFromChildren() .uniqueTag(ComputeServiceIndicatorsFromChildrenAndMembers.DEFAULT_UNIQUE_TAG_UP) .checkChildrenOnly() .configure(ComputeServiceIndicatorsFromChildrenAndMembers.DERIVE_SERVICE_PROBLEMS, false); }
@Override protected void initEnrichers() { super.initEnrichers(); // Because can have multiple children (similar to groups/clusters/apps), need to // monitor their health and indicate this has failed if any of them have failed. enrichers().add(ServiceStateLogic.newEnricherFromChildren() .suppressDuplicates(true) .configure(ComputeServiceIndicatorsFromChildrenAndMembers.UP_QUORUM_CHECK, QuorumCheck.QuorumChecks.all())); }
/** as {@link AbstractEntity#initEnrichers()} but also adding default service not-up and problem indicators from children */ @Override protected void initEnrichers() { super.initEnrichers(); // default app logic; easily overridable by adding a different enricher with the same tag ServiceStateLogic.newEnricherFromChildren().checkChildrenAndMembers() .configure(ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembers.UP_QUORUM_CHECK, config().get(UP_QUORUM_CHECK)) .configure(ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembers.RUNNING_QUORUM_CHECK, config().get(RUNNING_QUORUM_CHECK)) .addTo(this); ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL, "Application created but not yet started, at "+Time.makeDateString()); }