Class AutoTuningIncrementalReleaseFilter
- All Implemented Interfaces:
Expression
,Filter
,LogOutputAppendable
,LivenessManager
,LivenessNode
,LivenessReferent
,WhereFilter
,NotificationQueue.Dependency
,Serializable
,Runnable
The table has an initial size, which can be thought of as the size during query initialization. There is an initial number of rows that are released, which is then used to tune the number of rows to release on the subsequent cycle.
You must invoke the BaseIncrementalReleaseFilter.start()
method to begin producing rows.
The targetFactor parameter is multiplied by the UGP's targetCycle. This allows you to determine how busy you want the UGP to be. For example a factor of 1, will attempt to hit the target cycle exactly. A target of 0.5 should result an UGP ratio of about 50%. A factor of 10 would mean that the system will extend beyond the target cycle time, coalesce updates accordingly and have a ratio that is nearly 100%.
The time the rows are released is recorded, and a terminal notification is enqueued to record the end of the cycle. On each cycle, the number of rows per second is computed; and then the number of rows released is the UGP's target cycle multiplied by the rows per second multiplied by the target factor.
The AutotuningIncrementalReleaseFilter can be used to benchmark how many rows of data a query can process. In its simplest form we can measure how many rows a lastBy statement can process. For example:
import io.deephaven.engine.table.impl.select.AutoTuningIncrementalReleaseFilter quotes = engine.t("FeedOS", "EquityQuoteL1").where("Date=lastBusinessDateNy()") filter=new AutoTuningIncrementalReleaseFilter(10000, 10000, 1) quotesFiltered = quotes.where(filter) currentQuote = quotesFiltered.lastBy("LocalCodeStr").update("Mid=(Bid + Ask)/2")Produces a currentQuote table, and you can view the Log tab to determine how many rows per second were processed. The summary is sent to the WARN level:
12:55:49.985 WARN Completed release 6.97 seconds, rows=19630961, rows/second=2,817,053.86If verbose mode is enabled, progress is displayed for each cycle at the INFO level.
You may specify a StreamLoggerImpl() to send the data to STDOUT, as follows:
import io.deephaven.engine.table.impl.select.AutoTuningIncrementalReleaseFilter quotes = engine.t("FeedOS", "EquityQuoteL1").where("Date=lastBusinessDateNy()") logger = new io.deephaven.io.logger.StreamLoggerImpl() filterQuotes=new AutoTuningIncrementalReleaseFilter(logger, 10000, 10000, 1.0d, true) quotesFiltered = quotes.where(filterQuotes) currentQuote = quotesFiltered.lastBy("LocalCodeStr").update("Mid=(Bid + Ask)/2") filterQuotes.start()
The verbose information and the final report are easily visible on your console.
The AutotuningIncrementalReleaseFilter is best suited for queries that have a single source table with arbitrary amounts of processing on that table. Multiple incremental release filters may be combined, and each filter will report the number of rows that were released per second, however the data is not synchronized between tables and it is not possible to differentiate which table is contributing more to the query's load without examining the performance tables. You may need to adjust the initial size parameters so that one table does not complete processing before another.
import io.deephaven.engine.table.impl.select.AutoTuningIncrementalReleaseFilter quotes = engine.t("FeedOS", "EquityQuoteL1").where("Date=lastBusinessDateNy()") trades = engine.t("FeedOS", "EquityTradeL1").where("Date=lastBusinessDateNy()") filterQuotes=new AutoTuningIncrementalReleaseFilter(10000, 10000, 1, true) quotesFiltered = quotes.where(filterQuotes) filterTrades=new AutoTuningIncrementalReleaseFilter(10000, 10000, 1, true) tradesFiltered = trades.where(filterTrades) decorated = tradesFiltered.aj(quotesFiltered, "LocalCodeStr,MarketTimestamp", "QuoteTime=MarketTimestamp,Bid,BidSize,Ask,AskSize") filterTrades.start() filterQuotes.start()
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.api.filter.Filter
Filter.Visitor<T>
Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.select.WhereFilter
WhereFilter.PreviousFilteringNotSupported, WhereFilter.RecomputeListener
-
Field Summary
Fields inherited from class io.deephaven.engine.table.impl.select.WhereFilterLivenessArtifactImpl
updateGraph
Fields inherited from interface io.deephaven.engine.table.impl.select.WhereFilter
ZERO_LENGTH_WHERE_FILTER_ARRAY
-
Constructor Summary
ConstructorDescriptionAutoTuningIncrementalReleaseFilter
(long initialSize, long initialRelease, double targetFactor) Create an auto tuning release filter using a real time clock, without printing on each cycle.AutoTuningIncrementalReleaseFilter
(long initialSize, long initialRelease, double targetFactor, boolean verbose) Create an auto tuning release filter using a real time clock.AutoTuningIncrementalReleaseFilter
(Logger logger, long initialSize, long initialRelease, double targetFactor) Create an auto tuning release filter using a real time clock, without printing on each cycle.AutoTuningIncrementalReleaseFilter
(Logger logger, long initialSize, long initialRelease, double targetFactor, boolean verbose) Create an auto tuning release filter using a real time clock. -
Method Summary
Methods inherited from class io.deephaven.engine.table.impl.select.BaseIncrementalReleaseFilter
copy, destroy, durationNanos, filter, getColumnArrays, getColumns, getExpectedSize, getInitialSize, getUpdateGraph, init, isRefreshing, isSimpleFilter, permitParallelization, satisfied, setRecomputeListener, start, waitForCompletion, waitForCompletion
Methods inherited from class io.deephaven.engine.table.impl.select.WhereFilterLivenessArtifactImpl
isAutomatedFilter, setAutomatedFilter
Methods inherited from class io.deephaven.engine.liveness.LivenessArtifact
manageWithCurrentScope
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanage
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
dropReference, tryRetainReference
Methods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCount
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage
Methods inherited from interface io.deephaven.engine.liveness.LivenessNode
unmanage, unmanage
Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, retainReference, tryRetainReference
Methods inherited from interface io.deephaven.base.log.LogOutputAppendable
append
Methods inherited from interface io.deephaven.engine.updategraph.NotificationQueue.Dependency
getUpdateGraph
Methods inherited from interface io.deephaven.engine.table.impl.select.WhereFilter
beginOperation, canMemoize, filter, filterInverse, init, invert, validateSafeForRefresh, walk, walk
-
Constructor Details
-
AutoTuningIncrementalReleaseFilter
@ScriptApi public AutoTuningIncrementalReleaseFilter(long initialSize, long initialRelease, double targetFactor) Create an auto tuning release filter using a real time clock, without printing on each cycle.- Parameters:
initialSize
- the initial table sizeinitialRelease
- the initial incremental update; after the first cycle the rows per second is calculated based on the duration of the last cycle and the number of rows released by this filtertargetFactor
- the multiple of the UGP cycle we should aim for
-
AutoTuningIncrementalReleaseFilter
@ScriptApi public AutoTuningIncrementalReleaseFilter(Logger logger, long initialSize, long initialRelease, double targetFactor) Create an auto tuning release filter using a real time clock, without printing on each cycle.- Parameters:
logger
- the logger the final row/second calculations toinitialSize
- the initial table sizeinitialRelease
- the initial incremental update; after the first cycle the rows per second is calculated based on the duration of the last cycle and the number of rows released by this filtertargetFactor
- the multiple of the UGP cycle we should aim for
-
AutoTuningIncrementalReleaseFilter
@ScriptApi public AutoTuningIncrementalReleaseFilter(long initialSize, long initialRelease, double targetFactor, boolean verbose) Create an auto tuning release filter using a real time clock.- Parameters:
initialSize
- the initial table sizeinitialRelease
- the initial incremental update; after the first cycle the rows per second is calculated based on the duration of the last cycle and the number of rows released by this filtertargetFactor
- the multiple of the UGP cycle we should aim forverbose
- whether information should be printed on each UGP cycle describing the current rate and number of rows released
-
AutoTuningIncrementalReleaseFilter
@ScriptApi public AutoTuningIncrementalReleaseFilter(Logger logger, long initialSize, long initialRelease, double targetFactor, boolean verbose) Create an auto tuning release filter using a real time clock.- Parameters:
logger
- the logger to report progress (if verbose is set) and the final row/second calculationsinitialSize
- the initial table sizeinitialRelease
- the initial incremental update; after the first cycle the rows per second is calculated based on the duration of the last cycle and the number of rows released by this filtertargetFactor
- the multiple of the UGP cycle we should aim forverbose
- whether information should be printed on each UGP cycle describing the current rate and number of rows released
-
-
Method Details
-
run
public void run()- Specified by:
run
in interfaceRunnable
- Overrides:
run
in classBaseIncrementalReleaseFilter
-