Package com.qtsurfer.api.sdk.internal
Class Preparation
java.lang.Object
com.qtsurfer.api.sdk.internal.Preparation
The prepare stage, shared by every workflow that needs a dataset before it
can execute anything.
One implementation on purpose. Preparing is idempotent — the same instrument and window always resolve to the same job — so a workflow that prepares on every call duplicates no work, and that argument only holds while there is a single place where it is true.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringprepare(com.qtsurfer.api.client.api.BacktestingApi api, String exchangeId, com.qtsurfer.api.client.model.DataSourceType type, com.qtsurfer.api.client.model.PrepareRequest body, Duration pollInterval, Duration maxPollInterval, Duration timeout, Consumer<Double> onPercent, Consumer<com.qtsurfer.api.client.model.PrepareJobState> onPrepared) Submit a prepare and poll it to a terminal state.
-
Method Details
-
prepare
public static String prepare(com.qtsurfer.api.client.api.BacktestingApi api, String exchangeId, com.qtsurfer.api.client.model.DataSourceType type, com.qtsurfer.api.client.model.PrepareRequest body, Duration pollInterval, Duration maxPollInterval, Duration timeout, Consumer<Double> onPercent, Consumer<com.qtsurfer.api.client.model.PrepareJobState> onPrepared) Submit a prepare and poll it to a terminal state.- Parameters:
api- the generated backtesting apiexchangeId- exchange identifiertype- data source typebody- instrument and window to preparepollInterval- initial interval between status pollsmaxPollInterval- upper bound of the exponential backofftimeout- deadline for the stage;nulldisablesonPercent- called after each poll that reports size information; may benullonPrepared- called once with the terminal state; may benull- Returns:
- the prepare jobId, which identifies the prepared dataset
- Throws:
QTSPreparationError- when the submission, a status read, or the preparation itself failsQTSCanceledError- when the preparation is aborted server-side
-