|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Thread Sim_entity ReplicaManager
public abstract class ReplicaManager
This is an abstract class which describes the basic functionality of a Replica Manager in a Data Grid. This class is responsible for all data manipulation on a DataGridResource.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected Sim_port |
outputPort_
The output port of the DataGridResource |
protected AllocPolicy |
policy_
The policy of the DataGridResource |
protected int |
rcID_
ID of the Replica Catalogue entity |
protected Integer |
resIdObj_
ID of the DataGridResource entity (in Integer object) |
protected int |
resourceID_
ID of the DataGridResource entity |
protected List |
storageList_
List of all storage elements |
Fields inherited from class Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
protected |
ReplicaManager(String name,
String resourceName)
Creates a new Replica Manager object |
Method Summary | |
---|---|
protected abstract int |
addFile(File file)
Adds a file to the local storage. |
abstract boolean |
addStorage(List storageList)
Adds a list of storage elements to the DataGrid resource |
abstract boolean |
addStorage(Storage storage)
Adds a storage element to the DataGrid resource |
protected boolean |
contains(File file)
Checks whether the resource has the given file |
protected boolean |
contains(String fileName)
Checks whether the resource has the given file |
protected abstract int |
deleteFile(String fileName)
Deletes a file from the local storage, and registers the change to the designated Replica Catalogue. |
protected int |
deregisterDeletedFile(String fileName,
int tag)
Notifies a deleted file to the designated Replica Catalogue (RC) |
protected abstract File |
getFile(String fileName)
Gets a physical file based on its name |
double |
getTotalStorageCapacity()
Gets the total storage capacity (in MByte) for this DataGrid resource |
boolean |
init(Sim_port output,
AllocPolicy policy,
int resourceID)
Initializes the Replica Manager details. |
void |
processEndSimulation()
Notifies internal entities regarding to the end of simulation signal. |
abstract boolean |
processEvent(Sim_event ev)
Processes an incoming event |
abstract void |
registerAllMasterFiles()
Registers all master files that are currently stored in the storage at the beginning of the simulatin |
protected boolean |
registerFile(File file)
Registers a given file to the designated Replica Catalogue |
protected boolean |
registerFile(String fileName)
Registers a given file to the designated Replica Catalogue |
boolean |
setReplicaCatalogue(int rcID)
Sets the ID of the ReplicaCatalogue, to which all the requests for adding and deleting files will be sent. |
boolean |
setReplicaCatalogue(String rcName)
Sets the ReplicaCatalogue for this DataGridResource |
Methods inherited from class Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected AllocPolicy policy_
protected Sim_port outputPort_
protected int resourceID_
protected Integer resIdObj_
protected int rcID_
protected List storageList_
Constructor Detail |
---|
protected ReplicaManager(String name, String resourceName) throws ParameterException
name
- the name to be associated with this entityresourceName
- the name of the DataGrid resource
ParameterException
- This happens when one of the following scenarios occur:
GridSim.init(int, Calendar, boolean, String[], String[],
String)
Method Detail |
---|
public void processEndSimulation()
public boolean init(Sim_port output, AllocPolicy policy, int resourceID)
output
- the output port of a resource which is used to sent
events to other entitiespolicy
- the resource scheduling policy for executing incoming
GridletsresourceID
- the resource ID on which the ResourceManager is
located
DataGridResource
public boolean setReplicaCatalogue(String rcName)
rcName
- the name of the ReplicaCatalogue
public boolean setReplicaCatalogue(int rcID)
rcID
- the ReplicaCtalogue ID
protected boolean registerFile(File file)
file
- a file to be registered
protected boolean registerFile(String fileName)
fileName
- a file name to be registered
protected int deregisterDeletedFile(String fileName, int tag)
fileName
- a file name to be de-registered in RCtag
- a tag to denote the specific instruction to the RC
DataGridTags.CTLG_DELETE_REPLICA
,
DataGridTags.CTLG_DELETE_MASTER
,
DataGridTags.FILE_DELETE_ERROR
,
DataGridTags.FILE_DELETE_SUCCESSFUL
protected boolean contains(File file)
file
- a file to be searched
protected boolean contains(String fileName)
fileName
- a file name to be searched
public double getTotalStorageCapacity()
public abstract boolean addStorage(Storage storage)
storage
- the storage element to be added
public abstract boolean addStorage(List storageList)
storageList
- a list of storage elements to be added
protected abstract int addFile(File file)
file
- a file to be placed on the local resource
DataGridTags.FILE_ADD_SUCCESSFUL
,
DataGridTags.FILE_ADD_ERROR_STORAGE_FULL
protected abstract File getFile(String fileName)
fileName
- the file name to be retrieved
protected abstract int deleteFile(String fileName)
fileName
- the filename of the file to be deleted.
DataGridTags.FILE_DELETE_SUCCESSFUL
,
DataGridTags.FILE_DELETE_ERROR_READ_ONLY
public abstract boolean processEvent(Sim_event ev)
public abstract void registerAllMasterFiles()
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |