Package com.yahoo.vespa.hadoop.pig
Class VespaStorage
- java.lang.Object
-
- org.apache.pig.StoreFunc
-
- com.yahoo.vespa.hadoop.pig.VespaStorage
-
- All Implemented Interfaces:
org.apache.pig.StoreFuncInterface
public class VespaStorage extends org.apache.pig.StoreFunc
A small Pig UDF wrapper around the Vespa http client for feeding data into a Vespa endpoint.- Author:
- lesters
-
-
Constructor Summary
Constructors Constructor Description VespaStorage()
VespaStorage(String... params)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends Serializable>
Tbase64Deserialize(String s)
static String
base64Serialize(Object o)
void
checkSchema(org.apache.pig.ResourceSchema resourceSchema)
void
cleanupOnFailure(String s, org.apache.hadoop.mapreduce.Job job)
void
cleanupOnSuccess(String s, org.apache.hadoop.mapreduce.Job job)
org.apache.hadoop.mapreduce.OutputFormat
getOutputFormat()
void
prepareToWrite(org.apache.hadoop.mapreduce.RecordWriter recordWriter)
void
putNext(org.apache.pig.data.Tuple tuple)
String
relToAbsPathForStoreLocation(String endpoint, org.apache.hadoop.fs.Path path)
void
setStoreFuncUDFContextSignature(String s)
void
setStoreLocation(String endpoint, org.apache.hadoop.mapreduce.Job job)
-
-
-
Constructor Detail
-
VespaStorage
public VespaStorage()
-
VespaStorage
public VespaStorage(String... params)
-
-
Method Detail
-
getOutputFormat
public org.apache.hadoop.mapreduce.OutputFormat getOutputFormat() throws IOException
- Specified by:
getOutputFormat
in interfaceorg.apache.pig.StoreFuncInterface
- Specified by:
getOutputFormat
in classorg.apache.pig.StoreFunc
- Throws:
IOException
-
setStoreLocation
public void setStoreLocation(String endpoint, org.apache.hadoop.mapreduce.Job job) throws IOException
- Specified by:
setStoreLocation
in interfaceorg.apache.pig.StoreFuncInterface
- Specified by:
setStoreLocation
in classorg.apache.pig.StoreFunc
- Throws:
IOException
-
prepareToWrite
public void prepareToWrite(org.apache.hadoop.mapreduce.RecordWriter recordWriter) throws IOException
- Specified by:
prepareToWrite
in interfaceorg.apache.pig.StoreFuncInterface
- Specified by:
prepareToWrite
in classorg.apache.pig.StoreFunc
- Throws:
IOException
-
putNext
public void putNext(org.apache.pig.data.Tuple tuple) throws IOException
- Specified by:
putNext
in interfaceorg.apache.pig.StoreFuncInterface
- Specified by:
putNext
in classorg.apache.pig.StoreFunc
- Throws:
IOException
-
checkSchema
public void checkSchema(org.apache.pig.ResourceSchema resourceSchema) throws IOException
- Specified by:
checkSchema
in interfaceorg.apache.pig.StoreFuncInterface
- Overrides:
checkSchema
in classorg.apache.pig.StoreFunc
- Throws:
IOException
-
relToAbsPathForStoreLocation
public String relToAbsPathForStoreLocation(String endpoint, org.apache.hadoop.fs.Path path) throws IOException
- Specified by:
relToAbsPathForStoreLocation
in interfaceorg.apache.pig.StoreFuncInterface
- Overrides:
relToAbsPathForStoreLocation
in classorg.apache.pig.StoreFunc
- Throws:
IOException
-
setStoreFuncUDFContextSignature
public void setStoreFuncUDFContextSignature(String s)
- Specified by:
setStoreFuncUDFContextSignature
in interfaceorg.apache.pig.StoreFuncInterface
- Overrides:
setStoreFuncUDFContextSignature
in classorg.apache.pig.StoreFunc
-
cleanupOnFailure
public void cleanupOnFailure(String s, org.apache.hadoop.mapreduce.Job job) throws IOException
- Specified by:
cleanupOnFailure
in interfaceorg.apache.pig.StoreFuncInterface
- Overrides:
cleanupOnFailure
in classorg.apache.pig.StoreFunc
- Throws:
IOException
-
cleanupOnSuccess
public void cleanupOnSuccess(String s, org.apache.hadoop.mapreduce.Job job) throws IOException
- Specified by:
cleanupOnSuccess
in interfaceorg.apache.pig.StoreFuncInterface
- Overrides:
cleanupOnSuccess
in classorg.apache.pig.StoreFunc
- Throws:
IOException
-
base64Serialize
public static String base64Serialize(Object o) throws IOException
- Throws:
IOException
-
base64Deserialize
public static <T extends Serializable> T base64Deserialize(String s) throws IOException
- Throws:
IOException
-
-