reset password
Author Message
se1k1h1mawar1
Posts: 121
Posted 19:30 Nov 13, 2015 |

Could anyone please suggest a simple but useful programming exercise in order to get some exposure and experience in programming something with different access levels (Disk Level, File Level, Block I/O) in mind? Would it give a reasonably good experience if I simply try to write a  small program that uses RandomAccessFile and fiddle with it?
But what should I make the program to do to get the best out of the exercise? Thank you in advance.

 

Last edited by se1k1h1mawar1 at 19:30 Nov 13, 2015.
cysun
Posts: 2935
Posted 21:19 Nov 13, 2015 |

Create a file that consists of several blocks (e.g. a 32KB file, assuming block size 4KB). Try read/write a character in 1000 random locations in the file using either RandomAccessFile or block I/O (like the implementation in SimpleDB). You can test the two approaches and see if the block I/O approach is significantly faster.

se1k1h1mawar1
Posts: 121
Posted 22:15 Nov 13, 2015 |
cysun wrote:

Create a file that consists of several blocks (e.g. a 32KB file, assuming block size 4KB). Try read/write a character in 1000 random locations in the file using either RandomAccessFile or block I/O (like the implementation in SimpleDB). You can test the two approaches and see if the block I/O approach is significantly faster.

Thank you, Dr, Sun!