test_class.declarator: NEXT_LINE = "next line"
test_class.modifier: private static final
test_class.original_string: private static final String NEXT_LINE = "next line";
test_class.type: String
test_class.var_name: NEXT_LINE
test_class.declarator: reader
test_class.modifier: private
test_class.original_string: private FileReader reader;
test_class.type: FileReader
test_class.var_name: reader
test_class.declarator: spout
test_class.modifier: private
test_class.original_string: private TridentFileReadSpout spout;
test_class.type: TridentFileReadSpout
test_class.var_name: spout
test_class.declarator: collector
test_class.modifier: private
test_class.original_string: private TridentCollector collector;
test_class.type: TridentCollector
test_class.var_name: collector
test_class.file: storm/storm-benchmark/src/test/java/storm/benchmark/lib/spout/TridentFileReadSpoutTest.java
test_class.identifier: TridentFileReadSpoutTest
test_case.body: @Test
    public void testEmitBatch() {
      spout.emitBatch(0L, collector);
      spout.emitBatch(1L, collector);
  
      verify(collector, times(20)).emit(any(Values.class));
  
      Map<Long, List<String>> batches = spout.getBatches();
      assertThat(batches)
              .hasSize(2)
              .containsKey(0L)
              .containsKey(1L);
      assertThat(batches.get(0L)).hasSize(10);
      assertThat(batches.get(1L)).hasSize(10);
    }
test_case.class_method_signature: TridentFileReadSpoutTest.testEmitBatch()
test_case.full_signature: @Test public void testEmitBatch()
test_case.identifier: testEmitBatch
test_case.invocations: emitBatch emitBatch emit verify times any getBatches containsKey containsKey hasSize assertThat hasSize assertThat get hasSize assertThat get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEmitBatch()
focal_class.declarator: serialVersionUID = -3538746749629409899L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = -3538746749629409899L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: DEFAULT_FILE = "/resources/A_Tale_of_Two_City.txt"
focal_class.modifier: private static final
focal_class.original_string: private static final String DEFAULT_FILE = "/resources/A_Tale_of_Two_City.txt";
focal_class.type: String
focal_class.var_name: DEFAULT_FILE
focal_class.declarator: FIELDS = "sentence"
focal_class.modifier: public static final
focal_class.original_string: public static final String FIELDS = "sentence";
focal_class.type: String
focal_class.var_name: FIELDS
focal_class.declarator: maxBatchSize
focal_class.modifier: private final
focal_class.original_string: private final int maxBatchSize;
focal_class.type: int
focal_class.var_name: maxBatchSize
focal_class.declarator: reader
focal_class.modifier: private final
focal_class.original_string: private final FileReader reader;
focal_class.type: FileReader
focal_class.var_name: reader
focal_class.declarator: batches = new HashMap<Long, List<String>>()
focal_class.modifier: private final
focal_class.original_string: private final HashMap<Long, List<String>> batches = new HashMap<Long, List<String>>();
focal_class.type: HashMap<Long, List<String>>
focal_class.var_name: batches
focal_class.file: storm/storm-benchmark/src/main/java/storm/benchmark/lib/spout/TridentFileReadSpout.java
focal_class.identifier: TridentFileReadSpout
focal_class.interfaces: implements IBatchSpout
focal_class.class_method_signature: TridentFileReadSpout.TridentFileReadSpout(int maxBatchSize)
focal_class.full_signature: public  TridentFileReadSpout(int maxBatchSize)
focal_class.identifier: TridentFileReadSpout
focal_class.modifiers: public
focal_class.parameters: (int maxBatchSize)
focal_class.signature:  TridentFileReadSpout(int maxBatchSize)
focal_class.class_method_signature: TridentFileReadSpout.TridentFileReadSpout(int maxBatchSize, String file)
focal_class.full_signature: public  TridentFileReadSpout(int maxBatchSize, String file)
focal_class.identifier: TridentFileReadSpout
focal_class.modifiers: public
focal_class.parameters: (int maxBatchSize, String file)
focal_class.signature:  TridentFileReadSpout(int maxBatchSize, String file)
focal_class.class_method_signature: TridentFileReadSpout.TridentFileReadSpout(int maxBatchSize, FileReader reader)
focal_class.full_signature: public  TridentFileReadSpout(int maxBatchSize, FileReader reader)
focal_class.identifier: TridentFileReadSpout
focal_class.modifiers: public
focal_class.parameters: (int maxBatchSize, FileReader reader)
focal_class.signature:  TridentFileReadSpout(int maxBatchSize, FileReader reader)
focal_class.class_method_signature: TridentFileReadSpout.open(Map conf, TopologyContext context)
focal_class.full_signature: @Override public void open(Map conf, TopologyContext context)
focal_class.identifier: open
focal_class.modifiers: @Override public
focal_class.parameters: (Map conf, TopologyContext context)
focal_class.return: void
focal_class.signature: void open(Map conf, TopologyContext context)
focal_class.class_method_signature: TridentFileReadSpout.emitBatch(long batchId, TridentCollector collector)
focal_class.full_signature: @Override public void emitBatch(long batchId, TridentCollector collector)
focal_class.identifier: emitBatch
focal_class.modifiers: @Override public
focal_class.parameters: (long batchId, TridentCollector collector)
focal_class.return: void
focal_class.signature: void emitBatch(long batchId, TridentCollector collector)
focal_class.class_method_signature: TridentFileReadSpout.ack(long batchId)
focal_class.full_signature: @Override public void ack(long batchId)
focal_class.identifier: ack
focal_class.modifiers: @Override public
focal_class.parameters: (long batchId)
focal_class.return: void
focal_class.signature: void ack(long batchId)
focal_class.class_method_signature: TridentFileReadSpout.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: TridentFileReadSpout.getComponentConfiguration()
focal_class.full_signature: @Override public Map getComponentConfiguration()
focal_class.identifier: getComponentConfiguration
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map
focal_class.signature: Map getComponentConfiguration()
focal_class.class_method_signature: TridentFileReadSpout.getOutputFields()
focal_class.full_signature: @Override public Fields getOutputFields()
focal_class.identifier: getOutputFields
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Fields
focal_class.signature: Fields getOutputFields()
focal_class.class_method_signature: TridentFileReadSpout.getBatches()
focal_class.full_signature:  Map<Long, List<String>> getBatches()
focal_class.identifier: getBatches
focal_class.parameters: ()
focal_class.return: Map<Long, List<String>>
focal_class.signature: Map<Long, List<String>> getBatches()
focal_method.body: @Override
    public void emitBatch(long batchId, TridentCollector collector) {
      List<String> batch = batches.get(batchId);
      if (batch == null) {
        batch = new ArrayList<String>();
        for (int i = 0;  i < maxBatchSize; i++) {
          batch.add(reader.nextLine());
        }
        batches.put(batchId, batch);
      }
      for(String line : batch){
        collector.emit(new Values(line));
      }
    }
focal_method.class_method_signature: TridentFileReadSpout.emitBatch(long batchId, TridentCollector collector)
focal_method.full_signature: @Override public void emitBatch(long batchId, TridentCollector collector)
focal_method.identifier: emitBatch
focal_method.invocations: get add nextLine put emit
focal_method.modifiers: @Override public
focal_method.parameters: (long batchId, TridentCollector collector)
focal_method.return: void
focal_method.signature: void emitBatch(long batchId, TridentCollector collector)