public interface QDCollector extends SubscriptionContainer, QDStatsContainer
QDCollector
represents a hub which collects subscription from
data consumers and distributes it among data providers and at the same time it
collects data from data providers and distributes it among data consumers.
The data consumers are represented by their QDAgent
, and the data providers
are represented by their QDDistributor
.Modifier and Type | Interface and Description |
---|---|
static interface |
QDCollector.Builder<T extends QDCollector>
Builder for collectors.
|
static interface |
QDCollector.Factory
Factory for
QDCollector instances. |
Modifier and Type | Method and Description |
---|---|
QDAgent.Builder |
agentBuilder()
Returns a builder that can be configured to
build custom agents. |
QDAgent |
buildAgent(QDAgent.Builder builder)
Creates new agent with parameters from the specified builder.
|
QDDistributor |
buildDistributor(QDDistributor.Builder builder)
Creates new distributor with parameters from the specified builder.
|
void |
close()
Closes this collector and frees all external resources that are associated with it.
|
QDAgent |
createAgent(SubscriptionFilter filter)
Deprecated.
Use
agentBuilder and build |
QDAgent |
createAgent(SubscriptionFilter filter,
String keyProperties)
Deprecated.
Use
agentBuilder and build |
QDDistributor |
createDistributor(SubscriptionFilter filter)
Deprecated.
Use
distributorBuilder and build |
QDDistributor |
createDistributor(SubscriptionFilter filter,
String keyProperties)
Deprecated.
Use
distributorBuilder and build |
QDDistributor.Builder |
distributorBuilder()
Returns a builder that can be configured to
build custom distributors. |
boolean |
examineData(DataVisitor visitor)
Deprecated.
|
boolean |
examineData(RecordSink sink)
Examines all stored data via specified record sink.
|
boolean |
examineDataBySubscription(RecordSink sink,
RecordSource sub)
Examines all stored data for a given subscription via specified sink.
|
void |
executeLockBoundTask(Executor executor,
Runnable task)
Cooperative mechanism to execute a task that spends most of its time under the global lock of this collector
(like add/remove/set subscription or closing of agent).
|
QDContract |
getContract()
Returns contract that this collector provides.
|
DataScheme |
getScheme()
Returns data scheme used by this QD component.
|
SymbolStriper |
getStriper()
Returns symbol striper for this QD component.
|
String |
getSymbol(char[] chars,
int offset,
int length) |
boolean |
hasEventTimeSequence()
Returns
true if collector should process event time sequence, false otherwise. |
boolean |
isStoreEverything()
Returns status of "store everything" mode.
|
void |
remove(RecordSource source)
Removes the corresponding records from the underlying storage.
|
void |
setErrorHandler(QDErrorHandler errorHandler)
Sets errors handler for all errors that are happening during notification of agents
and distributors.
|
void |
setStoreEverything(boolean storeEverything)
Sets "store everything" mode (disabled by default).
|
void |
setStoreEverythingFilter(SubscriptionFilter filter)
Sets filter that is used for "store everything" mode.
|
examineSubscription, examineSubscription, getSubscriptionSize, isSubscribed
getStats
DataScheme getScheme()
QDContract getContract()
SymbolStriper getStriper()
QDAgent.Builder agentBuilder()
build
custom agents.QDAgent buildAgent(QDAgent.Builder builder)
builder
- parameters.QDAgent createAgent(SubscriptionFilter filter)
agentBuilder
and build
agentBuilder
() .withFilter
(QDFilter
.fromFilter
(filter)) .build
();
QDAgent createAgent(SubscriptionFilter filter, String keyProperties)
agentBuilder
and build
agentBuilder
() .withFilter
(QDFilter
.fromFilter
(filter)) .withKeyProperties
(keyProperties) .build
();
QDDistributor.Builder distributorBuilder()
build
custom distributors.QDDistributor buildDistributor(QDDistributor.Builder builder)
builder
- parameters.QDDistributor createDistributor(SubscriptionFilter filter)
distributorBuilder
and build
distributorBuilder
() .withFilter
(QDFilter
.fromFilter
(filter)) .build
();
QDDistributor createDistributor(SubscriptionFilter filter, String keyProperties)
distributorBuilder
and build
distributorBuilder
() .withFilter
(QDFilter
.fromFilter
(filter)) .withKeyProperties
(keyProperties) .build
();
void setErrorHandler(QDErrorHandler errorHandler)
DataScheme.getService(java.lang.Class<T>)
method
and QDErrorHandler.DEFAULT
is used if no override is found.boolean isStoreEverything()
setStoreEverything(boolean)
void setStoreEverything(boolean storeEverything)
processData
stores everything into underlying storage regardless of subscription (by default only records that are
subscribed on are being stored). When subscription is removed records are not removed from storage
(by default they are). Only records that match specified filter
are subject to this mode (all records by default).
Support of the feature depends on collector implementation.
void setStoreEverythingFilter(SubscriptionFilter filter)
null
(default)
to turn off filtering and store all records when "store everything" mode is on.
Support of the feature depends on collector implementation.
setStoreEverything(boolean)
String getSymbol(char[] chars, int offset, int length)
boolean hasEventTimeSequence()
true
if collector should process event time sequence, false
otherwise.boolean examineData(DataVisitor visitor)
examineData(RecordSink)
.true
if some data was not examined or
false
if everything was examined.boolean examineData(RecordSink sink)
RecordSink.flush
method outside of locks.
Returns true
if some data was not examined because sink ran out of
capacity
or false
if everything was examined.
In QDHistory
collector, this method method uses
SNAPSHOT_BEGIN
, SNAPSHOT_END
,
SNAPSHOT_SNIP
,
REMOVE_EVENT
, and TX_PENDING
flags appropriately
to describe the snapshot and transaction state of stored data, as if the fresh subscription
with history snapshot
was created.
boolean examineDataBySubscription(RecordSink sink, RecordSource sub)
RecordSink.flush
method outside of locks.
Returns true
if some data was not examined because sink ran out of
capacity
or false
if everything was examined.
In QDHistory
collector, this method method uses
SNAPSHOT_BEGIN
, SNAPSHOT_END
,
SNAPSHOT_SNIP
,
REMOVE_EVENT
, and TX_PENDING
flags appropriately
to describe the snapshot and transaction state of stored data, as if the fresh subscription
with history snapshot
was created.
sink
- the sink to append data to.sub
- the subscription source.void remove(RecordSource source)
storeEverything
mode.void executeLockBoundTask(Executor executor, Runnable task)
executor
- the executor for the task.task
- the runnable task.void close()
Copyright © 2002–2025 Devexperts LLC. All rights reserved.