GridSim 5.0 beta

gridsim.datagrid.index
Class RegionalRC

Object
  extended by Thread
      extended by Sim_entity
          extended by GridSimCore
              extended by AbstractRC
                  extended by RegionalRC
All Implemented Interfaces:
Cloneable, Runnable

public class RegionalRC
extends AbstractRC

This class acts as a local RC and/or a leaf RC in a hierarchical model. It is responsible for processing queries from users and resources.
NOTE: Generating a unique ID for each file name is done by the TopRegionalRC entity only.

Since:
GridSim Toolkit 4.0
Author:
Uros Cibej and Anthony Sulistio
See Also:
TopRegionalRC

Nested Class Summary
 
Nested classes/interfaces inherited from class Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class AbstractRC
localRC_, resourceID_
 
Fields inherited from class GridSimCore
input, NETWORK_TYPE, output
 
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RegionalRC(String name, int resourceID, Sim_port outputPort)
          Creates a new local Replica Catalogue (RC) entity.
RegionalRC(String name, Link link)
          Creates a new Replica Catalogue (RC) entity.
 
Method Summary
 int getHigherLevelRCid()
          Gets the ID of the Replica Catalogue that is the parent of this catalogue in the hierarchy.
protected  void processEndSimulation()
          Performs last activities before the end of a simulation -- THIS METHOD IS EMPTY
protected  boolean processOtherEvent(Sim_event ev)
          Processes an incoming request that uses a user-defined tag.
 boolean registerOriginalFile(FileAttribute fAttr, int sourceID)
          Register a file which is already stored in a resource before the start of simulation
protected  void registerOtherEntity()
          Registers other information to a GIS entity -- THIS METHOD IS EMPTY
 boolean setHigherLevelRCid(int higherLevelRCid)
          Sets the ID of the Replica Catalogue that is the parent of this catalogue in the hierarchy.
 
Methods inherited from class AbstractRC
body, processEvent, setRegionalGIS
 
Methods inherited from class GridSimCore
finalizeGridSimulation, getLink, getPingResult, isNetworked, ping, ping, ping, ping, pingBlockingCall, pingBlockingCall, pingBlockingCall, pingBlockingCall, send, send, send, send, send, send, setBackgroundTraffic, setBackgroundTraffic, terminateIOEntities
 
Methods inherited from class Sim_entity
add_generator, add_param, add_port, clone, get_id, get_name, get_port, get_port, get_stat, run, send_on, set_invisible, set_stat, sim_cancel, sim_completed, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_pause_for, sim_pause_for, sim_pause_until, sim_pause_until, sim_pause, sim_process_for, sim_process_for, sim_process_until, sim_process_until, sim_process, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait_for, sim_wait_for, sim_wait, sim_waiting, sim_waiting
 
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
 

Constructor Detail

RegionalRC

public RegionalRC(String name,
                  int resourceID,
                  Sim_port outputPort)
           throws Exception
Creates a new local Replica Catalogue (RC) entity. This constructor should be used if you want this RC entity to be inside a resource's domain, hence known as a Local RC. As a consequence, this entity uses the resource ID and I/O port for indentification.
The Local RC is responsible for indexing available files on the resource only. It also handles users' queries. However, the Local RC does not serve as a catalogue server to other resources. This should be done by a leaf or regional RC.

Parameters:
name - this entity name
resourceID - resource ID that hosts this RC entity
outputPort - resource's output port
Throws:
Exception - This happens when one of the input parameters is invalid.

RegionalRC

public RegionalRC(String name,
                  Link link)
           throws Exception
Creates a new Replica Catalogue (RC) entity.

Parameters:
name - this entity name
link - the link that this GridSim entity will use to communicate with other GridSim or Network entities.
Throws:
Exception - This happens when one of the input parameters is invalid.
Method Detail

processOtherEvent

protected boolean processOtherEvent(Sim_event ev)
Processes an incoming request that uses a user-defined tag. This method is useful for creating a new RC entity.

Specified by:
processOtherEvent in class AbstractRC
Parameters:
ev - a Sim_event object (or an incoming event or request)
Returns:
true if successful, false otherwise

registerOtherEntity

protected void registerOtherEntity()
Registers other information to a GIS entity -- THIS METHOD IS EMPTY

Specified by:
registerOtherEntity in class AbstractRC

processEndSimulation

protected void processEndSimulation()
Performs last activities before the end of a simulation -- THIS METHOD IS EMPTY

Specified by:
processEndSimulation in class AbstractRC

registerOriginalFile

public boolean registerOriginalFile(FileAttribute fAttr,
                                    int sourceID)
Register a file which is already stored in a resource before the start of simulation

Specified by:
registerOriginalFile in class AbstractRC
Parameters:
fAttr - a file attribute object
sourceID - the owner ID of this file
Returns:
true if successful, false otherwise

getHigherLevelRCid

public int getHigherLevelRCid()
Gets the ID of the Replica Catalogue that is the parent of this catalogue in the hierarchy. If the entity doesn't have a higher level RC registered then the default TopLevel replica catalogue is returned

Returns:
the ID of the higher RC
See Also:
TopRegionalRC

setHigherLevelRCid

public boolean setHigherLevelRCid(int higherLevelRCid)
Sets the ID of the Replica Catalogue that is the parent of this catalogue in the hierarchy.

Parameters:
higherLevelRCid - a Replica Catalogue ID
Returns:
true if successful, false otherwise

GridSim 5.0 beta

The University of Melbourne, Australia, 2009