Package org.apache.hadoop.mapred

Examples of org.apache.hadoop.mapred.SequenceFileRecordReader


    /**
     * Returns a reader for this split of the src file list.
     */
    public RecordReader getRecordReader(InputSplit split, JobConf job,
                                 Reporter reporter) throws IOException {
      return new SequenceFileRecordReader(job, (FileSplit)split);
    }
View Full Code Here


    /**
     * Returns a reader for this split of the src file list.
     */
    public RecordReader getRecordReader(InputSplit split, JobConf job,
                                 Reporter reporter) throws IOException {
      return new SequenceFileRecordReader(job, (FileSplit)split);
    }
View Full Code Here

      } catch (IOException e) {
        throw new RuntimeException("Cannot identify segment:", e);
      }

      try {
        return new SequenceFileRecordReader(job, (FileSplit)split) {
         
          @Override
          public synchronized boolean next(Writable key, Writable value) throws IOException {
            LOG.debug("Running OIF.next()");
           
View Full Code Here

      } catch (IOException e) {
        throw new RuntimeException("Cannot identify segment:", e);
      }

      try {
        return new SequenceFileRecordReader(job, (FileSplit)split) {
         
          @Override
          public synchronized boolean next(Writable key, Writable value) throws IOException {
            LOG.debug("Running OIF.next()");
           
View Full Code Here

      if (((RecordReader) reader) instanceof LineRecordReader
          || (RecordReader) reader instanceof SequenceFileRecordReader) {

        // sequnceFile的key是BytesWritable,lineRecordReader的key为LongWritable
        if ((RecordReader) reader instanceof SequenceFileRecordReader) {
          SequenceFileRecordReader sReader = (SequenceFileRecordReader) reader;
          key = (Writable) sReader.getKeyClass().newInstance();
        } else {
          key = new LongWritable();
        }
        while (reader.next(key, textValue)
            && count < MAX_RECORD_TO_READ) {
View Full Code Here

      if (((RecordReader) reader) instanceof LineRecordReader
          || (RecordReader) reader instanceof SequenceFileRecordReader) {

        // sequnceFile的key是BytesWritable,lineRecordReader的key为LongWritable
        if ((RecordReader) reader instanceof SequenceFileRecordReader) {
          SequenceFileRecordReader sReader = (SequenceFileRecordReader) reader;
          try {
            key = (Writable) sReader.getKeyClass().newInstance();
          } catch (Exception e) {
            log("partition download error!", e);
            resp.getWriter().write("分区下载失败");
            return;
          }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapred.SequenceFileRecordReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.