org.apache.pig.tools.pigstats
Class ScriptState

java.lang.Object
  extended by org.apache.pig.tools.pigstats.ScriptState
Direct Known Subclasses:
MRScriptState

public abstract class ScriptState
extends Object

ScriptStates encapsulates settings for a Pig script that runs on a hadoop cluster. These settings are added to all MR jobs spawned by the script and in turn are persisted in the hadoop job xml. With the properties already in the job xml, users who want to know the relations between the script and MR jobs can derive them from the job xmls.


Nested Class Summary
protected static class ScriptState.AliasVisitor
           
protected static class ScriptState.FeatureVisitor
           
static class ScriptState.PIG_FEATURE
          Features used in a Pig script
protected static class ScriptState.PIG_PROPERTY
          Keys of Pig settings added to Jobs
 
Field Summary
protected  String commandLine
           
protected  String fileName
           
protected  String hadoopVersion
           
protected  String id
           
protected  List<PigProgressNotificationListener> listeners
           
protected  PigContext pigContext
           
protected  String pigVersion
           
protected  String script
           
protected  long scriptFeatures
           
 
Constructor Summary
protected ScriptState(String id)
           
 
Method Summary
protected  long bitSetToLong(BitSet bs)
           
 void emitInitialPlanNotification(OperatorPlan<?> plan)
           
 void emitJobFailedNotification(JobStats jobStats)
           
 void emitjobFinishedNotification(JobStats jobStats)
           
 void emitJobsSubmittedNotification(int numJobsSubmitted)
           
 void emitJobStartedNotification(String assignedJobId)
           
 void emitLaunchCompletedNotification(int numJobsSucceeded)
           
 void emitLaunchStartedNotification(int numJobsToLaunch)
           
 void emitOutputCompletedNotification(OutputStats outputStats)
           
 void emitProgressUpdatedNotification(int progress)
           
protected  String featureLongToString(long l)
           
static ScriptState get()
           
 List<PigProgressNotificationListener> getAllListeners()
           
 String getCommandLine()
           
 String getFileName()
           
 String getHadoopVersion()
           
 String getId()
           
 PigContext getPigContext()
           
 String getPigVersion()
           
protected  String getScript()
           
 String getScriptFeatures()
           
 void registerListener(PigProgressNotificationListener listener)
           
 void setCommandLine(String commandLine)
           
 void setFileName(String fileName)
           
 void setPigContext(PigContext pigContext)
           
protected  void setScript(BufferedReader reader)
           
 void setScript(File file)
           
 void setScript(String script)
           
 void setScriptFeatures(LogicalPlan plan)
           
static ScriptState start(ScriptState state)
           
static ScriptState start(String commandLine, PigContext pigContext)
          Deprecated. use start(ScriptState) instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected String id

script

protected String script

commandLine

protected String commandLine

fileName

protected String fileName

pigVersion

protected String pigVersion

hadoopVersion

protected String hadoopVersion

scriptFeatures

protected long scriptFeatures

pigContext

protected PigContext pigContext

listeners

protected List<PigProgressNotificationListener> listeners
Constructor Detail

ScriptState

protected ScriptState(String id)
Method Detail

get

public static ScriptState get()

start

public static ScriptState start(ScriptState state)

start

@Deprecated
public static ScriptState start(String commandLine,
                                           PigContext pigContext)
Deprecated. use start(ScriptState) instead.


registerListener

public void registerListener(PigProgressNotificationListener listener)

getAllListeners

public List<PigProgressNotificationListener> getAllListeners()

emitInitialPlanNotification

public void emitInitialPlanNotification(OperatorPlan<?> plan)

emitLaunchStartedNotification

public void emitLaunchStartedNotification(int numJobsToLaunch)

emitJobsSubmittedNotification

public void emitJobsSubmittedNotification(int numJobsSubmitted)

emitJobStartedNotification

public void emitJobStartedNotification(String assignedJobId)

emitjobFinishedNotification

public void emitjobFinishedNotification(JobStats jobStats)

emitJobFailedNotification

public void emitJobFailedNotification(JobStats jobStats)

emitOutputCompletedNotification

public void emitOutputCompletedNotification(OutputStats outputStats)

emitProgressUpdatedNotification

public void emitProgressUpdatedNotification(int progress)

emitLaunchCompletedNotification

public void emitLaunchCompletedNotification(int numJobsSucceeded)

setScript

public void setScript(File file)

setScript

public void setScript(String script)

setScriptFeatures

public void setScriptFeatures(LogicalPlan plan)

getHadoopVersion

public String getHadoopVersion()

getPigVersion

public String getPigVersion()

getFileName

public String getFileName()

setFileName

public void setFileName(String fileName)

getId

public String getId()

setCommandLine

public void setCommandLine(String commandLine)

getCommandLine

public String getCommandLine()

getScript

protected String getScript()

setScript

protected void setScript(BufferedReader reader)

bitSetToLong

protected long bitSetToLong(BitSet bs)

featureLongToString

protected String featureLongToString(long l)

setPigContext

public void setPigContext(PigContext pigContext)

getPigContext

public PigContext getPigContext()

getScriptFeatures

public String getScriptFeatures()


Copyright © 2007-2012 The Apache Software Foundation