-
Notifications
You must be signed in to change notification settings - Fork 322
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
feat: add standalone mode in java sdk #1485
Conversation
java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/sdk/impl/SqlClusterExecutor.java
Outdated
Show resolved
Hide resolved
java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/sdk/SdkOption.java
Outdated
Show resolved
Hide resolved
add standalone test. start standalone openmldb in |
ok, should I add a StandaloneSmokeTest in |
Codecov Report
@@ Coverage Diff @@
## main #1485 +/- ##
============================================
+ Coverage 66.51% 66.62% +0.10%
Complexity 281 281
============================================
Files 583 587 +4
Lines 110438 111006 +568
Branches 974 981 +7
============================================
+ Hits 73455 73953 +498
- Misses 36791 36861 +70
Partials 192 192
Continue to review full report at Codecov.
|
java/openmldb-jdbc/src/test/java/com/_4paradigm/openmldb/jdbc/StandaloneRouterSmokeTest.java
Outdated
Show resolved
Hide resolved
java/openmldb-jdbc/src/test/java/com/_4paradigm/openmldb/jdbc/StandaloneRouterSmokeTest.java
Outdated
Show resolved
Hide resolved
java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/sdk/impl/SqlClusterExecutor.java
Outdated
Show resolved
Hide resolved
java/openmldb-jdbc/src/test/java/com/_4paradigm/openmldb/jdbc/TestConfig.java
Show resolved
Hide resolved
sqlOpt.setEnable_debug(option.getEnableDebug()); | ||
sqlOpt.setRequest_timeout(option.getRequestTimeout()); | ||
this.sqlRouter = sql_router_sdk.NewClusterSQLRouter(sqlOpt); | ||
sqlOpt.delete(); |
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.
don't the GC handle it automatically ? @vagetablechicken
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.
If swigCMemOwn==true
, it'll gc. But we've found CMem cost too much or memory leak before(maybe gc is not immediate), so in java sdk, we manually delete CMem in every place.
Just leave it, until we can remove all manul deletion.
java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/sdk/SdkOption.java
Outdated
Show resolved
Hide resolved
|
||
static { | ||
try { | ||
SdkOption option = new SdkOption(); | ||
option.setZkPath(TestConfig.ZK_PATH); | ||
option.setZkCluster(TestConfig.ZK_CLUSTER); | ||
option.setSessionTimeout(200000); | ||
router = new SqlClusterExecutor(option); | ||
java.sql.Statement state = router.getStatement(); | ||
clusterRouter = new SqlClusterExecutor(option); |
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.
must call Init()
for both clusterRouter
and standaloneRouter
before use
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.
must call
Init()
for bothclusterRouter
andstandaloneRouter
before use
which init()? SqlClusterExecutor seems have no Init()
method
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.
router->Init()
is in SqlClusterExecutor
. It's better to change the name. clusterRouter -> clusterExecutor or clusterClient
return isClusterMode; | ||
} | ||
|
||
public void setClusterMode(boolean clusterMode) { |
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.
where the option is set ?
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.
where the option is set ?
before use SqlClusterExecutor we should set option, see SQLRouterSmokeTest
close #620
onebox/start_onebox.sh
support standalone modeclose #1523