|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grid.jgrid.proxy.ComputeProxy
This class pretends to be an RMI registry and an RMI server in order to intercept RMI communications and feed them through an instance of the Sun Grid Engine.
Nested Class Summary | |
private static class |
ComputeProxy.Lock
Deprecated. This class is used by ComputeProxyto wait for jobs to complete. |
private class |
ComputeProxy.StreamException
Deprecated. This Exception is used to signal that an error occured while reading from the input stream that was not mechanical. |
Field Summary | |
private static boolean |
debug
Deprecated. Whether debug information should be printed |
private static java.rmi.server.ObjID |
DGC_OID
Deprecated. The ObjID of the DGC |
private static int |
DGC_OP_CLEAN
Deprecated. The number of the clean method on the DGCRegistry |
private static int |
DGC_OP_DIRTY
Deprecated. The number of the dirty method on the DGCRegistry |
private static long |
HASH_COMPUTE
Deprecated. The method hash for the compute method |
private static long |
HASH_COMPUTEASYNCH
Deprecated. The method hash for the computeAsynch method |
private static long |
HASH_GETRESULTS
Deprecated. The method hash for the getResults method |
private static long |
HASH_ISCOMPLETE
Deprecated. The method hash for the isComplete method |
private static java.lang.String |
jobPath
Deprecated. The path to the serialized job files |
private static java.util.Map |
lockbox
Deprecated. A place to store Lock objects referenced by job id. |
private static java.util.logging.Logger |
log
Deprecated. The logging mechanism |
private static long |
nextProcessId
Deprecated. The next job id to be assigned |
private static int |
port
Deprecated. The port on which to start the fake server |
private static sun.rmi.transport.LiveRef |
ref
Deprecated. A reference to this server |
private static java.rmi.server.ObjID |
REGISTRY_OID
Deprecated. The ObjID for the registry |
private static int |
REGISTRY_OP_BIND
Deprecated. The number of the bind method on the Registry |
private static int |
REGISTRY_OP_LIST
Deprecated. The number of the list method on the Registry |
private static int |
REGISTRY_OP_LOOKUP
Deprecated. The number of the lookup method on the Registry |
private static int |
REGISTRY_OP_REBIND
Deprecated. The number of the rebind method on the Registry |
private static int |
REGISTRY_OP_UNBIND
Deprecated. The number of the unbind method on the Registry |
private static java.lang.String |
skeletonCommand
Deprecated. The command for the grid engine execution engine to run on the execution host |
private java.net.Socket |
socket
Deprecated. The Socket over which communications will take place |
private static java.lang.String |
submitCommand
Deprecated. The command used to submit job to the grid engine queue |
private static java.rmi.server.UID |
uid
Deprecated. The UID of this server |
private static java.lang.String |
USAGE
Deprecated. The usage information String |
Constructor Summary | |
private |
ComputeProxy(java.net.Socket socket)
Deprecated. Creates a new instance of ComputeProxy |
Method Summary | |
private static java.lang.String[] |
createCommandStringArray(java.lang.String[] parts)
Deprecated. |
private void |
deleteJob(java.lang.String id)
Deprecated. This method removes a job from the lockbox and disk. |
private void |
doHandshake(java.io.DataInputStream in,
java.io.DataOutputStream out)
Deprecated. This method handles the initial JRMP handshake |
private static void |
flushLogs()
Deprecated. This methods flushes the logs |
private static java.lang.String |
getNextProcessId()
Deprecated. This method returns the next job id |
private static java.lang.Object |
getResult(java.lang.String processId)
Deprecated. This method waits for the job to complete and returns the results |
static void |
main(java.lang.String[] args)
Deprecated. The main method creates a registry on 1100 for return channel communications and creates a fake registry on 1099 to intercep RMI calls. |
private static void |
prepareLogging()
Deprecated. This method sets up the Logger object |
private java.lang.Object |
process(Computable computable,
java.lang.String annotation,
boolean asynch)
Deprecated. This method does the actual processing for calls to compute and computeAsynch on ComputeEngine |
private static void |
processArguments(java.lang.String[] args)
Deprecated. This method processes the command line arguments and sets the appropriate variables |
private void |
processBindCall(java.io.ObjectInputStream objIn,
java.io.DataOutputStream out)
Deprecated. This method handles calls to the bind method of the Registry |
private void |
processCall(java.io.ObjectInputStream objIn,
java.io.DataOutputStream out,
int opNum,
long hash)
Deprecated. This method handles calls to com.sun.grid.jgrid.ComputeEngine methods |
private void |
processCleanCall(java.io.ObjectInputStream objIn,
java.io.DataOutputStream out)
Deprecated. This method handles calls to the clean method of the DGC |
private void |
processComputeCall(java.io.ObjectInputStream objIn,
java.io.DataOutputStream out,
boolean asynch)
Deprecated. This method handles calls to the compute and computeAsynch methods of ComputeEngine |
private void |
processConnection(java.io.DataInputStream in,
java.io.DataOutputStream out)
Deprecated. This method handles the connection communication |
private void |
processDirtyCall(java.io.ObjectInputStream objIn,
java.io.DataOutputStream out)
Deprecated. This method handles calls to the dirty method of the DGC |
private void |
processException(java.io.DataOutputStream out,
java.lang.Exception e)
Deprecated. This method handles exceptions |
private void |
processGetResultsCall(java.io.ObjectInputStream objIn,
java.io.DataOutputStream out)
Deprecated. This method handles calls to the getResults method of ComputeEngine |
private void |
processIsCompleteCall(java.io.ObjectInputStream objIn,
java.io.DataOutputStream out)
Deprecated. This method handles calls to the isComplete method of ComputeEngine |
private void |
processListCall(java.io.ObjectInputStream objIn,
java.io.DataOutputStream out)
Deprecated. This method handles calls to the list method of the Registry |
private void |
processLookupCall(java.io.ObjectInputStream objIn,
java.io.DataOutputStream out)
Deprecated. This method handles calls to the lookup method of the Registry |
private void |
processRebindCall(java.io.ObjectInputStream objIn,
java.io.DataOutputStream out)
Deprecated. This method handles calls to the rebind method of the Registry |
private void |
processUnbindCall(java.io.ObjectInputStream objIn,
java.io.DataOutputStream out)
Deprecated. This method handles calls to the unbind method of the Registry |
void |
run()
Deprecated. This method begins the communications process |
private static void |
setLock(java.lang.String processId)
Deprecated. This method creates a Lock object for the job and stores it in the lockbox |
private java.lang.Object |
submitJob(Job job)
Deprecated. |
private void |
writeJobToDisk(Job job,
java.lang.String annotation)
Deprecated. This method serializes the Job object to disk at the location given by jobPath. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String USAGE
private static final java.rmi.server.ObjID REGISTRY_OID
private static final int REGISTRY_OP_BIND
private static final int REGISTRY_OP_LIST
private static final int REGISTRY_OP_LOOKUP
private static final int REGISTRY_OP_REBIND
private static final int REGISTRY_OP_UNBIND
private static final java.rmi.server.ObjID DGC_OID
private static final int DGC_OP_CLEAN
private static final int DGC_OP_DIRTY
private static final long HASH_COMPUTE
private static final long HASH_COMPUTEASYNCH
private static final long HASH_GETRESULTS
private static final long HASH_ISCOMPLETE
private static final java.rmi.server.UID uid
private static final sun.rmi.transport.LiveRef ref
private static java.util.logging.Logger log
private static java.util.Map lockbox
ResultChannelImpl
,
ComputeProxy.Lock
private static long nextProcessId
private static java.lang.String jobPath
private static java.lang.String submitCommand
private static java.lang.String skeletonCommand
private static int port
private static boolean debug
private java.net.Socket socket
Constructor Detail |
private ComputeProxy(java.net.Socket socket)
socket
- The Socket over which communications will take placeMethod Detail |
public static void main(java.lang.String[] args)
args
- the command line argumentsprivate static void processArguments(java.lang.String[] args)
args
- The args array from main()private static void prepareLogging()
private static void flushLogs()
public void run()
run
in interface java.lang.Runnable
private void doHandshake(java.io.DataInputStream in, java.io.DataOutputStream out) throws java.io.IOException
in
- the input streamout
- the outputstream
java.io.IOException
- if an error occurs during communicationsprivate void processConnection(java.io.DataInputStream in, java.io.DataOutputStream out) throws java.io.IOException
in
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processBindCall(java.io.ObjectInputStream objIn, java.io.DataOutputStream out) throws java.io.IOException
objIn
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processListCall(java.io.ObjectInputStream objIn, java.io.DataOutputStream out) throws java.io.IOException
objIn
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processLookupCall(java.io.ObjectInputStream objIn, java.io.DataOutputStream out) throws java.io.IOException
objIn
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processRebindCall(java.io.ObjectInputStream objIn, java.io.DataOutputStream out) throws java.io.IOException
objIn
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processUnbindCall(java.io.ObjectInputStream objIn, java.io.DataOutputStream out) throws java.io.IOException
objIn
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processCleanCall(java.io.ObjectInputStream objIn, java.io.DataOutputStream out) throws java.io.IOException
objIn
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processDirtyCall(java.io.ObjectInputStream objIn, java.io.DataOutputStream out) throws java.io.IOException
objIn
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processCall(java.io.ObjectInputStream objIn, java.io.DataOutputStream out, int opNum, long hash) throws java.io.IOException
opNum
- The number of the method called - will always be -1hash
- The hash of the method calledobjIn
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processComputeCall(java.io.ObjectInputStream objIn, java.io.DataOutputStream out, boolean asynch) throws java.io.IOException
asynch
- whether this call should be asynchronousobjIn
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processGetResultsCall(java.io.ObjectInputStream objIn, java.io.DataOutputStream out) throws java.io.IOException
objIn
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processIsCompleteCall(java.io.ObjectInputStream objIn, java.io.DataOutputStream out) throws java.io.IOException
objIn
- the input streamout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate void processException(java.io.DataOutputStream out, java.lang.Exception e) throws java.io.IOException
e
- the exception encounteredout
- the output stream
java.io.IOException
- if an error occurs during communicationsprivate java.lang.Object process(Computable computable, java.lang.String annotation, boolean asynch) throws java.io.IOException
computable
- the job to processannotation
- the source for the client class filesasynch
- whether this job should be executed asynchronously
java.io.IOException
- if an error occurs during communicationsprivate static java.lang.String getNextProcessId()
private void writeJobToDisk(Job job, java.lang.String annotation) throws java.io.IOException
job
- the job to be serializedannotation
- the location of the client class files
java.io.IOException
- if an error occurs while writing the job to diskprivate static void setLock(java.lang.String processId)
processId
- the id of the job for which to create a lockprivate static java.lang.Object getResult(java.lang.String processId)
processId
- the job id
private void deleteJob(java.lang.String id) throws java.io.IOException
id
- the id of the job to remove
java.io.IOException
- if an error occurs while removing the job from diskprivate java.lang.Object submitJob(Job job) throws java.io.IOException
java.io.IOException
private static java.lang.String[] createCommandStringArray(java.lang.String[] parts)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |