E
exits funnel
Hello,
I'm working on a project for which I've a custom collection class - an
instance of which is roughly analogous to a relational table. The
elements of the collection then are rows and the collection is divided
into logical pages of a fixed (at compile time) number of rows. Up to
this point, the collections have existed entirely in memory but now the
requirement has been added to support swapping to disk. I've played
around a bit with the DataInputStream/DataOutputStream classes and
reading/writing blocks of pages seems not to difficult a task but I'm in
need of some inspiration for the management machinery. I imagine a
single system wide disk file and writing blocks consisting of various
pages from different instances of the collection but I'm not sure how to
track the blocks so that when I need to swap in a given page, I can find
it effiecently. I'm confident that left to my own devices I can craft
something which works, but I'm much less confident that I can craft
something which will perform satisfactorily. Can anyone suggest some
useful patterns? Or possibly some discussion of the solution to a
similar problem? Even general ramblings will be appreciated. Thanks in
advance for any thoughts.
-exits
I'm working on a project for which I've a custom collection class - an
instance of which is roughly analogous to a relational table. The
elements of the collection then are rows and the collection is divided
into logical pages of a fixed (at compile time) number of rows. Up to
this point, the collections have existed entirely in memory but now the
requirement has been added to support swapping to disk. I've played
around a bit with the DataInputStream/DataOutputStream classes and
reading/writing blocks of pages seems not to difficult a task but I'm in
need of some inspiration for the management machinery. I imagine a
single system wide disk file and writing blocks consisting of various
pages from different instances of the collection but I'm not sure how to
track the blocks so that when I need to swap in a given page, I can find
it effiecently. I'm confident that left to my own devices I can craft
something which works, but I'm much less confident that I can craft
something which will perform satisfactorily. Can anyone suggest some
useful patterns? Or possibly some discussion of the solution to a
similar problem? Even general ramblings will be appreciated. Thanks in
advance for any thoughts.
-exits