org.apache.hadoop.tools.mapred
Class RetriableFileCopyCommand

java.lang.Object
  extended by org.apache.hadoop.tools.util.RetriableCommand
      extended by org.apache.hadoop.tools.mapred.RetriableFileCopyCommand

public class RetriableFileCopyCommand
extends RetriableCommand

This class extends RetriableCommand to implement the copy of files, with retries on failure.


Nested Class Summary
static class RetriableFileCopyCommand.CopyReadException
          Special subclass of IOException.
 
Field Summary
 
Fields inherited from class org.apache.hadoop.tools.util.RetriableCommand
description
 
Constructor Summary
RetriableFileCopyCommand(boolean skipCrc, String description, org.apache.hadoop.tools.mapred.CopyMapper.FileAction action)
          Create a RetriableFileCopyCommand.
RetriableFileCopyCommand(String description, org.apache.hadoop.tools.mapred.CopyMapper.FileAction action)
          Constructor, taking a description of the action.
 
Method Summary
protected  Object doExecute(Object... arguments)
          Implementation of RetriableCommand::doExecute().
 
Methods inherited from class org.apache.hadoop.tools.util.RetriableCommand
execute, setRetryPolicy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetriableFileCopyCommand

public RetriableFileCopyCommand(String description,
                                org.apache.hadoop.tools.mapred.CopyMapper.FileAction action)
Constructor, taking a description of the action.

Parameters:
description - Verbose description of the copy operation.

RetriableFileCopyCommand

public RetriableFileCopyCommand(boolean skipCrc,
                                String description,
                                org.apache.hadoop.tools.mapred.CopyMapper.FileAction action)
Create a RetriableFileCopyCommand.

Parameters:
skipCrc - Whether to skip the crc check.
description - A verbose description of the copy operation.
action - We should overwrite the target file or append new data to it.
Method Detail

doExecute

protected Object doExecute(Object... arguments)
                    throws Exception
Implementation of RetriableCommand::doExecute(). This is the actual copy-implementation.

Specified by:
doExecute in class RetriableCommand
Parameters:
arguments - Argument-list to the command.
Returns:
Number of bytes copied.
Throws:
Exception: - CopyReadException, if there are read-failures. All other failures are IOExceptions.
Exception - Throws Exception on complete failure.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.