@Test public void testIdealStateMatch() { TestIdealStateAndExternalViewMatchServiceStatusCallback callback; callback = buildTestISEVCallback(); callback.setExternalView(new ExternalView(TABLE_NAME)); assertEquals(callback.getServiceStatus(), ServiceStatus.Status.GOOD); callback = buildTestISEVCallback(); callback.setIdealState(new IdealState(TABLE_NAME)); assertEquals(callback.getServiceStatus(), ServiceStatus.Status.STARTING); callback = buildTestISEVCallback(); callback.setIdealState(new IdealState(TABLE_NAME)); callback.setExternalView(new ExternalView(TABLE_NAME)); assertEquals(callback.getServiceStatus(), ServiceStatus.Status.GOOD); callback.setIdealState(null); callback.setExternalView(null); assertEquals(callback.getServiceStatus(), ServiceStatus.Status.GOOD); callback = buildTestISEVCallback(); IdealState idealState = new IdealState(TABLE_NAME); idealState.setRebalanceMode(IdealState.RebalanceMode.CUSTOMIZED); idealState.setPartitionState("mySegment", INSTANCE_NAME, "ONLINE"); callback.setIdealState(idealState); callback.setExternalView(new ExternalView(TABLE_NAME)); assertEquals(callback.getServiceStatus(), ServiceStatus.Status.STARTING); callback.getResourceIdealState(TABLE_NAME).enable(false); assertEquals(callback.getServiceStatus(), ServiceStatus.Status.GOOD); callback = buildTestISEVCallback(); idealState = new IdealState(TABLE_NAME); idealState.setRebalanceMode(IdealState.RebalanceMode.CUSTOMIZED); idealState.setPartitionState("mySegment_1", INSTANCE_NAME, "ONLINE"); idealState.setPartitionState("mySegment_2", INSTANCE_NAME, "OFFLINE"); callback.setIdealState(idealState); ExternalView externalView = new ExternalView(TABLE_NAME); externalView.setState("mySegment_1", INSTANCE_NAME, "ONLINE"); callback.setExternalView(externalView); assertEquals(callback.getServiceStatus(), ServiceStatus.Status.GOOD); callback = buildTestISEVCallback(); idealState = new IdealState(TABLE_NAME); idealState.setRebalanceMode(IdealState.RebalanceMode.CUSTOMIZED); idealState.setPartitionState("mySegment_1", INSTANCE_NAME, "ONLINE"); idealState.setPartitionState("mySegment_2", INSTANCE_NAME, "OFFLINE"); callback.setIdealState(idealState); externalView = new ExternalView(TABLE_NAME); externalView.setState("mySegment_1", INSTANCE_NAME, "ERROR"); callback.setExternalView(externalView); assertEquals(callback.getServiceStatus(), ServiceStatus.Status.GOOD); callback = buildTestISEVCallback(); idealState = new IdealState(TABLE_NAME); idealState.setRebalanceMode(IdealState.RebalanceMode.CUSTOMIZED); idealState.setPartitionState("mySegment_1", INSTANCE_NAME, "ONLINE"); idealState.setPartitionState("mySegment_2", INSTANCE_NAME + "2", "ONLINE"); callback.setIdealState(idealState); externalView = new ExternalView(TABLE_NAME); externalView.setState("mySegment_1", INSTANCE_NAME, "ONLINE"); externalView.setState("mySegment_2", INSTANCE_NAME + "2", "OFFLINE"); callback.setExternalView(externalView); assertEquals(callback.getServiceStatus(), ServiceStatus.Status.GOOD); }
public static Status getServiceStatus() { return getServiceStatus(serviceStatusCallback); }
ServiceStatus { public static Status getServiceStatus() { return getServiceStatus(serviceStatusCallback); } }
ServiceStatus { public static Status getServiceStatus() { return getServiceStatus(serviceStatusCallback); }  }
ServiceStatus { public static Status getServiceStatus() { return getServiceStatus(serviceStatusCallback); }  static void setServiceStatusCallback(String name, ServiceStatusCallback serviceStatusCallback); static void removeServiceStatusCallback(String name); static Status getServiceStatus(); static Status getServiceStatus(String name); static String getStatusDescription(); static String getStatusDescription(String name); static Map<String, Map<String, String>> getServiceStatusMap(); }
ServiceStatus { public static Status getServiceStatus() { return getServiceStatus(serviceStatusCallback); }  static void setServiceStatusCallback(String name, ServiceStatusCallback serviceStatusCallback); static void removeServiceStatusCallback(String name); static Status getServiceStatus(); static Status getServiceStatus(String name); static String getStatusDescription(); static String getStatusDescription(String name); static Map<String, Map<String, String>> getServiceStatusMap(); static final String STATUS_DESCRIPTION_NONE; static final String STATUS_DESCRIPTION_INIT; static final String STATUS_DESCRIPTION_STARTED; static final String STATUS_DESCRIPTION_SHUTTING_DOWN; static final String STATUS_DESCRIPTION_NO_HELIX_STATE; }