Skip to content

Commit

Permalink
BanyanDBStorageClient: Add `define(Property property, PropertyStore.S…
Browse files Browse the repository at this point in the history
…trategy strategy)` API. (#11461)
  • Loading branch information
wankai123 authored Oct 27, 2023
1 parent 39d3659 commit 4c7dbbc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/en/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* Support collect ZGC memory pool metrics.
* Add a component ID for Netty-http (ID=151).
* Add a component ID for Fiber (ID=5021).
* BanyanDBStorageClient: Add `define(Property property, PropertyStore.Strategy strategy)` API.

#### UI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ public TopNQueryResponse query(TopNQuery q) throws IOException {
}
}

/**
* PropertyStore.Strategy is default to {@link PropertyStore.Strategy#MERGE}
*/
public void define(Property property) throws IOException {
try {
this.client.apply(property);
Expand All @@ -165,6 +168,16 @@ public void define(Property property) throws IOException {
}
}

public void define(Property property, PropertyStore.Strategy strategy) throws IOException {
try {
this.client.apply(property, strategy);
this.healthChecker.health();
} catch (BanyanDBException ex) {
healthChecker.unHealth(ex);
throw new IOException("fail to define property", ex);
}
}

public void define(Stream stream) throws IOException {
try {
this.client.define(stream);
Expand Down

0 comments on commit 4c7dbbc

Please sign in to comment.