@Test public void getDevicesOf() { mgr.setRole(NID_LOCAL, DEV_MASTER, MASTER); mgr.setRole(NID_LOCAL, DEV_OTHER, STANDBY); assertEquals("should be one device:", 1, mgr.getDevicesOf(NID_LOCAL).size()); mgr.setRole(NID_LOCAL, DEV_OTHER, MASTER); assertEquals("should be two devices:", 2, mgr.getDevicesOf(NID_LOCAL).size()); }
@Override public Set<DeviceId> getDevicesOf(NodeId nodeId) { checkPermission(CLUSTER_READ); checkNotNull(nodeId, NODE_ID_NULL); return store.getDevices(nodeId); }
MastershipManager extends AbstractListenerManager<MastershipEvent, MastershipListener> implements MastershipService, MastershipAdminService, MastershipTermService,
               MetricsHelper { @Override public Set<DeviceId> getDevicesOf(NodeId nodeId) { checkPermission(CLUSTER_READ); checkNotNull(nodeId, NODE_ID_NULL); return store.getDevices(nodeId); } }
MastershipManager extends AbstractListenerManager<MastershipEvent, MastershipListener> implements MastershipService, MastershipAdminService, MastershipTermService,
               MetricsHelper { @Override public Set<DeviceId> getDevicesOf(NodeId nodeId) { checkPermission(CLUSTER_READ); checkNotNull(nodeId, NODE_ID_NULL); return store.getDevices(nodeId); }  }
MastershipManager extends AbstractListenerManager<MastershipEvent, MastershipListener> implements MastershipService, MastershipAdminService, MastershipTermService,
               MetricsHelper { @Override public Set<DeviceId> getDevicesOf(NodeId nodeId) { checkPermission(CLUSTER_READ); checkNotNull(nodeId, NODE_ID_NULL); return store.getDevices(nodeId); }  @Activate void activate(); @Deactivate void deactivate(); @Override CompletableFuture<Void> setRole(NodeId nodeId, DeviceId deviceId, MastershipRole role); @Override MastershipRole getLocalRole(DeviceId deviceId); @Override CompletableFuture<Void> relinquishMastership(DeviceId deviceId); @Override CompletableFuture<MastershipRole> requestRoleFor(DeviceId deviceId); @Override NodeId getMasterFor(DeviceId deviceId); @Override Set<DeviceId> getDevicesOf(NodeId nodeId); @Override RoleInfo getNodesFor(DeviceId deviceId); @Override MastershipTerm getMastershipTerm(DeviceId deviceId); @Override MetricsService metricsService(); @Override void balanceRoles(); }
MastershipManager extends AbstractListenerManager<MastershipEvent, MastershipListener> implements MastershipService, MastershipAdminService, MastershipTermService,
               MetricsHelper { @Override public Set<DeviceId> getDevicesOf(NodeId nodeId) { checkPermission(CLUSTER_READ); checkNotNull(nodeId, NODE_ID_NULL); return store.getDevices(nodeId); }  @Activate void activate(); @Deactivate void deactivate(); @Override CompletableFuture<Void> setRole(NodeId nodeId, DeviceId deviceId, MastershipRole role); @Override MastershipRole getLocalRole(DeviceId deviceId); @Override CompletableFuture<Void> relinquishMastership(DeviceId deviceId); @Override CompletableFuture<MastershipRole> requestRoleFor(DeviceId deviceId); @Override NodeId getMasterFor(DeviceId deviceId); @Override Set<DeviceId> getDevicesOf(NodeId nodeId); @Override RoleInfo getNodesFor(DeviceId deviceId); @Override MastershipTerm getMastershipTerm(DeviceId deviceId); @Override MetricsService metricsService(); @Override void balanceRoles(); public boolean useRegionForBalanceRoles; }