Skip to content

Commit c92fd65

Browse files
authored
Refactor the way we use RCBI (#236)
Co-authored-by: Madhavan Sridharan <[email protected]>
1 parent 0e488c3 commit c92fd65

File tree

1 file changed

+35
-36
lines changed

1 file changed

+35
-36
lines changed

deployment/src/main/java/com/datastax/oss/quarkus/deployment/internal/CassandraClientProcessor.java

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,22 @@ FeatureBuildItem feature() {
6565
@BuildStep
6666
List<ReflectiveClassBuildItem> registerGraphForReflection() {
6767

68-
/* TODO: We're creating an RCBI instance per class here to match up with the pre-Quarkus3.0 usage.
69-
* Check to see if we can just simplify this to something like RCBI.builder(names).foo().build() */
70-
return Stream.of(
71-
// Required for the driver DependencyCheck mechanism
72-
"org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal",
73-
// Should be initialized at build time:
74-
"org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0",
75-
"org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer",
76-
// Required by Tinkerpop:
77-
// TODO check if this is really all that is instantiated by reflection
78-
"org.apache.tinkerpop.gremlin.structure.Graph",
79-
"org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph",
80-
"org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph",
81-
"org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource")
82-
.map(
83-
(clzName) ->
84-
ReflectiveClassBuildItem.builder(clzName).methods(true).fields(true).build())
85-
.collect(Collectors.toList());
68+
return Collections.singletonList(
69+
ReflectiveClassBuildItem.builder(
70+
// Required for the driver DependencyCheck mechanism
71+
"org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal",
72+
// Should be initialized at build time:
73+
"org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0",
74+
"org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer",
75+
// Required by Tinkerpop:
76+
// TODO check if this is really all that is instantiated by reflection
77+
"org.apache.tinkerpop.gremlin.structure.Graph",
78+
"org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph",
79+
"org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph",
80+
"org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource")
81+
.methods(true)
82+
.fields(true)
83+
.build());
8684
}
8785

8886
@BuildStep
@@ -94,10 +92,11 @@ ReflectiveClassBuildItem registerGeometryForReflection() {
9492
@BuildStep
9593
List<ReflectiveClassBuildItem> registerJsonForReflection() {
9694
// Required for the driver DependencyCheck mechanism
97-
return Stream.of(
98-
"com.fasterxml.jackson.core.JsonParser", "com.fasterxml.jackson.databind.ObjectMapper")
99-
.map((clzName) -> ReflectiveClassBuildItem.builder(clzName).build())
100-
.collect(Collectors.toList());
95+
return Collections.singletonList(
96+
ReflectiveClassBuildItem.builder(
97+
"com.fasterxml.jackson.core.JsonParser",
98+
"com.fasterxml.jackson.databind.ObjectMapper")
99+
.build());
101100
}
102101

103102
@BuildStep
@@ -111,20 +110,20 @@ List<ReflectiveClassBuildItem> registerReactiveForReflection() {
111110
List<ReflectiveClassBuildItem> registerLz4ForReflection(
112111
CassandraClientBuildTimeConfig buildTimeConfig) {
113112
if (buildTimeConfig.protocolCompression.equalsIgnoreCase("lz4")) {
114-
return Stream.of(
115-
"net.jpountz.lz4.LZ4Compressor",
116-
"net.jpountz.lz4.LZ4JavaSafeCompressor",
117-
"net.jpountz.lz4.LZ4HCJavaSafeCompressor",
118-
"net.jpountz.lz4.LZ4JavaSafeFastDecompressor",
119-
"net.jpountz.lz4.LZ4JavaSafeSafeDecompressor",
120-
"net.jpountz.lz4.LZ4JavaUnsafeCompressor",
121-
"net.jpountz.lz4.LZ4HCJavaUnsafeCompressor",
122-
"net.jpountz.lz4.LZ4JavaUnsafeFastDecompressor",
123-
"net.jpountz.lz4.LZ4JavaUnsafeSafeDecompressor")
124-
.map(
125-
(clzName) ->
126-
ReflectiveClassBuildItem.builder(clzName).constructors(true).fields(true).build())
127-
.collect(Collectors.toList());
113+
return Collections.singletonList(
114+
ReflectiveClassBuildItem.builder(
115+
"net.jpountz.lz4.LZ4Compressor",
116+
"net.jpountz.lz4.LZ4JavaSafeCompressor",
117+
"net.jpountz.lz4.LZ4HCJavaSafeCompressor",
118+
"net.jpountz.lz4.LZ4JavaSafeFastDecompressor",
119+
"net.jpountz.lz4.LZ4JavaSafeSafeDecompressor",
120+
"net.jpountz.lz4.LZ4JavaUnsafeCompressor",
121+
"net.jpountz.lz4.LZ4HCJavaUnsafeCompressor",
122+
"net.jpountz.lz4.LZ4JavaUnsafeFastDecompressor",
123+
"net.jpountz.lz4.LZ4JavaUnsafeSafeDecompressor")
124+
.constructors(true)
125+
.fields(true)
126+
.build());
128127
}
129128
return Collections.emptyList();
130129
}

0 commit comments

Comments
 (0)