rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ding...@apache.org
Subject [rocketmq] branch graalvm updated: [graal] Successfully run with main method (#1158)
Date Mon, 15 Apr 2019 11:52:53 GMT
This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch graalvm
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/graalvm by this push:
     new 8ab9aef  [graal] Successfully run with main method (#1158)
8ab9aef is described below

commit 8ab9aef0315e6e2bc44db5e95a6d4d11bf39d4ee
Author: ziyilin <lin.ziyi@hotmail.com>
AuthorDate: Mon Apr 15 19:52:48 2019 +0800

    [graal] Successfully run with main method (#1158)
---
 client/config/reflect-config.json                  | 170 +++++++++++++++++++++
 .../java/org/apache/rocketmq/client/Producer.java  |   5 +-
 client/svm.sh                                      |  15 +-
 3 files changed, 183 insertions(+), 7 deletions(-)

diff --git a/client/config/reflect-config.json b/client/config/reflect-config.json
new file mode 100644
index 0000000..d369915
--- /dev/null
+++ b/client/config/reflect-config.json
@@ -0,0 +1,170 @@
+[
+  
+  {
+    "name":"[B"
+  },
+  {
+    "name":"[J"
+  },
+  {
+    "name":"[Ljava.lang.Object;"
+  },
+  {
+    "name":"io.netty.channel.socket.nio.NioSocketChannel",
+    "methods":[{ "name":"<init>", "parameterTypes":[] }]
+  },
+  {
+    "name":"java.beans.Transient"
+  },
+  {
+    "name":"java.lang.Byte"
+  },
+  {
+    "name":"java.lang.Class"
+  },
+  {
+    "name":"java.lang.Comparable",
+    "allPublicMethods":true
+  },
+  {
+    "name":"java.lang.Float"
+  },
+  {
+    "name":"java.lang.Integer"
+  },
+  {
+    "name":"java.lang.Long"
+  },
+  {
+    "name":"java.lang.Object"
+  },
+  {
+    "name":"java.lang.String",
+    "fields":[{"name":"value"}]
+  },
+  {
+    "name":"java.lang.System"
+  },
+  {
+    "name":"java.nio.Bits",
+    "methods":[{ "name":"unaligned", "parameterTypes":[] }]
+  },
+  {
+    "name":"java.nio.Buffer",
+    "fields":[{"name":"address"}]
+  },
+  {
+    "name":"java.nio.DirectByteBuffer",
+    "fields":[{"name":"cleaner"}],
+    "methods":[{ "name":"<init>", "parameterTypes":["long", "int"] }]
+  },
+  {
+    "name":"java.nio.file.Path"
+  },
+  {
+    "name":"org.apache.rocketmq.common.protocol.header.SendMessageRequestHeaderV2",
+    "allDeclaredFields":true
+  },
+  {
+    "name":"org.apache.rocketmq.common.protocol.header.SendMessageResponseHeader",
+    "allDeclaredFields":true,
+    "methods":[{ "name":"<init>", "parameterTypes":[] }]
+  },
+  {
+    "name":"org.apache.rocketmq.common.protocol.header.UnregisterClientRequestHeader",
+    "allDeclaredFields":true
+  },
+  {
+    "name":"org.apache.rocketmq.common.protocol.header.namesrv.GetRouteInfoRequestHeader",
+    "allDeclaredFields":true
+  },
+  {
+    "name":"org.apache.rocketmq.common.protocol.heartbeat.HeartbeatData",
+    "allDeclaredFields":true,
+    "allPublicFields":true,
+    "allPublicMethods":true
+  },
+  {
+    "name":"org.apache.rocketmq.common.protocol.heartbeat.ProducerData",
+    "allDeclaredFields":true,
+    "allPublicFields":true,
+    "allPublicMethods":true
+  },
+  {
+    "name":"org.apache.rocketmq.common.protocol.route.BrokerData",
+    "allDeclaredFields":true,
+    "allDeclaredConstructors":true,
+    "allPublicFields":true,
+    "allPublicMethods":true
+  },
+  {
+    "name":"org.apache.rocketmq.common.protocol.route.QueueData",
+    "allDeclaredFields":true,
+    "allDeclaredConstructors":true,
+    "allPublicFields":true,
+    "allPublicMethods":true
+  },
+  {
+    "name":"org.apache.rocketmq.common.protocol.route.TopicRouteData",
+    "allDeclaredFields":true,
+    "allDeclaredConstructors":true,
+    "allPublicFields":true,
+    "allPublicMethods":true
+  },
+  {
+    "name":"org.apache.rocketmq.remoting.protocol.LanguageCode",
+    "fields":[
+      {"name":"CPP"}, 
+      {"name":"DELPHI"}, 
+      {"name":"DOTNET"}, 
+      {"name":"ERLANG"}, 
+      {"name":"GO"}, 
+      {"name":"HTTP"}, 
+      {"name":"JAVA"}, 
+      {"name":"OMS"}, 
+      {"name":"OTHER"}, 
+      {"name":"PHP"}, 
+      {"name":"PYTHON"}, 
+      {"name":"RUBY"}
+    ]
+  },
+  {
+    "name":"org.apache.rocketmq.remoting.protocol.RemotingCommand",
+    "allDeclaredFields":true,
+    "allDeclaredConstructors":true,
+    "allPublicFields":true,
+    "allPublicMethods":true
+  },
+  {
+    "name":"org.apache.rocketmq.remoting.protocol.RemotingSerializable",
+    "allDeclaredFields":true,
+    "allPublicMethods":true
+  },
+  {
+    "name":"org.apache.rocketmq.remoting.protocol.SerializeType",
+    "fields":[
+      {"name":"JSON"}, 
+      {"name":"ROCKETMQ"}
+    ]
+  },
+  {
+    "name":"sun.misc.Cleaner",
+    "methods":[{ "name":"clean", "parameterTypes":[] }]
+  },
+  {
+    "name":"sun.misc.Unsafe",
+    "fields":[{"name":"theUnsafe"}],
+    "methods":[{ "name":"copyMemory", "parameterTypes":["java.lang.Object", "long", "java.lang.Object",
"long", "long"] }]
+  },
+  {
+    "name":"sun.misc.VM",
+    "methods":[{ "name":"maxDirectMemory", "parameterTypes":[] }]
+  },
+  {
+    "name":"sun.nio.ch.SelectorImpl",
+    "fields":[
+      {"name":"publicSelectedKeys"}, 
+      {"name":"selectedKeys"}
+    ]
+  }
+]
diff --git a/client/src/main/java/org/apache/rocketmq/client/Producer.java b/client/src/main/java/org/apache/rocketmq/client/Producer.java
index 6751d40..ff87cd6 100644
--- a/client/src/main/java/org/apache/rocketmq/client/Producer.java
+++ b/client/src/main/java/org/apache/rocketmq/client/Producer.java
@@ -8,13 +8,16 @@ import org.apache.rocketmq.client.producer.DefaultMQProducer;
 import org.apache.rocketmq.client.producer.SendResult;
 import org.apache.rocketmq.common.message.Message;
 import org.apache.rocketmq.remoting.common.RemotingHelper;
+
+import com.alibaba.fastjson.parser.ParserConfig;
+
 import io.netty.handler.logging.LoggingHandler;
 import io.netty.handler.logging.LogLevel;
 
 public class Producer {
     private static final LoggingHandler log = new LoggingHandler(LogLevel.DEBUG);
     public static void main(String[] args) throws MQClientException, InterruptedException
{
-
+    	ParserConfig.global.setAsmEnable(false);
         DefaultMQProducer producer = new DefaultMQProducer("ProducerGroupName");
         producer.start();
 
diff --git a/client/svm.sh b/client/svm.sh
index 5a09433..e13cfcf 100755
--- a/client/svm.sh
+++ b/client/svm.sh
@@ -1,21 +1,24 @@
 #!/bin/bash
 SVM_OPT="--allow-incomplete-classpath --report-unsupported-elements-at-runtime"
-SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=com.alibaba.fastjson.serializer.JodaCodec"
 SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator"
 SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator"
 SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkNpnApplicationProtocolNegotiator"
 SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkNpnSslEngine"
 SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkAlpnSslEngine"
+SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.util.internal.JavassistTypeParameterMatcherGenerator"
+SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=com.alibaba.fastjson.serializer.JodaCodec"
 # testing
 #SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.util.SelfSignedCertificate"
 #SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.util.ThreadLocalInsecureRandom"
 SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=io.netty.handler.ssl.util.SelfSignedCertificate"
 SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=io.netty.handler.ssl.util.ThreadLocalInsecureRandom"
-SVM_OPT="${SVM_OPT} --enable-url-protocols=http"
+SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=com.alibaba.fastjson.serializer.SerializeConfig"
+SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=com.alibaba.fastjson.parser.ParserConfig"
 
+SVM_OPT="${SVM_OPT} --enable-url-protocols=http"
 
 WORKDIR=`pwd`
-CONFIG_OPT=" -Dio.netty.noUnsafe=true -H:+ReportExceptionStackTraces --allow-incomplete-classpath"
-#native_image=/home/cengfeng.lzy/GraalDev/graal/vm/mxbuild/linux-amd64/GRAALVM_LIBGRAAL/graalvm-libgraal-1.0.0-rc15-dev/bin/native-image
-native_image=~/tools/graalvm-ce-1.0.0-rc14/bin/native-image
-$native_image  $CONFIG_OPT $SVM_OPT -jar target/rocketmq-client-4.4.1-SNAPSHOT-jar-with-dependencies.jar
+CONFIG_OPT="-H:ConfigurationFileDirectories=${WORKDIR}/config -Dio.netty.noUnsafe=true -H:+ReportExceptionStackTraces
--allow-incomplete-classpath"
+native_image=/home/cengfeng.lzy/GraalDev/graal/vm/mxbuild/linux-amd64/GRAALVM_LIBGRAAL/graalvm-libgraal-1.0.0-rc16-dev/bin/native-image
+#native_image=~/tools/graalvm-ce-1.0.0-rc14/bin/native-image
+$native_image  $CONFIG_OPT $SVM_OPT  -jar target/rocketmq-client-4.5.1-SNAPSHOT-jar-with-dependencies.jar


Mime
View raw message