org.apache.pig
Class StoreFuncMetadataWrapper

java.lang.Object
  extended by org.apache.pig.StoreFuncWrapper
      extended by org.apache.pig.StoreFuncMetadataWrapper
All Implemented Interfaces:
StoreFuncInterface, StoreMetadata

public class StoreFuncMetadataWrapper
extends StoreFuncWrapper
implements StoreMetadata

Convenience class to extend when decorating a class that implements both StoreFunc and StoreMetadata. It's not abstract so that it will fail to compile if new methods get added to either interface.


Constructor Summary
protected StoreFuncMetadataWrapper()
           
 
Method Summary
protected  void setStoreFunc(StoreMetadata storeFunc)
          The wrapped StoreMetadata object must be set before method calls are made on this object.
 void storeSchema(ResourceSchema resourceSchema, String location, org.apache.hadoop.mapreduce.Job job)
          Store schema of the data being written
 void storeStatistics(ResourceStatistics resourceStatistics, String location, org.apache.hadoop.mapreduce.Job job)
          Store statistics about the data being written.
 
Methods inherited from class org.apache.pig.StoreFuncWrapper
checkSchema, cleanupOnFailure, cleanupOnSuccess, getMethodName, getOutputFormat, prepareToWrite, putNext, relToAbsPathForStoreLocation, setStoreFunc, setStoreFuncUDFContextSignature, setStoreLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoreFuncMetadataWrapper

protected StoreFuncMetadataWrapper()
Method Detail

setStoreFunc

protected void setStoreFunc(StoreMetadata storeFunc)
The wrapped StoreMetadata object must be set before method calls are made on this object. Typically, this is done with via constructor, but often times the wrapped object can not be properly initialized until later in the lifecycle of the wrapper object.

Parameters:
storeFunc -

storeStatistics

public void storeStatistics(ResourceStatistics resourceStatistics,
                            String location,
                            org.apache.hadoop.mapreduce.Job job)
                     throws IOException
Description copied from interface: StoreMetadata
Store statistics about the data being written.

Specified by:
storeStatistics in interface StoreMetadata
Parameters:
resourceStatistics - statistics to be recorded
location - Location as returned by LoadFunc.relativeToAbsolutePath(String, org.apache.hadoop.fs.Path)
job - The Job object - this should be used only to obtain cluster properties through JobContext.getConfiguration() and not to set/query any runtime job information.
Throws:
IOException

storeSchema

public void storeSchema(ResourceSchema resourceSchema,
                        String location,
                        org.apache.hadoop.mapreduce.Job job)
                 throws IOException
Description copied from interface: StoreMetadata
Store schema of the data being written

Specified by:
storeSchema in interface StoreMetadata
Parameters:
resourceSchema - Schema to be recorded
location - Location as returned by LoadFunc.relativeToAbsolutePath(String, org.apache.hadoop.fs.Path)
job - The Job object - this should be used only to obtain cluster properties through JobContext.getConfiguration() and not to set/query any runtime job information.
Throws:
IOException


Copyright © 2007-2012 The Apache Software Foundation