@Test public void testPriority() throws IOException { ConcurrentBoundedWorkUnitList list = new ConcurrentBoundedWorkUnitList(10, new NameComparator(), 1); Assert.assertTrue(addFiles(list, "z-1", 10)); Assert.assertEquals(list.getWorkUnits().size(), 10); Assert.assertFalse(addFiles(list, "z-2", 5)); Assert.assertTrue(addFiles(list, "y-1", 5)); Assert.assertEquals(list.getWorkUnits().size(), 5); Assert.assertTrue(addFiles(list, "z-3", 2)); Assert.assertEquals(list.getWorkUnits().size(), 7); Assert.assertTrue(addFiles(list, "z-4", 2)); Assert.assertEquals(list.getWorkUnits().size(), 9); Assert.assertTrue(addFiles(list, "y-2", 4)); Assert.assertEquals(list.getWorkUnits().size(), 9); Assert.assertTrue(addFiles(list, "x-1", 4)); Assert.assertEquals(list.getWorkUnits().size(), 9); }
public List<WorkUnit> getWorkUnits() { ImmutableList.Builder<WorkUnit> allWorkUnits = ImmutableList.builder(); for (List<WorkUnit> workUnits : this.workUnitsMap.values()) { allWorkUnits.addAll(workUnits); } return allWorkUnits.build(); }
ConcurrentBoundedWorkUnitList { public List<WorkUnit> getWorkUnits() { ImmutableList.Builder<WorkUnit> allWorkUnits = ImmutableList.builder(); for (List<WorkUnit> workUnits : this.workUnitsMap.values()) { allWorkUnits.addAll(workUnits); } return allWorkUnits.build(); } }
ConcurrentBoundedWorkUnitList { public List<WorkUnit> getWorkUnits() { ImmutableList.Builder<WorkUnit> allWorkUnits = ImmutableList.builder(); for (List<WorkUnit> workUnits : this.workUnitsMap.values()) { allWorkUnits.addAll(workUnits); } return allWorkUnits.build(); } @Builder  ConcurrentBoundedWorkUnitList(int maxSize, final Comparator<FileSet<CopyEntity>> comparator,
      double strictLimitMultiplier); }
ConcurrentBoundedWorkUnitList { public List<WorkUnit> getWorkUnits() { ImmutableList.Builder<WorkUnit> allWorkUnits = ImmutableList.builder(); for (List<WorkUnit> workUnits : this.workUnitsMap.values()) { allWorkUnits.addAll(workUnits); } return allWorkUnits.build(); } @Builder  ConcurrentBoundedWorkUnitList(int maxSize, final Comparator<FileSet<CopyEntity>> comparator,
      double strictLimitMultiplier); boolean addFileSet(FileSet<CopyEntity> fileSet, List<WorkUnit> workUnits); boolean hasRejectedFileSet(); synchronized boolean isFull(); List<WorkUnit> getWorkUnits(); Map<FileSet<CopyEntity>, List<WorkUnit>> getRawWorkUnitMap(); }
ConcurrentBoundedWorkUnitList { public List<WorkUnit> getWorkUnits() { ImmutableList.Builder<WorkUnit> allWorkUnits = ImmutableList.builder(); for (List<WorkUnit> workUnits : this.workUnitsMap.values()) { allWorkUnits.addAll(workUnits); } return allWorkUnits.build(); } @Builder  ConcurrentBoundedWorkUnitList(int maxSize, final Comparator<FileSet<CopyEntity>> comparator,
      double strictLimitMultiplier); boolean addFileSet(FileSet<CopyEntity> fileSet, List<WorkUnit> workUnits); boolean hasRejectedFileSet(); synchronized boolean isFull(); List<WorkUnit> getWorkUnits(); Map<FileSet<CopyEntity>, List<WorkUnit>> getRawWorkUnitMap();  }