class TridentFileReadSpout implements IBatchSpout {

  @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));
    }
  }

  public  TridentFileReadSpout(int maxBatchSize);
  public  TridentFileReadSpout(int maxBatchSize, String file);
  public  TridentFileReadSpout(int maxBatchSize, FileReader reader);

}