Make java-qwp dataset-compatible with the Python generator#14
Open
javier wants to merge 2 commits into
Open
Conversation
Lets a Python backfill be continued (or taken live) by the Java generator on the same tables, with matching schemas, views, and price continuity. - Cli: add --prefix (verbatim, default qwp_; set "" for the exact Python names), prefix-based table accessors, rename the trades stem to fx_trades so an empty prefix yields fx_trades. Reject --incremental in real-time (real-time always syncs live quotes), and default --create_views to true to match Python. - Views: create the full 11 Python-parity materialized views (core_price OHLC-mid, BBO 1s/1m/1h/1d ladder, market_data OHLC 1m/15m/1d, fx_trades OHLC 1m/1d) with byte-faithful DDL, per-view TTLs, and refresh/deferred clauses; each view gated on its base pool being enabled. - Incremental: seed mid/spread/indicators from the last stored core_price row per symbol (was mid-only from trades) and continue the per-symbol walk from it, so open(seam) == close(prev) for bid/ask/spread/indicators. - Real-time mid-walk drift 5.0 -> 7.0 (faster-than-life stays 5.0), matching the Python real-time path. - Retention parity: base-table STORAGE POLICY under --enterprise and per-view TTLs already mirror Python. - Fix the stale FxUniverse Javadoc (it no longer claims there is no order book / no market_data/core_price tables). - Docs: update both READMEs and add INTERCHANGEABILITY_SPEC.md covering --prefix, the view set, incremental-from-core_price, and the requirement to match EPS/orders rates across engines for a seamless cross-engine dataset.
- Cli: new --durable_ack [true|false] (default false), independent of --enterprise. OSS rejects durable ack during the WS upgrade, so it stays opt-in; enable it for no-loss Enterprise HA. - buildSender: call requestDurableAck(true) when --durable_ack, so a failover cannot lose rows the old primary accepted but had not yet replicated to the node that gets promoted. - pom: default questdb.client.version to 1.3.6-SNAPSHOT (the build with the QWP HA role-failover + durable-ack lifecycle). Not on Maven Central; install the java-questdb-client locally, or override with -Dquestdb.client.version=... - README: document --durable_ack and the 1.3.6-SNAPSHOT requirement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Makes the Java QWP generator dataset-compatible with the authoritative Python
fx_data_generator.py, so a demo can backfill with one engine and continue (or go live) with the other on the same tables, with consistent schemas, views, and price continuity.Changes
--prefixoption (verbatim, defaultqwp_; set""for the exact Python names). Trades stem renamed tofx_trades, so an empty prefix yieldsfx_trades(nottrades), matching Python.core_price_1s/1d,bbo_1s/1m/1h/1d,market_data_ohlc_1m/15m/1d,fx_trades_ohlc_1m/1d— byte-faithful DDL, per-view TTLs, andREFRESH EVERY … DEFERRED STARTclauses, each gated on its base pool being enabled.--create_viewsnow defaults to true (matches Python).--incrementalseeds fromcore_price(mid, spread, indicator1/indicator2) instead of mid-only from trades, and continues the per-symbol walk from it, soopen(seam) == close(prev)for bid/ask/spread/indicators.--incrementalrejected in real-time (real-time always syncs live Yahoo quotes), symmetric with Python.5.0 → 7.0(faster-than-life stays5.0), matching Python's real-time path.STORAGE POLICYunder--enterpriseand per-view TTLs mirror Python.FxUniverseJavadoc.java-qwp/) updated; addedINTERCHANGEABILITY_SPEC.md.Validation (local QuestDB)
--prefix "" --incremental) resumed all three pools contiguously from13:00:00with zero gap-seconds infx_trades/market_data/core_price;core_pricemid continuity ≤ 0.5 pip (pip-quantization only); the existing Python matviews incrementally refreshed across the seam.Operational note
For a seamless cross-engine dataset, run both engines with the same EPS / orders rates — per-second density comes from the rate flags, not from the existing data, so mismatched EPS steps the row density at the seam even though prices stay continuous. Documented in both the README runbook and the spec.