@Test public void testIsMine() { setUpLeadershipService(1); replay(leadershipService); Key myKey = new ControllableHashKey(0); Key notMyKey = new ControllableHashKey(1); assertTrue(partitionManager.isMine(myKey)); assertFalse(partitionManager.isMine(notMyKey)); reset(leadershipService); setUpLeadershipService(4); replay(leadershipService); assertTrue(partitionManager.isMine(myKey)); assertTrue(partitionManager.isMine(notMyKey)); assertFalse(partitionManager.isMine(new ControllableHashKey(4))); }
@Override public boolean isMine(Key intentKey) { return Objects.equals(leadershipService.getLeadership(getPartitionPath(getPartitionForKey(intentKey))) .leaderNodeId(), localNodeId); }
IntentPartitionManager implements IntentPartitionService { @Override public boolean isMine(Key intentKey) { return Objects.equals(leadershipService.getLeadership(getPartitionPath(getPartitionForKey(intentKey))) .leaderNodeId(), localNodeId); } }
IntentPartitionManager implements IntentPartitionService { @Override public boolean isMine(Key intentKey) { return Objects.equals(leadershipService.getLeadership(getPartitionPath(getPartitionForKey(intentKey))) .leaderNodeId(), localNodeId); }  }
IntentPartitionManager implements IntentPartitionService { @Override public boolean isMine(Key intentKey) { return Objects.equals(leadershipService.getLeadership(getPartitionPath(getPartitionForKey(intentKey))) .leaderNodeId(), localNodeId); }  @Activate void activate(); @Deactivate void deactivate(); @Override boolean isMine(Key intentKey); @Override NodeId getLeader(Key intentKey); @Override void addListener(IntentPartitionEventListener listener); @Override void removeListener(IntentPartitionEventListener listener); }
IntentPartitionManager implements IntentPartitionService { @Override public boolean isMine(Key intentKey) { return Objects.equals(leadershipService.getLeadership(getPartitionPath(getPartitionForKey(intentKey))) .leaderNodeId(), localNodeId); }  @Activate void activate(); @Deactivate void deactivate(); @Override boolean isMine(Key intentKey); @Override NodeId getLeader(Key intentKey); @Override void addListener(IntentPartitionEventListener listener); @Override void removeListener(IntentPartitionEventListener listener);  }