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


  static public String[] readDocnoData(Path p, FileSystem fs) throws IOException {
    FSDataInputStream in = fs.open(p);

    // docnos start at one, so we need an array that's one larger than
    // number of docs
    int sz = in.readInt() + 1;
    String[] arr = new String[sz];

    for (int i = 1; i < sz; i++) {
      arr[i] = in.readUTF();
    }
View Full Code Here

    // Class name; throw away.
    in.readUTF();
    collectionPath = in.readUTF();

    int blocks = in.readInt();

    LOG.info(blocks + " blocks expected");
    docnos = new int[blocks];
    offsets = new int[blocks];
    fileno = new short[blocks];
View Full Code Here

    docnos = new int[blocks];
    offsets = new int[blocks];
    fileno = new short[blocks];

    for (int i = 0; i < blocks; i++) {
      docnos[i] = in.readInt();
      offsets[i] = in.readInt();
      fileno[i] = in.readShort();

      if (i > 0 && i % 100000 == 0)
        LOG.info(i + " blocks read");
View Full Code Here

    // Class name; throw away.
    in.readUTF();
    collectionPath = in.readUTF();

    int blocks = in.readInt();

    LOG.info(blocks + " blocks expected");
    docnos = new int[blocks];
    offsets = new int[blocks];
    fileno = new short[blocks];
View Full Code Here

    docnos = new int[blocks];
    offsets = new int[blocks];
    fileno = new short[blocks];

    for (int i = 0; i < blocks; i++) {
      docnos[i] = in.readInt();
      offsets[i] = in.readInt();
      fileno[i] = in.readShort();

      if (i > 0 && i % 100000 == 0)
        LOG.info(i + " blocks read");
View Full Code Here

    offsets = new int[blocks];
    fileno = new short[blocks];

    for (int i = 0; i < blocks; i++) {
      docnos[i] = in.readInt();
      offsets[i] = in.readInt();
      fileno[i] = in.readShort();

      if (i > 0 && i % 100000 == 0)
        LOG.info(i + " blocks read");
    }
View Full Code Here

  }

  public static int readInt(FileSystem fs, String path) {
    try {
      FSDataInputStream in = fs.open(new Path(path));
      int val = in.readInt();
      in.close();
      return val;
    } catch (Exception e) {
      throw new RuntimeException("Unable to read property at " + path);
    }
View Full Code Here

    // class name; throw away
    in.readUTF();
    collectionPath = in.readUTF();

    int blocks = in.readInt();

    docnos = new int[blocks];
    offsets = new int[blocks];
    filenos = new short[blocks];
View Full Code Here

    docnos = new int[blocks];
    offsets = new int[blocks];
    filenos = new short[blocks];

    for (int i = 0; i < blocks; i++) {
      docnos[i] = in.readInt();
      offsets[i] = in.readInt();
      filenos[i] = in.readShort();
    }

    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.