Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-199

Refactor RemoteRepository / RemoteRepositoryManager

    XMLWordPrintable

    Details

      Description

      The RemoteRepositoryManager needs to be available from the RemoteRepository in order to support the transaction service (which is 1:1 with the database, not the namespace). This means that the RemoteRepositoryManager can no longer extend RemoteRepository. Instead, we need to obtain a RemoteRepository from the RemoteRepositoryManager. There are already methods for this. We can also add a getRemoteRepositoryForDefaultNamespace() for convenience.

      The recommended pattern is as follows.

       // Create client for the remote service.
       final RemoteRepositoryManager mgr = new RemoteRepositoryManager(serviceURL);
       try {
         // Obtain a Sesame Repository for the default sparql endpoint on that service.
         final Repository repo = mgr.getRepositoryForDefaultNamespace().getBigdataSailRemoteRepository();
         try {
           doWork(repo);
         } finally {
           repo.close();
         }
       } finally {
         mgr.close();
       }
      

      This pattern makes it possible to:
      - Obtain BigdataSailRemoteRepository objects for different sparql end points on the same blazegraph server.
      - Those BigdataSailRemoteRepository objects are flyweight.
      - The RemoteRepositoryManager can be used to access additional interfaces, including the multi-tenancy API and the transaction API.

      See BLZG-1195 Read/write tx support in NSS and BigdataSailRemoteRepositoryConnection

        Attachments

          Activity

            People

            Assignee:
            bryanthompson bryanthompson
            Reporter:
            bryanthompson bryanthompson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: