You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by lu...@apache.org on 2022/04/27 01:38:39 UTC

[skywalking-banyandb-java-client] branch expose-methods updated: update cache while get measure and stream

This is an automated email from the ASF dual-hosted git repository.

lujiajing pushed a commit to branch expose-methods
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb-java-client.git


The following commit(s) were added to refs/heads/expose-methods by this push:
     new a222038  update cache while get measure and stream
a222038 is described below

commit a222038e3e3a924fd52b6fd6ef748e0c1fb776ee
Author: Megrez Lu <lu...@gmail.com>
AuthorDate: Wed Apr 27 09:38:30 2022 +0800

    update cache while get measure and stream
---
 .../org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java b/src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java
index c9e924d..23d8ff7 100644
--- a/src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java
+++ b/src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java
@@ -471,7 +471,9 @@ public class BanyanDBClient implements Closeable {
         Preconditions.checkArgument(!Strings.isNullOrEmpty(name));
 
         Stream s = new StreamMetadataRegistry(checkNotNull(this.channel)).get(group, name);
-        return s.withIndexRules(findIndexRulesByGroupAndBindingName(group, IndexRuleBinding.defaultBindingRule(name)));
+        s = s.withIndexRules(findIndexRulesByGroupAndBindingName(group, IndexRuleBinding.defaultBindingRule(name)));
+        MetadataCache.INSTANCE.register(s);
+        return s;
     }
 
     /**
@@ -486,7 +488,9 @@ public class BanyanDBClient implements Closeable {
         Preconditions.checkArgument(!Strings.isNullOrEmpty(name));
 
         Measure m = new MeasureMetadataRegistry(checkNotNull(this.channel)).get(group, name);
-        return m.withIndexRules(findIndexRulesByGroupAndBindingName(group, IndexRuleBinding.defaultBindingRule(name)));
+        m = m.withIndexRules(findIndexRulesByGroupAndBindingName(group, IndexRuleBinding.defaultBindingRule(name)));
+        MetadataCache.INSTANCE.register(m);
+        return m;
     }
 
     private List<IndexRule> findIndexRulesByGroupAndBindingName(String group, String bindingName) throws BanyanDBException {