jberragan commented on code in PR #62:
URL:
https://github.com/apache/cassandra-analytics/pull/62#discussion_r1668957381
##########
cassandra-analytics-common/src/main/java/org/apache/cassandra/spark/utils/ByteBufferUtils.java:
##########
@@ -30,20 +30,13 @@
import java.nio.charset.CharsetDecoder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
-
-import io.netty.util.concurrent.FastThreadLocal;
+import java.util.function.Supplier;
public final class ByteBufferUtils
{
+ public static final ThreadLocal<CharsetDecoder> UTF8_DECODER_PROVIDER =
ThreadLocal.withInitial(StandardCharsets.UTF_8::newDecoder);
Review Comment:
We do not depend on netty in the `common` module, and we only depend
transitively through Spark in the `core` module to use the
`io.netty.util.concurrent.FastThreadLocal` class to provide the
`CharsetDecoder`.
This allows us to use `io.netty.util.concurrent.FastThreadLocal` when
running in Spark, and fallback to `java.lang.ThreadLocal` if netty is not
available.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]