prajwal-jadhav01 commented on code in PR #20121:
URL: https://github.com/apache/pinot/pull/20121#discussion_r4451230383
##########
pinot-connectors/pinot-flink-connector/src/main/java/org/apache/pinot/connector/flink/sink/PinotSink.java:
##########
@@ -83,6 +86,15 @@ public PinotSink(PinotGenericRowConverter<T>
recordConverter, TableConfig tableC
DEFAULT_SEGMENT_FLUSH_MAX_NUM_RECORDS, DEFAULT_EXECUTOR_POOL_SIZE);
}
+ /// Same as [#PinotSink(PinotGenericRowConverter, TableConfig, Schema,
String)], and also adds `authToken` to the
+ /// batch config so segment uploads authenticate with the controller. The
token only lives in the in-memory table
+ /// config; it is never written back to the controller.
+ public PinotSink(PinotGenericRowConverter<T> recordConverter, TableConfig
tableConfig, Schema schema,
+ String controllerBaseUrl, @Nullable String authToken) {
Review Comment:
Good catch, thanks. The `authToken` constructor now deep-copies the table
config (JSON round-trip via `JsonUtils`, since `new TableConfig(tc)` shares the
nested ingestion config) and only modifies the copy, so the caller's object
never holds the token. Added two tests: one where the caller's config has no
ingestion config and one with an existing batch config, both asserting the
caller's config is unchanged and doesn't contain the token. I checked that both
fail with the copy removed. I also updated the javadoc and README accordingly,
and noted in the README that the token is part of the serialized job graph.
I left the existing 4-arg constructor's in-place behaviour as is, since it
predates this PR and carries no secret; happy to change that separately if you
think it's worth it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]