L
- The type of the QueryLogger
to be created.T
- The type of the Record
instances managed by the
Logger
.P
- The type of the Column
's value used for partitioning the
QueryLogger
.public abstract class AbstractPartedQueryLogger<L extends QueryLogger<T>,T,P extends T> extends AbstractPartedLogger<L,T,P> implements QueryLogger<T>
AbstractPartedQueryLogger
extends the
AbstractPartedLogger
with the functionality of a QueryLogger
.
Any query operations, such as #findLogs(Criteria), are targeted at
that partition containing the queried data. For this to work, the query must
obey some rules:
The query is to contain an {@link EqualWithCriteria} addressing the partition in an unambiguous way; by being part of a root level {@link AndCriteria} or an unambiguously nested {@link AndCriteria} hierarchy. More than one partition gets detected when unambiguous {@link OrCriteria} are applied to the partition {@link Criteria}. In such cases, the query is addressed to the potential partitions.
In case it was not possible to identify any partitions, then as a fallback, all partitions are queried.
Query results are taken from from the the invoked partitions (in normal cases this would be a single partition) round robin. the first result is taken from the first queried partition's result set ({@link Records}), the next result from the next queried partition and so on to start over again with the first queried partition. Round robin has been used to prevent invalidation of physical data sinks's result sets as of timeouts.
(you may specify the actual {@link Record} type (generic parameter) accepted by the {@link QueryLogger} instances to enforce a dedicated {@link Record} type which contains the required partition {@link Column})
LOGGER
Constructor and Description |
---|
AbstractPartedQueryLogger(org.refcodes.tabular.Column<P> aPartitionColumn,
LoggerFactory<L> aLoggerFactory,
boolean isPartitionAutoInitialize) |
AbstractPartedQueryLogger(org.refcodes.tabular.Column<P> aPartitionColumn,
String aDefaultLoggerName,
LoggerFactory<L> aLoggerFactory,
boolean isPartitionAutoInitialize) |
Modifier and Type | Method and Description |
---|---|
org.refcodes.tabular.Records<T> |
findLogs()
Retrieves all available
Record instances being logged. |
org.refcodes.tabular.Records<T> |
findLogs(org.refcodes.criteria.Criteria aCriteria)
Retrieves all available
Record instances being logged matching
the given criteria and restrictions. |
org.refcodes.tabular.Records<T> |
findLogs(org.refcodes.criteria.Criteria aCriteria,
org.refcodes.tabular.Header<T> aHeader)
Retrieves all available
Record instances being logged matching
the given criteria and restrictions. |
org.refcodes.tabular.Records<T> |
findLogs(org.refcodes.criteria.Criteria aCriteria,
org.refcodes.tabular.Header<T> aHeader,
int aLimit)
Retrieves all available
Record instances being logged matching
the given criteria and restrictions. |
org.refcodes.tabular.Records<T> |
findLogs(org.refcodes.criteria.Criteria aCriteria,
int aLimit)
Retrieves all available
Record instances being logged matching
the given criteria and restrictions. |
org.refcodes.tabular.Records<T> |
findLogs(org.refcodes.tabular.Header<T> aHeader,
int aLimit)
Retrieves all available
Record instances being logged matching
the given criteria and restrictions. |
org.refcodes.tabular.Records<T> |
findLogs(int aLimit)
Retrieves all available
Record instances being logged matching
the given criteria and restrictions. |
protected Collection<L> |
getPartitionLoggers(Set<P> aPartitions)
Retrieves a collection with
Logger instances managing the
provided partitions. |
decomposePartition, destroyPartition, flushPartition, getFallbackLogger, getLoggers, getPartitionColumn, getPartitionLogger, getPartitionUid, hasPartition, initPartition, log
public AbstractPartedQueryLogger(org.refcodes.tabular.Column<P> aPartitionColumn, LoggerFactory<L> aLoggerFactory, boolean isPartitionAutoInitialize)
public AbstractPartedQueryLogger(org.refcodes.tabular.Column<P> aPartitionColumn, String aDefaultLoggerName, LoggerFactory<L> aLoggerFactory, boolean isPartitionAutoInitialize)
public org.refcodes.tabular.Records<T> findLogs()
Record
instances being logged.findLogs
in interface QueryLogger<T>
Records
instance containing all available
Record
instances being logged.public org.refcodes.tabular.Records<T> findLogs(int aLimit)
Record
instances being logged matching
the given criteria and restrictions.findLogs
in interface QueryLogger<T>
aLimit
- The maximum Record
instances contained in the
returned Records
instance; there may be more
Record
instances which are not contained in the
Records
instance in case the Records
instance's
size is that of the specified limit.Records
instance containing all available
Record
instances being logged matching the given criteria
and restrictions.public org.refcodes.tabular.Records<T> findLogs(org.refcodes.criteria.Criteria aCriteria)
Record
instances being logged matching
the given criteria and restrictions.findLogs
in interface QueryLogger<T>
aCriteria
- The Criteria
to be applied to the Record
instancesRecords
instance containing all available
Record
instances being logged matching the given criteria
and restrictions.public org.refcodes.tabular.Records<T> findLogs(org.refcodes.tabular.Header<T> aHeader, int aLimit)
Record
instances being logged matching
the given criteria and restrictions.findLogs
in interface QueryLogger<T>
aHeader
- The Header
used to restrict the "columns"
(key/value entries) in the retrieved Record
instances
(provided by the Records
instance).aLimit
- The maximum Record
instances contained in the
returned Records
instance; there may be more
Record
instances which are not contained in the
Records
instance in case the Records
instance's
size is that of the specified limit.Records
instance containing all available
Record
instances being logged matching the given criteria
and restrictions.public org.refcodes.tabular.Records<T> findLogs(org.refcodes.criteria.Criteria aCriteria, int aLimit)
Record
instances being logged matching
the given criteria and restrictions.findLogs
in interface QueryLogger<T>
aCriteria
- The Criteria
to be applied to the Record
instancesaLimit
- The maximum Record
instances contained in the
returned Records
instance; there may be more
Record
instances which are not contained in the
Records
instance in case the Records
instance's
size is that of the specified limit.Records
instance containing all available
Record
instances being logged matching the given criteria
and restrictions.public org.refcodes.tabular.Records<T> findLogs(org.refcodes.criteria.Criteria aCriteria, org.refcodes.tabular.Header<T> aHeader)
Record
instances being logged matching
the given criteria and restrictions.findLogs
in interface QueryLogger<T>
aCriteria
- The Criteria
to be applied to the Record
instancesaHeader
- The Header
used to restrict the "columns"
(key/value entries) in the retrieved Record
instances
(provided by the Records
instance).Records
instance containing all available
Record
instances being logged matching the given criteria
and restrictions.public org.refcodes.tabular.Records<T> findLogs(org.refcodes.criteria.Criteria aCriteria, org.refcodes.tabular.Header<T> aHeader, int aLimit)
Record
instances being logged matching
the given criteria and restrictions.findLogs
in interface QueryLogger<T>
aCriteria
- The Criteria
to be applied to the Record
instancesaHeader
- The Header
used to restrict the "columns"
(key/value entries) in the retrieved Record
instances
(provided by the Records
instance).aLimit
- The maximum Record
instances contained in the
returned Records
instance; there may be more
Record
instances which are not contained in the
Records
instance in case the Records
instance's
size is that of the specified limit.Records
instance containing all available
Record
instances being logged matching the given criteria
and restrictions.protected Collection<L> getPartitionLoggers(Set<P> aPartitions)
Logger
instances managing the
provided partitions.aPartitions
- The partitions for which to get the Logger
instances.Collection
with none to many Logger
instancesCopyright © 2015. All rights reserved.