org.apache.pig.tools.pigstats
Class PigStats

java.lang.Object
  extended by org.apache.pig.tools.pigstats.PigStats

@InterfaceAudience.Public
@InterfaceStability.Evolving
public final class PigStats
extends Object

PigStats encapsulates the statistics collected from a running script. It includes status of the execution, the DAG of its MR jobs, as well as information about outputs and inputs of the script.


Nested Class Summary
static class PigStats.JobGraph
          JobGraph is an OperatorPlan whose members are JobStats
 
Method Summary
 JobStats addJobStatsForNative(NativeMapReduceOper mr)
           
static PigStats get()
           
 long getBytesWritten()
          Returns the total bytes written to user specified HDFS locations of this script.
 long getDuration()
           
 int getErrorCode()
          Returns the error code of PigException
 String getErrorMessage()
           
 String getFeatures()
           
 String getHadoopVersion()
           
 List<InputStats> getInputStats()
           
 PigStats.JobGraph getJobGraph()
          Returns the DAG of the MR jobs spawned by the script
 long getNumberBytes(String location)
          Returns the number of bytes for the given output location, -1 for invalid location or name.
 int getNumberJobs()
          Returns the number of MR jobs for this script
 long getNumberRecords(String location)
          Returns the number of records for the given output location, -1 for invalid location or name.
 String getOutputAlias(String location)
          Returns the alias associated with this output location
 List<String> getOutputLocations()
          Returns the list of output locations in the script
 List<String> getOutputNames()
          Returns the list of output names in the script
 List<OutputStats> getOutputStats()
           
 Properties getPigProperties()
          Returns the properties associated with the script
 String getPigVersion()
           
 long getProactiveSpillCountObjects()
          Returns the total number of bags that spilled proactively
 long getProactiveSpillCountRecords()
          Returns the total number of records that spilled proactively
 long getRecordWritten()
          Returns the total number of records in user specified output locations of this script.
 int getReturnCode()
          Return codes are defined in PigRunner.ReturnCode
 String getScriptId()
           
 long getSMMSpillCount()
          Returns the total spill counts from SpillableMemoryManager.
 boolean isSuccessful()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static PigStats get()

isSuccessful

public boolean isSuccessful()

getReturnCode

public int getReturnCode()
Return codes are defined in PigRunner.ReturnCode


getErrorMessage

public String getErrorMessage()

getErrorCode

public int getErrorCode()
Returns the error code of PigException


getPigProperties

public Properties getPigProperties()
Returns the properties associated with the script


getJobGraph

public PigStats.JobGraph getJobGraph()
Returns the DAG of the MR jobs spawned by the script


getOutputLocations

public List<String> getOutputLocations()
Returns the list of output locations in the script


getOutputNames

public List<String> getOutputNames()
Returns the list of output names in the script


getNumberBytes

public long getNumberBytes(String location)
Returns the number of bytes for the given output location, -1 for invalid location or name.


getNumberRecords

public long getNumberRecords(String location)
Returns the number of records for the given output location, -1 for invalid location or name.


getOutputAlias

public String getOutputAlias(String location)
Returns the alias associated with this output location


getSMMSpillCount

public long getSMMSpillCount()
Returns the total spill counts from SpillableMemoryManager.


getProactiveSpillCountObjects

public long getProactiveSpillCountObjects()
Returns the total number of bags that spilled proactively


getProactiveSpillCountRecords

public long getProactiveSpillCountRecords()
Returns the total number of records that spilled proactively


getBytesWritten

public long getBytesWritten()
Returns the total bytes written to user specified HDFS locations of this script.


getRecordWritten

public long getRecordWritten()
Returns the total number of records in user specified output locations of this script.


getHadoopVersion

public String getHadoopVersion()

getPigVersion

public String getPigVersion()

getScriptId

public String getScriptId()

getFeatures

public String getFeatures()

getDuration

public long getDuration()

getNumberJobs

public int getNumberJobs()
Returns the number of MR jobs for this script


getOutputStats

public List<OutputStats> getOutputStats()

getInputStats

public List<InputStats> getInputStats()

addJobStatsForNative

public JobStats addJobStatsForNative(NativeMapReduceOper mr)


Copyright © ${year} The Apache Software Foundation