@Test public void group_down_to_clear_reason_emits_group_up_event() { final EventFixture fixture = EventFixture.createForNodes(3) .clusterStateBefore("distributor:3 storage:3 .2.s:d") .clusterStateAfter("distributor:3 storage:3") .storageNodeReasonBefore(2, NodeStateReason.GROUP_IS_DOWN); final List<Event> events = fixture.computeEventDiff(); assertThat(events.size(), equalTo(2)); assertThat(events, hasItem(allOf( eventForNode(storageNode(2)), nodeEventWithDescription("Altered node state in cluster state from 'D' to 'U'")))); assertThat(events, hasItem(allOf( eventForNode(storageNode(2)), eventTypeIs(NodeEvent.Type.CURRENT), nodeEventWithDescription("Group node availability has been restored")))); }
public static List<Event> computeEventDiff(final Params params) { final List<Event> events = new ArrayList<>(); emitPerNodeDiffEvents(createBaselineParams(params), events); emitWholeClusterDiffEvent(createBaselineParams(params), events); emitDerivedBucketSpaceStatesDiffEvents(params, events); return events; }
EventDiffCalculator { public static List<Event> computeEventDiff(final Params params) { final List<Event> events = new ArrayList<>(); emitPerNodeDiffEvents(createBaselineParams(params), events); emitWholeClusterDiffEvent(createBaselineParams(params), events); emitDerivedBucketSpaceStatesDiffEvents(params, events); return events; } }
EventDiffCalculator { public static List<Event> computeEventDiff(final Params params) { final List<Event> events = new ArrayList<>(); emitPerNodeDiffEvents(createBaselineParams(params), events); emitWholeClusterDiffEvent(createBaselineParams(params), events); emitDerivedBucketSpaceStatesDiffEvents(params, events); return events; }  }
EventDiffCalculator { public static List<Event> computeEventDiff(final Params params) { final List<Event> events = new ArrayList<>(); emitPerNodeDiffEvents(createBaselineParams(params), events); emitWholeClusterDiffEvent(createBaselineParams(params), events); emitDerivedBucketSpaceStatesDiffEvents(params, events); return events; }  static Params params(); static List<Event> computeEventDiff(final Params params); }
EventDiffCalculator { public static List<Event> computeEventDiff(final Params params) { final List<Event> events = new ArrayList<>(); emitPerNodeDiffEvents(createBaselineParams(params), events); emitWholeClusterDiffEvent(createBaselineParams(params), events); emitDerivedBucketSpaceStatesDiffEvents(params, events); return events; }  static Params params(); static List<Event> computeEventDiff(final Params params);  }