Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
ec97c6c
[timeseries] Introducing Apache ECharts timeseries results visualizat…
shauryachats Jul 22, 2025
af7047a
Bump com.diffplug.spotless:spotless-maven-plugin from 2.46.0 to 2.46.…
dependabot[bot] Jul 22, 2025
b96200e
Bump software.amazon.awssdk:bom from 2.32.4 to 2.32.5 (#16403)
dependabot[bot] Jul 22, 2025
b6e43ac
Bump net.openhft:chronicle-bom from 2.27ea60 to 2.27ea62 (#16404)
dependabot[bot] Jul 22, 2025
b9e5116
serialize TlsSpec when executing DataIngestion backfill job (#16381)
hongkunxu Jul 23, 2025
831a25a
Fixes race condition in RealtimeConsumptionRateManager.MetricEmitter …
noob-se7en Jul 23, 2025
90346d5
Allow Reset of ThreadResourceUsageAccountant in Tracing.java (#16360)
vrajat Jul 23, 2025
c1c8916
Cleanup logs (#16410)
9aman Jul 23, 2025
c7dd57c
Enhance LookupTable implementations and add comprehensive test covera…
xiangfu0 Jul 23, 2025
ccd5523
Bump commons-codec:commons-codec from 1.18.0 to 1.19.0 (#16413)
dependabot[bot] Jul 23, 2025
da51092
Bump software.amazon.awssdk:bom from 2.32.5 to 2.32.6 (#16412)
dependabot[bot] Jul 23, 2025
0189f92
Add a protected method for deleting snapshots to be extended (#16414)
deepthi912 Jul 24, 2025
1a3f2bd
Emit segment download metrics for local (NFS/GPFS) file access (#16379)
praveenc7 Jul 24, 2025
8316aa3
udf test framework (#16258)
gortiz Jul 24, 2025
0415a2b
Make ForwardIndexReader pluggable by removing static methods from For…
raghavyadav01 Jul 24, 2025
3011912
Support executing backfill jobs on clusters that use self-signed cert…
hongkunxu Jul 24, 2025
9a18bec
Use correlation ID instead of request id in PerQueryCpuMemAccountant …
vrajat Jul 24, 2025
92a16d4
Bump software.amazon.awssdk:bom from 2.32.6 to 2.32.7 (#16417)
dependabot[bot] Jul 24, 2025
e8b1c52
Bump curator.version from 5.8.0 to 5.9.0 (#16418)
dependabot[bot] Jul 24, 2025
4935e41
[timeseries] Adding error banner for timeseries error handling in Con…
shauryachats Jul 24, 2025
bd333b4
Cleanup stream message related APIs (#16388)
Jackie-Jiang Jul 24, 2025
c1fceb2
Queries now self terminate if in panic mode. (#16380)
vrajat Jul 25, 2025
4f1c40c
feat: Enhance PurgeTask to automatically delete empty segments (#16368)
avshenuk Jul 25, 2025
2188ca2
Fix CAST evaluation with literal-only operands in MSQE (#16421)
yashmayya Jul 25, 2025
f7b9a25
[Query Resource Isolation] Additonal Sampling for Broker and Server (…
praveenc7 Jul 25, 2025
ee474de
Bump org.apache.commons:commons-text from 1.13.1 to 1.14.0 (#16427)
dependabot[bot] Jul 28, 2025
313965a
Bump com.google.errorprone:error_prone_annotations from 2.40.0 to 2.4…
dependabot[bot] Jul 28, 2025
7fa52b8
Bump software.amazon.awssdk:bom from 2.32.7 to 2.32.8 (#16429)
dependabot[bot] Jul 28, 2025
a255751
Use Broker's accountant to sample in the request handler. (#16439)
vrajat Jul 28, 2025
0bd90a1
Enhance and unify JSON index reader (#16436)
Jackie-Jiang Jul 28, 2025
b1a98ee
Add auth for revert replace segment (#16434)
hongkunxu Jul 28, 2025
3121f8f
Add state and table filtering support to task counts API (#16433)
xiangfu0 Jul 29, 2025
7ffd1e0
Move logical tables related classes from pinot-query-planner to pinot…
yashmayya Jul 29, 2025
9e22441
Fixed loading the zookeeper browser page is failing (#16440)
userhimanshuverma Jul 29, 2025
5232e28
Add logs for segment status checker to be able to debug which segment…
krishan1390 Jul 29, 2025
b8c8efb
Bump software.amazon.awssdk:bom from 2.32.8 to 2.32.10 (#16446)
dependabot[bot] Jul 29, 2025
737029b
Bump io.grpc:grpc-bom from 1.73.0 to 1.74.0 (#16447)
dependabot[bot] Jul 29, 2025
b33a786
Bump org.webjars:swagger-ui from 5.26.2 to 5.27.0 (#16448)
dependabot[bot] Jul 29, 2025
8680854
Bump net.openhft:chronicle-bom from 2.27ea62 to 2.27ea64 (#16449)
dependabot[bot] Jul 29, 2025
f9052de
Enables auto reset of error segments by default (#15736)
noob-se7en Jul 29, 2025
4538997
[timeseries] Adding timeseries language endpoint and UI integration (…
shauryachats Jul 29, 2025
36ea7c0
Bump org.apache.commons:commons-compress from 1.27.1 to 1.28.0 (#16465)
dependabot[bot] Jul 30, 2025
8449763
Bump com.squareup.okio:okio-bom from 3.15.0 to 3.16.0 (#16466)
dependabot[bot] Jul 30, 2025
16eadb7
Bump net.openhft:chronicle-bom from 2.27ea64 to 2.27ea65 (#16467)
dependabot[bot] Jul 30, 2025
2314fe6
Bump software.amazon.awssdk:bom from 2.32.10 to 2.32.11 (#16464)
dependabot[bot] Jul 30, 2025
7cfef89
Incorporate parallelWhitelist and parallelBlacklist to the new Tenant…
J-HowHuang Jul 30, 2025
f0e5eed
Reduce log volume added from #16437 (#16459)
krishan1390 Jul 30, 2025
e2f8077
Fix var-length dictionary validation on BIG_DECIMAL (#16469)
Jackie-Jiang Jul 30, 2025
510275d
[Query Resource Isolation] Workload Scheduler (#16018)
praveenc7 Jul 30, 2025
b6f0319
Make VARIANT/UUID non reserved keyword (#16471)
Jackie-Jiang Jul 30, 2025
9c10407
Replace all usages of commons-collections with commons-collections4 (…
NihalJain Jul 30, 2025
46ddb9a
Minor cleanups in logical tables routing related code (#16460)
yashmayya Jul 31, 2025
4ace88c
mse: change SendStatsPredicate.Safe to only send when the cluster is …
gortiz Jul 31, 2025
132f90a
Bump software.amazon.awssdk:bom from 2.32.11 to 2.32.12 (#16472)
dependabot[bot] Jul 31, 2025
d1926a6
Bump org.apache.commons:commons-csv from 1.14.0 to 1.14.1 (#16473)
dependabot[bot] Jul 31, 2025
62c7576
Fix unnesting of non-Map value collections. (#16387)
avshenuk Jul 31, 2025
1d534b4
Adding Match prefix phrase query lucene parser (#16476)
raghavyadav01 Aug 1, 2025
2cf81be
Enhance REGEXP_LIKE to scan dictionary when dictionary is small (#16478)
Jackie-Jiang Aug 1, 2025
221441f
Fix field shadowing in SparkSegmentTarPushJobRunner (#16482)
vedant280 Aug 1, 2025
1a4a530
Cleanup deprecated methods in ThreadResourceUsageAccountant (#16479)
Jackie-Jiang Aug 1, 2025
e59aa47
Fix linter violation in SparkSegmentTarPushJobRunner and also apply f…
Jackie-Jiang Aug 1, 2025
4cd3296
[timeseries][bugfix] Fixed timeseries API clashes in Controller (#16487)
shauryachats Aug 2, 2025
43ec504
Bump software.amazon.awssdk:bom from 2.32.12 to 2.32.13 (#16483)
dependabot[bot] Aug 2, 2025
b6f0067
Bump org.apache.pulsar:pulsar-bom from 4.0.5 to 4.0.6 (#16484)
dependabot[bot] Aug 2, 2025
9e4bb2a
Add TableNameExtractor class to improve SQL table name extraction (#1…
xiangfu0 Aug 3, 2025
a09d01f
Remove unnecessary methods and config for ThreadResourceUsageAccounta…
vrajat Aug 4, 2025
0b0b35c
Provide the correct comparison time for evaluating whether a segment …
9aman Aug 4, 2025
c867974
Bump com.azure:azure-sdk-bom from 1.2.36 to 1.2.37 (#16501)
dependabot[bot] Aug 4, 2025
7750e03
Bump software.amazon.awssdk:bom from 2.32.13 to 2.32.14 (#16499)
dependabot[bot] Aug 4, 2025
12a3d29
Bump commons-cli:commons-cli from 1.9.0 to 1.10.0 (#16502)
dependabot[bot] Aug 4, 2025
5ceec5d
Bump net.minidev:json-smart from 2.5.2 to 2.6.0 (#16500)
dependabot[bot] Aug 4, 2025
923e61d
Bump commons-net:commons-net from 3.11.1 to 3.12.0 (#16503)
dependabot[bot] Aug 4, 2025
4abe567
Bump com.google.cloud:libraries-bom from 26.64.0 to 26.65.0 (#16504)
dependabot[bot] Aug 4, 2025
4f46771
Fixing typo CONFIG_OF_ZOOKEEPER_SERVER in the codebase (#16505)
xiangfu0 Aug 4, 2025
e061d04
Support time zone in controller ui and add start/end time of segment …
xiangfu0 Aug 5, 2025
1a5e0e5
Fail task cleanup validation only upon active subtasks (#16493)
shounakmk219 Aug 5, 2025
123dbfe
[refactor] Switching to RoutingManager for broker request handlers (#…
shauryachats Aug 5, 2025
1d03cd8
[timeseries] Enable table name driven broker selection for time serie…
shauryachats Aug 5, 2025
e961bdf
Bump software.amazon.awssdk:bom from 2.32.14 to 2.32.15 (#16512)
dependabot[bot] Aug 5, 2025
c9cf6d0
Bump immutables.version from 2.11.1 to 2.11.2 (#16513)
dependabot[bot] Aug 5, 2025
575032c
[Bug fix] Update logic that determines if a table is associated with …
J-HowHuang Aug 5, 2025
850b6ac
Add prune option for lineage operations (#16310)
Aug 5, 2025
64a07ec
[Planner] Add ProjectRemove rule into PRUNE_RULES (#16518)
songwdfu Aug 5, 2025
407d6f2
Clear threadLocal maps after use for DictionaryBasedGroupKeyGenerator…
songwdfu Aug 6, 2025
77d6de9
Fix string parsing for value aggregator (#16519)
Jackie-Jiang Aug 6, 2025
e50947a
Add tests for OOM Termination of MSE queries. (#16514)
vrajat Aug 6, 2025
ad4a39f
Bump com.nimbusds:nimbus-jose-jwt from 10.4 to 10.4.1 (#16522)
dependabot[bot] Aug 6, 2025
c4ea4ea
Bump software.amazon.awssdk:bom from 2.32.15 to 2.32.16 (#16523)
dependabot[bot] Aug 6, 2025
021368c
Fix typo in semi-join distinct project optimization rule (#16520)
yashmayya Aug 6, 2025
d5206cb
Remove ResourceManagerAccountingTest.testWorkerThreadInterruption() (…
Jackie-Jiang Aug 6, 2025
4b83b8b
Fix SSE subquery handling and clarify query start semantics (#16524)
gortiz Aug 6, 2025
78dabce
feat: Enhance Controller UI with comprehensive minion task stats and …
xiangfu0 Aug 6, 2025
4323a72
Enhance StringFunctions.replace() (#16528)
Jackie-Jiang Aug 6, 2025
4ff0448
fixing the bug in passive timeout handling (#16530)
xiangfu0 Aug 7, 2025
109d391
Fix a flaky assert when testing OOM Cancellation of MSE Queries (#16533)
vrajat Aug 7, 2025
b12d7f2
Allow and Initialise Server Rate Limiter before server starts consumi…
noob-se7en Aug 7, 2025
9f74fc7
Disable Calcite's AggregateUnionAggregate planner rule by default (#1…
yashmayya Aug 7, 2025
24c2346
Table rebalance changes for handling peer-download enabled tables (#1…
somandal Aug 7, 2025
94adc1a
Bump net.openhft:chronicle-bom from 2.27ea65 to 2.27ea66 (#16546)
dependabot[bot] Aug 7, 2025
befd8df
Bump org.jline:jline from 3.30.4 to 3.30.5 (#16548)
dependabot[bot] Aug 7, 2025
d510264
Bump org.webjars:swagger-ui from 5.27.0 to 5.27.1 (#16549)
dependabot[bot] Aug 7, 2025
8d061ee
rebalance ui flow fixes (#16545)
saptarshi1996 Aug 7, 2025
584119f
Bump tmp, @typescript-eslint/eslint-plugin, @typescript-eslint/parser…
dependabot[bot] Aug 7, 2025
34bc3a6
Persist QueryableDocIds on Disk for Upsert Tables (#16517)
deepthi912 Aug 8, 2025
ebd258c
Add Package Versions section to cluster manager UI (#16534)
xiangfu0 Aug 8, 2025
7bad810
Pauseless supports size based thresholds. Remove the todo for the sam…
9aman Aug 8, 2025
d8704ed
Add controller REST API to compile / validate MSE query (#16536)
yashmayya Aug 8, 2025
7d9d4f3
Bump net.openhft:chronicle-bom from 2.27ea66 to 2.27ea68 (#16557)
dependabot[bot] Aug 8, 2025
3117df7
Bump org.assertj:assertj-bom from 3.27.3 to 3.27.4 (#16558)
dependabot[bot] Aug 8, 2025
ff217a1
Bump software.amazon.awssdk:bom from 2.32.16 to 2.32.18 (#16559)
dependabot[bot] Aug 8, 2025
5b70d6f
Parse booleans for optimizeMaxInitialResultHolder once (#16561)
dinoocch Aug 8, 2025
642bf00
Enhance ValueAggregator (#16552)
Jackie-Jiang Aug 9, 2025
662be93
[Enhancement] Support refresh AWS credentials (#16553)
hongkunxu Aug 11, 2025
fd7a5ab
Making LIKE predicate case in-sensitive. (#16568)
raghavyadav01 Aug 11, 2025
a1e39b5
Fixing grpc maxInboundMessageSize usage in the GRPC ChannelManager (#…
xiangfu0 Aug 11, 2025
29f91c6
Add string type support to MIN/MAX aggregation functions (#16497)
arunkumarucet Aug 11, 2025
aa1cd28
Bump net.openhft:chronicle-bom from 2.27ea68 to 2.27ea70 (#16574)
dependabot[bot] Aug 11, 2025
6fb347e
Bump software.amazon.awssdk:bom from 2.32.18 to 2.32.19 (#16573)
dependabot[bot] Aug 11, 2025
3c6d5b1
[multistage] Push Collation from Exchange to Lite Mode Sort (#16551)
Aug 11, 2025
08b76f1
Udf improvements (#16431)
gortiz Aug 12, 2025
e05678a
Bump net.openhft:chronicle-bom from 2.27ea70 to 2.27ea71 (#16579)
dependabot[bot] Aug 12, 2025
2e9fc65
Bump software.amazon.awssdk:bom from 2.32.19 to 2.32.20 (#16578)
dependabot[bot] Aug 12, 2025
7f55d4f
[timeseries] Introducing POST /query/timeseries as a BrokerResponse c…
shauryachats Aug 13, 2025
b837df1
[timeseries][ui] Add configurable max series limit for timeseries cha…
shauryachats Aug 13, 2025
7f1c9fd
Add cluster level configuration for max num subtasks (#16571)
krishan1390 Aug 13, 2025
cb718b8
Bypass storage quota check for segment refresh with smaller size even…
jtao15 Aug 13, 2025
136139d
Bump immutables.version from 2.11.2 to 2.11.3 (#16586)
dependabot[bot] Aug 13, 2025
b06721a
Bump net.openhft:chronicle-bom from 2.27ea71 to 2.27ea72 (#16587)
dependabot[bot] Aug 13, 2025
dec9d04
Bump software.amazon.awssdk:bom from 2.32.20 to 2.32.21 (#16588)
dependabot[bot] Aug 13, 2025
1dc1320
Enhance LeafOperator (#16582)
Jackie-Jiang Aug 13, 2025
6b43809
Extract trimSize calculation logic to QueryContext (#16526)
songwdfu Aug 13, 2025
5bc318e
Misc bugfix/cleanup for thread accountant (#16532)
Jackie-Jiang Aug 13, 2025
0163ddf
broker: register LifecycleServiceStatusCallback before Helix matchers…
xiangfu0 Aug 13, 2025
436beaa
Controller UI: Fix subtask filter crash; add Minion Task page status …
xiangfu0 Aug 13, 2025
2a2048a
check pauseless comsumption when multi-topic ingest (#16507)
musclemuller Aug 13, 2025
625330e
Add distinct UNION set operator (#16570)
yashmayya Aug 14, 2025
058f7aa
Pass QueryContext to ProjectionOperator (#16589)
rhodo Aug 14, 2025
a9bf0cc
Fix logger for pauseless (#16593)
9aman Aug 14, 2025
1cc901f
[MSE] Enriched join operator (#16123)
songwdfu Aug 14, 2025
224174c
Bump eclipse.jetty.version from 9.4.57.v20241219 to 9.4.58.v20250814 …
dependabot[bot] Aug 14, 2025
2c42233
Bump com.nimbusds:nimbus-jose-jwt from 10.4.1 to 10.4.2 (#16598)
dependabot[bot] Aug 14, 2025
671022e
Bump software.amazon.awssdk:bom from 2.32.21 to 2.32.22 (#16599)
dependabot[bot] Aug 14, 2025
2119b7d
Bump org.jetbrains.kotlin:kotlin-bom from 2.2.0 to 2.2.10 (#16600)
dependabot[bot] Aug 14, 2025
d9e7317
broker: per-table routing build lock and request gating\n\n- Add per-…
xiangfu0 Aug 14, 2025
3d44c91
Refactor SetOperator and child classes for cleaner abstraction (#16602)
yashmayya Aug 15, 2025
6f2b8f9
Bump com.google.j2objc:j2objc-annotations from 3.0.0 to 3.1 (#16612)
dependabot[bot] Aug 15, 2025
88190cc
Enforce UTF8 when decoding byte[] to string in ValueReader (#16608)
jtao15 Aug 15, 2025
eec756e
[Auto reset 1/3]Auto reset offset during ingestion lag (#16492)
lnbest0707 Aug 15, 2025
7965e04
Refactor set operator tests to use BlockListMultiStageOperator instea…
yashmayya Aug 15, 2025
014cdd6
change consuming segment offset and age from int to long (#16614)
J-HowHuang Aug 15, 2025
3512df7
Bump software.amazon.awssdk:bom from 2.32.22 to 2.32.23 (#16611)
dependabot[bot] Aug 15, 2025
1eb2e78
Handle timestamp string to long casts in scalar cast function (#16606)
yashmayya Aug 15, 2025
f7f054f
[Plannner] Support tracing of planner rule productions (#16581)
songwdfu Aug 15, 2025
3349df1
[SSE] Trim group when orderBy key is same as groupBy key, sort-aggreg…
songwdfu Aug 15, 2025
e78c836
Change BasePeriodicTask to use a lock object for start / stop rather …
somandal Aug 16, 2025
555e576
Add distinctCountSmartULL aggregation (set→ULL smart promotion) (#16605)
xiangfu0 Aug 16, 2025
44dd108
Add a rebalance option to disable the summary (#16615)
somandal Aug 17, 2025
285a18b
broker/server: add ignoreMissingSegments query option with broker con…
xiangfu0 Aug 18, 2025
962f45c
Controller UI: add TASK_ERROR to subtask status filter (#16609)
xiangfu0 Aug 19, 2025
72bf3bf
Remove TaskType from ThreadExecutionContext (#16633)
Jackie-Jiang Aug 19, 2025
2c901d7
Revert "broker: per-table routing build lock and request gating (#165…
rhodo Aug 19, 2025
cf1e3de
Revert "Remove TaskType from ThreadExecutionContext (#16633)" (#16640)
J-HowHuang Aug 19, 2025
269c9c9
Bump software.amazon.awssdk:bom from 2.32.23 to 2.32.25 (#16637)
dependabot[bot] Aug 19, 2025
09f8876
Bump com.google.cloud:libraries-bom from 26.65.0 to 26.66.0 (#16638)
dependabot[bot] Aug 19, 2025
46a1f0e
Keep value of necessary columns only in ComplexTypeTranformer (#16624)
J-HowHuang Aug 20, 2025
5b151f7
[multistage] Fix Bug in Physical Optimizer for SetOp Heterogenous Dis…
Aug 20, 2025
18d5644
Project 2B POC code
Aug 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ kubernetes/helm/**/Chart.lock
#Develocity
.mvn/.gradle-enterprise/
.mvn/.develocity/

pinot-integration-tests/src/test/resources/udf-test-results/*.md
!/pinot-integration-tests/src/test/resources/udf-test-results/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
import org.apache.pinot.core.auth.ManualAuthorization;
import org.apache.pinot.core.auth.TargetType;
import org.apache.pinot.core.routing.RoutingTable;
import org.apache.pinot.core.routing.ServerRouteInfo;
import org.apache.pinot.core.routing.TimeBoundaryInfo;
import org.apache.pinot.core.routing.SegmentsToQuery;
import org.apache.pinot.core.routing.timeboundary.TimeBoundaryInfo;
import org.apache.pinot.core.transport.ServerInstance;
import org.apache.pinot.core.transport.server.routing.stats.ServerRoutingStatsEntry;
import org.apache.pinot.core.transport.server.routing.stats.ServerRoutingStatsManager;
Expand Down Expand Up @@ -158,11 +158,11 @@ public Map<String, Map<ServerInstance, List<String>>> getRoutingTable(
@ApiResponse(code = 404, message = "Routing not found"),
@ApiResponse(code = 500, message = "Internal server error")
})
public Map<String, Map<ServerInstance, ServerRouteInfo>> getRoutingTableWithOptionalSegments(
public Map<String, Map<ServerInstance, SegmentsToQuery>> getRoutingTableWithOptionalSegments(
@ApiParam(value = "Name of the table") @PathParam("tableName") String tableName,
@Context HttpHeaders headers) {
tableName = DatabaseUtils.translateTableName(tableName, headers);
Map<String, Map<ServerInstance, ServerRouteInfo>> result = new TreeMap<>();
Map<String, Map<ServerInstance, SegmentsToQuery>> result = new TreeMap<>();
getRoutingTable(tableName, (tableNameWithType, routingTable) -> result.put(tableNameWithType,
routingTable.getServerInstanceToSegmentsMap()));
if (!result.isEmpty()) {
Expand Down Expand Up @@ -193,7 +193,7 @@ private void getRoutingTable(String tableName, BiConsumer<String, RoutingTable>
}

private static Map<ServerInstance, List<String>> removeOptionalSegments(
Map<ServerInstance, ServerRouteInfo> serverInstanceToSegmentsMap) {
Map<ServerInstance, SegmentsToQuery> serverInstanceToSegmentsMap) {
Map<ServerInstance, List<String>> ret = new HashMap<>();
serverInstanceToSegmentsMap.forEach((k, v) -> ret.put(k, v.getSegments()));
return ret;
Expand Down Expand Up @@ -232,7 +232,7 @@ public Map<ServerInstance, List<String>> getRoutingTableForQuery(
@ApiResponse(code = 404, message = "Routing not found"),
@ApiResponse(code = 500, message = "Internal server error")
})
public Map<ServerInstance, ServerRouteInfo> getRoutingTableForQueryWithOptionalSegments(
public Map<ServerInstance, SegmentsToQuery> getRoutingTableForQueryWithOptionalSegments(
@ApiParam(value = "SQL query (table name should have type suffix)") @QueryParam("query") String query,
@Context HttpHeaders httpHeaders) {
BrokerRequest brokerRequest = CalciteSqlCompiler.compileToBrokerRequest(query);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,33 @@ public void processSqlWithMultiStageQueryEnginePost(String query, @Suspended Asy
}
}

@POST
@ManagedAsync
@Produces(MediaType.APPLICATION_JSON)
@Path("query/timeseries")
@ApiOperation(value = "Query Pinot using the Time Series Engine")
@ManualAuthorization
public void processTimeSeriesQueryEngine(Map<String, String> queryParams, @Suspended AsyncResponse asyncResponse,
@Context org.glassfish.grizzly.http.server.Request requestCtx, @Context HttpHeaders httpHeaders) {
try {
if (!queryParams.containsKey(Request.QUERY)) {
throw new IllegalStateException("Payload is missing the query string field 'query'");
}
String language = queryParams.get(Request.LANGUAGE);
String queryString = queryParams.get(Request.QUERY);
try (RequestScope requestContext = Tracing.getTracer().createRequestScope()) {
PinotBrokerTimeSeriesResponse response = executeTimeSeriesQuery(language, queryString, queryParams,
requestContext, makeHttpIdentity(requestCtx), httpHeaders);
asyncResponse.resume(response.toBrokerResponse());
}
} catch (Exception e) {
LOGGER.error("Caught exception while processing POST timeseries request", e);
_brokerMetrics.addMeteredGlobalValue(BrokerMeter.UNCAUGHT_POST_EXCEPTIONS, 1L);
asyncResponse.resume(new WebApplicationException(e,
Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build()));
}
}

@GET
@ManagedAsync
@Produces(MediaType.APPLICATION_JSON)
Expand All @@ -293,7 +320,7 @@ public void processTimeSeriesQueryEngine(@Suspended AsyncResponse asyncResponse,
try {
try (RequestScope requestContext = Tracing.getTracer().createRequestScope()) {
String queryString = requestCtx.getQueryString();
PinotBrokerTimeSeriesResponse response = executeTimeSeriesQuery(language, queryString, requestContext,
PinotBrokerTimeSeriesResponse response = executeTimeSeriesQuery(language, queryString, Map.of(), requestContext,
makeHttpIdentity(requestCtx), httpHeaders);
if (response.getErrorType() != null && !response.getErrorType().isEmpty()) {
asyncResponse.resume(Response.serverError().entity(response).build());
Expand Down Expand Up @@ -538,9 +565,10 @@ private BrokerResponse executeSqlQuery(ObjectNode sqlRequestJson, HttpRequesterI
}

private PinotBrokerTimeSeriesResponse executeTimeSeriesQuery(String language, String queryString,
RequestContext requestContext, RequesterIdentity requesterIdentity, HttpHeaders httpHeaders) {
return _requestHandler.handleTimeSeriesRequest(language, queryString, requestContext, requesterIdentity,
httpHeaders);
Map<String, String> queryParams, RequestContext requestContext, RequesterIdentity requesterIdentity,
HttpHeaders httpHeaders) {
return _requestHandler.handleTimeSeriesRequest(language, queryString, queryParams, requestContext,
requesterIdentity, httpHeaders);
}

public static HttpRequesterIdentity makeHttpIdentity(org.glassfish.grizzly.http.server.Request context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.apache.pinot.broker.broker.helix;

import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import java.io.IOException;
import java.net.InetAddress;
import java.util.ArrayList;
Expand Down Expand Up @@ -85,6 +84,7 @@
import org.apache.pinot.query.mailbox.MailboxService;
import org.apache.pinot.query.service.dispatch.QueryDispatcher;
import org.apache.pinot.segment.local.function.GroovyFunctionEvaluator;
import org.apache.pinot.spi.accounting.ThreadResourceUsageAccountant;
import org.apache.pinot.spi.accounting.ThreadResourceUsageProvider;
import org.apache.pinot.spi.cursors.ResponseStoreService;
import org.apache.pinot.spi.env.PinotConfiguration;
Expand Down Expand Up @@ -153,13 +153,14 @@ public abstract class BaseBrokerStarter implements ServiceStartable {
protected AbstractResponseStore _responseStore;
protected BrokerGrpcServer _brokerGrpcServer;
protected FailureDetector _failureDetector;
protected ThreadResourceUsageAccountant _resourceUsageAccountant;

@Override
public void init(PinotConfiguration brokerConf)
throws Exception {
_brokerConf = brokerConf;
// Remove all white-spaces from the list of zkServers (if any).
_zkServers = brokerConf.getProperty(Helix.CONFIG_OF_ZOOKEEPR_SERVER).replaceAll("\\s+", "");
_zkServers = brokerConf.getProperty(Helix.CONFIG_OF_ZOOKEEPER_SERVER).replaceAll("\\s+", "");
_clusterName = brokerConf.getProperty(Helix.CONFIG_OF_CLUSTER_NAME);
ServiceStartableUtils.applyClusterConfig(_brokerConf, _zkServers, _clusterName, ServiceRole.BROKER);
applyCustomConfigs(brokerConf);
Expand Down Expand Up @@ -345,14 +346,27 @@ public void start()
instanceId -> _routingManager.excludeServerFromRouting(instanceId));
_failureDetector.start();

// Enable/disable thread CPU time measurement through instance config.
ThreadResourceUsageProvider.setThreadCpuTimeMeasurementEnabled(
_brokerConf.getProperty(CommonConstants.Broker.CONFIG_OF_ENABLE_THREAD_CPU_TIME_MEASUREMENT,
CommonConstants.Broker.DEFAULT_ENABLE_THREAD_CPU_TIME_MEASUREMENT));
// Enable/disable thread memory allocation tracking through instance config
ThreadResourceUsageProvider.setThreadMemoryMeasurementEnabled(
_brokerConf.getProperty(CommonConstants.Broker.CONFIG_OF_ENABLE_THREAD_ALLOCATED_BYTES_MEASUREMENT,
CommonConstants.Broker.DEFAULT_THREAD_ALLOCATED_BYTES_MEASUREMENT));
_resourceUsageAccountant = Tracing.ThreadAccountantOps.createThreadAccountant(
_brokerConf.subset(CommonConstants.PINOT_QUERY_SCHEDULER_PREFIX), _instanceId,
org.apache.pinot.spi.config.instance.InstanceType.BROKER);
Preconditions.checkNotNull(_resourceUsageAccountant);

// Create Broker request handler.
String brokerId = _brokerConf.getProperty(Broker.CONFIG_OF_BROKER_ID, getDefaultBrokerId());
String brokerRequestHandlerType =
_brokerConf.getProperty(Broker.BROKER_REQUEST_HANDLER_TYPE, Broker.DEFAULT_BROKER_REQUEST_HANDLER_TYPE);
BaseSingleStageBrokerRequestHandler singleStageBrokerRequestHandler;
if (brokerRequestHandlerType.equalsIgnoreCase(Broker.GRPC_BROKER_REQUEST_HANDLER_TYPE)) {
singleStageBrokerRequestHandler = new GrpcBrokerRequestHandler(_brokerConf, brokerId, _routingManager,
_accessControlFactory, _queryQuotaManager, tableCache, _failureDetector);
_accessControlFactory, _queryQuotaManager, tableCache, _failureDetector, _resourceUsageAccountant);
} else {
// Default request handler type, i.e. netty
NettyConfig nettyDefaults = NettyConfig.extractNettyConfig(_brokerConf, Broker.BROKER_NETTY_PREFIX);
Expand All @@ -364,7 +378,7 @@ public void start()
singleStageBrokerRequestHandler =
new SingleConnectionBrokerRequestHandler(_brokerConf, brokerId, _routingManager, _accessControlFactory,
_queryQuotaManager, tableCache, nettyDefaults, tlsDefaults, _serverRoutingStatsManager,
_failureDetector);
_failureDetector, _resourceUsageAccountant);
}
MultiStageBrokerRequestHandler multiStageBrokerRequestHandler = null;
QueryDispatcher queryDispatcher = null;
Expand All @@ -377,13 +391,13 @@ public void start()
queryDispatcher = createQueryDispatcher(_brokerConf);
multiStageBrokerRequestHandler =
new MultiStageBrokerRequestHandler(_brokerConf, brokerId, _routingManager, _accessControlFactory,
_queryQuotaManager, tableCache, _multiStageQueryThrottler, _failureDetector);
_queryQuotaManager, tableCache, _multiStageQueryThrottler, _failureDetector, _resourceUsageAccountant);
}
TimeSeriesRequestHandler timeSeriesRequestHandler = null;
if (StringUtils.isNotBlank(_brokerConf.getProperty(PinotTimeSeriesConfiguration.getEnabledLanguagesConfigKey()))) {
Preconditions.checkNotNull(queryDispatcher, "Multistage Engine should be enabled to use time-series engine");
timeSeriesRequestHandler = new TimeSeriesRequestHandler(_brokerConf, brokerId, _routingManager,
_accessControlFactory, _queryQuotaManager, tableCache, queryDispatcher);
_accessControlFactory, _queryQuotaManager, tableCache, queryDispatcher, _resourceUsageAccountant);
}

LOGGER.info("Initializing PinotFSFactory");
Expand All @@ -407,17 +421,6 @@ public void start()
timeSeriesRequestHandler, _responseStore);
_brokerRequestHandler.start();

// Enable/disable thread CPU time measurement through instance config.
ThreadResourceUsageProvider.setThreadCpuTimeMeasurementEnabled(
_brokerConf.getProperty(CommonConstants.Broker.CONFIG_OF_ENABLE_THREAD_CPU_TIME_MEASUREMENT,
CommonConstants.Broker.DEFAULT_ENABLE_THREAD_CPU_TIME_MEASUREMENT));
// Enable/disable thread memory allocation tracking through instance config
ThreadResourceUsageProvider.setThreadMemoryMeasurementEnabled(
_brokerConf.getProperty(CommonConstants.Broker.CONFIG_OF_ENABLE_THREAD_ALLOCATED_BYTES_MEASUREMENT,
CommonConstants.Broker.DEFAULT_THREAD_ALLOCATED_BYTES_MEASUREMENT));
Tracing.ThreadAccountantOps.initializeThreadAccountant(
_brokerConf.subset(CommonConstants.PINOT_QUERY_SCHEDULER_PREFIX), _instanceId,
org.apache.pinot.spi.config.instance.InstanceType.BROKER);
Tracing.ThreadAccountantOps.startThreadAccountant();

String controllerUrl = _brokerConf.getProperty(Broker.CONTROLLER_URL);
Expand Down Expand Up @@ -568,7 +571,7 @@ private void updateInstanceConfigAndBrokerResourceIfNeeded() {
if (StringUtils.isNotEmpty(instanceTagsConfig)) {
for (String instanceTag : StringUtils.split(instanceTagsConfig, ',')) {
Preconditions.checkArgument(TagNameUtils.isBrokerTag(instanceTag), "Illegal broker instance tag: %s",
instanceTag);
instanceTag);
instanceConfig.addTag(instanceTag);
}
shouldUpdateBrokerResource = true;
Expand Down Expand Up @@ -618,11 +621,12 @@ private void registerServiceStatusHandler() {

LOGGER.info("Registering service status handler");
ServiceStatus.setServiceStatusCallback(_instanceId, new ServiceStatus.MultipleCallbackServiceStatusCallback(
ImmutableList.of(new ServiceStatus.IdealStateAndCurrentStateMatchServiceStatusCallback(_participantHelixManager,
List.of(
new ServiceStatus.LifecycleServiceStatusCallback(this::isStarting, this::isShuttingDown),
new ServiceStatus.IdealStateAndCurrentStateMatchServiceStatusCallback(_participantHelixManager,
_clusterName, _instanceId, resourcesToMonitor, minResourcePercentForStartup),
new ServiceStatus.IdealStateAndExternalViewMatchServiceStatusCallback(_participantHelixManager,
_clusterName, _instanceId, resourcesToMonitor, minResourcePercentForStartup),
new ServiceStatus.LifecycleServiceStatusCallback(this::isStarting, this::isShuttingDown))));
_clusterName, _instanceId, resourcesToMonitor, minResourcePercentForStartup))));
}

private String getDefaultBrokerId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public HelixBrokerStarter(PinotConfiguration brokerConf, String clusterName, Str
private static PinotConfiguration applyBrokerConfigs(PinotConfiguration brokerConf, String clusterName,
String zkServers, @Nullable String brokerHost) {
brokerConf.setProperty(Helix.CONFIG_OF_CLUSTER_NAME, clusterName);
brokerConf.setProperty(Helix.CONFIG_OF_ZOOKEEPR_SERVER, zkServers);
brokerConf.setProperty(Helix.CONFIG_OF_ZOOKEEPER_SERVER, zkServers);
if (brokerHost == null) {
brokerConf.clearProperty(Broker.CONFIG_OF_BROKER_HOSTNAME);
} else {
Expand All @@ -75,7 +75,7 @@ public static HelixBrokerStarter getDefault()
properties.put(Helix.KEY_OF_BROKER_QUERY_PORT, 5001);
properties.put(Broker.CONFIG_OF_BROKER_TIMEOUT_MS, 60 * 1000L);
properties.put(Helix.CONFIG_OF_CLUSTER_NAME, "quickstart");
properties.put(Helix.CONFIG_OF_ZOOKEEPR_SERVER, "localhost:2122");
properties.put(Helix.CONFIG_OF_ZOOKEEPER_SERVER, "localhost:2122");
HelixBrokerStarter helixBrokerStarter = new HelixBrokerStarter();
helixBrokerStarter.init(new PinotConfiguration(properties));
return helixBrokerStarter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.apache.pinot.broker.broker.AccessControlFactory;
import org.apache.pinot.broker.querylog.QueryLogger;
import org.apache.pinot.broker.queryquota.QueryQuotaManager;
import org.apache.pinot.broker.routing.BrokerRoutingManager;
import org.apache.pinot.common.config.provider.TableCache;
import org.apache.pinot.common.metrics.BrokerMeter;
import org.apache.pinot.common.metrics.BrokerMetrics;
Expand All @@ -53,6 +52,8 @@
import org.apache.pinot.common.utils.request.RequestUtils;
import org.apache.pinot.core.auth.Actions;
import org.apache.pinot.core.auth.TargetType;
import org.apache.pinot.core.routing.RoutingManager;
import org.apache.pinot.spi.accounting.ThreadResourceUsageAccountant;
import org.apache.pinot.spi.auth.AuthorizationResult;
import org.apache.pinot.spi.auth.TableAuthorizationResult;
import org.apache.pinot.spi.auth.broker.RequesterIdentity;
Expand All @@ -76,7 +77,7 @@ public abstract class BaseBrokerRequestHandler implements BrokerRequestHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(BaseBrokerRequestHandler.class);
protected final PinotConfiguration _config;
protected final String _brokerId;
protected final BrokerRoutingManager _routingManager;
protected final RoutingManager _routingManager;
protected final AccessControlFactory _accessControlFactory;
protected final QueryQuotaManager _queryQuotaManager;
protected final TableCache _tableCache;
Expand All @@ -89,6 +90,8 @@ public abstract class BaseBrokerRequestHandler implements BrokerRequestHandler {
protected final QueryLogger _queryLogger;
@Nullable
protected final String _enableNullHandling;
protected final ThreadResourceUsageAccountant _resourceUsageAccountant;

/**
* Maps broker-generated query id to the query string.
*/
Expand All @@ -98,8 +101,9 @@ public abstract class BaseBrokerRequestHandler implements BrokerRequestHandler {
*/
protected final Map<Long, String> _clientQueryIds;

public BaseBrokerRequestHandler(PinotConfiguration config, String brokerId, BrokerRoutingManager routingManager,
AccessControlFactory accessControlFactory, QueryQuotaManager queryQuotaManager, TableCache tableCache) {
public BaseBrokerRequestHandler(PinotConfiguration config, String brokerId, RoutingManager routingManager,
AccessControlFactory accessControlFactory, QueryQuotaManager queryQuotaManager, TableCache tableCache,
ThreadResourceUsageAccountant resourceUsageAccountant) {
_config = config;
_brokerId = brokerId;
_routingManager = routingManager;
Expand All @@ -125,6 +129,7 @@ public BaseBrokerRequestHandler(PinotConfiguration config, String brokerId, Brok
_queriesById = null;
_clientQueryIds = null;
}
_resourceUsageAccountant = resourceUsageAccountant;
}

@Override
Expand Down Expand Up @@ -389,6 +394,12 @@ protected String extractClientRequestId(SqlNodeAndOptions sqlNodeAndOptions) {
? sqlNodeAndOptions.getOptions().get(Broker.Request.QueryOptionKey.CLIENT_QUERY_ID) : null;
}

/**
* Called when a query starts
* TODO: This method was created to keep track of running queries for cancellation, but it is useful for other uses.
* But right now the semantics are not clear. For example, while MSE calls this method once, SSE calls it once per
* query AND subquery, which means this method is called multiple times for the same query.
*/
protected void onQueryStart(long requestId, String clientRequestId, String query, Object... extras) {
if (isQueryCancellationEnabled()) {
_queriesById.put(requestId, query);
Expand Down
Loading