edu.stolaf.cs.wmrserver
Class JobServiceHandler

java.lang.Object
  extended by edu.stolaf.cs.wmrserver.JobServiceHandler
All Implemented Interfaces:
JobService.Iface

public class JobServiceHandler
extends java.lang.Object
implements JobService.Iface


Field Summary
static java.lang.String LANG_CONF_FILE
           
 
Constructor Summary
JobServiceHandler(org.apache.hadoop.conf.Configuration conf)
           
 
Method Summary
static org.apache.hadoop.fs.Path getHome(org.apache.hadoop.conf.Configuration conf)
           
static org.apache.hadoop.fs.Path getNonexistantPath(org.apache.hadoop.fs.Path parentDir, java.lang.String name, org.apache.hadoop.fs.FileSystem fs)
           
static int getOutputPageSize(org.apache.hadoop.conf.Configuration conf)
           
 JobStatus getStatus(long id)
           
 Submission getSubmission(long id)
           
static java.io.File getTempDir(org.apache.hadoop.conf.Configuration conf)
           
 void kill(long id)
           
static org.apache.hadoop.fs.FileStatus[] listInputFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path)
           
 DataPage readDataPage(java.lang.String pathString, int page)
           
static org.apache.hadoop.fs.Path relativizePath(org.apache.hadoop.fs.Path parentPath, org.apache.hadoop.fs.Path childPath)
          Relativize the given path with respect to the WMR home directory
 java.lang.String storeDataset(java.lang.String name, java.lang.String data)
           
 long submit(JobRequest request)
           
static InternalException wrapException(java.lang.String message, java.lang.Throwable cause)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LANG_CONF_FILE

public static final java.lang.String LANG_CONF_FILE
See Also:
Constant Field Values
Constructor Detail

JobServiceHandler

public JobServiceHandler(org.apache.hadoop.conf.Configuration conf)
                  throws java.io.IOException
Throws:
java.io.IOException
Method Detail

submit

public long submit(JobRequest request)
            throws ValidationException,
                   NotFoundException,
                   CompilationException,
                   InternalException,
                   PermissionException,
                   QuotaException,
                   ForbiddenTestJobException
Specified by:
submit in interface JobService.Iface
Throws:
ValidationException
NotFoundException
CompilationException
InternalException
PermissionException
QuotaException
ForbiddenTestJobException

storeDataset

public java.lang.String storeDataset(java.lang.String name,
                                     java.lang.String data)
                              throws InternalException
Specified by:
storeDataset in interface JobService.Iface
Throws:
InternalException

readDataPage

public DataPage readDataPage(java.lang.String pathString,
                             int page)
                      throws NotFoundException,
                             InternalException,
                             PermissionException
Specified by:
readDataPage in interface JobService.Iface
Throws:
NotFoundException
InternalException
PermissionException

getStatus

public JobStatus getStatus(long id)
                    throws NotFoundException,
                           InternalException
Specified by:
getStatus in interface JobService.Iface
Throws:
NotFoundException
InternalException

kill

public void kill(long id)
          throws NotFoundException,
                 IllegalJobStateException,
                 InternalException
Specified by:
kill in interface JobService.Iface
Throws:
NotFoundException
IllegalJobStateException
InternalException

getSubmission

public Submission getSubmission(long id)
                         throws NotFoundException
Throws:
NotFoundException

wrapException

public static InternalException wrapException(java.lang.String message,
                                              java.lang.Throwable cause)

getHome

public static org.apache.hadoop.fs.Path getHome(org.apache.hadoop.conf.Configuration conf)
                                         throws java.io.IOException
Throws:
java.io.IOException

getTempDir

public static java.io.File getTempDir(org.apache.hadoop.conf.Configuration conf)

getOutputPageSize

public static int getOutputPageSize(org.apache.hadoop.conf.Configuration conf)

relativizePath

public static org.apache.hadoop.fs.Path relativizePath(org.apache.hadoop.fs.Path parentPath,
                                                       org.apache.hadoop.fs.Path childPath)
Relativize the given path with respect to the WMR home directory


getNonexistantPath

public static org.apache.hadoop.fs.Path getNonexistantPath(org.apache.hadoop.fs.Path parentDir,
                                                           java.lang.String name,
                                                           org.apache.hadoop.fs.FileSystem fs)
                                                    throws java.io.IOException
Throws:
java.io.IOException

listInputFiles

public static org.apache.hadoop.fs.FileStatus[] listInputFiles(org.apache.hadoop.fs.FileSystem fs,
                                                               org.apache.hadoop.fs.Path path)
                                                        throws java.io.IOException
Throws:
java.io.IOException