Package org.apache.hadoop.fs

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


      LOG.debug("Writing recovery event to output stream"
          + ", dagId=" + dagID
          + ", eventType=" + eventType);
    }
    ++unflushedEventsCount;
    outputStream.writeInt(event.getHistoryEvent().getEventType().ordinal());
    event.getHistoryEvent().toProtoStream(outputStream);
    if (!EnumSet.of(HistoryEventType.DAG_SUBMITTED,
        HistoryEventType.DAG_FINISHED).contains(eventType)) {
      maybeFlush(outputStream);
    }
View Full Code Here


        LOG.debug("[DAG RECOVERY]"
            + " dagId=" + lastInProgressDAG
            + ", eventType=" + eventType
            + ", event=" + event.toString());
      }
      newDAGRecoveryStream.writeInt(eventType.ordinal());
      event.toProtoStream(newDAGRecoveryStream);
    }
    dagRecoveryStream.close();
    newDAGRecoveryStream.hsync();
    newDAGRecoveryStream.close();
View Full Code Here

  public static void writeInt(int value, Path path, Configuration configuration) throws IOException {
    FileSystem fs = FileSystem.get(path.toUri(), configuration);
    FSDataOutputStream out = fs.create(path);
    try {
      out.writeInt(value);
    } finally {
      Closeables.close(out, false);
    }
  }
View Full Code Here

      Path recoveredEditsDir = HLogUtil.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));
      FSDataOutputStream dos = fs.create(recoveredEdits);
View Full Code Here

      Path recoveredEditsDir = HLogUtil.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

      for(int docid: qrels.get(qid)) {
        if(!docidHistory.contains(docid)) {
          docidHistory.add(docid);

          IntDocVector vector = env.documentVectors(new int[]{docid})[0];
          output.writeInt(docid);
          DocumentVectorUtility.newInstance(documentVectorClass, vector).write(output);
        }
      }
      LOGGER.info("Compressed query " + qid);
    }
View Full Code Here

        }
      }
      LOGGER.info("Compressed query " + qid);
    }

    output.writeInt(-1);
    output.close();
  }
}
View Full Code Here

    FSDataOutputStream out = fs.create(forestPath);

    // write partitions' sizes
    for (int p = 0; p < numMaps; p++) {
      out.writeInt(sizes[p]);
    }

    // write the data
    for (int index = 0; index < numTrees; index++) {
      keys[index].write(out);
View Full Code Here

        LOG.info("max docno: " + maxDocno);

        // Write out the doc length data into a single file.
        FSDataOutputStream out = fs.create(new Path(dataFile), true);

        out.writeInt(docnoOffset); // Write out the docno offset.
        out.writeInt(maxDocno - docnoOffset); // Write out the collection size.

        // Write out length of each document (docnos are sequentially
        // ordered, so no need to explicitly keep track).
        int n = 0;
View Full Code Here

        // Write out the doc length data into a single file.
        FSDataOutputStream out = fs.create(new Path(dataFile), true);

        out.writeInt(docnoOffset); // Write out the docno offset.
        out.writeInt(maxDocno - docnoOffset); // Write out the collection size.

        // Write out length of each document (docnos are sequentially
        // ordered, so no need to explicitly keep track).
        int n = 0;
        for (int i = 1; i <= maxDocno - docnoOffset; 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.