/**
   * read the the given input split.
   *
   * @return List : List of read messages
   */
  private List<Message> readSplit(
      DatabusInputFormat format, InputSplit split, JobConf job, Reporter reporter)
      throws IOException {
    List<Message> result = new ArrayList<Message>();
    RecordReader<LongWritable, Message> reader = format.getRecordReader(split, job, reporter);
    LongWritable key = ((DatabusRecordReader) reader).createKey();
    Message value = ((DatabusRecordReader) reader).createValue();

    while (((DatabusRecordReader) reader).next(key, value)) {
      result.add(value);
      value = (Message) ((DatabusRecordReader) reader).createValue();
    }
    reader.close();
    return result;
  }
  @Override
  public void close() {
    // some hive input formats are broken and bad things can happen if you close them multiple times
    if (closed) {
      return;
    }
    closed = true;

    updateCompletedBytes();

    try {
      recordReader.close();
    } catch (IOException e) {
      throw Throwables.propagate(e);
    }
  }
 @Override
 public void close() throws IOException {
   realReader.close();
 }
示例#4
0
 public void close() throws IOException {
   recordReader.close();
 }
示例#5
0
 /** Forward close request to proxied RR. */
 public void close() throws IOException {
   rr.close();
 }