Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FSDataInputStream.readInt()


      }

      FSDataInputStream in = fs.open(restartFile);
      try {
        // read the old count
        restartCount = in.readInt();
        ++restartCount; // increment the restart count
      } catch (IOException ioe) {
        LOG.warn("System directory is garbled. Failed to read file "
                 + restartFile);
        LOG.warn("Jobtracker recovery is not possible with garbled"
View Full Code Here


  public static int readInt(Path path, Configuration conf) throws IOException {
    FileSystem fs = FileSystem.get(path.toUri(), conf);
    FSDataInputStream in = fs.open(path);
    try {
      return in.readInt();
    } finally {
      Closeables.closeQuietly(in);
    }
  }
}
View Full Code Here

      }

      FSDataInputStream in = fs.open(restartFile);
      try {
        // read the old count
        restartCount = in.readInt();
        ++restartCount; // increment the restart count
      } catch (IOException ioe) {
        LOG.warn("System directory is garbled. Failed to read file "
                 + restartFile);
        LOG.warn("Jobtracker recovery is not possible with garbled"
View Full Code Here

    byte[] buf = new byte[MAGIC.length];
    inputStream.readFully(buf);
    if (!Arrays.equals(MAGIC, buf)) {
      throw new IOException("File [" + path + "] not a " + BLUR_KEY_VALUE + " file.");
    }
    int version = inputStream.readInt();
    if (version == 1) {
      long fileLength = getFileLength(path, inputStream);
      Operation operation = new Operation();
      try {
        while (inputStream.getPos() < fileLength) {
View Full Code Here

    FSDataInputStream in = fs.open(forestPath);

    try {
      // partitions' sizes
      for (int p = 0; p < NUM_MAPPERS; p++) {
        assertEquals(splits[p].length, in.readInt());
      }

      // load (key, tree)
      TreeID key = new TreeID();
      for (int index = 0; index < NUM_TREES; index++) {
View Full Code Here

    try {
      // get current partition's size
      for (int p = 0; p < numMaps; p++) {
        if (p == partition) {
          numInstances = in.readInt();
        } else {
          in.readInt();
        }
      }
View Full Code Here

      // get current partition's size
      for (int p = 0; p < numMaps; p++) {
        if (p == partition) {
          numInstances = in.readInt();
        } else {
          in.readInt();
        }
      }

      // load (key, tree)
      int current = 0;
View Full Code Here

    try {
      byte[] magic = LOG_FILE_HEADER_V2.getBytes(Constants.UTF8);
      byte[] buffer = new byte[magic.length];
      file.readFully(buffer);
      if (Arrays.equals(buffer, magic)) {
        int count = file.readInt();
        for (int i = 0; i < count; i++) {
          String key = file.readUTF();
          String value = file.readUTF();
          opts.put(key, value);
        }
View Full Code Here

    FSDataInputStream in = fs.open(forestPath);

    try {
      // partitions' sizes
      for (int p = 0; p < nbMappers; p++) {
        assertEquals(splits[p].length, in.readInt());
      }

      // load (key, tree)
      TreeID key = new TreeID();
      for (int index = 0; index < nbTrees; index++) {
View Full Code Here

    in.close();

    int l = 0;

    in = fs.open(idsPath);
    l = in.readInt();
    ids = new int[l];
    for (int i = 0; i < l; i++) {
      ids[i] = in.readInt();
    }
    in.close();
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.