E
- public abstract class AbstractResource<E> extends Object implements IMutableResource<E>
Modifier and Type | Class and Description |
---|---|
static interface |
AbstractResource.Options
Options for locatable resources.
|
Modifier and Type | Field and Description |
---|---|
protected IIndexManager |
indexManager |
protected static org.apache.log4j.Logger |
log |
Modifier | Constructor and Description |
---|---|
protected |
AbstractResource(IIndexManager indexManager,
String namespace,
Long timestamp,
Properties properties) |
protected |
AbstractResource(ILocatableResource container,
IIndexManager indexManager,
String namespace,
Long timestamp,
Properties properties)
Alternative version used when a resource exists within some container.
|
Modifier and Type | Method and Description |
---|---|
protected IResourceLock |
acquireExclusiveLock()
Acquires an exclusive lock for the
getNamespace() . |
protected void |
assertWritable() |
void |
create()
Create any logically contained resources (relations, indices).
|
void |
destroy()
Destroy any logically contained resources (relations, indices).
|
protected Properties |
getBareProperties()
Return the
Properties object without wrapping it. |
int |
getChunkCapacity()
Deprecated.
by
BOp annotations. |
int |
getChunkOfChunksCapacity()
Deprecated.
by
BOp annotations. |
long |
getChunkTimeout()
Deprecated.
by
BOp annotations. |
protected Long |
getCommitTime()
The commit time from which a read-only view was materialized (if known)
and otherwise
null . |
ILocatableResource |
getContainer()
Return the container.
|
String |
getContainerNamespace()
The identifier for the containing resource.
|
ExecutorService |
getExecutorService() |
int |
getFullyBufferedReadThreshold()
Deprecated.
by
BOp annotations. |
IIndexManager |
getIndexManager()
Return the object used to locate indices, relations, and relation
containers and to execute operations on those resources.
|
int |
getMaxParallelSubqueries()
Deprecated.
by
BOp annotations. |
String |
getNamespace()
The identifying namespace.
|
Properties |
getProperties()
Wrap and return the properties specified to the ctor.
|
String |
getProperty(String localName,
String defaultValue)
Resolve the property value using the
IIndexManager , the
namespace of the resource, and the Properties instance to be
tested as hidden parameters. |
<T> T |
getProperty(String name,
String defaultValue,
IValidator<T> validator)
Resolves, parses, and validates the property value.
|
long |
getTimestamp()
The timestamp associated with the view of the resource.
|
AbstractResource<E> |
init()
The default implementation only logs the event.
|
boolean |
isForceSerialExecution()
Deprecated.
by
BOp annotations. |
boolean |
isReadOnly() |
String |
toString()
The class name, timestamp and namespace for the relation view.
|
protected void |
unlock(IResourceLock resourceLock)
Release the lock.
|
protected static final transient org.apache.log4j.Logger log
protected final IIndexManager indexManager
protected AbstractResource(IIndexManager indexManager, String namespace, Long timestamp, Properties properties)
protected AbstractResource(ILocatableResource container, IIndexManager indexManager, String namespace, Long timestamp, Properties properties)
public final int getChunkOfChunksCapacity()
BOp
annotations.public final int getChunkCapacity()
BOp
annotations.public final long getChunkTimeout()
BOp
annotations.BlockingBuffer
will wait for
another chunk to combine with the current chunk before returning the
current chunk. This may be ZERO (0) to disable the chunk combiner.public int getFullyBufferedReadThreshold()
BOp
annotations.IAccessPath.iterator(long,long, int)
is LTE this threshold then
do a fully buffered (synchronous) read. Otherwise we will do an
asynchronous read.public boolean isForceSerialExecution()
BOp
annotations.true
, rule sets will be forced to execute
sequentially even when they are not flagged as a sequential program.public int getMaxParallelSubqueries()
BOp
annotations.ExecutorService
entirely and ONE (1) to submit a single task at a
time to the ExecutorService
.public final String getNamespace()
ILocatableResource
getNamespace
in interface ILocatableResource<E>
public final String getContainerNamespace()
ILocatableResource
getContainerNamespace
in interface ILocatableResource<E>
null
if there is no containing resource.public ILocatableResource getContainer()
null
if there is no container.public final long getTimestamp()
ILocatableResource
getTimestamp
in interface ILocatableResource<E>
protected Long getCommitTime()
null
.https://sourceforge.net/apps/trac/bigdata/ticket/266
public final Properties getProperties()
Properties
object prevents inadvertent side-effects.protected final Properties getBareProperties()
Properties
object without wrapping it. This method can
be used in those cases where you need to access non-String property
values. The caller is responsible for avoiding mutation to the returned
Properties object.
Note: This explicitly does NOT wrap the properties. Doing so makes it
impossible to access the default properties using Hashtable#get(), which
in turn means that we can not access non-String objects which have been
materialized from the GRS in the Properties
. This does introduce
some potential for side-effects between read-only instances of the same
resource view which share the same properties object.
public IIndexManager getIndexManager()
Note: For scale-out, this is always the federation's index manager NOT the data service local index manager. This is an artifact of how we resolve the metadata for the relation against the global row store.
IIndexManager
.public final ExecutorService getExecutorService()
public String toString()
public AbstractResource<E> init()
init
in interface ILocatableResource<E>
public void create()
IMutableResource
ILocatableResource.init()
is suitable for invocation from
IMutableResource.create()
. Instead, you are responsible for invoking ILocatableResource.init()
from this method IFF it is appropriate to reuse its initialization logic.create
in interface IMutableResource<E>
public void destroy()
IMutableResource
destroy
in interface IMutableResource<E>
protected IResourceLock acquireExclusiveLock()
getNamespace()
.RuntimeException
- if anything goes wrong.IResourceLockService
protected void unlock(IResourceLock resourceLock)
resourceLock
- The lock.public String getProperty(String localName, String defaultValue)
IIndexManager
, the
namespace of the resource, and the Properties
instance to be
tested as hidden parameters.globalName
- The global property name.defaultValue
- The default.Configuration
public <T> T getProperty(String name, String defaultValue, IValidator<T> validator)
name
- The property name.defaultValue
- The default value.public boolean isReadOnly()
protected final void assertWritable()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.