Since now I don't need the transaction summary any more (just number of records
associated with the transaction at the currentFile),
I will need to use temporary files, and rename them as you suggested.
- I will open a journal file with a temporary name. (Open here, means gets it from the
cached files, or create a new one).
- As I read the journal files I add the valid records to the temporary file. (I will off
course open new files as I fill the file).
- Add a temporary small file when I start renaming the files, and deleting the old files.
and delete that file when I'm done.
The only issue I have now is allowing concurrent appends to the journal, as I'm
compacting the files.
The problem is, when deleteing or updating a record, I don't know where the AddRecord
is going to be located at. So, I don't know where to add the negative value to.
So, what I'm thinking as a solution is:
- During compacting, all Adds, updates and deletes are stored to the current-file, as we
aways do.
- But instead of discounting POSFiles right away, I cache those IDs on a collection. When
I'm done compacting I do a fast operation applying the reference counts accordingly.
- Case the server is interrupted during reload, the delete or update will take the
original location of the record.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4239872#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...