public class NamedSolutionSetRefUtility extends Object
INamedSolutionSetRef
s.Constructor and Description |
---|
NamedSolutionSetRefUtility() |
Modifier and Type | Method and Description |
---|---|
static String |
getFQN(String namespace,
String localName,
IVariable[] joinVars)
Return the fully qualified name for a named solution set NOT attached to
a query.
|
static StringBuilder |
getPrefix(String namespace)
The prefix that may be used to identify all named solution sets belonging
to the specified KB namespace.
|
static StringBuilder |
getPrefix(String namespace,
String localName)
The prefix that may be used to identify all named solution sets belonging
to the specified KB namespace and having the specified localName.
|
static ICloseableIterator<IBindingSet[]> |
getSolutionSet(ISolutionSetManager sparqlCache,
IBTreeManager localIndexManager,
String namespace,
long timestamp,
String localName,
IVariable[] joinVars,
int chunkCapacity)
Resolve the pre-existing named solution set returning an iterator that
will visit the solutions (access path scan).
|
static ISolutionSetStats |
getSolutionSetStats(ISolutionSetManager sparqlCache,
IBTreeManager localIndexManager,
String namespace,
long timestamp,
String localName,
IVariable[] joinVars)
Resolve the pre-existing named solution set returning its
ISolutionSetStats . |
static INamedSolutionSetRef |
newInstance(String namespace,
long timestamp,
String localName,
IVariable[] joinVars)
Factory for
INamedSolutionSetRef s that will be resolved against a
KB view identified by a namespace and timestamp. |
static INamedSolutionSetRef |
newInstance(UUID queryId,
String namedSet,
IVariable[] joinVars)
Factory for
INamedSolutionSetRef s that will be resolved against
the IRunningQuery identified by the specified queryId. |
static INamedSolutionSetRef |
valueOf(String s)
Parses the
INamedSolutionSetRef.toString() representation,
returning an instance of that interface. |
public static INamedSolutionSetRef newInstance(UUID queryId, String namedSet, IVariable[] joinVars)
INamedSolutionSetRef
s that will be resolved against
the IRunningQuery
identified by the specified queryId.queryId
- The UUID
of the IRunningQuery
where you need
to look to find the data (optional). When null
,
you must look at the current query. When non-null
you must look at the specified query. See BLZG-1493.namedSet
- The application level name for the named solution set
(required).joinVars
- The join variables (required, but may be an empty array).public static INamedSolutionSetRef newInstance(String namespace, long timestamp, String localName, IVariable[] joinVars)
INamedSolutionSetRef
s that will be resolved against a
KB view identified by a namespace and timestamp.namespace
- The bigdata namespace of the AbstractTripleStore
where
you need to look to find the data (required).timestamp
- The timestamp of the view.localName
- The application level name for the named solution set
(required).joinVars
- The join variables (required, but may be an empty array).public static INamedSolutionSetRef valueOf(String s)
INamedSolutionSetRef.toString()
representation,
returning an instance of that interface.NamedSolutionSetRef.toString()
public static String getFQN(String namespace, String localName, IVariable[] joinVars)
Note: this includes the namespace (to keep the named solution sets distinct for different KB instances) and the ordered list of key components (so we can identify different index orders for the same solution set).
Note: This does not allow duplicate indices of different types (BTree versus HTree) for the same key orders as their FQNs would collide.
Note: All index orders for the same "namedSet" will share a common prefix.
Note: All named solution set for the same KB will share a common prefix, and that prefix will be distinct from any other index.
namespace
- The KB namespace.localName
- The local (aka application) name for the named solution set.joinVars
- The ordered set of key components (differentiates among
different indices for the same named solution set).public static StringBuilder getPrefix(String namespace)
namespace
- The KB namespace.public static StringBuilder getPrefix(String namespace, String localName)
namespace
- The KB namespace.localName
- The application name for the named solution set.public static ISolutionSetStats getSolutionSetStats(ISolutionSetManager sparqlCache, IBTreeManager localIndexManager, String namespace, long timestamp, String localName, IVariable[] joinVars)
ISolutionSetStats
.sparqlCache
- localIndexManager
- namespace
- timestamp
- localName
- joinVars
- ISolutionSetStats
RuntimeException
- if the named solution set can not be found.
FIXME Drop joinVars here and just do a Name2Addr scan on the
value returned by getPrefix(String, String)
to see
if we can locate an index (regardless of the join variables).
It does not matter *which* index we find, as long as it is
the same data.public static ICloseableIterator<IBindingSet[]> getSolutionSet(ISolutionSetManager sparqlCache, IBTreeManager localIndexManager, String namespace, long timestamp, String localName, IVariable[] joinVars, int chunkCapacity)
This method MUST NOT be used if the named solution set is hung off of an
IRunningQuery
. In that case, you need to resolve the
IRunningQuery
using INamedSolutionSetRef.getQueryId()
and
then resolve the solution set on the IQueryAttributes
associated
with that IRunningQuery
.
RuntimeException
- if the named solution set can not be found.
FIXME Drop joinVars here and just do a Name2Addr scan on the
value returned by getPrefix(String, String)
to see
if we can locate an index (regardless of the join variables).
It does not matter *which* index we find, as long as it is
the same data.
TODO Provide federation-wide access to a durable named index?
The concept would need to be developed further. Would this be
a local index exposed to other nodes in the federation? A
hash partitioned index? An remote view of a global
IIndex
?Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.