You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "kezhenxu94 (via GitHub)" <gi...@apache.org> on 2023/02/09 08:31:16 UTC

[GitHub] [skywalking] kezhenxu94 opened a new pull request, #10367: Refactor `@Column` annotation, move column name that was used as logical sharding to legacy and deprecate it

kezhenxu94 opened a new pull request, #10367:
URL: https://github.com/apache/skywalking/pull/10367

   
   
   <!--
       ⚠️ Please make sure to read this template first, pull requests that don't accord with this template
       maybe closed without notice.
       Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
       Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
   -->
   
   <!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
   ### Fix <bug description or the bug issue number or bug issue link>
   - [ ] Add a unit test to verify that the fix works.
   - [ ] Explain briefly why the bug exists and how to fix it.
        ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
   
   <!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
   ### Improve the performance of <class or module or ...>
   - [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
   - [ ] The benchmark result.
   ```text
   <Paste the benchmark results here>
   ```
   - [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
        ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
   
   <!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
   ### <Feature description>
   - [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
   - [ ] Update the documentation to include this new feature.
   - [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
   - [ ] If it's UI related, attach the screenshots below.
        ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
   
   - [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
   - [ ] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).
   


-- 
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


[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10367: Refactor `@Column` annotation, move column name that was used as logical sharding to legacy and deprecate it

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #10367:
URL: https://github.com/apache/skywalking/pull/10367#discussion_r1101347172


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/DeepAnalysis.java:
##########
@@ -136,7 +138,10 @@ public AnalysisResult analysis(AnalysisResult result) {
             for (Field field : c.getDeclaredFields()) {
                 Column column = field.getAnnotation(Column.class);
                 if (column != null) {
-                    result.addPersistentField(field.getName(), column.columnName(), field.getType());
+                    result.addPersistentField(
+                        field.getName(),
+                        !Strings.isNullOrEmpty(column.legacyName()) ? column.legacyName() : column.name(),
+                        field.getType());

Review Comment:
   Well let me just revise



-- 
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


[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10367: Refactor `@Column` annotation, move column name that was used as logical sharding to legacy and deprecate it

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #10367:
URL: https://github.com/apache/skywalking/pull/10367#discussion_r1101333024


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/DeepAnalysis.java:
##########
@@ -136,7 +138,10 @@ public AnalysisResult analysis(AnalysisResult result) {
             for (Field field : c.getDeclaredFields()) {
                 Column column = field.getAnnotation(Column.class);
                 if (column != null) {
-                    result.addPersistentField(field.getName(), column.columnName(), field.getType());
+                    result.addPersistentField(
+                        field.getName(),
+                        !Strings.isNullOrEmpty(column.legacyName()) ? column.legacyName() : column.name(),
+                        field.getType());

Review Comment:
   > I am fine with this change. Meanwhile, legacy column should be used in ElasticSearch only.
   > What do I miss?
   
   Do we want to break all other storages? I mean do we want to use the new column names (like `datatable_summation` instead of previously `summation`) for all other storages? If true, than the legacy column is only used in ElasticSearch, otherwise, the other storages have to check whether `legacyColumn` is empty, if not use the legacy one so no breaking changes happen.



-- 
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


[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10367: Refactor `@Column` annotation, move column name that was used as logical sharding to legacy and deprecate it

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #10367:
URL: https://github.com/apache/skywalking/pull/10367#discussion_r1101343096


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/DeepAnalysis.java:
##########
@@ -136,7 +138,10 @@ public AnalysisResult analysis(AnalysisResult result) {
             for (Field field : c.getDeclaredFields()) {
                 Column column = field.getAnnotation(Column.class);
                 if (column != null) {
-                    result.addPersistentField(field.getName(), column.columnName(), field.getType());
+                    result.addPersistentField(
+                        field.getName(),
+                        !Strings.isNullOrEmpty(column.legacyName()) ? column.legacyName() : column.name(),
+                        field.getType());

Review Comment:
   We only need to keep consistent for ElasticSearch only.



-- 
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


[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10367: Refactor `@Column` annotation, move column name that was used as logical sharding to legacy and deprecate it

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #10367:
URL: https://github.com/apache/skywalking/pull/10367#discussion_r1101345185


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/DeepAnalysis.java:
##########
@@ -136,7 +138,10 @@ public AnalysisResult analysis(AnalysisResult result) {
             for (Field field : c.getDeclaredFields()) {
                 Column column = field.getAnnotation(Column.class);
                 if (column != null) {
-                    result.addPersistentField(field.getName(), column.columnName(), field.getType());
+                    result.addPersistentField(
+                        field.getName(),
+                        !Strings.isNullOrEmpty(column.legacyName()) ? column.legacyName() : column.name(),
+                        field.getType());

Review Comment:
   So you mean we should use the `ElasticSearch.Column` everywhere in the oal-module and maybe other non-storage related modules?



-- 
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


[GitHub] [skywalking] wu-sheng commented on pull request #10367: Refactor `@Column` annotation, move column name that was used as logical sharding to legacy and deprecate it

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #10367:
URL: https://github.com/apache/skywalking/pull/10367#issuecomment-1423861661

   I think we are better to keep legacy column name as ElasticSearch only?


-- 
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


[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10367: Refactor `@Column` annotation, move column name that was used as logical sharding to legacy and deprecate it

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #10367:
URL: https://github.com/apache/skywalking/pull/10367#discussion_r1101327647


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/DeepAnalysis.java:
##########
@@ -136,7 +138,10 @@ public AnalysisResult analysis(AnalysisResult result) {
             for (Field field : c.getDeclaredFields()) {
                 Column column = field.getAnnotation(Column.class);
                 if (column != null) {
-                    result.addPersistentField(field.getName(), column.columnName(), field.getType());
+                    result.addPersistentField(
+                        field.getName(),
+                        !Strings.isNullOrEmpty(column.legacyName()) ? column.legacyName() : column.name(),
+                        field.getType());

Review Comment:
   I am fine with this change. Meanwhile, legacy column should be  used in ElasticSearch only.
   What do I miss?



-- 
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


[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10367: Refactor `@Column` annotation, move column name that was used as logical sharding to legacy and deprecate it

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #10367:
URL: https://github.com/apache/skywalking/pull/10367#discussion_r1101343298


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/DeepAnalysis.java:
##########
@@ -136,7 +138,10 @@ public AnalysisResult analysis(AnalysisResult result) {
             for (Field field : c.getDeclaredFields()) {
                 Column column = field.getAnnotation(Column.class);
                 if (column != null) {
-                    result.addPersistentField(field.getName(), column.columnName(), field.getType());
+                    result.addPersistentField(
+                        field.getName(),
+                        !Strings.isNullOrEmpty(column.legacyName()) ? column.legacyName() : column.name(),
+                        field.getType());

Review Comment:
   > There is no other storage, BanyanDB is PoC stage only. All SQL database is going to be broke due to new design proposal.
   
   What about influxdb?



-- 
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


[GitHub] [skywalking] wu-sheng merged pull request #10367: Refactor `@Column` annotation, swap `Column#name` and `ElasticSearch.Column#columnAlias` and rename `ElasticSearch.Column#columnAlias` to `ElasticSearch.Column#legacyName`

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #10367:
URL: https://github.com/apache/skywalking/pull/10367


-- 
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


[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10367: Refactor `@Column` annotation, move column name that was used as logical sharding to legacy and deprecate it

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #10367:
URL: https://github.com/apache/skywalking/pull/10367#discussion_r1101291517


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/DeepAnalysis.java:
##########
@@ -136,7 +138,10 @@ public AnalysisResult analysis(AnalysisResult result) {
             for (Field field : c.getDeclaredFields()) {
                 Column column = field.getAnnotation(Column.class);
                 if (column != null) {
-                    result.addPersistentField(field.getName(), column.columnName(), field.getType());
+                    result.addPersistentField(
+                        field.getName(),
+                        !Strings.isNullOrEmpty(column.legacyName()) ? column.legacyName() : column.name(),
+                        field.getType());

Review Comment:
   > I think we are better to keep legacy column name as ElasticSearch only?
   
   legacy column is not only used in ElasticSearch storage, it's used in all other storage, moving it to ElasticSearch would make the codes look confusing and hard to understand.
   
   Here is an example, this is in `oal-rt` module, there is no reason we should use `ElasticSearch.Column`, that's really confusing why we should care about storage-specific implementation here.



-- 
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


[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10367: Refactor `@Column` annotation, move column name that was used as logical sharding to legacy and deprecate it

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #10367:
URL: https://github.com/apache/skywalking/pull/10367#discussion_r1101342555


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/DeepAnalysis.java:
##########
@@ -136,7 +138,10 @@ public AnalysisResult analysis(AnalysisResult result) {
             for (Field field : c.getDeclaredFields()) {
                 Column column = field.getAnnotation(Column.class);
                 if (column != null) {
-                    result.addPersistentField(field.getName(), column.columnName(), field.getType());
+                    result.addPersistentField(
+                        field.getName(),
+                        !Strings.isNullOrEmpty(column.legacyName()) ? column.legacyName() : column.name(),
+                        field.getType());

Review Comment:
   There is no other storage, BanyanDB is PoC stage only. All SQL database is going to be broke due to new design proposal.



-- 
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