BufferedExternalSorter implements Sorter { public static Options options() { return new Options("/tmp", 100, SorterType.HADOOP); } BufferedExternalSorter(ExternalSorter externalSorter, InMemorySorter inMemorySorter); static Options options(); static BufferedExternalSorter create(Options options); @Override void add(KV<byte[], byte[]> record); @Override Iterable<KV<byte[], byte[]>> sort();  }
@Test public void testNegativeMemory() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("memoryMB must be greater than zero"); BufferedExternalSorter.Options options = BufferedExternalSorter.options().withTempLocation(getTmpLocation().toString()); options.withMemoryMB(-1); }
@Test public void testZeroMemory() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("memoryMB must be greater than zero"); BufferedExternalSorter.Options options = BufferedExternalSorter.options(); options.withMemoryMB(0); }
@Test public void testMemoryTooLarge() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("memoryMB must be less than 2048"); BufferedExternalSorter.Options options = BufferedExternalSorter.options(); options.withMemoryMB(2048); }
@Test public void testNegativeMemory() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("memoryMB must be greater than zero"); BufferedExternalSorter.Options options = BufferedExternalSorter.options().withTempLocation(tmpLocation.toString()); options.withMemoryMB(-1); }