You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/04/27 13:06:54 UTC
[GitHub] [skywalking-banyandb-java-client] lujiajing1126 commented on a diff in pull request #11: Truncate duration unit at days
lujiajing1126 commented on code in PR #11:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/11#discussion_r859774001
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java:
##########
@@ -373,7 +386,14 @@ private void defineIndexRules(Stream stream, List<IndexRule> indexRules) throws
IndexRuleMetadataRegistry irRegistry = new IndexRuleMetadataRegistry(checkNotNull(this.channel));
for (final IndexRule ir : indexRules) {
- irRegistry.create(ir);
+ try {
+ irRegistry.create(ir);
+ } catch (BanyanDBException ex) {
+ if (ex.getStatus().equals(Status.Code.ALREADY_EXISTS)) {
+ continue;
+ }
Review Comment:
> In code practice, we should not use `exception` to control workflow. Please use `isExist` before `create`.
Currently, we don't have `isExist` API.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org