hu.mta.sztaki.lpds.cloud.simulator.io
Class StorageObject

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.io.StorageObject
Direct Known Subclasses:
VirtualAppliance

public class StorageObject
extends Object

Represents arbitrary data fragments (e.g. files) to be stored in a repository. Also useful for modeling file transfers.

Author:
"Gabor Kecskemeti, Distributed and Parallel Systems Group, University of Innsbruck (c) 2013" "Gabor Kecskemeti, Laboratory of Parallel and Distributed Systems, MTA SZTAKI (c) 2012"

Field Summary
 String id
          the identifier of the storage object.
 long size
          The actual size of the object.
 
Constructor Summary
StorageObject(String myid)
          Allows the creation of the storage object with unknown size (the simulator will pick a random one!
StorageObject(String myid, long mysize, boolean vary)
          Allows the creation of the storage object with an influence on the size of the object
 
Method Summary
 StorageObject newCopy(String myid)
          creates a new storage object based on the current one, but with new name.
 String toString()
          Provides a compact output of all data represented in this Storage Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public final String id
the identifier of the storage object. This might not be unique everywhere. It is the user's responsibility to keep it unique with the newcopy function.


size

public final long size
The actual size of the object. This is immutable, if a storage object needs to increase in size in a repository, it is recommended to replace it with a bigger one while holding the same name. unit: bytes

Constructor Detail

StorageObject

public StorageObject(String myid)
Allows the creation of the storage object with unknown size (the simulator will pick a random one!

Parameters:
myid - the id of the new storage object

StorageObject

public StorageObject(String myid,
                     long mysize,
                     boolean vary)
Allows the creation of the storage object with an influence on the size of the object

Parameters:
myid - the id of the new storage object
mysize - the size of the storage object (this might not be the actual size, but could be used for generating varying sizes according to the param vary. Unit: bytes.
vary - true if the requested storage object size is not fixed, false otherwise
Method Detail

newCopy

public StorageObject newCopy(String myid)
creates a new storage object based on the current one, but with new name. The size of the two objects will remain the same.

Parameters:
myid - the id of the new storage object
Returns:
the storage object that has the same size as this one but that has the new id given in myid

toString

public String toString()
Provides a compact output of all data represented in this Storage Object. Useful for debugging.

Overrides:
toString in class Object


Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.