public class DirectDataOperator extends java.lang.Object implements DataOperator, ContextProvider
DataOperator implementation for direct accesses.| Modifier and Type | Class and Description |
|---|---|
static class |
DirectDataOperator.DelegateDataAccessorFactory |
| Modifier and Type | Field and Description |
|---|---|
private Context |
context |
private Factory<java.util.concurrent.ExecutorService> |
executorFactory |
private java.util.Map<AttributeFamilyDescriptor,DirectAttributeFamilyDescriptor> |
familyMap
AttributeFamilyDescriptor with associated DirectAttributeFamilyDescriptor.
|
private static java.lang.String |
ID |
private static java.lang.String |
KW_CLASS |
private DataAccessorLoader<DirectDataOperator,DataAccessor,DataAccessorFactory> |
loader |
private Repository |
repo
Repository.
|
private static java.util.concurrent.atomic.AtomicInteger |
threadId |
private static java.lang.String |
THROUGHPUT_LIMITER_PREFIX |
private java.util.Map<AttributeDescriptor<?>,OnlineAttributeWriter> |
writers
Cache of writers for all attributes.
|
| Constructor and Description |
|---|
DirectDataOperator(Repository repo) |
| Modifier and Type | Method and Description |
|---|---|
private void |
addResolvedFamily(AttributeFamilyDescriptor family) |
void |
close()
Close the operator and release all allocated resources.
|
private static Factory<java.util.concurrent.ExecutorService> |
createExecutorFactory() |
private java.util.List<AttributeFamilyDescriptor> |
dependencyOrdered(java.util.stream.Stream<AttributeFamilyDescriptor> families)
Create list of families ordered by dependencies between them (non-proxy first).
|
private DataAccessor |
findAccessorFor(AttributeFamilyDescriptor desc) |
java.util.Optional<DirectAttributeFamilyDescriptor> |
findFamilyByName(java.lang.String name)
Retrieve family by given name.
|
java.util.Optional<DataAccessorFactory> |
getAccessorFactory(java.net.URI uri)
Retrieve factory that first matches given uri.
|
java.util.stream.Stream<DirectAttributeFamilyDescriptor> |
getAllFamilies()
Retrieve all families with their direct representation.
|
java.util.Optional<BatchLogReader> |
getBatchLogReader(AttributeDescriptor<?>... attrs)
Retrieve
CommitLogReader for given AttributeDescriptors. |
java.util.Optional<BatchLogReader> |
getBatchLogReader(java.util.Collection<AttributeDescriptor<?>> attrs)
Retrieve
CommitLogReader for given AttributeDescriptors. |
java.util.Optional<CachedView> |
getCachedView(AttributeDescriptor<?>... attrs)
Retrieve
CachedView for given AttributeDescriptors. |
java.util.Optional<CachedView> |
getCachedView(java.util.Collection<AttributeDescriptor<?>> attrs)
Retrieve
CachedView for given AttributeDescriptors. |
java.util.Optional<CommitLogReader> |
getCommitLogReader(AttributeDescriptor<?>... attrs)
Retrieve
CommitLogReader for given AttributeDescriptors. |
java.util.Optional<CommitLogReader> |
getCommitLogReader(java.util.Collection<AttributeDescriptor<?>> attrs)
Retrieve
CommitLogReader for given AttributeDescriptors. |
Context |
getContext()
Retrieve
Context that is used in all distributed operations. |
java.util.Set<DirectAttributeFamilyDescriptor> |
getFamiliesForAttribute(AttributeDescriptor<?> desc)
Resolve all direct attribute representations of given attribute.
|
DirectAttributeFamilyDescriptor |
getFamilyByName(java.lang.String name)
Retrieve family by given name.
|
private java.util.Optional<DirectAttributeFamilyDescriptor> |
getFamilyForAttributes(java.util.Collection<AttributeDescriptor<?>> attrs,
UnaryFunction<DirectAttributeFamilyDescriptor,java.lang.Boolean> mask) |
java.util.Optional<RandomAccessReader> |
getRandomAccess(AttributeDescriptor<?>... attrs)
Retrieve
RandomAccessReader for given AttributeDescriptors. |
java.util.Optional<RandomAccessReader> |
getRandomAccess(java.util.Collection<AttributeDescriptor<?>> attrs)
Retrieve
RandomAccessReader for given AttributeDescriptors. |
Repository |
getRepository() |
java.util.Optional<OnlineAttributeWriter> |
getWriter(AttributeDescriptor<?> attr)
Retrieve writer for given
AttributeDescriptor. |
void |
reload() |
java.util.Optional<DirectAttributeFamilyDescriptor> |
resolve(AttributeFamilyDescriptor family)
Optionally convert given family to direct representation.
|
DirectAttributeFamilyDescriptor |
resolveRequired(AttributeFamilyDescriptor family)
Convert given core family to direct representation.
|
DirectDataOperator |
withExecutorFactory(Factory<java.util.concurrent.ExecutorService> factory)
Explicitly specify
ExecutorService to use when constructing threads. |
private static final java.lang.String THROUGHPUT_LIMITER_PREFIX
private static final java.lang.String KW_CLASS
private static final java.util.concurrent.atomic.AtomicInteger threadId
private static final java.lang.String ID
private final Repository repo
private final java.util.Map<AttributeFamilyDescriptor,DirectAttributeFamilyDescriptor> familyMap
private final java.util.Map<AttributeDescriptor<?>,OnlineAttributeWriter> writers
private Factory<java.util.concurrent.ExecutorService> executorFactory
private final Context context
private final DataAccessorLoader<DirectDataOperator,DataAccessor,DataAccessorFactory> loader
DirectDataOperator(Repository repo)
private static Factory<java.util.concurrent.ExecutorService> createExecutorFactory()
public DirectDataOperator withExecutorFactory(Factory<java.util.concurrent.ExecutorService> factory)
ExecutorService to use when constructing threads.factory - the factory for ExecutorServicepublic final void reload()
reload in interface DataOperatorprivate java.util.List<AttributeFamilyDescriptor> dependencyOrdered(java.util.stream.Stream<AttributeFamilyDescriptor> families)
private void addResolvedFamily(AttributeFamilyDescriptor family)
private DataAccessor findAccessorFor(AttributeFamilyDescriptor desc)
public Context getContext()
Context that is used in all distributed operations.getContext in interface ContextProviderpublic DirectAttributeFamilyDescriptor resolveRequired(AttributeFamilyDescriptor family)
family - the family to convertpublic java.util.Optional<DirectAttributeFamilyDescriptor> resolve(AttributeFamilyDescriptor family)
family - the family to convertpublic java.util.Optional<DataAccessorFactory> getAccessorFactory(java.net.URI uri)
uri - the URI to search factory forDataAccessorFactory for specified URIpublic java.util.Optional<OnlineAttributeWriter> getWriter(AttributeDescriptor<?> attr)
AttributeDescriptor.attr - the attribute to find writer forpublic java.util.Optional<CommitLogReader> getCommitLogReader(java.util.Collection<AttributeDescriptor<?>> attrs)
CommitLogReader for given AttributeDescriptors.attrs - the attributes to find commit log reader for@SafeVarargs public final java.util.Optional<CommitLogReader> getCommitLogReader(AttributeDescriptor<?>... attrs)
CommitLogReader for given AttributeDescriptors.attrs - the attributes to find commit log reader forpublic java.util.Optional<BatchLogReader> getBatchLogReader(java.util.Collection<AttributeDescriptor<?>> attrs)
CommitLogReader for given AttributeDescriptors.attrs - the attributes to find commit log reader for@SafeVarargs public final java.util.Optional<BatchLogReader> getBatchLogReader(AttributeDescriptor<?>... attrs)
CommitLogReader for given AttributeDescriptors.attrs - the attributes to find commit log reader forpublic java.util.Optional<CachedView> getCachedView(java.util.Collection<AttributeDescriptor<?>> attrs)
CachedView for given AttributeDescriptors.attrs - the attributes to find cached view for@SafeVarargs public final java.util.Optional<CachedView> getCachedView(AttributeDescriptor<?>... attrs)
CachedView for given AttributeDescriptors.attrs - the attributes to find cached view forpublic java.util.Optional<RandomAccessReader> getRandomAccess(java.util.Collection<AttributeDescriptor<?>> attrs)
RandomAccessReader for given AttributeDescriptors.attrs - the attributes to find radom access reader for@SafeVarargs public final java.util.Optional<RandomAccessReader> getRandomAccess(AttributeDescriptor<?>... attrs)
RandomAccessReader for given AttributeDescriptors.attrs - the attributes to find radom access reader forprivate java.util.Optional<DirectAttributeFamilyDescriptor> getFamilyForAttributes(java.util.Collection<AttributeDescriptor<?>> attrs, UnaryFunction<DirectAttributeFamilyDescriptor,java.lang.Boolean> mask)
public void close()
close in interface DataOperatorclose in interface java.lang.AutoCloseablepublic java.util.Set<DirectAttributeFamilyDescriptor> getFamiliesForAttribute(AttributeDescriptor<?> desc)
desc - descriptor of attributepublic java.util.stream.Stream<DirectAttributeFamilyDescriptor> getAllFamilies()
DirectAttributeFamilyDescriptors.public DirectAttributeFamilyDescriptor getFamilyByName(java.lang.String name)
name - name of the family to search forDirectAttributeFamilyDescriptor for given familyjava.lang.IllegalArgumentException - when family not foundpublic java.util.Optional<DirectAttributeFamilyDescriptor> findFamilyByName(java.lang.String name)
name - name of the family to search forOptional of DirectAttributeFamilyDescriptor for given family of Optional.empty()public Repository getRepository()
getRepository in interface DataOperatorCopyright © 2017–2021. All rights reserved.