Package org.apache.hadoop.io

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


            BytesWritable value = new BytesWritable();
            int count = 0;
            while (true) {
                try {
                    key.readFields(input);
                    value.readFields(input);
                    writer.append(key, value);
                    count++;
                }
                catch (EOFException e) {
                    break;
View Full Code Here


    BasicTable.Reader reader = new BasicTable.Reader(path, conf);
    reader.setProjection("a,d,c,f");
    BytesWritable tmp = new BytesWritable();
    DataInputStream dis = reader.getMetaBlock("testMetaBlocks.meta1");
    try {
      tmp.readFields(dis);
      Assert.assertTrue(tmp.compareTo(meta1) == 0);
    } finally {
      dis.close();
    }
View Full Code Here

      dis.close();
    }

    dis = reader.getMetaBlock("testMetaBlocks.meta2");
    try {
      tmp.readFields(dis);
      Assert.assertTrue(tmp.compareTo(meta2) == 0);
    } finally {
      dis.close();
    }
    reader.close();
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(jobId, jobFilename.toString(), conf.get("mapred.tip.id"),
                         taskId, partition, splitClass, split);
    } else {
      int numMaps = conf.getNumMapTasks();
View Full Code Here

    BasicTable.Reader reader = new BasicTable.Reader(path, conf);
    reader.setProjection("a,d,c,f");
    BytesWritable tmp = new BytesWritable();
    DataInputStream dis = reader.getMetaBlock("testMetaBlocks.meta1");
    try {
      tmp.readFields(dis);
      Assert.assertTrue(tmp.compareTo(meta1) == 0);
    } finally {
      dis.close();
    }
View Full Code Here

      dis.close();
    }

    dis = reader.getMetaBlock("testMetaBlocks.meta2");
    try {
      tmp.readFields(dis);
      Assert.assertTrue(tmp.compareTo(meta2) == 0);
    } finally {
      dis.close();
    }
    reader.close();
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(jobId, jobFilename.toString(), conf.get("mapred.tip.id"),
                         taskId, partition, splitClass, split);
    } else {
      int numMaps = conf.getNumMapTasks();
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

    int entries = WritableUtils.readVInt(in);
    for (int i = 0; i < entries; i++) {
      Text txt = new Text();
      txt.readFields(in);
      BytesWritable value = new BytesWritable();
      value.readFields(in);
      instance.put(txt, value);
    }
  }

  @Override
View Full Code Here

      if (nulls == values.length) {
        return;
      }
      for (int i = 0; i < values.length - nulls; i++) {
        BytesWritable value = new BytesWritable();
        value.readFields(in); // read a value
        values[i] = value; // store it in values
      }
    }
  }
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.