Package org.apache.hadoop.io

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


    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

      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

      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

      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(jobFilename.toString(), taskId, partition, splitClass, split);
    } else {
      int numMaps = conf.getNumMapTasks();
      fillInMissingMapOutputs(local, taskId, numMaps, conf);
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

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.