Hi. Question regarding the design thoughts behind Context and the callbacks. Also merging BNodes...
I have implemented a Thrift based RPC DatasetGraph consisting of a Client (implements DatasetGraph) which forwards calls to an IFace (generated from a Thrift file which closely mimics the DatasetGraph interface with some method name tweaks to handle thrift nuances such as not supporting method overloading). The IFace wraps a DatasetGraph. The IFace supports all of the DatasetGraph interface (including RPC lock and transaction support) with the exception of getContext(), currently it returns Context.emptyContext. Context and Symbol don't implement Serializable, which in itself can be overcome. But I stumped at the callback part of Context. What is it? What does it do? (besides the obvious!). In the bigger picture I implement a distributed DatasetGraph which contains a set of IFace endpoints. Thus when find(Quad) is called it makes a set of RPC calls to the IFace endpoints and aggregates the results. Internally locks are applied when needed, in particular write locks are weighted e.g. add(x, s, p, o) will attempt to lock the IFace which has graph x (i.e. it checks for the graph before doing the write lock and add). Basically beginTransaction(ReadWrite) on the DatsetGraphDistributed won't actually call beginTransaction(ReadWrite) on an IFace until it needs to. This allows multiple IFace endpoints to be in write transactions. To support the thread affinity of DatasetGraph the IFace endpoints use a UUID to delegate from the Thrift thread pool thread (i.e. the one servicing the RPC call) to the same thread which actually performs the wrapped DatasetGraph action. Additionally the underlying DatasetGraph can be accessed as usual whilst being wrapped by the IFace which supports RPC calls into the same DatasetGraph. Anyway... What was the Context callback designed for? Is it ever used? If I have a central Context which I push to the IFace endpoints would that cause me any issues? Similar idea to a central config... Will BNodes in two DatasetGraph's ever collide? Dick.