@Override public Bulletin createBulletin(final String componentId, final String category, final Severity severity, final String message) { final Bulletin bulletin = BulletinFactory.createBulletin(null, null, componentId, "test processor", category, severity.name(), message); List<Bulletin> bulletins = componentBulletinsCreated.get(componentId); if (bulletins == null) { bulletins = new ArrayList<>(); componentBulletinsCreated.put(componentId, bulletins); } bulletins.add(bulletin); return bulletin; }
@Override public Bulletin createBulletin(final String category, final Severity severity, final String message) { return BulletinFactory.createBulletin(category, severity.name(), message); }
@Override public Bulletin createBulletin(final String category, final Severity severity, final String message) { return BulletinFactory.createBulletin(category, severity.name(), message); }
@Override public synchronized void onLeaderRelinquish() { LOG.info("This node is no longer the elected Active Cluster Coordinator"); bulletinRepository.addBulletin(BulletinFactory.createBulletin("Cluster Coordinator", Severity.INFO.name(), participantId + " is no longer the Cluster Coordinator")); // We do not want to stop the heartbeat monitor. This is because even though ZooKeeper offers guarantees // that watchers will see changes on a ZNode in the order they happened, there does not seem to be any // guarantee that Curator will notify us that our leadership was gained or loss in the order that it happened. // As a result, if nodes connect/disconnect from cluster quickly, we could invoke stop() then start() or // start() then stop() in the wrong order, which can cause the cluster to behavior improperly. As a result, we simply // call start() when we become the leader, and this will ensure that initialization is handled. The heartbeat monitor // then will check the zookeeper znode to check if it is the cluster coordinator before kicking any nodes out of the // cluster. }
@Override public void reportEvent(final Severity severity, final String category, final String message) { final Bulletin bulletin = BulletinFactory.createBulletin(category, severity.name(), message); bulletinRepo.addBulletin(bulletin); } }
@Override public void reportEvent(final Severity severity, final String category, final String message) { final Bulletin bulletin = BulletinFactory.createBulletin(category, severity.name(), message); bulletinRepository.addBulletin(bulletin); } };
@Override public Bulletin createBulletin(final String componentId, final String category, final Severity severity, final String message) { final Connectable connectable = flowController.getFlowManager().findConnectable(componentId); if (connectable == null) { throw new IllegalStateException("Cannot create Component-Level Bulletin because no component can be found with ID " + componentId); } return BulletinFactory.createBulletin(connectable, category, severity.name(), message); }
@Override public synchronized void onLeaderElection() { LOG.info("This node elected Active Cluster Coordinator"); bulletinRepository.addBulletin(BulletinFactory.createBulletin("Cluster Coordinator", Severity.INFO.name(), participantId + " has been elected the Cluster Coordinator")); // Purge any heartbeats that we already have. If we don't do this, we can have a scenario where we receive heartbeats // from a node, and then another node becomes Cluster Coordinator. As a result, we stop receiving heartbeats. Now that // we are again the Cluster Coordinator, we will detect that there are old heartbeat messages and start disconnecting // nodes due to a lack of heartbeat. By purging the heartbeats here, we remove any old heartbeat messages so that this // does not happen. FlowController.this.heartbeatMonitor.purgeHeartbeats(); } }, participantId);
if (this.bulletinRepo != null) { this.bulletinRepo.addBulletin(BulletinFactory.createBulletin("Controller Service", Severity.ERROR.name(), "Could not start " + controllerServiceNode + " due to " + e));
private void applyNewReportingTaskScheduleState(final FlowController controller, final ReportingTaskDTO dto, final ReportingTaskNode reportingTask) { if (autoResumeState) { if (ScheduledState.RUNNING.name().equals(dto.getState())) { try { controller.startReportingTask(reportingTask); } catch (final Exception e) { logger.error("Failed to start {} due to {}", reportingTask, e); if (logger.isDebugEnabled()) { logger.error("", e); } controller.getBulletinRepository().addBulletin(BulletinFactory.createBulletin( "Reporting Tasks", Severity.ERROR.name(), "Failed to start " + reportingTask + " due to " + e)); } } else if (ScheduledState.DISABLED.name().equals(dto.getState())) { try { controller.disableReportingTask(reportingTask); } catch (final Exception e) { logger.error("Failed to mark {} as disabled due to {}", reportingTask, e); if (logger.isDebugEnabled()) { logger.error("", e); } controller.getBulletinRepository().addBulletin(BulletinFactory.createBulletin( "Reporting Tasks", Severity.ERROR.name(), "Failed to mark " + reportingTask + " as disabled due to " + e)); } } } }
@Override public void onLogMessage(final LogMessage message) { // Map LogLevel.WARN to Severity.WARNING so that we are consistent with the Severity enumeration. Else, just use whatever // the LogLevel is (INFO and ERROR map directly and all others we will just accept as they are). final String bulletinLevel = (message.getLevel() == LogLevel.WARN) ? Severity.WARNING.name() : message.getLevel().toString(); bulletinRepository.addBulletin(BulletinFactory.createBulletin(processorNode, CATEGORY, bulletinLevel, message.getMessage())); }
@Override public void reportEvent(final Severity severity, final String category, final String message) { final String groupId = StandardRemoteProcessGroup.this.getProcessGroup().getIdentifier(); final String groupName = StandardRemoteProcessGroup.this.getProcessGroup().getName(); final String sourceId = StandardRemoteProcessGroup.this.getIdentifier(); final String sourceName = StandardRemoteProcessGroup.this.getName(); bulletinRepository.addBulletin(BulletinFactory.createBulletin(groupId, groupName, sourceId, ComponentType.REMOTE_PROCESS_GROUP, sourceName, category, severity.name(), message)); } };
@Override public void onLogMessage(final LogMessage message) { // Map LogLevel.WARN to Severity.WARNING so that we are consistent with the Severity enumeration. Else, just use whatever // the LogLevel is (INFO and ERROR map directly and all others we will just accept as they are). final String bulletinLevel = message.getLevel() == LogLevel.WARN ? Severity.WARNING.name() : message.getLevel().toString(); final Bulletin bulletin = BulletinFactory.createBulletin(null, taskNode.getIdentifier(), ComponentType.REPORTING_TASK, taskNode.getName(), "Log Message", bulletinLevel, message.getMessage()); bulletinRepository.addBulletin(bulletin); } }
@Override public void reportEvent(final Severity severity, final String category, final String message) { final String groupId = StandardRootGroupPort.this.getProcessGroup().getIdentifier(); final String groupName = StandardRootGroupPort.this.getProcessGroup().getName(); final String sourceId = StandardRootGroupPort.this.getIdentifier(); final String sourceName = StandardRootGroupPort.this.getName(); final ComponentType componentType = direction == TransferDirection.RECEIVE ? ComponentType.INPUT_PORT : ComponentType.OUTPUT_PORT; bulletinRepository.addBulletin(BulletinFactory.createBulletin(groupId, groupName, sourceId, componentType, sourceName, category, severity.name(), message)); } };
final Bulletin bulletin = BulletinFactory.createBulletin("Primary Node", Severity.INFO.name(), message); bulletinRepository.addBulletin(bulletin); LOG.info(message);
@Override public void onLogMessage(final LogMessage message) { // Map LogLevel.WARN to Severity.WARNING so that we are consistent with the Severity enumeration. Else, just use whatever // the LogLevel is (INFO and ERROR map directly and all others we will just accept as they are). final String bulletinLevel = message.getLevel() == LogLevel.WARN ? Severity.WARNING.name() : message.getLevel().toString(); final ProcessGroup pg = serviceNode.getProcessGroup(); final String groupId = pg == null ? null : pg.getIdentifier(); final String groupName = pg == null ? null : pg.getName(); final Bulletin bulletin = BulletinFactory.createBulletin(groupId, groupName, serviceNode.getIdentifier(), ComponentType.CONTROLLER_SERVICE, serviceNode.getName(), "Log Message", bulletinLevel, message.getMessage()); bulletinRepository.addBulletin(bulletin); } }
nodeEventDto.setCategory(event.getSeverity().name()); nodeEventDto.setTimestamp(new Date(event.getTimestamp()));
controller.getBulletinRepository().addBulletin(BulletinFactory.createBulletin("Node Reconnection", Severity.ERROR.name(), "Failed to change Scheduled State of " + taskNode + " from " + taskNode.getScheduledState().name() + " to " + dto.getState() + " due to " + ise.toString())); controller.getBulletinRepository().addBulletin(BulletinFactory.createBulletin("Node Reconnection", Severity.ERROR.name(), "Failed to change Scheduled State of " + taskNode + " from " + taskNode.getScheduledState().name() + " to " + dto.getState() + " due to " + ise.toString()));
controller.getBulletinRepository().addBulletin(BulletinFactory.createBulletin(procNode, "Node Reconnection", Severity.ERROR.name(), "Failed to change Scheduled State of " + procNode + " from " + procNode.getScheduledState().name() + " to " + dto.getState() + " due to " + ise.toString())); controller.getBulletinRepository().addBulletin(BulletinFactory.createBulletin("Node Reconnection", Severity.ERROR.name(), "Failed to change Scheduled State of " + procNode + " from " + procNode.getScheduledState().name() + " to " + dto.getState() + " due to " + ise.toString()));