Class VespaDocumentOperation


  • public class VespaDocumentOperation
    extends org.apache.pig.EvalFunc<java.lang.String>
    A Pig UDF to convert simple Pig types into a valid Vespa JSON document format.
    Author:
    lesters
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  VespaDocumentOperation.Operation  
      • Nested classes/interfaces inherited from class org.apache.pig.EvalFunc

        org.apache.pig.EvalFunc.SchemaType
    • Field Summary

      • Fields inherited from class org.apache.pig.EvalFunc

        log, pigLogger, reporter, returnType
    • Constructor Summary

      Constructors 
      Constructor Description
      VespaDocumentOperation​(java.lang.String... params)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String create​(VespaDocumentOperation.Operation op, java.lang.String docId, java.util.Map<java.lang.String,​java.lang.Object> fields, java.util.Properties properties)
      Create a JSON Vespa document operation given the supplied fields, operation and document id template.
      java.lang.String exec​(org.apache.pig.data.Tuple tuple)  
      • Methods inherited from class org.apache.pig.EvalFunc

        allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, outputSchema, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VespaDocumentOperation

        public VespaDocumentOperation​(java.lang.String... params)
    • Method Detail

      • exec

        public java.lang.String exec​(org.apache.pig.data.Tuple tuple)
                              throws java.io.IOException
        Specified by:
        exec in class org.apache.pig.EvalFunc<java.lang.String>
        Throws:
        java.io.IOException
      • create

        public static java.lang.String create​(VespaDocumentOperation.Operation op,
                                              java.lang.String docId,
                                              java.util.Map<java.lang.String,​java.lang.Object> fields,
                                              java.util.Properties properties)
                                       throws java.io.IOException
        Create a JSON Vespa document operation given the supplied fields, operation and document id template.
        Parameters:
        op - Operation (put, remove, update)
        docId - Document id
        fields - Fields to put in document operation
        Returns:
        A valid JSON Vespa document operation
        Throws:
        java.io.IOException - ...