|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthu.mta.sztaki.lpds.cloud.simulator.io.NetworkNode
hu.mta.sztaki.lpds.cloud.simulator.io.Repository
public class Repository
This class represents the storage entities in the system. Data transfers could take place among these entities. Data is simulated to be stored in the repositories. To allow initial contents in a repository without delays, the class contains the registerObject function. For regular use during the simulation, please use its requestContentDelivery, and duplicateContent functions.
Nested Class Summary | |
---|---|
private static interface |
Repository.MainStorageActivity
|
Nested classes/interfaces inherited from class hu.mta.sztaki.lpds.cloud.simulator.io.NetworkNode |
---|
NetworkNode.NetworkException, NetworkNode.SingleTransfer |
Field Summary | |
---|---|
(package private) HashMap<String,StorageObject> |
contents
Stuff that is already in the current repository |
private long |
currentStorageUse
The current total size of the contents in the actual repository object |
private long |
maxStorageCapacity
The total possible size of the contents in the current repository |
private long |
promisedStorage
The amount of contents that are about to arrive. |
(package private) HashSet<String> |
underTransfer
Contents that are under transfer, to ensure that we are not allowing the deletion of contents that are being transferred currently |
Fields inherited from class hu.mta.sztaki.lpds.cloud.simulator.io.NetworkNode |
---|
diskinbws, diskoutbws, inbws, meminbws, memoutbws, outbws |
Constructor Summary | |
---|---|
Repository(long capacity,
String id,
long maxInBW,
long maxOutBW,
long diskBW,
Map<String,Integer> latencyMap)
Constructor for repository objects |
Method Summary | |
---|---|
Collection<StorageObject> |
contents()
Offers an unmodifiable list of contents. |
boolean |
deregisterObject(StorageObject so)
This function is designed to simulate the erase function of the repository given that its user knows the StorageObject to be dropped. |
boolean |
deregisterObject(String soid)
This function is designed to simulate the erase function of the repository given that its user knows the identifier of the content to be dropped. |
boolean |
duplicateContent(String id,
String newId,
ResourceConsumption.ConsumptionEvent ev)
Initiates the duplication of some repository content |
boolean |
fetchObjectToMemory(StorageObject so,
ResourceConsumption.ConsumptionEvent ev)
|
long |
getFreeStorageCapacity()
|
long |
getMaxStorageCapacity()
|
StorageObject |
lookup(String soid)
Searches and returns the storage object with a given identifier |
private static boolean |
manageStoragePromise(long size,
String id,
Repository target,
Repository.MainStorageActivity mainActivity)
|
boolean |
registerObject(StorageObject so)
This function is designed to initially set up the repository contents. |
boolean |
requestContentDelivery(String id,
Repository target,
ResourceConsumption.ConsumptionEvent ev)
Initiates transfer from a remote location |
boolean |
requestContentDelivery(String id,
String newId,
Repository target,
ResourceConsumption.ConsumptionEvent ev)
This function registers a storage object for transfer. |
boolean |
storeInMemoryObject(StorageObject so,
ResourceConsumption.ConsumptionEvent ev)
|
String |
toString()
|
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.io.NetworkNode |
---|
checkConnectivity, getDiskbw, getInputbw, getName, getOutputbw, initTransfer, pushFromMemory, readToMemory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
final HashMap<String,StorageObject> contents
final HashSet<String> underTransfer
private final long maxStorageCapacity
private long currentStorageUse
private long promisedStorage
Constructor Detail |
---|
public Repository(long capacity, String id, long maxInBW, long maxOutBW, long diskBW, Map<String,Integer> latencyMap)
capacity
- the storage capacity of the repositorymaxInBW
- the input network bandwidth of the repositorymaxOutBW
- the output network bandwidth of the repositorydiskBW
- the disk bandwidth of the repositoryMethod Detail |
---|
public boolean registerObject(StorageObject so)
so
- is the object to be stored
public boolean deregisterObject(StorageObject so)
so
- The storage object to be removed from the repository
public boolean deregisterObject(String soid)
soid
- The storage object identifier
public boolean requestContentDelivery(String id, Repository target, ResourceConsumption.ConsumptionEvent ev) throws NetworkNode.NetworkException
id
- The storage object id that will be transferredtarget
- The target repository where the transferred data will resideev
- the event to be fired if the transfer is completed
NetworkNode.NetworkException
public boolean duplicateContent(String id, String newId, ResourceConsumption.ConsumptionEvent ev) throws NetworkNode.NetworkException
id
- The storage object id that will be duplicatednewId
- The name of the copied storage object id if the target is the
same repository where the request is made.ev
- the event to be fired if the transfer is completed
NetworkNode.NetworkException
public boolean requestContentDelivery(String id, String newId, Repository target, ResourceConsumption.ConsumptionEvent ev) throws NetworkNode.NetworkException
id
- The storage object id that will be transferrednewId
- The name of the copied storage object id if it needs to be
changed. If the target is the same repository this must be
specified. If the caller needs the same storage id then null
can be specified here.target
- The target repository where the transferred data will reside.
If the target is the same repository please check the specific
requirements for newId!ev
- the event to be fired if the transfer is completed
NetworkNode.NetworkException
private static boolean manageStoragePromise(long size, String id, Repository target, Repository.MainStorageActivity mainActivity) throws NetworkNode.NetworkException
NetworkNode.NetworkException
public boolean storeInMemoryObject(StorageObject so, ResourceConsumption.ConsumptionEvent ev) throws NetworkNode.NetworkException
NetworkNode.NetworkException
public boolean fetchObjectToMemory(StorageObject so, ResourceConsumption.ConsumptionEvent ev)
public StorageObject lookup(String soid)
soid
- the id of the storage object in question
public Collection<StorageObject> contents()
public String toString()
toString
in class NetworkNode
public long getMaxStorageCapacity()
public long getFreeStorageCapacity()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |