HarddriveStorage confused

76 views
Skip to first unread message

tanya

unread,
Feb 22, 2012, 4:14:33 AM2/22/12
to cloudsim
Through reading the source code of CloudSim,an issue confused me for a
long time,in the HarddriveStorage class,in getFile method
obj.setTransactionTime(seekTime + transferTime) why not
obj.setTransactionTime(seekTime + transferTime+latency)

best regards.



code like below:
public File getFile(String fileName) {
// check first whether file name is valid or not
File obj = null;
if (fileName == null || fileName.length() == 0) {
Log.printLine(name + ".getFile(): Warning - invalid " + "file
name.");
return obj;
}

Iterator<File> it = fileList.iterator();
int size = 0;
int index = 0;
boolean found = false;
File tempFile = null;

// find the file in the disk
while (it.hasNext()) {
tempFile = it.next();
size += tempFile.getSize();
if (tempFile.getName().equals(fileName)) {
found = true;
obj = tempFile;
break;
}

index++;
}

// if the file is found, then determine the time taken to get it
if (found) {
obj = fileList.get(index);
double seekTime = getSeekTime(size);
double transferTime = getTransferTime(obj.getSize());

// total time for this operation
obj.setTransactionTime(seekTime + transferTime);
}

return obj;
}

Ashly Angel

unread,
Feb 22, 2012, 4:48:27 AM2/22/12
to clou...@googlegroups.com
hi.. can u help me how to write coding to connect with database in cloudsim?

Rodrigo Calheiros

unread,
Feb 22, 2012, 5:48:06 PM2/22/12
to clou...@googlegroups.com
Hi Tanya,

In fact, all these times could be ignored, as they are very small for
simulation purposes. Latencies are in the order of 10s of ms, and seek
time tend to be even smaller (<5ms). In fact, in the future we may
consider removing the whole delay calculation.

Regards,
Rodrigo

tanya

unread,
Feb 22, 2012, 9:35:58 PM2/22/12
to cloudsim
Thank you for you help.

On 2月23日, 上午6時48分, Rodrigo Calheiros <rodrigo.calhei...@gmail.com>
wrote:


> Hi Tanya,
>
> In fact, all these times could be ignored, as they are very small for
> simulation purposes. Latencies are in the order of 10s of ms, and seek
> time tend to be even smaller (<5ms). In fact, in the future we may
> consider removing the whole delay calculation.
>
> Regards,
> Rodrigo
>

Baptiste Louis

unread,
Feb 18, 2015, 5:33:40 AM2/18/15
to clou...@googlegroups.com
Hi

Actually I believe the implementation of the transaction time is totally wrong.

Let's look together the getSeekTime and getTransferTime in HarddriveStorage.java CloudSim v3.0.3.

private double getSeekTime(int fileSize) {
        double result = 0;

        if (gen != null) { result += gen.sample(); }

        if (fileSize > 0 && capacity != 0) { result += (fileSize / capacity); }       //Why the SeekTime depends on HDD capacity and the file size?!?
         //The seek time measures the time it takes the head assembly on the actuator arm to travel to the track of the disk where the data will be read or written
       
        return result;
 }

private double getTransferTime(int fileSize) {
        double result = 0;

        if (fileSize > 0 && capacity != 0) { result = (fileSize * maxTransferRate) / capacity; }         // Why the transfer time depends on hdd capacity ?!!??
       // If we look at the units, we do not obtain a result in second....
       // For me it would be (fileSize/maxTransferRate).

       
        return result;
    }

My comments on the code show where I am not agree. Please give me your opinion on it.
Reply all
Reply to author
Forward
0 new messages