druid/extensions-core
Gian Merlino 878adff9aa
MSQ profile for Brokers and Historicals. (#17140)
This patch adds a profile of MSQ named "Dart" that runs on Brokers and
Historicals, and which is compatible with the standard SQL query API.
For more high-level description, and notes on future work, refer to #17139.

This patch contains the following changes, grouped into packages.

Controller (org.apache.druid.msq.dart.controller):

The controller runs on Brokers. Main classes are,

- DartSqlResource, which serves /druid/v2/sql/dart/.
- DartSqlEngine and DartQueryMaker, the entry points from SQL that actually
  run the MSQ controller code.
- DartControllerContext, which configures the MSQ controller.
- DartMessageRelays, which sets up relays (see "message relays" below) to read
  messages from workers' DartControllerClients.
- DartTableInputSpecSlicer, which assigns work based on a TimelineServerView.

Worker (org.apache.druid.msq.dart.worker)

The worker runs on Historicals. Main classes are,

- DartWorkerResource, which supplies the regular MSQ WorkerResource, plus
  Dart-specific APIs.
- DartWorkerRunner, which runs MSQ worker code.
- DartWorkerContext, which configures the MSQ worker.
- DartProcessingBuffersProvider, which provides processing buffers from
  sliced-up merge buffers.
- DartDataSegmentProvider, which provides segments from the Historical's
  local cache.

Message relays (org.apache.druid.messages):

To avoid the need for Historicals to contact Brokers during a query, which
would create opportunities for queries to get stuck, all connections are
opened from Broker to Historical. This is made possible by a message relay
system, where the relay server (worker) has an outbox of messages.

The relay client (controller) connects to the outbox and retrieves messages.
Code for this system lives in the "server" package to keep it separate from
the MSQ extension and make it easier to maintain. The worker-to-controller
ControllerClient is implemented using message relays.

Other changes:

- Controller: Added the method "hasWorker". Used by the ControllerMessageListener
  to notify the appropriate controllers when a worker fails.
- WorkerResource: No longer tries to respond more than once in the
  "httpGetChannelData" API. This comes up when a response due to resolved future
  is ready at about the same time as a timeout occurs.
- MSQTaskQueryMaker: Refactor to separate out some useful functions for reuse
  in DartQueryMaker.
- SqlEngine: Add "queryContext" to "resultTypeForSelect" and "resultTypeForInsert".
  This allows the DartSqlEngine to modify result format based on whether a "fullReport"
  context parameter is set.
- LimitedOutputStream: New utility class. Used when in "fullReport" mode.
- TimelineServerView: Add getDruidServerMetadata as a performance optimization.
- CliHistorical: Add SegmentWrangler, so it can query inline data, lookups, etc.
- ServiceLocation: Add "fromUri" method, relocating some code from ServiceClientImpl.
- FixedServiceLocator: New locator for a fixed set of service locations. Useful for
  URI locations.
2024-10-01 14:38:55 -07:00
..
avro-extensions Migrated commons-lang usages to commons-lang3 (#17156) 2024-09-28 10:28:11 +02:00
azure-extensions Migrated commons-lang usages to commons-lang3 (#17156) 2024-09-28 10:28:11 +02:00
datasketches Window Functions : Remove enable windowing flag (#17087) 2024-09-23 08:24:26 +02:00
druid-aws-rds-extensions Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
druid-basic-security Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
druid-bloom-filter Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
druid-catalog Properly url encode schema and table names when syncing catalog (#17131) 2024-09-23 23:23:26 -04:00
druid-kerberos Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
druid-pac4j Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
druid-ranger-security Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
ec2-extensions Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
google-extensions Migrated commons-lang usages to commons-lang3 (#17156) 2024-09-28 10:28:11 +02:00
hdfs-storage Migrated commons-lang usages to commons-lang3 (#17156) 2024-09-28 10:28:11 +02:00
histogram Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
kafka-extraction-namespace inter-Extension dependency support (#16973) 2024-09-24 14:17:33 -04:00
kafka-indexing-service Support to parse numbers in text-based input formats (#17082) 2024-09-19 13:21:18 -07:00
kinesis-indexing-service Support to parse numbers in text-based input formats (#17082) 2024-09-19 13:21:18 -07:00
kubernetes-extensions Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
lookups-cached-global Support to parse numbers in text-based input formats (#17082) 2024-09-19 13:21:18 -07:00
lookups-cached-single Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
multi-stage-query MSQ profile for Brokers and Historicals. (#17140) 2024-10-01 14:38:55 -07:00
mysql-metadata-storage Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
orc-extensions Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
parquet-extensions Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
postgresql-metadata-storage Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
protobuf-extensions Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
s3-extensions Migrated commons-lang usages to commons-lang3 (#17156) 2024-09-28 10:28:11 +02:00
simple-client-sslcontext Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30
stats Window Functions : Remove enable windowing flag (#17087) 2024-09-23 08:24:26 +02:00
testing-tools Prepare master for 32.0.0 release (#17022) 2024-09-10 11:01:20 +05:30