}
builder = builder.setSortReadTimeMillis(6);
builder = builder.setWorkerQueueName("queue1");
MapReduceSettings mrSettings = builder.build();
assertEquals("b1", mrSettings.getBackend());
assertNull(mrSettings.getModule());
assertEquals("bucket", mrSettings.getBucketName());
assertEquals("base-url", mrSettings.getBaseUrl());
assertEquals(3, mrSettings.getMapFanout());
assertEquals(1, mrSettings.getMaxShardRetries());
assertEquals(0, mrSettings.getMaxSliceRetries());
assertEquals(10L, (long) mrSettings.getMaxSortMemory());
assertEquals(4, mrSettings.getMergeFanin());
assertEquals(10, mrSettings.getMillisPerSlice());
assertEquals(5, mrSettings.getSortBatchPerEmitBytes());
assertEquals(6, mrSettings.getSortReadTimeMillis());
assertEquals("queue1", mrSettings.getWorkerQueueName());
builder = new MapReduceSettings.Builder().setModule("m1");
try {
builder.setBackend("b").build();
fail("Expected exception to be thrown");
} catch (IllegalArgumentException ex) {
// expected
builder.setBackend(null);
}
mrSettings = builder.build();
assertNull(mrSettings.getBackend());
assertEquals("m1", mrSettings.getModule());
}