-
Notifications
You must be signed in to change notification settings - Fork 972
Add FileSessionConfAdvisor to manage session level configuration #3742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… only explicitly specify relevant parameters after the URL, for example:
beeline -u 'jdbc:hive2://127.0.0.1:10009/?kyuubi.engineEnv.FLINK_HOME=/opt/flink;kyuubi.ha.namespace=kyuubi-ns-c;kyuubi.engine.type=FLINK_SQL'
This method is extremely unfriendly to users, and it is extremely unsafe to expose namespaces to users.
So I added a yaml file(engine-cluster-env.yaml) to manage the engine clusters, so that we can use this cluster only by specifying a unique engine name, for example:
use cluster-a:
beeline -u 'jdbc:hive2://127.0.0.1:10009/?kyuubi.engine.cluster.name=cluster-a'
use cluster-c:
beeline -u 'jdbc:hive2://127.0.0.1:10009/?kyuubi.engine.cluster.name=cluster-c'
engine-cluster-env.yaml configuration is as follows:
cluster-a:
conf:
"kyuubi.ha.namespace": kyuubi-ns-a
"kyuubi.engine.type": SPARK_SQL
"kyuubi.engine.pool.balance.policy": POLLING
env:
SPARK_HOME: /opt/spark
HADOOP_CONF_DIR: /opt/hadoop_conf_dir
cluster-b:
conf:
"kyuubi.ha.namespace": kyuubi-ns-b
"kyuubi.engine.type": SPARK_SQL
"kyuubi.engine.pool.balance.policy": POLLING
env:
SPARK_HOME: /opt/spark2
HADOOP_CONF_DIR: /opt/hadoop_conf_dir2
cluster-c:
conf:
"kyuubi.ha.namespace": kyuubi-ns-c
"kyuubi.engine.type": FLINK_SQL
"kyuubi.engine.pool.balance.policy": POLLING
env:
FLINK_HOME: /opt/flink
|
It looks like |
|
How about leveraging |
|
I'm thinking of some ideas that may be related. Currently, Kyuubi provides the For example,
|
Sorry for the trouble caused by the inappropriate title, which has been corrected |
Codecov Report
@@ Coverage Diff @@
## master #3742 +/- ##
============================================
+ Coverage 52.57% 52.89% +0.31%
Complexity 13 13
============================================
Files 492 497 +5
Lines 27705 27994 +289
Branches 3830 3860 +30
============================================
+ Hits 14566 14807 +241
- Misses 11751 11788 +37
- Partials 1388 1399 +11
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Changed to the implementation of SessionConfAdvisor based on yaml file, please review again, thanks |
When kyuubi.session.conf.advisor=org.apache.kyuubi.plugin.FileSessionConfAdvisor,Specify a session level configuration file, which will be combined with default.conf to have an impact. The corresponding configuration file is conf/kyuubi-session-<profile>.conf
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/flink/FlinkProcessBuilder.scala
Show resolved
Hide resolved
kyuubi-server/src/test/scala/org/apache/kyuubi/engine/flink/FlinkProcessBuilderSuite.scala
Show resolved
Hide resolved
...rver/kyuubi-server-plugin/src/main/java/org/apache/kyuubi/plugin/FileSessionConfAdvisor.java
Outdated
Show resolved
Hide resolved
...s/server/kyuubi-server-plugin/src/main/java/org/apache/kyuubi/plugin/SessionConfAdvisor.java
Outdated
Show resolved
Hide resolved
...rver/kyuubi-server-plugin/src/main/java/org/apache/kyuubi/plugin/FileSessionConfAdvisor.java
Outdated
Show resolved
Hide resolved
kyuubi-server/src/test/scala/org/apache/kyuubi/engine/flink/FlinkProcessBuilderSuite.scala
Show resolved
Hide resolved
kyuubi-server/src/test/scala/org/apache/kyuubi/plugin/PluginLoaderSuite.scala
Outdated
Show resolved
Hide resolved
kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/session/FileSessionConfAdvisor.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/session/FileSessionConfAdvisor.scala
Outdated
Show resolved
Hide resolved
…sionConfAdvisor.scala
…sionConfAdvisor.scala
kyuubi-server/src/main/scala/org/apache/kyuubi/session/FileSessionConfAdvisor.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/session/FileSessionConfAdvisor.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/session/FileSessionConfAdvisor.scala
Outdated
Show resolved
Hide resolved
turboFei
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Some confusion on the pr description:
|
removed |
|
Thanks @ychris78 and all reviewers, merging to master |
thanks, merged to master |
Why are the changes needed?
When a kyuubi service connections to multiple engine clusters, we can only explicitly specify relevant parameters after the URL, for example:
beeline -u 'jdbc:hive2://127.0.0.1:10009/?kyuubi.engineEnv.FLINK_HOME=/opt/flink;kyuubi.ha.namespace=kyuubi-ns-c;kyuubi.engine.type=FLINK_SQL'This method is extremely unfriendly to users.
I implemented a SessionConfAdvisor implementation class
org.apache.kyuubi.session.FileSessionConfAdvisorbased on the conf file that to manage session level configurations, so that we can access this cluster only by specifying a unique engine name, for example:access cluster-a:
beeline -u 'jdbc:hive2://127.0.0.1:10009/?kyuubi.session.conf.profile=cluster-a'access cluster-c:
beeline -u 'jdbc:hive2://127.0.0.1:10009/?kyuubi.session.conf.profile=cluster-c'kyuubi-session-cluster-a.confconfiguration is as follows:kyuubi-session-cluster-c.confconfiguration is as follows:How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before make a pull request