This is an automated email from the ASF dual-hosted git repository.
keith-turner pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new f97a02f98b use slf4j in BCFile (#6684)
f97a02f98b is described below
commit f97a02f98b693f13a09306ac3aea82e063ecf8a0
Author: Keith Turner <[email protected]>
AuthorDate: Mon Nov 30 09:48:28 2026 -0500
use slf4j in BCFile (#6684)
When attempting to run a map reduce job that wrote RFiles it failed
because org.apache.commons.logging.LogFactory could not find a class.
Not sure why this started failing, but commons logging should not be
used when writing RFiles. Tracked this down to BCFile. Saw the
following exception.
```
2026-11-29 22:24:30,055 INFO mapreduce.Job: Task Id :
attempt_1795990110430_0002_r_000021_0, Status : FAILED
Error: java.lang.ExceptionInInitializerError: Exception
java.lang.NoClassDefFoundError: org/apache/logging/log4j/spi/LoggerAdapter [in
thread "main"]
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:423)
at java.base/java.lang.Class.forName(Class.java:414)
at
org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:419)
at
org.apache.commons.logging.LogFactory.lambda$newFactory$3(LogFactory.java:1432)
at
java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:1431)
at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:928)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:987)
at
org.apache.accumulo.core.file.rfile.bcfile.BCFile.<clinit>(BCFile.java:83)
at
org.apache.accumulo.core.file.rfile.bcfile.BCFile$Writer$WBlockState.<init>(BCFile.java:147)
at
org.apache.accumulo.core.file.rfile.bcfile.BCFile$Writer.prepareDataBlock(BCFile.java:426)
at
org.apache.accumulo.core.file.rfile.RFile$LocalityGroupWriter.append(RFile.java:490)
at
org.apache.accumulo.core.file.rfile.RFile$Writer.append(RFile.java:674)
at
org.apache.accumulo.core.client.rfile.RFileWriter.append(RFileWriter.java:212)
at
org.apache.accumulo.hadoop.mapreduce.AccumuloFileOutputFormat$1.write(AccumuloFileOutputFormat.java:91)
at
org.apache.accumulo.hadoop.mapreduce.AccumuloFileOutputFormat$1.write(AccumuloFileOutputFormat.java:74)
at
org.apache.hadoop.mapred.ReduceTask$NewTrackingRecordWriter.write(ReduceTask.java:559)
at
org.apache.hadoop.mapreduce.task.TaskInputOutputContextImpl.write(TaskInputOutputContextImpl.java:89)
at
org.apache.hadoop.mapreduce.lib.reduce.WrappedReducer$Context.write(WrappedReducer.java:105)
at org.apache.hadoop.mapreduce.Reducer.reduce(Reducer.java:150)
at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:171)
at
org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:628)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:390)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:178)
at
java.base/javax.security.auth.Subject.lambda$callAs$0(Subject.java:379)
at
java.base/java.security.AccessController.doPrivileged(AccessController.java:714)
at java.base/javax.security.auth.Subject.doAs(Subject.java:525)
at java.base/javax.security.auth.Subject.callAs(Subject.java:381)
at
org.apache.hadoop.security.authentication.util.SubjectUtil.callAs(SubjectUtil.java:242)
at
org.apache.hadoop.security.authentication.util.SubjectUtil.doAs(SubjectUtil.java:314)
at
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1958)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:172)
```
---
core/pom.xml | 4 ----
.../java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java | 6 +++---
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/core/pom.xml b/core/pom.xml
index c010e14333..68dfcf7b10 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -73,10 +73,6 @@
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
diff --git
a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
index 693c956b85..f9cd346417 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
@@ -48,14 +48,14 @@ import org.apache.accumulo.core.spi.crypto.NoFileDecrypter;
import org.apache.accumulo.core.spi.crypto.NoFileEncrypter;
import org.apache.accumulo.core.trace.ScanInstrumentation;
import org.apache.accumulo.core.util.CountingInputStream;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.Seekable;
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.io.compress.Compressor;
import org.apache.hadoop.io.compress.Decompressor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Block Compressed file, the underlying physical storage layer for TFile.
BCFile provides the basic
@@ -80,7 +80,7 @@ public final class BCFile {
* encryption were marked with this version.
*/
static final Version API_VERSION_1 = new Version((short) 1, (short) 0);
- static final Log LOG = LogFactory.getLog(BCFile.class);
+ static final Logger LOG = LoggerFactory.getLogger(BCFile.class);
private static final String FS_OUTPUT_BUF_SIZE_ATTR =
"tfile.fs.output.buffer.size";
private static final String FS_INPUT_BUF_SIZE_ATTR =
"tfile.fs.input.buffer.size";