Yingyi Bu has posted comments on this change.

Change subject: ASTERIXDB-1945 [STO] Cleanup Buffer Cache API
......................................................................


Patch Set 16:

I think we probably don't want thread-safety for FileMapManager at all, since 
the call sites anyway has to orchestrate multiple steps and make sure the 
bigger block is synchronized:

E.g. BufferCache.openFile(...):

synchronized (fileInfoMap) {
            if (fileMapManager.isMapped(fileRef)) {
                fileId = fileMapManager.lookupFileId(fileRef);
            } else {
                fileId = fileMapManager.registerFile(fileRef);
            }
            openFile(fileId);
        }
        return fileId;

Even if FileMapManager is thread-safe, it doesn't help and you still have to 
synchronized on the big block to make sure atomicity of the sequence of 
isMapped/lookup/register.  Most call sites have a similar pattern.  Thoughts?

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1840
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I15565b07afdc94ac74c608bfe4480fa09dcf8f1c
Gerrit-PatchSet: 16
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <bamou...@gmail.com>
Gerrit-Reviewer: Ian Maxon <ima...@apache.org>
Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Murtadha Hubail <hubail...@gmail.com>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <buyin...@gmail.com>
Gerrit-Reviewer: abdullah alamoudi <bamou...@gmail.com>
Gerrit-HasComments: No

Reply via email to