org.apache.hadoop.yarn.server.applicationhistoryservice
Class FileSystemApplicationHistoryStore

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.yarn.server.applicationhistoryservice.FileSystemApplicationHistoryStore
All Implemented Interfaces:
Closeable, org.apache.hadoop.service.Service, ApplicationHistoryReader, ApplicationHistoryStore, ApplicationHistoryWriter

@InterfaceAudience.Public
@InterfaceStability.Unstable
public class FileSystemApplicationHistoryStore
extends org.apache.hadoop.service.AbstractService
implements ApplicationHistoryStore

File system implementation of ApplicationHistoryStore. In this implementation, one application will have just one file in the file system, which contains all the history data of one application, and its attempts and containers. applicationStarted(ApplicationStartData) is supposed to be invoked first when writing any history data of one application and it will open a file, while applicationFinished(ApplicationFinishData) is supposed to be last writing operation and will close the file.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE
 
Constructor Summary
FileSystemApplicationHistoryStore()
           
 
Method Summary
 void applicationAttemptFinished(ApplicationAttemptFinishData appAttemptFinish)
          This method writes the information of RMAppAttempt that is available when it finishes.
 void applicationAttemptStarted(ApplicationAttemptStartData appAttemptStart)
          This method writes the information of RMAppAttempt that is available when it starts.
 void applicationFinished(ApplicationFinishData appFinish)
          This method writes the information of RMApp that is available when it finishes.
 void applicationStarted(ApplicationStartData appStart)
          This method writes the information of RMApp that is available when it starts.
 void containerFinished(ContainerFinishData containerFinish)
          This method writes the information of RMContainer that is available when it finishes.
 void containerStarted(ContainerStartData containerStart)
          This method writes the information of RMContainer that is available when it starts.
 Map<org.apache.hadoop.yarn.api.records.ApplicationId,ApplicationHistoryData> getAllApplications()
          This method returns all Application ApplicationHistoryDatas
 ContainerHistoryData getAMContainer(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
          This method returns ContainerHistoryData for specified ApplicationAttemptId.
 ApplicationHistoryData getApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId)
          This method returns Application ApplicationHistoryData for the specified ApplicationId.
 ApplicationAttemptHistoryData getApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
          This method returns ApplicationAttemptHistoryData for specified ApplicationId.
 Map<org.apache.hadoop.yarn.api.records.ApplicationAttemptId,ApplicationAttemptHistoryData> getApplicationAttempts(org.apache.hadoop.yarn.api.records.ApplicationId appId)
          Application can have multiple application attempts ApplicationAttemptHistoryData.
 ContainerHistoryData getContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
          This method returns ContainerHistoryData for specified ContainerId.
 Map<org.apache.hadoop.yarn.api.records.ContainerId,ContainerHistoryData> getContainers(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
          This method returns MapContainerId to ContainerHistoryData for specified ApplicationAttemptId.
protected  org.apache.hadoop.fs.FileSystem getFileSystem(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf)
           
 void serviceStart()
           
 void serviceStop()
           
 
Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.service.Service
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, registerServiceListener, start, stop, unregisterServiceListener, waitForServiceToStop
 

Constructor Detail

FileSystemApplicationHistoryStore

public FileSystemApplicationHistoryStore()
Method Detail

getFileSystem

protected org.apache.hadoop.fs.FileSystem getFileSystem(org.apache.hadoop.fs.Path path,
                                                        org.apache.hadoop.conf.Configuration conf)
                                                 throws Exception
Throws:
Exception

serviceStart

public void serviceStart()
                  throws Exception
Overrides:
serviceStart in class org.apache.hadoop.service.AbstractService
Throws:
Exception

serviceStop

public void serviceStop()
                 throws Exception
Overrides:
serviceStop in class org.apache.hadoop.service.AbstractService
Throws:
Exception

getApplication

public ApplicationHistoryData getApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId)
                                      throws IOException
Description copied from interface: ApplicationHistoryReader
This method returns Application ApplicationHistoryData for the specified ApplicationId.

Specified by:
getApplication in interface ApplicationHistoryReader
Returns:
ApplicationHistoryData for the ApplicationId.
Throws:
IOException

getAllApplications

public Map<org.apache.hadoop.yarn.api.records.ApplicationId,ApplicationHistoryData> getAllApplications()
                                                                                                throws IOException
Description copied from interface: ApplicationHistoryReader
This method returns all Application ApplicationHistoryDatas

Specified by:
getAllApplications in interface ApplicationHistoryReader
Returns:
map of ApplicationId to ApplicationHistoryDatas.
Throws:
IOException

getApplicationAttempts

public Map<org.apache.hadoop.yarn.api.records.ApplicationAttemptId,ApplicationAttemptHistoryData> getApplicationAttempts(org.apache.hadoop.yarn.api.records.ApplicationId appId)
                                                                                                                  throws IOException
Description copied from interface: ApplicationHistoryReader
Application can have multiple application attempts ApplicationAttemptHistoryData. This method returns the all ApplicationAttemptHistoryDatas for the Application.

Specified by:
getApplicationAttempts in interface ApplicationHistoryReader
Returns:
all ApplicationAttemptHistoryDatas for the Application.
Throws:
IOException

getApplicationAttempt

public ApplicationAttemptHistoryData getApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
                                                    throws IOException
Description copied from interface: ApplicationHistoryReader
This method returns ApplicationAttemptHistoryData for specified ApplicationId.

Specified by:
getApplicationAttempt in interface ApplicationHistoryReader
Parameters:
appAttemptId - ApplicationAttemptId
Returns:
ApplicationAttemptHistoryData for ApplicationAttemptId
Throws:
IOException

getContainer

public ContainerHistoryData getContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
                                  throws IOException
Description copied from interface: ApplicationHistoryReader
This method returns ContainerHistoryData for specified ContainerId.

Specified by:
getContainer in interface ApplicationHistoryReader
Parameters:
containerId - ContainerId
Returns:
ContainerHistoryData for ContainerId
Throws:
IOException

getAMContainer

public ContainerHistoryData getAMContainer(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
                                    throws IOException
Description copied from interface: ApplicationHistoryReader
This method returns ContainerHistoryData for specified ApplicationAttemptId.

Specified by:
getAMContainer in interface ApplicationHistoryReader
Parameters:
appAttemptId - ApplicationAttemptId
Returns:
ContainerHistoryData for ApplicationAttemptId
Throws:
IOException

getContainers

public Map<org.apache.hadoop.yarn.api.records.ContainerId,ContainerHistoryData> getContainers(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
                                                                                       throws IOException
Description copied from interface: ApplicationHistoryReader
This method returns MapContainerId to ContainerHistoryData for specified ApplicationAttemptId.

Specified by:
getContainers in interface ApplicationHistoryReader
Parameters:
appAttemptId - ApplicationAttemptId
Returns:
MapContainerId to ContainerHistoryData for ApplicationAttemptId
Throws:
IOException

applicationStarted

public void applicationStarted(ApplicationStartData appStart)
                        throws IOException
Description copied from interface: ApplicationHistoryWriter
This method writes the information of RMApp that is available when it starts.

Specified by:
applicationStarted in interface ApplicationHistoryWriter
Parameters:
appStart - the record of the information of RMApp that is available when it starts
Throws:
IOException

applicationFinished

public void applicationFinished(ApplicationFinishData appFinish)
                         throws IOException
Description copied from interface: ApplicationHistoryWriter
This method writes the information of RMApp that is available when it finishes.

Specified by:
applicationFinished in interface ApplicationHistoryWriter
Parameters:
appFinish - the record of the information of RMApp that is available when it finishes
Throws:
IOException

applicationAttemptStarted

public void applicationAttemptStarted(ApplicationAttemptStartData appAttemptStart)
                               throws IOException
Description copied from interface: ApplicationHistoryWriter
This method writes the information of RMAppAttempt that is available when it starts.

Specified by:
applicationAttemptStarted in interface ApplicationHistoryWriter
Parameters:
appAttemptStart - the record of the information of RMAppAttempt that is available when it starts
Throws:
IOException

applicationAttemptFinished

public void applicationAttemptFinished(ApplicationAttemptFinishData appAttemptFinish)
                                throws IOException
Description copied from interface: ApplicationHistoryWriter
This method writes the information of RMAppAttempt that is available when it finishes.

Specified by:
applicationAttemptFinished in interface ApplicationHistoryWriter
Parameters:
appAttemptFinish - the record of the information of RMAppAttempt that is available when it finishes
Throws:
IOException

containerStarted

public void containerStarted(ContainerStartData containerStart)
                      throws IOException
Description copied from interface: ApplicationHistoryWriter
This method writes the information of RMContainer that is available when it starts.

Specified by:
containerStarted in interface ApplicationHistoryWriter
Parameters:
containerStart - the record of the information of RMContainer that is available when it starts
Throws:
IOException

containerFinished

public void containerFinished(ContainerFinishData containerFinish)
                       throws IOException
Description copied from interface: ApplicationHistoryWriter
This method writes the information of RMContainer that is available when it finishes.

Specified by:
containerFinished in interface ApplicationHistoryWriter
Parameters:
containerFinish - the record of the information of RMContainer that is available when it finishes
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.