public abstract class PigStatsUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FS_COUNTER_GROUP |
static java.lang.String |
HDFS_BYTES_READ |
static java.lang.String |
HDFS_BYTES_WRITTEN |
static java.lang.String |
MAP_INPUT_RECORDS |
static java.lang.String |
MAP_OUTPUT_RECORDS |
static java.lang.String |
MULTI_INPUTS_COUNTER_GROUP |
static java.lang.String |
MULTI_INPUTS_RECORD_COUNTER |
static java.lang.String |
MULTI_STORE_COUNTER_GROUP |
static java.lang.String |
MULTI_STORE_RECORD_COUNTER |
static java.lang.String |
REDUCE_INPUT_RECORDS |
static java.lang.String |
REDUCE_OUTPUT_RECORDS |
static java.lang.String |
TASK_COUNTER_GROUP |
Constructor and Description |
---|
PigStatsUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
accumulateStats(org.apache.hadoop.mapred.jobcontrol.JobControl jc)
Updates the statistics after a patch of jobs is done
|
static JobStats |
addJobStats(org.apache.hadoop.mapred.jobcontrol.Job job)
Add stats for a new Job, which doesn't yet need to be completed.
|
static JobStats |
addNativeJobStats(PigStats ps,
NativeMapReduceOper mr,
boolean success) |
static JobStats |
addNativeJobStats(PigStats ps,
NativeMapReduceOper mr,
boolean success,
java.lang.Exception e) |
static void |
displayStatistics()
Logs the statistics in the Pig log file at INFO level
|
static PigStats |
getEmptyPigStats()
Returns an empty PigStats object
|
static java.lang.String |
getMultiInputsCounterName(java.lang.String fname,
int index)
Returns the counter name for the given input file name
|
static long |
getMultiStoreCount(org.apache.hadoop.mapred.jobcontrol.Job job,
org.apache.hadoop.mapred.JobClient jobClient,
java.lang.String counterName)
Returns the count for the given counter name in the counter group
'MultiStoreCounters'
|
static java.lang.String |
getMultiStoreCounterName(POStore store)
Returns the counter name for the given
POStore |
static PigStats |
getPigStats(int code)
Returns the PigStats with the given return code
|
static boolean |
isTempFile(java.lang.String fileName) |
static void |
setBackendException(org.apache.hadoop.mapred.jobcontrol.Job job,
java.lang.Exception e) |
static void |
setErrorCode(int code) |
static void |
setErrorMessage(java.lang.String msg) |
static void |
setErrorThrowable(java.lang.Throwable t) |
static void |
setStatsMap(java.util.Map<java.lang.String,java.util.List<PigStats>> statsMap) |
static void |
startCollection(PigContext pc,
org.apache.hadoop.mapred.JobClient client,
JobControlCompiler jcc,
MROperPlan plan)
Starts collecting statistics for the given MR plan
|
static void |
stopCollection(boolean display)
Stops collecting statistics for a MR plan
|
static void |
updateJobMroMap(java.util.Map<org.apache.hadoop.mapred.jobcontrol.Job,MapReduceOper> jobMroMap)
Updates the
PigStats.JobGraph of the PigStats . |
public static final java.lang.String MULTI_STORE_RECORD_COUNTER
public static final java.lang.String MULTI_STORE_COUNTER_GROUP
public static final java.lang.String TASK_COUNTER_GROUP
public static final java.lang.String FS_COUNTER_GROUP
public static final java.lang.String MAP_INPUT_RECORDS
public static final java.lang.String MAP_OUTPUT_RECORDS
public static final java.lang.String REDUCE_INPUT_RECORDS
public static final java.lang.String REDUCE_OUTPUT_RECORDS
public static final java.lang.String HDFS_BYTES_WRITTEN
public static final java.lang.String HDFS_BYTES_READ
public static final java.lang.String MULTI_INPUTS_RECORD_COUNTER
public static final java.lang.String MULTI_INPUTS_COUNTER_GROUP
public static long getMultiStoreCount(org.apache.hadoop.mapred.jobcontrol.Job job, org.apache.hadoop.mapred.JobClient jobClient, java.lang.String counterName)
job
- the MR jobjobClient
- the Hadoop job clientcounterName
- the counter namepublic static java.lang.String getMultiStoreCounterName(POStore store)
POStore
store
- the POStorepublic static java.lang.String getMultiInputsCounterName(java.lang.String fname, int index)
fname
- the input file namepublic static void startCollection(PigContext pc, org.apache.hadoop.mapred.JobClient client, JobControlCompiler jcc, MROperPlan plan)
pc
- the Pig contextclient
- the Hadoop job clientjcc
- the job compilerplan
- the MR planpublic static void stopCollection(boolean display)
display
- if true, log collected statistics in the Pig log
file at INFO levelpublic static JobStats addJobStats(org.apache.hadoop.mapred.jobcontrol.Job job)
job
- the job being runpublic static PigStats getEmptyPigStats()
public static PigStats getPigStats(int code)
code
- the return codepublic static void displayStatistics()
public static void updateJobMroMap(java.util.Map<org.apache.hadoop.mapred.jobcontrol.Job,MapReduceOper> jobMroMap)
PigStats.JobGraph
of the PigStats
. The initial
PigStats.JobGraph
is created without job ids using MROperPlan
,
before any job is submitted for execution. The PigStats.JobGraph
then
is updated with job ids after jobs are executed.jobMroMap
- the map that maps Job
s to MapReduceOper
spublic static void accumulateStats(org.apache.hadoop.mapred.jobcontrol.JobControl jc)
jc
- the job controlpublic static void setErrorMessage(java.lang.String msg)
public static void setErrorCode(int code)
public static void setErrorThrowable(java.lang.Throwable t)
public static void setBackendException(org.apache.hadoop.mapred.jobcontrol.Job job, java.lang.Exception e)
public static boolean isTempFile(java.lang.String fileName)
public static JobStats addNativeJobStats(PigStats ps, NativeMapReduceOper mr, boolean success)
public static void setStatsMap(java.util.Map<java.lang.String,java.util.List<PigStats>> statsMap)
public static JobStats addNativeJobStats(PigStats ps, NativeMapReduceOper mr, boolean success, java.lang.Exception e)
Copyright © 2007-2012 The Apache Software Foundation