cascading.operation
Class Debug

java.lang.Object
  extended by cascading.operation.BaseOperation<Long>
      extended by cascading.operation.Debug
All Implemented Interfaces:
DeclaresResults, Filter<Long>, Operation<Long>, PlannedOperation<Long>, Traceable, Serializable

public class Debug
extends BaseOperation<Long>
implements Filter<Long>, PlannedOperation<Long>

Class Debug is a Filter that will never remove an item from a stream, but will print the Tuple to either stdout or stderr.

Currently, if printFields is true, they will print every 10 Tuples.

The frequency that fields and tuples are printed can be set via setPrintFieldsEvery(int) and setPrintTupleEvery(int) methods, respectively.

See Also:
Serialized Form

Nested Class Summary
static class Debug.Output
           
 
Field Summary
 
Fields inherited from class cascading.operation.BaseOperation
fieldDeclaration, numArgs, trace
 
Fields inherited from interface cascading.operation.Operation
ANY
 
Constructor Summary
Debug()
          Constructor Debug creates a new Debug instance that prints to stderr by default, and does not print the Tuple instance field names.
Debug(boolean printFields)
          Constructor Debug creates a new Debug instance that prints to stderr and will print the current Tuple instance field names if printFields is true.
Debug(Debug.Output output)
          Constructor Debug creates a new Debug instance that prints to the declared stream and does not print the Tuple field names.
Debug(Debug.Output output, boolean printFields)
          Constructor Debug creates a new Debug instance that prints to the declared stream and will print the Tuple instances field names if printFields is true.
Debug(Debug.Output output, String prefix)
          Constructor Debug creates a new Debug instance that prints to the declared stream and does not print the Tuple field names.
Debug(Debug.Output output, String prefix, boolean printFields)
          Constructor Debug creates a new Debug instance that prints to the declared stream and will print the Tuple instances field names if printFields is true.
Debug(String prefix)
          Constructor Debug creates a new Debug instance that prints to stderr by default, and does not print the Tuple instance field names.
Debug(String prefix, boolean printFields)
          Constructor Debug creates a new Debug instance that prints to stderr and will print the current Tuple instance field names if printFields is true.
 
Method Summary
 void cleanup(FlowProcess flowProcess, OperationCall<Long> longOperationCall)
          Method cleanup does nothing, and may safely be overridden.
 boolean equals(Object object)
           
 Debug.Output getOutput()
           
 String getPrefix()
           
 int getPrintFieldsEvery()
          Method getPrintFieldsEvery returns the printFieldsEvery interval value of this Debug object.
 int getPrintTupleEvery()
          Method getPrintTupleEvery returns the printTupleEvery interval value of this Debug object.
 int hashCode()
           
 boolean isPrintFields()
           
 boolean isRemove(FlowProcess flowProcess, FilterCall<Long> filterCall)
          Method isRemove returns true if input should be removed from the tuple stream.
 void prepare(FlowProcess flowProcess, OperationCall<Long> operationCall)
          Method prepare does nothing, and may safely be overridden.
 void setPrintFieldsEvery(int printFieldsEvery)
          Method setPrintFieldsEvery sets the printFieldsEvery interval value of this Debug object.
 void setPrintTupleEvery(int printTupleEvery)
          Method setPrintTupleEvery sets the printTupleEvery interval value of this Debug object.
 boolean supportsPlannerLevel(PlannerLevel plannerLevel)
           
 
Methods inherited from class cascading.operation.BaseOperation
flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cascading.operation.Operation
flush, getFieldDeclaration, getNumArgs, isSafe
 

Constructor Detail

Debug

public Debug()
Constructor Debug creates a new Debug instance that prints to stderr by default, and does not print the Tuple instance field names.


Debug

@ConstructorProperties(value="prefix")
public Debug(String prefix)
Constructor Debug creates a new Debug instance that prints to stderr by default, and does not print the Tuple instance field names.

Parameters:
prefix - of type String

Debug

@ConstructorProperties(value={"prefix","printFields"})
public Debug(String prefix,
                                        boolean printFields)
Constructor Debug creates a new Debug instance that prints to stderr and will print the current Tuple instance field names if printFields is true.

Parameters:
prefix - of type String
printFields - of type boolean

Debug

@ConstructorProperties(value="printFields")
public Debug(boolean printFields)
Constructor Debug creates a new Debug instance that prints to stderr and will print the current Tuple instance field names if printFields is true.

Parameters:
printFields - of type boolean

Debug

@ConstructorProperties(value="output")
public Debug(Debug.Output output)
Constructor Debug creates a new Debug instance that prints to the declared stream and does not print the Tuple field names.

Parameters:
output - of type Output

Debug

@ConstructorProperties(value={"output","prefix"})
public Debug(Debug.Output output,
                                        String prefix)
Constructor Debug creates a new Debug instance that prints to the declared stream and does not print the Tuple field names.

Parameters:
output - of type Output
prefix - of type String

Debug

@ConstructorProperties(value={"output","prefix","printFields"})
public Debug(Debug.Output output,
                                        String prefix,
                                        boolean printFields)
Constructor Debug creates a new Debug instance that prints to the declared stream and will print the Tuple instances field names if printFields is true.

Parameters:
output - of type Output
prefix - of type String
printFields - of type boolean

Debug

@ConstructorProperties(value={"output","printFields"})
public Debug(Debug.Output output,
                                        boolean printFields)
Constructor Debug creates a new Debug instance that prints to the declared stream and will print the Tuple instances field names if printFields is true.

Parameters:
output - of type Output
printFields - of type boolean
Method Detail

getOutput

public Debug.Output getOutput()

getPrefix

public String getPrefix()

isPrintFields

public boolean isPrintFields()

getPrintFieldsEvery

public int getPrintFieldsEvery()
Method getPrintFieldsEvery returns the printFieldsEvery interval value of this Debug object.

Returns:
the printFieldsEvery (type int) of this Debug object.

setPrintFieldsEvery

public void setPrintFieldsEvery(int printFieldsEvery)
Method setPrintFieldsEvery sets the printFieldsEvery interval value of this Debug object.

Parameters:
printFieldsEvery - the printFieldsEvery of this Debug object.

getPrintTupleEvery

public int getPrintTupleEvery()
Method getPrintTupleEvery returns the printTupleEvery interval value of this Debug object.

Returns:
the printTupleEvery (type int) of this Debug object.

setPrintTupleEvery

public void setPrintTupleEvery(int printTupleEvery)
Method setPrintTupleEvery sets the printTupleEvery interval value of this Debug object.

Parameters:
printTupleEvery - the printTupleEvery of this Debug object.

supportsPlannerLevel

public boolean supportsPlannerLevel(PlannerLevel plannerLevel)
Specified by:
supportsPlannerLevel in interface PlannedOperation<Long>

prepare

public void prepare(FlowProcess flowProcess,
                    OperationCall<Long> operationCall)
Description copied from class: BaseOperation
Method prepare does nothing, and may safely be overridden.

Specified by:
prepare in interface Operation<Long>
Overrides:
prepare in class BaseOperation<Long>

isRemove

public boolean isRemove(FlowProcess flowProcess,
                        FilterCall<Long> filterCall)
Description copied from interface: Filter
Method isRemove returns true if input should be removed from the tuple stream.

Specified by:
isRemove in interface Filter<Long>
Parameters:
flowProcess - of type FlowProcess
filterCall - of type FilterCall
Returns:
boolean
See Also:
Filter.isRemove(cascading.flow.FlowProcess, FilterCall)

cleanup

public void cleanup(FlowProcess flowProcess,
                    OperationCall<Long> longOperationCall)
Description copied from class: BaseOperation
Method cleanup does nothing, and may safely be overridden.

Specified by:
cleanup in interface Operation<Long>
Overrides:
cleanup in class BaseOperation<Long>

equals

public boolean equals(Object object)
Overrides:
equals in class BaseOperation<Long>

hashCode

public int hashCode()
Overrides:
hashCode in class BaseOperation<Long>


Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.