提交 429c9b3c 编写于 作者: W webb2019 提交者: wu-sheng

Data binary limit (#3321)

*  fix "DATA_BINARY" limit VARCHAR(20000)
上级 f0acf9b6
......@@ -19,7 +19,10 @@
package org.apache.skywalking.oap.server.storage.plugin.jdbc.h2.dao;
import java.sql.*;
import org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord;
import org.apache.skywalking.oap.server.core.analysis.metrics.IntKeyLongValueHashMap;
import org.apache.skywalking.oap.server.core.source.DefaultScopeDefine;
import org.apache.skywalking.oap.server.core.storage.StorageException;
import org.apache.skywalking.oap.server.core.storage.model.*;
import org.apache.skywalking.oap.server.library.client.Client;
......@@ -90,6 +93,11 @@ public class H2TableInstaller extends ModelInstaller {
} else if (IntKeyLongValueHashMap.class.equals(type)) {
return "VARCHAR(20000)";
} else if (byte[].class.equals(type)) {
if (DefaultScopeDefine.SEGMENT == model.getScopeId()) {
if (name.getName().equals(SegmentRecord.DATA_BINARY)) {
return "MEDIUMTEXT";
}
}
return "VARCHAR(20000)";
} else {
throw new IllegalArgumentException("Unsupported data type: " + type.getName());
......
......@@ -71,6 +71,9 @@ public class MySQLTableInstaller extends H2TableInstaller {
if (DefaultScopeDefine.SEGMENT == model.getScopeId()) {
if (name.getName().equals(SegmentRecord.TRACE_ID) || name.getName().equals(SegmentRecord.SEGMENT_ID))
return "VARCHAR(300)";
if (name.getName().equals(SegmentRecord.DATA_BINARY)) {
return "MEDIUMTEXT";
}
}
return "VARCHAR(2000)";
} else if (IntKeyLongValueHashMap.class.equals(type)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册