Project Crunch has retired. For details please refer to its Attic page.
Target.WriteMode (Apache Crunch 0.10.0 API)

org.apache.crunch
Enum Target.WriteMode

java.lang.Object
  extended by java.lang.Enum<Target.WriteMode>
      extended by org.apache.crunch.Target.WriteMode
All Implemented Interfaces:
Serializable, Comparable<Target.WriteMode>
Enclosing interface:
Target

public static enum Target.WriteMode
extends Enum<Target.WriteMode>

An enum to represent different options the client may specify for handling the case where the output path, table, etc. referenced by a Target already exists.


Enum Constant Summary
APPEND
          If the output target does not exist, create it.
CHECKPOINT
          If the output target exists and is newer than any of its source inputs, don't rewrite it, just start the pipeline from here.
DEFAULT
          Check to see if the output target already exists before running the pipeline, and if it does, print an error and throw an exception.
OVERWRITE
          Check to see if the output target already exists, and if it does, delete it and overwrite it with the new output (if any).
 
Method Summary
static Target.WriteMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Target.WriteMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DEFAULT

public static final Target.WriteMode DEFAULT
Check to see if the output target already exists before running the pipeline, and if it does, print an error and throw an exception.


OVERWRITE

public static final Target.WriteMode OVERWRITE
Check to see if the output target already exists, and if it does, delete it and overwrite it with the new output (if any).


APPEND

public static final Target.WriteMode APPEND
If the output target does not exist, create it. If it does exist, add the output of this pipeline to the target. This was the behavior in Crunch up to version 0.4.0.


CHECKPOINT

public static final Target.WriteMode CHECKPOINT
If the output target exists and is newer than any of its source inputs, don't rewrite it, just start the pipeline from here. Only works with SourceTarget instances.

Method Detail

values

public static Target.WriteMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Target.WriteMode c : Target.WriteMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Target.WriteMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.