From e9fb5d54a840e6591fa86462722cf56150874601 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Tue, 23 Jun 2020 10:04:41 +0200 Subject: [PATCH] Add basic native image configuration #1316 Original pull request: #1318. --- .../native-image/native-image.properties | 1 + .../META-INF/native-image/proxy-config.json | 3 + .../META-INF/native-image/reflect-config.json | 233 ++++++++++++++++++ 3 files changed, 237 insertions(+) create mode 100644 src/main/resources/META-INF/native-image/native-image.properties create mode 100644 src/main/resources/META-INF/native-image/proxy-config.json create mode 100644 src/main/resources/META-INF/native-image/reflect-config.json diff --git a/src/main/resources/META-INF/native-image/native-image.properties b/src/main/resources/META-INF/native-image/native-image.properties new file mode 100644 index 0000000000..96c2bea8f5 --- /dev/null +++ b/src/main/resources/META-INF/native-image/native-image.properties @@ -0,0 +1 @@ +Args = --initialize-at-build-time=io.lettuce.core.metrics.DefaultCommandLatencyCollector diff --git a/src/main/resources/META-INF/native-image/proxy-config.json b/src/main/resources/META-INF/native-image/proxy-config.json new file mode 100644 index 0000000000..97c6691e38 --- /dev/null +++ b/src/main/resources/META-INF/native-image/proxy-config.json @@ -0,0 +1,3 @@ +[ + ["io.lettuce.core.api.sync.RedisCommands","io.lettuce.core.cluster.api.sync.RedisClusterCommands"] +] diff --git a/src/main/resources/META-INF/native-image/reflect-config.json b/src/main/resources/META-INF/native-image/reflect-config.json new file mode 100644 index 0000000000..6211bae33c --- /dev/null +++ b/src/main/resources/META-INF/native-image/reflect-config.json @@ -0,0 +1,233 @@ +[ + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields", + "fields":[{"name":"producerLimit","allowUnsafeAccess" : true}] + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields", + "fields":[{"name":"consumerIndex","allowUnsafeAccess" : true}] + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields", + "fields":[{"name":"producerIndex", "allowUnsafeAccess" : true}] + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerIndexField", + "fields":[{"name":"consumerIndex", "allowUnsafeAccess" : true}] + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerIndexField", + "fields":[{"name":"producerIndex", "allowUnsafeAccess" : true}] + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerLimitField", + "fields":[{"name":"producerLimit","allowUnsafeAccess" : true}] + }, + { + "name":"java.nio.Buffer", + "fields":[{"name":"address", "allowUnsafeAccess":true}] + }, + { + "name":"java.nio.DirectByteBuffer", + "fields":[{"name":"cleaner", "allowUnsafeAccess":true}], + "methods":[{"name":"","parameterTypes":["long","int"] }] + }, + { + "name":"io.netty.buffer.AbstractReferenceCountedByteBuf", + "fields":[{"name":"refCnt", "allowUnsafeAccess":true}] + }, + { + "name": "io.lettuce.core.AbstractRedisAsyncCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.lettuce.core.ChannelGroupListener", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.lettuce.core.ConnectionEventTrigger", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.lettuce.core.PlainChannelInitializer$1", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.lettuce.core.RedisAsyncCommandsImpl", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.lettuce.core.RedisClient", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.lettuce.core.api.sync.BaseRedisCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.lettuce.core.api.sync.RedisCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.lettuce.core.api.sync.RedisGeoCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.lettuce.core.api.sync.RedisHLLCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.lettuce.core.api.sync.RedisHashCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.lettuce.core.api.sync.RedisKeyCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.lettuce.core.api.sync.RedisListCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.lettuce.core.api.sync.RedisScriptingCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.lettuce.core.api.sync.RedisServerCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.lettuce.core.api.sync.RedisSetCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.lettuce.core.api.sync.RedisSortedSetCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.lettuce.core.api.sync.RedisStreamCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.lettuce.core.api.sync.RedisStringCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.lettuce.core.api.sync.RedisTransactionalCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + + { + "name":"io.lettuce.core.cluster.api.sync.RedisClusterCommands", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + + { + "name":"io.lettuce.core.protocol.CommandHandler", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.lettuce.core.protocol.ConnectionWatchdog", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + + { + "name":"io.lettuce.core.resource.ClientResources", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + + { + "name":"io.lettuce.core.resource.DefaultClientResources", + "allDeclaredFields" : true, + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.netty.buffer.AbstractByteBufAllocator", + "allPublicMethods": true, + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true + }, + { + "name":"io.netty.buffer.PooledByteBufAllocator", + "allPublicMethods": true, + "allDeclaredFields":true, + "allDeclaredMethods":true, + "allDeclaredConstructors":true + }, + { + "name":"io.netty.channel.ChannelDuplexHandler", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.netty.channel.ChannelHandlerAdapter", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.netty.channel.ChannelInboundHandlerAdapter", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.netty.channel.ChannelInitializer", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.netty.channel.ChannelOutboundHandlerAdapter", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.netty.channel.DefaultChannelPipeline$HeadContext", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.netty.channel.DefaultChannelPipeline$TailContext", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.netty.channel.socket.nio.NioSocketChannel", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name": "io.netty.handler.codec.MessageToByteEncoder", + "allPublicMethods": true, + "allDeclaredConstructors":true + }, + { + "name":"io.netty.util.ReferenceCountUtil", + "allPublicMethods": true, + "allDeclaredConstructors":true + } +]