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/03/02 11:34:32 UTC

[GitHub] [skywalking] wu-sheng commented on a change in pull request #8615: fix [Bug] Length of column events.parameters is too small to hold "Start Java Application" event with long JAVA_OPTS #8608

wu-sheng commented on a change in pull request #8615:
URL: https://github.com/apache/skywalking/pull/8615#discussion_r817605126



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Event.java
##########
@@ -99,7 +99,7 @@ protected String id0() {
     @Column(columnName = MESSAGE)
     private String message;
 
-    @Column(columnName = PARAMETERS, storageOnly = true, length = 1024)
+    @Column(columnName = PARAMETERS, storageOnly = true, length = 20000)

Review comment:
       I think we need to control length in serialization process too? Otherwise still could have over length.

##########
File path: oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/test/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/mysql/MySQLTableInstallerTest.java
##########
@@ -0,0 +1,40 @@
+package org.apache.skywalking.oap.server.storage.plugin.jdbc.mysql;
+
+import org.apache.skywalking.oap.server.core.source.DefaultScopeDefine;
+import org.apache.skywalking.oap.server.core.source.Event;
+import org.apache.skywalking.oap.server.core.storage.annotation.Storage;
+import org.apache.skywalking.oap.server.core.storage.model.Model;
+import org.apache.skywalking.oap.server.core.storage.model.StorageModels;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author jayxu
+ */
+public class MySQLTableInstallerTest {
+    @Test
+    public void test() throws Exception {
+        new DefaultScopeDefine.Listener().notify(Event.class);
+        Model m = new StorageModels().add(Event.class, DefaultScopeDefine.EVENT,
+            new Storage(null, false, null), false);
+
+        m.getColumns().stream()
+            .filter(c -> Event.PARAMETERS.equals(c.getColumnName().getName()))
+            .findAny().ifPresent(c -> {
+                String sql = new TestTableInstaller().getColumn(c);
+//                System.out.println(sql);
+                Assert.assertTrue("Should contains 'TEXT'",
+                    sql.contains("TEXT"));

Review comment:
       I think we have a type mapping method, don't have to test in a separate UT.

##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/model/ModelInstaller.java
##########
@@ -62,7 +62,7 @@ public void whenCreating(Model model) throws StorageException {
      * Installer implementation could use this API to request a column name replacement. This method delegates for
      * {@link ModelManipulator}.
      */
-    protected final void overrideColumnName(String columnName, String newName) {
+    protected void overrideColumnName(String columnName, String newName) {

Review comment:
       Don't recommend this change as UT seems not necessary.

##########
File path: oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/test/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/mysql/MySQLTableInstallerTest.java
##########
@@ -0,0 +1,40 @@
+package org.apache.skywalking.oap.server.storage.plugin.jdbc.mysql;
+
+import org.apache.skywalking.oap.server.core.source.DefaultScopeDefine;
+import org.apache.skywalking.oap.server.core.source.Event;
+import org.apache.skywalking.oap.server.core.storage.annotation.Storage;
+import org.apache.skywalking.oap.server.core.storage.model.Model;
+import org.apache.skywalking.oap.server.core.storage.model.StorageModels;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author jayxu
+ */
+public class MySQLTableInstallerTest {
+    @Test
+    public void test() throws Exception {
+        new DefaultScopeDefine.Listener().notify(Event.class);
+        Model m = new StorageModels().add(Event.class, DefaultScopeDefine.EVENT,
+            new Storage(null, false, null), false);
+
+        m.getColumns().stream()
+            .filter(c -> Event.PARAMETERS.equals(c.getColumnName().getName()))
+            .findAny().ifPresent(c -> {
+                String sql = new TestTableInstaller().getColumn(c);
+//                System.out.println(sql);

Review comment:
       Please remove this.




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