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

lujiajing pushed a commit to branch banyandb-integration-stream
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/banyandb-integration-stream by 
this push:
     new 5552736735 fix interface after rebase
5552736735 is described below

commit 5552736735386eaf08cfe64a63c46c1474a3dc77
Author: Megrez Lu <[email protected]>
AuthorDate: Thu May 5 12:27:32 2022 +0800

    fix interface after rebase
---
 .../storage/plugin/banyandb/BanyanDBConverter.java | 28 +++++++++++++++-------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git 
a/oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/BanyanDBConverter.java
 
b/oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/BanyanDBConverter.java
index 77963e2ff5..1f91e55cac 100644
--- 
a/oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/BanyanDBConverter.java
+++ 
b/oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/BanyanDBConverter.java
@@ -37,7 +37,6 @@ import 
org.apache.skywalking.oap.server.library.util.StringUtil;
 import org.apache.skywalking.oap.server.storage.plugin.banyandb.util.ByteUtil;
 
 import java.util.List;
-import java.util.function.Function;
 
 public class BanyanDBConverter {
     public static class StorageToStream implements Convert2Entity {
@@ -60,8 +59,8 @@ public class BanyanDBConverter {
         }
 
         @Override
-        public <T, R> R getWith(String fieldName, Function<T, R> typeDecoder) {
-            return (R) this.get(fieldName);
+        public byte[] getBytes(String fieldName) {
+            return rowEntity.getTagValue(fieldName);
         }
     }
 
@@ -240,16 +239,27 @@ public class BanyanDBConverter {
         @Override
         public Object get(String fieldName) {
             MetadataRegistry.ColumnSpec spec = schema.getSpec(fieldName);
-            if (double.class.equals(spec.getColumnClass())) {
-                return ByteUtil.bytes2Double(dataPoint.getTagValue(fieldName));
-            } else {
-                return dataPoint.getTagValue(fieldName);
+            switch (spec.getColumnType()) {
+                case TAG:
+                    if (double.class.equals(spec.getColumnClass())) {
+                        return 
ByteUtil.bytes2Double(dataPoint.getTagValue(fieldName));
+                    } else {
+                        return dataPoint.getTagValue(fieldName);
+                    }
+                case FIELD:
+                default:
+                    if (double.class.equals(spec.getColumnClass())) {
+                        return 
ByteUtil.bytes2Double(dataPoint.getFieldValue(fieldName));
+                    } else {
+                        return dataPoint.getFieldValue(fieldName);
+                    }
             }
         }
 
         @Override
-        public <T, R> R getWith(String fieldName, Function<T, R> typeDecoder) {
-            return (R) this.get(fieldName);
+        public byte[] getBytes(String fieldName) {
+            // TODO: double may be a field?
+            return dataPoint.getFieldValue(fieldName);
         }
     }
 }

Reply via email to