p2pMapReduce.nodeModule
Class UserNode

java.lang.Object
  extended by p2pMapReduce.nodeModule.UserNode

public class UserNode
extends java.lang.Object

An utility class to start an user node, join the P2PMapReduce network and submit jobs.


Nested Class Summary
static class UserNode.UserJob
           
 
Field Summary
static int MASTER_SEARCH_PERIOD
          Time interval for master searching
 
Method Summary
 void addEventListener(EventListener eventListener)
           
static UserNode createUserNode()
          Creates and starts a new UserNode
static UserNode createUserNode(NetworkConfiguration nc)
          Creates and starts a new UserNode providing a specific NetworkConfiguration
 java.util.HashMap<java.lang.String,UserNode.UserJob> getAssignedJob()
           
 FileSystemView getFileSystemView()
           
 java.lang.String getNodeID()
           
 java.util.LinkedList<UserNode.UserJob> getSubittedJob()
           
 void setAssignedJob(java.util.HashMap<java.lang.String,UserNode.UserJob> assignedJob)
           
 void setSubittedJob(java.util.LinkedList<UserNode.UserJob> subittedJob)
           
 void submit(Job job)
          A way to submit a job through this user node
 void submit(Job job, java.lang.Runnable jobCompletionAction)
          Submit the job through this user node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MASTER_SEARCH_PERIOD

public static final int MASTER_SEARCH_PERIOD
Time interval for master searching

See Also:
Constant Field Values
Method Detail

createUserNode

public static UserNode createUserNode()
Creates and starts a new UserNode

Returns:

createUserNode

public static UserNode createUserNode(NetworkConfiguration nc)
Creates and starts a new UserNode providing a specific NetworkConfiguration

Returns:

submit

public void submit(Job job)
            throws java.io.IOException
A way to submit a job through this user node

Parameters:
job -
Throws:
java.io.IOException

submit

public void submit(Job job,
                   java.lang.Runnable jobCompletionAction)
Submit the job through this user node.

Parameters:
job -
jobCompletionAction - A runnable object to execute when the job is successfully completed. the execution will be performed in a new thread

getNodeID

public java.lang.String getNodeID()

getFileSystemView

public FileSystemView getFileSystemView()

addEventListener

public void addEventListener(EventListener eventListener)

getAssignedJob

public java.util.HashMap<java.lang.String,UserNode.UserJob> getAssignedJob()

setAssignedJob

public void setAssignedJob(java.util.HashMap<java.lang.String,UserNode.UserJob> assignedJob)

getSubittedJob

public java.util.LinkedList<UserNode.UserJob> getSubittedJob()

setSubittedJob

public void setSubittedJob(java.util.LinkedList<UserNode.UserJob> subittedJob)