コード例 #1
0
 /**
  * Restores the checkpointed writer.
  *
  * @param checkPointWriter The checkpointed writer.
  * @param writer The writer to restore state into.
  */
 @SuppressWarnings({"unchecked", "rawtypes"})
 public static void restoreCheckPoint(CheckPointWriter checkPointWriter, AbstractFSWriter writer) {
   writer.append = checkPointWriter.append;
   writer.counts = checkPointWriter.counts;
   writer.endOffsets = checkPointWriter.endOffsets;
   writer.openPart = checkPointWriter.openPart;
   writer.filePath = checkPointWriter.filePath;
   writer.maxOpenFiles = checkPointWriter.maxOpenFiles;
   writer.replication = checkPointWriter.replication;
   writer.totalBytesWritten = checkPointWriter.totalBytesWritten;
   writer.maxLength = checkPointWriter.maxLength;
   writer.rollingFile = checkPointWriter.rollingFile;
 }
コード例 #2
0
    @Override
    @SuppressWarnings("unchecked")
    public void populateDAG(DAG dag, Configuration conf) {
      RandomWordGenerator randomWordGenerator = new RandomWordGenerator();
      randomWordGenerator.setTuplesPerWindow(2);

      dag.addOperator("random", randomWordGenerator);

      if (maxLength != null) {
        fsWriter.setMaxLength(maxLength);
      }

      fsWriter.setFilePath(testDir.getPath());
      dag.addOperator("fswriter", fsWriter);

      dag.addStream("fswriterstream", randomWordGenerator.output, fsWriter.input);
    }