Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Import the dependency for your maven project:
<dependency>
<groupId>com.oceanbase</groupId>
<artifactId>obkv-table-client</artifactId>
<version>1.2.1</version>
<version>1.2.5</version>
</dependency>
```

Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/alipay/oceanbase/rpc/table/ObTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void init() throws Exception {
return;
}
initProperties();
init_check();
connectionFactory = ObConnectionFactory
.newBuilder()
.configWriteBufferWaterMark(getNettyBufferLowWatermark(),
Expand Down Expand Up @@ -113,6 +114,21 @@ public void close() {
}
}

/*
* Init check
*/
private void init_check() throws IllegalArgumentException {
if (obTableConnectionPoolSize <= 0) {
throw new IllegalArgumentException("invalid obTableConnectionPoolSize: "
+ obTableConnectionPoolSize);
} else if (ip.isEmpty() || port <= 0) {
throw new IllegalArgumentException("invalid ip or port: " + ip + ":" + port);
} else if (userName.isEmpty() || database.isEmpty()) {
throw new IllegalArgumentException("invalid userName or database: "
+ userName + ":" + database);
}
}

private void checkStatus() throws IllegalStateException {
if (!initialized) {
throw new IllegalStateException(" database [" + database + "] in ip [" + ip
Expand Down