Package velox.api.layer1.dynamichistory
Interface DynamicHistoryAccessInterface
@DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
public interface DynamicHistoryAccessInterface
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionget(long t1, long intervalWidth, int intervalNumber, com.bookmap.api.treestructure.DataSource dataSource, InstrumentInfo instrumentInfo, List<com.bookmap.api.treestructure.TreeId> treeIds, DynamicHistoryAccessInterface.AsyncResultConsumer consumer) Requests historical data for a specific time interval and instrument.<T> CompletionStage<T> getMetadata(com.bookmap.api.treestructure.DataSource dataSource, InstrumentInfo instrumentInfo, MetadataType<T> metadataType) Provides metadata related to given instrument.
NOTE: Do not block or perform any heavy computation on the thread that completed CompletionStage. If you need to do that, use *Async or similar methods to offload the work to another thread.
-
Method Details
-
get
DynamicHistoryLoadingResult get(long t1, long intervalWidth, int intervalNumber, com.bookmap.api.treestructure.DataSource dataSource, InstrumentInfo instrumentInfo, List<com.bookmap.api.treestructure.TreeId> treeIds, DynamicHistoryAccessInterface.AsyncResultConsumer consumer) Requests historical data for a specific time interval and instrument.
Request parameters are similar toDataStructureInterface.get(long, long, int, String, DataStructureInterface.StandardEvents[]), but instead ofaliasdataSourceandinstrumentInfopair is used, and instead ofStandardEvents[]List<TreeId>is used.
Returns theDynamicHistoryLoadingResultobject, containing events from thet1(inclusive) tot2 = t1 + intervalWidth * intervalNumber(exclusive).
Note: result object contain events from cache, but missing events are loaded asynchroniously and passed to the given consumer.
Note: this method was provided to look similar to DataStructureInterface, but in reality, the meaning of this request is: give me the events from [t0, t1) interval, so there at least one aggregated event in each pixel of intervalWidth size from this interval. Keep in mind that those blocks are precomputed so the t0 and t1 also not precise, as result- Parameters:
t1- Start time of the interval in nanoseconds, same as inDataStructureInterface. Must be non-negativeintervalWidth- Width of each interval in nanoseconds, same as inDataStructureInterface. Must be positiveintervalNumber- Number of intervals to load, same as inDataStructureInterface. But note there is no relation between final event count and intervalNumber. Must be positivedataSource- The data source from which to load the historical data. This parameter identifies the add-on source of the data.instrumentInfo- InstumentInfo of the instrument for which to load historical data.treeIds- List ofTreeIdobjects representing which trees do you want to load. All these trees are connected to the given data source and instrument.consumer- Consumer that will receive the updates as they are loaded.- Returns:
- A
DynamicHistoryLoadingResultobject containing the historical data for the specified time interval and instrument.
-
getMetadata
<T> CompletionStage<T> getMetadata(com.bookmap.api.treestructure.DataSource dataSource, InstrumentInfo instrumentInfo, MetadataType<T> metadataType) Provides metadata related to given instrument.
NOTE: Do not block or perform any heavy computation on the thread that completed CompletionStage. If you need to do that, use *Async or similar methods to offload the work to another thread.- Type Parameters:
T- metadata class- Parameters:
dataSource- The data source from which to get metadata. This parameter identifies the add-on source of the data.instrumentInfo- InstrumentInfo of the instrument for which to get metadata.metadataType- Type of metadata to get, seeMetadataTypefor details- Returns:
- requested metadata if possible, see
MetadataTypefor reasons why it can be unavailable
-