Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeInt()


        TreeMap<Tuple, LinkedList<Long>> rootMap = rootCollector.getMap();
        keySet = rootMap.keySet();

        rootOut = fs.create(new Path(fileName + ".root"));
        rootOut.writeInt(this.loadNum);
        rootOut.writeInt(keySet.size());

        /* root key writing */
        for (Tuple key : keySet) {
          byte[] buf = rowStoreEncoder.toBytes(key);
          rootOut.writeInt(buf.length);
View Full Code Here


        rootOut.writeInt(keySet.size());

        /* root key writing */
        for (Tuple key : keySet) {
          byte[] buf = rowStoreEncoder.toBytes(key);
          rootOut.writeInt(buf.length);
          rootOut.write(buf);

          LinkedList<Long> offsetList = rootMap.get(key);
          if (offsetList.size() > 1 || offsetList.size() == 0) {
            throw new IOException("Why root index doen't have one offset?");
View Full Code Here

        // write the jobtracker.info file
        try {
          FSDataOutputStream out = FileSystem.create(fs, restartFile,
                                                     filePerm);
          out.writeInt(0);
          out.close();
        } catch (IOException ioe) {
          LOG.warn("Writing to file " + restartFile + " failed!");
          LOG.warn("FileSystem is not ready yet!");
          fs.delete(restartFile, false);
View Full Code Here

      //TODO This is similar to jobhistory recovery, maybe this common code
      //      can be factored out.
     
      // write to the tmp file
      FSDataOutputStream out = FileSystem.create(fs, tmpRestartFile, filePerm);
      out.writeInt(restartCount);
      out.close();

      // delete the main file
      fs.delete(restartFile, false);
     
View Full Code Here

        job.getCounters().write(dataOut);

        TaskCompletionEvent[] events =
                job.getTaskCompletionEvents(0, Integer.MAX_VALUE);
        dataOut.writeInt(events.length);
        for (TaskCompletionEvent event : events) {
          event.write(dataOut);
        }

        dataOut.close();
View Full Code Here

      if (this.level == TWO_LEVEL_INDEX) {
        TreeMap<Tuple, LinkedList<Long>> rootMap = rootCollector.getMap();
        keySet = rootMap.keySet();

        rootOut = fs.create(new Path(fileName + ".root"));
        rootOut.writeInt(this.loadNum);
        rootOut.writeInt(keySet.size());

        /* root key writing */
        for (Tuple key : keySet) {
          byte[] buf = RowStoreUtil.RowStoreEncoder.toBytes(keySchema, key);
View Full Code Here

        TreeMap<Tuple, LinkedList<Long>> rootMap = rootCollector.getMap();
        keySet = rootMap.keySet();

        rootOut = fs.create(new Path(fileName + ".root"));
        rootOut.writeInt(this.loadNum);
        rootOut.writeInt(keySet.size());

        /* root key writing */
        for (Tuple key : keySet) {
          byte[] buf = RowStoreUtil.RowStoreEncoder.toBytes(keySchema, key);
          rootOut.writeInt(buf.length);
View Full Code Here

        rootOut.writeInt(keySet.size());

        /* root key writing */
        for (Tuple key : keySet) {
          byte[] buf = RowStoreUtil.RowStoreEncoder.toBytes(keySchema, key);
          rootOut.writeInt(buf.length);
          rootOut.write(buf);

          LinkedList<Long> offsetList = rootMap.get(key);
          if (offsetList.size() > 1 || offsetList.size() == 0) {
            throw new IOException("Why root index doen't have one offset?");
View Full Code Here

      Path recoveredEditsDir = HLog.getRegionDirRecoveredEditsDir(regiondir);
      for (int i = 1000; i < 1050; i += 10) {
        Path recoveredEdits = new Path(
            recoveredEditsDir, String.format("%019d", i));
        FSDataOutputStream dos=  fs.create(recoveredEdits);
        dos.writeInt(i);
        dos.close();
      }
      long minSeqId = 2000;
      Path recoveredEdits = new Path(
          recoveredEditsDir, String.format("%019d", minSeqId-1));
View Full Code Here

    if (bs == null || _outputStream == null) {
      throw new RuntimeException("bs [" + bs + "] outputStream [" + _outputStream + "]");
    }
    synchronized (_running) {
      FSDataOutputStream os = _outputStream.get();
      os.writeInt(bs.length);
      os.write(bs);
      tryToSync(os);
    }
  }
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.