This project has retired. For details please refer to its Attic page.
AvroDeepCopier (Apache Crunch 0.4.0-incubating API)

org.apache.crunch.types.avro
Class AvroDeepCopier<T>

java.lang.Object
  extended by org.apache.crunch.types.avro.AvroDeepCopier<T>
All Implemented Interfaces:
Serializable, DeepCopier<T>
Direct Known Subclasses:
AvroDeepCopier.AvroGenericDeepCopier, AvroDeepCopier.AvroReflectDeepCopier, AvroDeepCopier.AvroSpecificDeepCopier

public abstract class AvroDeepCopier<T>
extends Object
implements DeepCopier<T>, Serializable

Performs deep copies of Avro-serializable objects.

Warning: Methods in this class are not thread-safe. This shouldn't be a problem when running in a map-reduce context where each mapper/reducer is running in its own JVM, but it may well be a problem in any other kind of multi-threaded context.

See Also:
Serialized Form

Nested Class Summary
static class AvroDeepCopier.AvroGenericDeepCopier
          Deep copier for Avro generic data objects.
static class AvroDeepCopier.AvroReflectDeepCopier<T>
          Deep copier for Avro reflect data objects.
static class AvroDeepCopier.AvroSpecificDeepCopier<T>
          Deep copier for Avro specific data objects.
 
Nested classes/interfaces inherited from interface org.apache.crunch.types.DeepCopier
DeepCopier.NoOpDeepCopier<V>
 
Constructor Summary
AvroDeepCopier(org.apache.avro.Schema schema)
           
 
Method Summary
 T deepCopy(T source)
          Create a deep copy of an Avro value.
 void initialize(org.apache.hadoop.conf.Configuration conf)
          Initialize the deep copier with a job-specific configuration
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvroDeepCopier

public AvroDeepCopier(org.apache.avro.Schema schema)
Method Detail

initialize

public void initialize(org.apache.hadoop.conf.Configuration conf)
Description copied from interface: DeepCopier
Initialize the deep copier with a job-specific configuration

Specified by:
initialize in interface DeepCopier<T>
Parameters:
conf - Job-specific configuration

deepCopy

public T deepCopy(T source)
Create a deep copy of an Avro value.

Specified by:
deepCopy in interface DeepCopier<T>
Parameters:
source - The value to be copied
Returns:
The deep copy of the value


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