@Test public void testStopTrackingPartitions() { final ResultPartitionID partitionId2 = new ResultPartitionID(); final PartitionTable<JobID> table = new PartitionTable<>(); table.startTrackingPartitions(JOB_ID, Collections.singletonList(PARTITION_ID)); table.startTrackingPartitions(JOB_ID, Collections.singletonList(partitionId2)); table.stopTrackingPartitions(JOB_ID, Collections.singletonList(partitionId2)); assertTrue(table.hasTrackedPartitions(JOB_ID)); Collection<ResultPartitionID> storedPartitions = table.stopTrackingPartitions(JOB_ID); assertThat(storedPartitions, contains(PARTITION_ID)); assertFalse(table.hasTrackedPartitions(JOB_ID)); }
public Collection<ResultPartitionID> stopTrackingPartitions(K key) { Preconditions.checkNotNull(key); Set<ResultPartitionID> storedPartitions = trackedPartitionsPerJob.remove(key); return storedPartitions == null ? Collections.emptyList() : storedPartitions; }
PartitionTable { public Collection<ResultPartitionID> stopTrackingPartitions(K key) { Preconditions.checkNotNull(key); Set<ResultPartitionID> storedPartitions = trackedPartitionsPerJob.remove(key); return storedPartitions == null ? Collections.emptyList() : storedPartitions; } }
PartitionTable { public Collection<ResultPartitionID> stopTrackingPartitions(K key) { Preconditions.checkNotNull(key); Set<ResultPartitionID> storedPartitions = trackedPartitionsPerJob.remove(key); return storedPartitions == null ? Collections.emptyList() : storedPartitions; }  }
PartitionTable { public Collection<ResultPartitionID> stopTrackingPartitions(K key) { Preconditions.checkNotNull(key); Set<ResultPartitionID> storedPartitions = trackedPartitionsPerJob.remove(key); return storedPartitions == null ? Collections.emptyList() : storedPartitions; }  boolean hasTrackedPartitions(K key); void startTrackingPartitions(K key, Collection<ResultPartitionID> newPartitionIds); Collection<ResultPartitionID> stopTrackingPartitions(K key); void stopTrackingPartitions(K key, Collection<ResultPartitionID> partitionIds); }
PartitionTable { public Collection<ResultPartitionID> stopTrackingPartitions(K key) { Preconditions.checkNotNull(key); Set<ResultPartitionID> storedPartitions = trackedPartitionsPerJob.remove(key); return storedPartitions == null ? Collections.emptyList() : storedPartitions; }  boolean hasTrackedPartitions(K key); void startTrackingPartitions(K key, Collection<ResultPartitionID> newPartitionIds); Collection<ResultPartitionID> stopTrackingPartitions(K key); void stopTrackingPartitions(K key, Collection<ResultPartitionID> partitionIds);  }