Package org.apache.hadoop.io.SequenceFile

Examples of org.apache.hadoop.io.SequenceFile.Reader


      }
      if (dump) {
        if (!fs.isFile(logPath)) {
          throw new IOException(args[i] + " is not a file");
        }
        Reader log = new SequenceFile.Reader(fs, logPath, conf);
        try {
          HLogKey key = new HLogKey();
          KeyValue val = new KeyValue();
          while (log.next(key, val)) {
            System.out.println(key.toString() + " " + val.toString());
          }
        } finally {
          log.close();
        }
      } else {
        if (!fs.getFileStatus(logPath).isDir()) {
          throw new IOException(args[i] + " is not a directory");
        }
View Full Code Here


    // import the InMemOutputs
    IntWritable key = new IntWritable();
    MapredOutput value = new MapredOutput();
   
    for (Path path : outfiles) {
      Reader reader = new Reader(fs, path, conf);
     
      try {
        while (reader.next(key, value)) {
          output.put(key.get(), value.clone());
        }
      } finally {
        reader.close();
      }
    }
   
    return processOutput(output, callback);
  }
View Full Code Here

    // read all the outputs
    IntWritable key = new IntWritable();
    Step0Output value = new Step0Output(0L, 0);
   
    for (Path path : outfiles) {
      Reader reader = new Reader(fs, path, conf);
     
      try {
        while (reader.next(key, value)) {
          keys.add(key.get());
          values.add(value.clone());
        }
      } finally {
        reader.close();
      }
    }
   
    return processOutput(keys, values);
  }
View Full Code Here

    sorter.merge(outfiles, output);
   
    // import the evaluations
    LongWritable key = new LongWritable();
    DoubleWritable value = new DoubleWritable();
    Reader reader = new Reader(fs, output, conf);
    try {
      while (reader.next(key, value)) {
        evaluations.add(value.get());
      }
    } finally {
      reader.close();
    }
  }
View Full Code Here

    LongWritable key = new LongWritable();
    Frequencies value = new Frequencies();
   
    int index = 0;
    for (Path path : outfiles) {
      Reader reader = new Reader(fs, path, conf);
     
      try {
        while (reader.next(key, value)) {
          values[index++] = value.clone();
        }
      } finally {
        reader.close();
      }
    }
   
    if (index < numMaps) {
      throw new IllegalStateException(String.format(
View Full Code Here

    TreeID key = new TreeID();
    MapredOutput value = new MapredOutput();
   
    int index = 0;
    for (Path path : outfiles) {
      Reader reader = new Reader(fs, path, conf);
     
      try {
        while (reader.next(key, value)) {
          if (keys != null) {
            keys[index] = key.clone();
          }
         
          if (trees != null) {
            trees[index] = value.getTree();
          }
         
          processOutput(firstIds, key, value, callback);
         
          index++;
        }
      } finally {
        reader.close();
      }
    }
   
    // make sure we got all the keys/values
    if ((keys != null) && (index != keys.length)) {
View Full Code Here

    IntWritable key = new IntWritable();
    Step0Output value = new Step0Output(0L, 0);
   
    int index = 0;
    for (Path path : outfiles) {
      Reader reader = new Reader(fs, path, job);
     
      try {
        while (reader.next(key, value)) {
          keys[index] = key.get();
          values[index] = value.clone();
         
          index++;
        }
      } finally {
        reader.close();
      }
    }
   
    return processOutput(keys, values);
  }
View Full Code Here

    // import the InMemOutputs
    IntWritable key = new IntWritable();
    MapredOutput value = new MapredOutput();
   
    for (Path path : outfiles) {
      Reader reader = new Reader(fs, path, conf);
     
      try {
        while (reader.next(key, value)) {
          output.put(key.get(), value.clone());
        }
      } finally {
        reader.close();
      }
    }
   
    return processOutput(output, callback);
  }
View Full Code Here

    TreeID key = new TreeID();
    MapredOutput value = new MapredOutput();
   
    int index = 0;
    for (Path path : outfiles) {
      Reader reader = new Reader(fs, path, job);
     
      try {
        while (reader.next(key, value)) {
          if (keys != null) {
            keys[index] = key.clone();
          }
         
          if (trees != null) {
            trees[index] = value.getTree();
          }
         
          processOutput(firstIds, key, value, callback);
         
          index++;
        }
      } finally {
        reader.close();
      }
    }
   
    // make sure we got all the keys/values
    if (keys != null && index != keys.length) {
View Full Code Here

    sorter.merge(outfiles, output);
   
    // import the descriptions
    LongWritable key = new LongWritable();
    Text value = new Text();
    Reader reader = new Reader(fs, output, conf);
   
    while (reader.next(key, value)) {
      descriptions.add(value.toString());
    }
   
    reader.close();
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.io.SequenceFile.Reader

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.