InMemoryMapKeyValueStore implements KeyValueStore<K, V> { public static <K, V> InMemoryMapKeyValueStore<K, V> fromMap(Map<K, V> map) { return builder().withMap(map).build(); } InMemoryMapKeyValueStore(); private  InMemoryMapKeyValueStore(Builder builder); static Builder builder(); static InMemoryMapKeyValueStore<K, V> fromMap(Map<K, V> map); @Override void storeToConf(KeyValueStoreConfiguration conf); @SuppressWarnings("unchecked") @Override void initFromConf(KeyValueStoreConfiguration conf); @Override KeyValueStoreReader<K, V> open();  }
@Test public void testProducer() throws Exception { final Map<String, String> smallMap = new HashMap<String, String>(); smallMap.put("lorem", "ipsum"); final Map<String, String> largeMap = new HashMap<String, String>(LARGE_KV_SIZE); for (int i = 0; i < LARGE_KV_SIZE; i++) { largeMap.put(Integer.toString(i), Integer.toString(i)); } final KijiURI tableURI = KijiURI.newBuilder(getKiji().getURI()).withTableName("test").build(); final KijiMapReduceJob job = KijiProduceJobBuilder.create() .withConf(getConf()) .withProducer(TestingProducer.class) .withInputTable(tableURI) .withOutput(MapReduceJobOutputs.newDirectKijiTableMapReduceJobOutput(tableURI)) .withStore("small", InMemoryMapKeyValueStore.fromMap(smallMap)) .withStore("large", InMemoryMapKeyValueStore.fromMap(largeMap)) .build(); assertTrue(job.run()); final KijiTable table = getKiji().openTable("test"); final KijiTableReader reader = table.openTableReader(); String value = reader .get(table.getEntityId("Marsellus Wallace"), KijiDataRequest.create("info", "first_name")) .getMostRecentValue("info", "first_name").toString(); assertEquals("Expected producer output not present. Did producer run successfully?", "lorem", value); reader.close(); table.release(); }