test_class.declarator: LARGE_KV_SIZE = 1024
test_class.modifier: private static final
test_class.original_string: private static final int LARGE_KV_SIZE = 1024;
test_class.type: int
test_class.var_name: LARGE_KV_SIZE
test_class.file: kiji-mapreduce/src/test/java/org/kiji/mapreduce/kvstore/lib/TestInMemoryMapKeyValueStore.java
test_class.identifier: TestInMemoryMapKeyValueStore
test_class.superclass: extends KijiClientTest
test_case.body: @Test
    public void testProducer() throws Exception {
      // Create some maps for KV stores for this test.
      // A small map whose value will be checked.
      final Map<String, String> smallMap = new HashMap<String, String>();
      smallMap.put("lorem", "ipsum");
      // A larger map to ensure that we can safely encode non-trivial amounts of data.
      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();
      // Be sure the job runs successfully and to completion.
      // If the producer finishes, the first_name of the main row will be changed to "lorem".
      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();
    }
test_case.class_method_signature: TestInMemoryMapKeyValueStore.testProducer()
test_case.full_signature: @Test public void testProducer()
test_case.identifier: testProducer
test_case.invocations: put put toString toString build withTableName newBuilder getURI getKiji build withStore withStore withOutput withInputTable withProducer withConf create getConf newDirectKijiTableMapReduceJobOutput fromMap fromMap assertTrue run openTable getKiji openTableReader toString getMostRecentValue get getEntityId create assertEquals close release
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testProducer()
focal_class.declarator: CONF_MAP = "map"
focal_class.modifier: private static final
focal_class.original_string: private static final String CONF_MAP = "map";
focal_class.type: String
focal_class.var_name: CONF_MAP
focal_class.declarator: mMap
focal_class.modifier: private
focal_class.original_string: private HashMap<K, V> mMap;
focal_class.type: HashMap<K, V>
focal_class.var_name: mMap
focal_class.declarator: mOpened
focal_class.modifier: private
focal_class.original_string: private boolean mOpened;
focal_class.type: boolean
focal_class.var_name: mOpened
focal_class.file: kiji-mapreduce/src/main/java/org/kiji/mapreduce/kvstore/lib/InMemoryMapKeyValueStore.java
focal_class.identifier: InMemoryMapKeyValueStore
focal_class.interfaces: implements KeyValueStore<K, V>
focal_class.class_method_signature: InMemoryMapKeyValueStore.builder()
focal_class.full_signature: public static Builder builder()
focal_class.identifier: builder
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Builder
focal_class.signature: Builder builder()
focal_class.class_method_signature: InMemoryMapKeyValueStore.InMemoryMapKeyValueStore()
focal_class.full_signature: public  InMemoryMapKeyValueStore()
focal_class.identifier: InMemoryMapKeyValueStore
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  InMemoryMapKeyValueStore()
focal_class.class_method_signature: InMemoryMapKeyValueStore.InMemoryMapKeyValueStore(Builder builder)
focal_class.full_signature: private  InMemoryMapKeyValueStore(Builder builder)
focal_class.identifier: InMemoryMapKeyValueStore
focal_class.modifiers: private
focal_class.parameters: (Builder builder)
focal_class.signature:  InMemoryMapKeyValueStore(Builder builder)
focal_class.class_method_signature: InMemoryMapKeyValueStore.fromMap(Map<K, V> map)
focal_class.full_signature: public static InMemoryMapKeyValueStore<K, V> fromMap(Map<K, V> map)
focal_class.identifier: fromMap
focal_class.modifiers: public static
focal_class.parameters: (Map<K, V> map)
focal_class.return: InMemoryMapKeyValueStore<K, V>
focal_class.signature: InMemoryMapKeyValueStore<K, V> fromMap(Map<K, V> map)
focal_class.class_method_signature: InMemoryMapKeyValueStore.storeToConf(KeyValueStoreConfiguration conf)
focal_class.full_signature: @Override public void storeToConf(KeyValueStoreConfiguration conf)
focal_class.identifier: storeToConf
focal_class.modifiers: @Override public
focal_class.parameters: (KeyValueStoreConfiguration conf)
focal_class.return: void
focal_class.signature: void storeToConf(KeyValueStoreConfiguration conf)
focal_class.class_method_signature: InMemoryMapKeyValueStore.initFromConf(KeyValueStoreConfiguration conf)
focal_class.full_signature: @SuppressWarnings("unchecked") @Override public void initFromConf(KeyValueStoreConfiguration conf)
focal_class.identifier: initFromConf
focal_class.modifiers: @SuppressWarnings("unchecked") @Override public
focal_class.parameters: (KeyValueStoreConfiguration conf)
focal_class.return: void
focal_class.signature: void initFromConf(KeyValueStoreConfiguration conf)
focal_class.class_method_signature: InMemoryMapKeyValueStore.open()
focal_class.full_signature: @Override public KeyValueStoreReader<K, V> open()
focal_class.identifier: open
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: KeyValueStoreReader<K, V>
focal_class.signature: KeyValueStoreReader<K, V> open()
focal_method.body: public static <K, V> InMemoryMapKeyValueStore<K, V> fromMap(Map<K, V> map) {
      return builder().withMap(map).build();
    }
focal_method.class_method_signature: InMemoryMapKeyValueStore.fromMap(Map<K, V> map)
focal_method.full_signature: public static InMemoryMapKeyValueStore<K, V> fromMap(Map<K, V> map)
focal_method.identifier: fromMap
focal_method.invocations: build withMap builder
focal_method.modifiers: public static
focal_method.parameters: (Map<K, V> map)
focal_method.return: InMemoryMapKeyValueStore<K, V>
focal_method.signature: InMemoryMapKeyValueStore<K, V> fromMap(Map<K, V> map)