org.duracloud.services.amazonmapreduce
Class BaseAmazonMapReduceJobWorker

java.lang.Object
  extended by org.duracloud.services.amazonmapreduce.BaseAmazonMapReduceJobWorker
All Implemented Interfaces:
java.lang.Runnable, AmazonMapReduceJobWorker
Direct Known Subclasses:
AmazonFixityJobWorker, HadoopJobWorker, ReplicationOnDemandJobWorker

public abstract class BaseAmazonMapReduceJobWorker
extends java.lang.Object
implements AmazonMapReduceJobWorker

This class manages starting a hadoop job that relies on a jar being installed within the storageprovider environment.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.duracloud.services.amazonmapreduce.AmazonMapReduceJobWorker
AmazonMapReduceJobWorker.JobStatus
 
Constructor Summary
BaseAmazonMapReduceJobWorker(ContentStore contentStore, java.lang.String workSpaceId, java.util.Map<java.lang.String,java.lang.String> taskParams, java.lang.String serviceWorkDir)
           
 
Method Summary
 java.lang.String getError()
          This method returns any errors associated with the current running job.
 java.util.Map<java.lang.String,java.lang.String> getJobDetailsMap()
          This method queries the hadoop framework and returns a listing of details related to the currently running job.
 java.lang.String getJobId()
          This method returns the jobId of the current job.
 AmazonMapReduceJobWorker.JobStatus getJobStatus()
          This method returns the current job state.
protected abstract  java.util.Map<java.lang.String,java.lang.String> getParamToResourceFileMap()
          This abstract method creates and returns a map of filenames that should be found in the service package, and their associated HadoopTypes.TASK_PARAM.name().
 void run()
           
 void shutdown()
          This methods terminates the processing of this job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseAmazonMapReduceJobWorker

public BaseAmazonMapReduceJobWorker(ContentStore contentStore,
                                    java.lang.String workSpaceId,
                                    java.util.Map<java.lang.String,java.lang.String> taskParams,
                                    java.lang.String serviceWorkDir)
Method Detail

getParamToResourceFileMap

protected abstract java.util.Map<java.lang.String,java.lang.String> getParamToResourceFileMap()
This abstract method creates and returns a map of filenames that should be found in the service package, and their associated HadoopTypes.TASK_PARAM.name().

Note: jars used by the hadoop framework must have the extension = .hjar so that the services-osgi-framework does not try to deploy the hadoop jar as a service. While copying the .hjar over to the storageprovider, the extension is then corrected to .jar .

Returns:
map of resource filename => task param name

run

public void run()
Specified by:
run in interface java.lang.Runnable

getJobStatus

public AmazonMapReduceJobWorker.JobStatus getJobStatus()
Description copied from interface: AmazonMapReduceJobWorker
This method returns the current job state.

Specified by:
getJobStatus in interface AmazonMapReduceJobWorker
Returns:
jobStatus

getJobId

public java.lang.String getJobId()
Description copied from interface: AmazonMapReduceJobWorker
This method returns the jobId of the current job.

Specified by:
getJobId in interface AmazonMapReduceJobWorker
Returns:
jobId

getError

public java.lang.String getError()
Description copied from interface: AmazonMapReduceJobWorker
This method returns any errors associated with the current running job.

Specified by:
getError in interface AmazonMapReduceJobWorker
Returns:
error text

shutdown

public void shutdown()
Description copied from interface: AmazonMapReduceJobWorker
This methods terminates the processing of this job.

Specified by:
shutdown in interface AmazonMapReduceJobWorker

getJobDetailsMap

public java.util.Map<java.lang.String,java.lang.String> getJobDetailsMap()
Description copied from interface: AmazonMapReduceJobWorker
This method queries the hadoop framework and returns a listing of details related to the currently running job. Details include: jobId, job start time, job state, job end time

Specified by:
getJobDetailsMap in interface AmazonMapReduceJobWorker
Returns:
map


Copyright © 2009-2011 DuraSpace. All Rights Reserved.