Package org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager

Examples of org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager.JobListCache.values()


    NavigableSet<JobId> set = mapWithSize.navigableKeySet();
    assertEquals("Incorrect navigableKeySet()", 1, set.size());
    assertTrue("Incorrect navigableKeySet()", set.contains(jobId));

    // check values()
    Collection<HistoryFileInfo> values = mapWithSize.values();
    assertEquals("Incorrect values()", 1, values.size());
    assertTrue("Incorrect values()", values.contains(fileInfo1));
  }
}
View Full Code Here


    Mockito.when(fileInfo.getJobId()).thenReturn(jobId);

    cache.addIfAbsent(fileInfo);
    cache.addIfAbsent(fileInfo);
    assertEquals("Incorrect number of cache entries", 1,
        cache.values().size());
  }

  @Test (timeout = 1000)
  public void testEviction() throws InterruptedException {
    int maxSize = 2;
View Full Code Here

    cache.addIfAbsent(fileInfo2);
    cache.addIfAbsent(fileInfo3);

    Collection <HistoryFileInfo> values;
    for (int i = 0; i < 9; i++) {
      values = cache.values();
      if (values.size() > maxSize) {
        Thread.sleep(100);
      } else {
        assertFalse("fileInfo1 should have been evicted",
          values.contains(fileInfo1));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.