@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())); }
@Override protected void initEnrichers() { super.initEnrichers(); enrichers().add(ServiceStateLogic.newEnricherFromChildrenUp() .checkChildrenOnly() .requireUpChildren(QuorumCheck.QuorumChecks.all()) .suppressDuplicates(true)); }
@Override protected void initEnrichers() { super.initEnrichers(); ServiceNotUpLogic.updateNotUpIndicator(this, SERVICE_PROCESS_IS_RUNNING, "No information yet on whether this service is running"); // add an indicator above so that if is_running comes through, the map is cleared and an update is guaranteed enrichers().add(EnricherSpec.create(UpdatingNotUpFromServiceProcessIsRunning.class).uniqueTag("service-process-is-running-updating-not-up")); enrichers().add(EnricherSpec.create(ServiceNotUpDiagnosticsCollector.class).uniqueTag("service-not-up-diagnostics-collector")); }
/** 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()); }
@Override protected void initEnrichers() { super.initEnrichers(); // check states and upness separately so they can be individually replaced if desired // problem if any children or members are on fire enrichers().add(ServiceStateLogic.newEnricherFromChildrenState() .checkChildrenAndMembers() .requireRunningChildren(getConfig(RUNNING_QUORUM_CHECK)) .suppressDuplicates(true)); // defaults to requiring at least one member or child who is up enrichers().add(ServiceStateLogic.newEnricherFromChildrenUp() .checkChildrenAndMembers() .requireUpChildren(getConfig(UP_QUORUM_CHECK)) .suppressDuplicates(true)); }
/** * Default entity initialization sets ID sensors and calls {@link #initEnrichers()}. */ @Override public void init() { super.init(); initEnrichers(); if (Strings.isNonBlank(getConfig(DEFAULT_DISPLAY_NAME))) { setDefaultDisplayName(getConfig(DEFAULT_DISPLAY_NAME)); } sensors().set(ENTITY_ID, getId()); sensors().set(APPLICATION_ID, getApplicationId()); sensors().set(CATALOG_ID, getCatalogItemId()); }