/** * Register an {@link IChangeLog} listener that will manage the maintenance * of the describe cache. */ @Override public void startConnection(final BigdataSailConnection conn) { /** * TODO This really should not be using getCacheConnection() but rather * getExistingCacheConnection(). I need to figure out the pattern that * brings the cache connection into existence and who is responsible for * invoking it. The problem is that there are multiple entry points, * including AST evaluation, the DescribeServlet, and the test suite. * AST2BOpContext does this, but it is not always created before we need * the cache connection. */ final ICacheConnection cacheConn = CacheConnectionFactory .getCacheConnection(conn.getBigdataSail().getQueryEngine()); if (cacheConn == null) { // Cache is not enabled. return; } final AbstractTripleStore tripleStore = conn.getTripleStore(); final IDescribeCache describeCache = cacheConn.getDescribeCache( tripleStore.getNamespace(), tripleStore.getTimestamp()); if (describeCache == null) { // DESCRIBE cache is not enabled. return; } conn.addChangeLog(new DescribeCacheChangeLogListener(describeCache)); }
/** * Register an {@link IChangeLog} listener that will manage the maintenance * of the describe cache. */ @Override public void startConnection(final BigdataSailConnection conn) { /** * TODO This really should not be using getCacheConnection() but rather * getExistingCacheConnection(). I need to figure out the pattern that * brings the cache connection into existence and who is responsible for * invoking it. The problem is that there are multiple entry points, * including AST evaluation, the DescribeServlet, and the test suite. * AST2BOpContext does this, but it is not always created before we need * the cache connection. */ final ICacheConnection cacheConn = CacheConnectionFactory .getCacheConnection(conn.getBigdataSail().getQueryEngine()); if (cacheConn == null) { // Cache is not enabled. return; } final AbstractTripleStore tripleStore = conn.getTripleStore(); final IDescribeCache describeCache = cacheConn.getDescribeCache( tripleStore.getNamespace(), tripleStore.getTimestamp()); if (describeCache == null) { // DESCRIBE cache is not enabled. return; } conn.addChangeLog(new DescribeCacheChangeLogListener(describeCache)); }