Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.BytesWritable.readFields()


      int numEntries = WritableUtils.readVInt(in);
      entries.clear();
      for (int i = 0; i < numEntries; i++) {
        String key = Text.readString(in);
        BytesWritable val = new BytesWritable();
        val.readFields(in);
        entries.put(key, val);
      }
    }

    public void write(DataOutput out) throws IOException {
View Full Code Here


    BytesWritable data = getDataObj();

    if (null == data) {
      data = new BytesWritable();
    }
    data.readFields(in);
    setDataObj(data);
  }

  @Override
  public void writeInternal(DataOutput out) throws IOException {
View Full Code Here

      readRpcIds(in, logVersion);
    }

    private static Rename[] readRenameOptions(DataInputStream in) throws IOException {
      BytesWritable writable = new BytesWritable();
      writable.readFields(in);

      byte[] bytes = writable.getBytes();
      Rename[] options = new Rename[bytes.length];

      for (int i = 0; i < bytes.length; i++) {
View Full Code Here

        int count = in.readInt();
        files = new ArrayList<Pair<BytesWritable, Long>>(count);
        length = 0;
        for (int i = 0; i < count; ++i) {
          BytesWritable fileInfo = new BytesWritable();
          fileInfo.readFields(in);
          long size = in.readLong();
          files.add(new Pair<BytesWritable, Long>(fileInfo, size));
          length += size;
        }
      }
View Full Code Here

      Path localSplit = new Path(new Path(jobFilename.toString()).getParent(),
                                 "split.dta");
      DataInputStream splitFile = FileSystem.getLocal(conf).open(localSplit);
      String splitClass = Text.readString(splitFile);
      BytesWritable split = new BytesWritable();
      split.readFields(splitFile);
      splitFile.close();
      task = new MapTask(jobFilename.toString(), taskId, partition, splitClass, split);
    } else {
      int numMaps = conf.getNumMapTasks();
      fillInMissingMapOutputs(local, taskId, numMaps, conf);
View Full Code Here

      this.options = readRenameOptions(in);
    }

    private static Rename[] readRenameOptions(DataInputStream in) throws IOException {
      BytesWritable writable = new BytesWritable();
      writable.readFields(in);

      byte[] bytes = writable.getBytes();
      Rename[] options = new Rename[bytes.length];

      for (int i = 0; i < bytes.length; i++) {
View Full Code Here

      readRpcIds(in, logVersion);
    }

    private static Rename[] readRenameOptions(DataInputStream in) throws IOException {
      BytesWritable writable = new BytesWritable();
      writable.readFields(in);

      byte[] bytes = writable.getBytes();
      Rename[] options = new Rename[bytes.length];

      for (int i = 0; i < bytes.length; i++) {
View Full Code Here

      this.options = readRenameOptions(in);
    }

    private static Rename[] readRenameOptions(DataInputStream in) throws IOException {
      BytesWritable writable = new BytesWritable();
      writable.readFields(in);

      byte[] bytes = writable.getBytes();
      Rename[] options = new Rename[bytes.length];

      for (int i = 0; i < bytes.length; i++) {
View Full Code Here

    }
  }
 
  static Rename[] readRenameOptions(DataInputStream in) throws IOException {
    BytesWritable writable = new BytesWritable();
    writable.readFields(in);
   
    byte[] bytes = writable.getBytes();
    Rename[] options = new Rename[bytes.length];
   
    for (int i = 0; i < bytes.length; i++) {
View Full Code Here

  /**
   * Deserializes DBChunk
   */
  private DBChunk deserializeChunk(DataInput in) throws IOException {
    BytesWritable br = new BytesWritable();
    br.readFields(in);
    byte[] buf = br.getBytes();
    ObjectInputStream byte_stream = new ObjectInputStream(
        new ByteArrayInputStream(buf));
    DBChunk chunk = null;
    try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.