org.apache.pig.scripting
Class ScriptingOutputCapturer

java.lang.Object
  extended by org.apache.pig.scripting.ScriptingOutputCapturer

public class ScriptingOutputCapturer
extends Object

This class helps a scripting UDF capture user output by managing when to capture output and where the output is written to. For illustrate, we will only capture output for the last run (with the final set of data) and we need to keep track of the file containing that output for returning w/ the illustrate results. For runs, all standard output is written to the user logs.


Constructor Summary
ScriptingOutputCapturer(ExecType execType)
           
 
Method Summary
static String getRunId()
           
 String getStandardOutputRootWriteLocation()
           
 String getTaskLogDir(String jobId, String taskId)
           
static Map<String,String> getUdfOutput()
           
static boolean isClassCapturingOutput()
           
 boolean isInstanceCapturingOutput()
           
 void registerOutputLocation(String functionName, String fileName)
           
 void setInstanceCapturingOutput(boolean instanceCapturingOutput)
           
static void startCapturingOutput()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptingOutputCapturer

public ScriptingOutputCapturer(ExecType execType)
Method Detail

getStandardOutputRootWriteLocation

public String getStandardOutputRootWriteLocation()

getTaskLogDir

public String getTaskLogDir(String jobId,
                            String taskId)

startCapturingOutput

public static void startCapturingOutput()

getUdfOutput

public static Map<String,String> getUdfOutput()
                                       throws IOException
Throws:
IOException

registerOutputLocation

public void registerOutputLocation(String functionName,
                                   String fileName)

getRunId

public static String getRunId()

isClassCapturingOutput

public static boolean isClassCapturingOutput()

isInstanceCapturingOutput

public boolean isInstanceCapturingOutput()

setInstanceCapturingOutput

public void setInstanceCapturingOutput(boolean instanceCapturingOutput)


Copyright © 2007-2012 The Apache Software Foundation