You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2022/12/16 01:48:55 UTC
[skywalking] branch components created (now 6685839012)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a change to branch components
in repository https://gitbox.apache.org/repos/asf/skywalking.git
at 6685839012 upport multiple component IDs in the service topology level
This branch includes the following new commits:
new 6685839012 upport multiple component IDs in the service topology level
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[skywalking] 01/01: upport multiple component IDs in the service topology level
Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch components
in repository https://gitbox.apache.org/repos/asf/skywalking.git
commit 6685839012cfeae9b36408cb44d38d9935437e8e
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Fri Dec 16 09:48:38 2022 +0800
upport multiple component IDs in the service topology level
---
.../server/core/storage/model/DataTypeMapping.java | 28 ----------------------
.../ElasticSearchColumnTypeMappingTestCase.java | 25 ++++++++++++-------
2 files changed, 17 insertions(+), 36 deletions(-)
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/DataTypeMapping.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/DataTypeMapping.java
deleted file mode 100644
index 1f679de7e5..0000000000
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/DataTypeMapping.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.oap.server.core.storage.model;
-
-import java.lang.reflect.Type;
-
-public interface DataTypeMapping {
- /**
- * Map the given typd and genericType of the field to the column type.
- */
- String transform(Class<?> type, Type genericType);
-}
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/test/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/ElasticSearchColumnTypeMappingTestCase.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/test/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/ElasticSearchColumnTypeMappingTestCase.java
index ae1ecc78b7..fe3dcbc834 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/test/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/ElasticSearchColumnTypeMappingTestCase.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/test/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/ElasticSearchColumnTypeMappingTestCase.java
@@ -20,6 +20,8 @@ package org.apache.skywalking.oap.server.storage.plugin.elasticsearch.base;
import java.lang.reflect.Type;
import java.util.List;
+import org.apache.skywalking.oap.server.core.analysis.metrics.IntList;
+import org.apache.skywalking.oap.server.core.storage.model.ElasticSearchExtension;
import org.junit.Assert;
import org.junit.Test;
@@ -30,18 +32,25 @@ public class ElasticSearchColumnTypeMappingTestCase {
public void test() throws NoSuchFieldException {
ColumnTypeEsMapping mapping = new ColumnTypeEsMapping();
- Assert.assertEquals("integer", mapping.transform(int.class, int.class));
- Assert.assertEquals("integer", mapping.transform(Integer.class, Integer.class));
+ Assert.assertEquals("integer", mapping.transform(int.class, int.class, null));
+ Assert.assertEquals("integer", mapping.transform(Integer.class, Integer.class, null));
- Assert.assertEquals("long", mapping.transform(long.class, long.class));
- Assert.assertEquals("long", mapping.transform(Long.class, Long.class));
+ Assert.assertEquals("long", mapping.transform(long.class, long.class, null));
+ Assert.assertEquals("long", mapping.transform(Long.class, Long.class, null));
- Assert.assertEquals("double", mapping.transform(double.class, double.class));
- Assert.assertEquals("double", mapping.transform(Double.class, Double.class));
+ Assert.assertEquals("double", mapping.transform(double.class, double.class, null));
+ Assert.assertEquals("double", mapping.transform(Double.class, Double.class, null));
- Assert.assertEquals("keyword", mapping.transform(String.class, String.class));
+ Assert.assertEquals("keyword", mapping.transform(String.class, String.class, null));
final Type listFieldType = this.getClass().getField("a").getGenericType();
- Assert.assertEquals("keyword", mapping.transform(List.class, listFieldType));
+ Assert.assertEquals("keyword", mapping.transform(List.class, listFieldType,
+ new ElasticSearchExtension(null, null, false)
+ ));
+
+ Assert.assertEquals("keyword", mapping.transform(IntList.class, int.class,
+ new ElasticSearchExtension(null, null, true)));
+ Assert.assertEquals("text", mapping.transform(IntList.class, int.class,
+ new ElasticSearchExtension(null, null, false)));
}
}