This is an automated email from the ASF dual-hosted git repository.
rgoers pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/logging-flume.git
The following commit(s) were added to refs/heads/trunk by this push:
new bf19bb6f Spring boot4 (#460)
bf19bb6f is described below
commit bf19bb6fe975e7e36f5637292224faba3153e689
Author: Ralph Goers <[email protected]>
AuthorDate: Fri Jun 26 13:57:59 2026 -0700
Spring boot4 (#460)
* Add RoutableProxyChannelSelector and allow Interceptors to be configured
in Spring Boot
* Enhancements for Spring Boot
* Add relative path
* Drop LGPL spotbugs-annotations in favor of internal annotation
SpotBugs honors any annotation whose simple name is SuppressFBWarnings,
so a tiny internal annotation lets us avoid shipping a build dependency
on the LGPL-licensed spotbugs-annotations artifact.
Assisted-By: Claude Opus 4.8 (1M context) <[email protected]>
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI
<[email protected]>
* Fix formatting
* Fix potential NPE
---------
Co-authored-by: Piotr P. Karwasz <[email protected]>
Co-authored-by: Copilot Autofix powered by AI
<[email protected]>
---
flume-bom/pom.xml | 8 +-
flume-ng-channels/flume-file-channel/pom.xml | 1 -
.../org/apache/flume/conf/FlumeConfiguration.java | 2 +
.../flume/conf/channel/ChannelSelectorType.java | 6 +-
.../org/apache/flume/conf/channel/ChannelType.java | 5 +
.../flume/conf/internal/SuppressFBWarnings.java | 38 ++
.../apache/flume/conf/internal/package-info.java | 22 +
flume-ng-core/pom.xml | 1 -
.../org/apache/flume/channel/ChannelProcessor.java | 7 +
.../channel/LoadBalancingChannelSelector.java | 2 +
.../flume/channel/MultiplexingChannelSelector.java | 2 +
.../channel/RoutableProxyChannelSelector.java | 127 +++++
.../flume/lifecycle/LifecycleSupervisor.java | 2 +
.../flume/sink/AbstractSingleSinkProcessor.java | 2 +
.../apache/flume/sink/AbstractSinkProcessor.java | 2 +
.../apache/flume/sink/FailoverSinkProcessor.java | 2 +
.../flume/sink/LoadBalancingSinkProcessor.java | 2 +
.../java/org/apache/flume/source/ExecSource.java | 2 +
.../channel/TestRoutableProxyChannelSelector.java | 111 +++++
flume-ng-node/pom.xml | 23 -
.../flume/node/AbstractConfigurationProvider.java | 2 +-
flume-parent/pom.xml | 427 +----------------
flume-third-party/pom.xml | 520 +++++++++++++++++++++
pom.xml | 1 +
24 files changed, 870 insertions(+), 447 deletions(-)
diff --git a/flume-bom/pom.xml b/flume-bom/pom.xml
index 67ce79ed..67f840d2 100644
--- a/flume-bom/pom.xml
+++ b/flume-bom/pom.xml
@@ -38,11 +38,11 @@
<flume-jms.version>2.0.0-SNAPSHOT</flume-jms.version>
<flume-kafka.version>2.0.0-SNAPSHOT</flume-kafka.version>
<flume-scribe.version>2.0.0-SNAPSHOT</flume-scribe.version>
- <flume-spring-boot.version>2.0.0-SNAPSHOT</flume-spring-boot.version>
+ <flume-spring-boot.version>2.1.0-SNAPSHOT</flume-spring-boot.version>
<flume-taildir.version>2.0.0-SNAPSHOT</flume-taildir.version>
<flume-tools.version>2.0.0-SNAPSHOT</flume-tools.version>
<flume-legacy.version>2.0.0-SNAPSHOT</flume-legacy.version>
- <flume-morphline.version>2.0.0-SNAPSHOT</flume-morphline.version>
+ <flume-rpc.version>2.0.0-SNAPSHOT</flume-rpc.version>
</properties>
<dependencyManagement>
@@ -105,12 +105,12 @@
<dependency>
<groupId>org.apache.flume</groupId>
<artifactId>flume-rpc-avro</artifactId>
- <version>${project.version}</version>
+ <version>${flume-rpc.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flume</groupId>
<artifactId>flume-rpc-thrift</artifactId>
- <version>${project.version}</version>
+ <version>${flume-rpc.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flume</groupId>
diff --git a/flume-ng-channels/flume-file-channel/pom.xml
b/flume-ng-channels/flume-file-channel/pom.xml
index d4052e92..9e7e219c 100644
--- a/flume-ng-channels/flume-file-channel/pom.xml
+++ b/flume-ng-channels/flume-file-channel/pom.xml
@@ -121,7 +121,6 @@
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
- <version>${jsr305.version}</version>
<scope>provided</scope>
</dependency>
diff --git
a/flume-ng-configuration/src/main/java/org/apache/flume/conf/FlumeConfiguration.java
b/flume-ng-configuration/src/main/java/org/apache/flume/conf/FlumeConfiguration.java
index 1fd692a0..29c40a82 100644
---
a/flume-ng-configuration/src/main/java/org/apache/flume/conf/FlumeConfiguration.java
+++
b/flume-ng-configuration/src/main/java/org/apache/flume/conf/FlumeConfiguration.java
@@ -61,6 +61,7 @@ import org.apache.flume.conf.channel.ChannelConfiguration;
import org.apache.flume.conf.channel.ChannelType;
import org.apache.flume.conf.configfilter.ConfigFilterConfiguration;
import org.apache.flume.conf.configfilter.ConfigFilterType;
+import org.apache.flume.conf.internal.SuppressFBWarnings;
import org.apache.flume.conf.sink.SinkConfiguration;
import org.apache.flume.conf.sink.SinkGroupConfiguration;
import org.apache.flume.conf.sink.SinkType;
@@ -83,6 +84,7 @@ import org.apache.logging.log4j.Logger;
* @see org.apache.flume.node.ConfigurationProvider
*
*/
+@SuppressFBWarnings(value = {"EI_EXPOSE_REP"})
public class FlumeConfiguration {
private static final Logger logger = LogManager.getLogger();
diff --git
a/flume-ng-configuration/src/main/java/org/apache/flume/conf/channel/ChannelSelectorType.java
b/flume-ng-configuration/src/main/java/org/apache/flume/conf/channel/ChannelSelectorType.java
index 37bc1bcd..c15a8a79 100644
---
a/flume-ng-configuration/src/main/java/org/apache/flume/conf/channel/ChannelSelectorType.java
+++
b/flume-ng-configuration/src/main/java/org/apache/flume/conf/channel/ChannelSelectorType.java
@@ -41,7 +41,11 @@ public enum ChannelSelectorType implements
ComponentWithClassName {
/**
* Multiplexing channel selector.
*/
- MULTIPLEXING("org.apache.flume.channel.MultiplexingChannelSelector");
+ MULTIPLEXING("org.apache.flume.channel.MultiplexingChannelSelector"),
+ /**
+ * Routable proxy channel selector.
+ */
+ ROUTABLE_PROXY("org.apache.flume.channel.RoutableProxyChannelSelector");
private final String channelSelectorClassName;
diff --git
a/flume-ng-configuration/src/main/java/org/apache/flume/conf/channel/ChannelType.java
b/flume-ng-configuration/src/main/java/org/apache/flume/conf/channel/ChannelType.java
index e782472c..e6797dc5 100644
---
a/flume-ng-configuration/src/main/java/org/apache/flume/conf/channel/ChannelType.java
+++
b/flume-ng-configuration/src/main/java/org/apache/flume/conf/channel/ChannelType.java
@@ -46,6 +46,11 @@ public enum ChannelType implements ComponentWithClassName {
*/
JDBC("org.apache.flume.channel.jdbc.JdbcChannel"),
+ /**
+ * Kafka channel.
+ */
+ KAFKA("org.apache.flume.channel.kafka.KafkaChannel"),
+
/**
* Spillable Memory channel
*
diff --git
a/flume-ng-configuration/src/main/java/org/apache/flume/conf/internal/SuppressFBWarnings.java
b/flume-ng-configuration/src/main/java/org/apache/flume/conf/internal/SuppressFBWarnings.java
new file mode 100644
index 00000000..733eeaf5
--- /dev/null
+++
b/flume-ng-configuration/src/main/java/org/apache/flume/conf/internal/SuppressFBWarnings.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flume.conf.internal;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Used to suppress SpotBugs warnings in Flume artifacts.
+ *
+ * <p>SpotBugs recognizes any annotation whose simple name is {@code
SuppressFBWarnings}, so this
+ * type lets us drop the dependency on the LGPL-licensed {@code
spotbugs-annotations} artifact.</p>
+ *
+ * <p>This type is not exported via JPMS. Do <strong>not</strong> use in
third-party modules.</p>
+ */
+@Retention(RetentionPolicy.CLASS)
+@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD,
ElementType.CONSTRUCTOR, ElementType.PARAMETER})
+public @interface SuppressFBWarnings {
+
+ /** The set of SpotBugs warnings to suppress. */
+ String[] value() default {};
+}
diff --git
a/flume-ng-configuration/src/main/java/org/apache/flume/conf/internal/package-info.java
b/flume-ng-configuration/src/main/java/org/apache/flume/conf/internal/package-info.java
new file mode 100644
index 00000000..c0cd674b
--- /dev/null
+++
b/flume-ng-configuration/src/main/java/org/apache/flume/conf/internal/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Contains types used only by Flume modules.
+ *
+ * <p>These types are not exported via JPMS and are not available to
third-party modules.</p>
+ */
+package org.apache.flume.conf.internal;
diff --git a/flume-ng-core/pom.xml b/flume-ng-core/pom.xml
index a41891d2..cb8129ba 100644
--- a/flume-ng-core/pom.xml
+++ b/flume-ng-core/pom.xml
@@ -89,7 +89,6 @@
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
- <version>${jsr305.version}</version>
<scope>provided</scope>
</dependency>
diff --git
a/flume-ng-core/src/main/java/org/apache/flume/channel/ChannelProcessor.java
b/flume-ng-core/src/main/java/org/apache/flume/channel/ChannelProcessor.java
index c3d85ed4..30ef43b5 100644
--- a/flume-ng-core/src/main/java/org/apache/flume/channel/ChannelProcessor.java
+++ b/flume-ng-core/src/main/java/org/apache/flume/channel/ChannelProcessor.java
@@ -55,8 +55,15 @@ public class ChannelProcessor implements Configurable {
private final InterceptorChain interceptorChain;
public ChannelProcessor(ChannelSelector selector) {
+ this(selector, null);
+ }
+
+ public ChannelProcessor(ChannelSelector selector, List<Interceptor>
interceptors) {
this.selector = selector;
this.interceptorChain = new InterceptorChain();
+ if (interceptors != null) {
+ interceptorChain.setInterceptors(interceptors);
+ }
}
public void initialize() {
diff --git
a/flume-ng-core/src/main/java/org/apache/flume/channel/LoadBalancingChannelSelector.java
b/flume-ng-core/src/main/java/org/apache/flume/channel/LoadBalancingChannelSelector.java
index 5aea76d2..78e656a2 100644
---
a/flume-ng-core/src/main/java/org/apache/flume/channel/LoadBalancingChannelSelector.java
+++
b/flume-ng-core/src/main/java/org/apache/flume/channel/LoadBalancingChannelSelector.java
@@ -25,6 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.apache.flume.Channel;
import org.apache.flume.Context;
import org.apache.flume.Event;
+import org.apache.flume.conf.internal.SuppressFBWarnings;
/**
* Load balancing channel selector. This selector allows for load balancing
@@ -39,6 +40,7 @@ import org.apache.flume.Event;
* defaults to <tt>ROUND_ROBIN</tt> type, but can be overridden via
* configuration.</p>
*/
+@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public class LoadBalancingChannelSelector extends AbstractChannelSelector {
private final List<Channel> emptyList = Collections.emptyList();
private ChannelPicker picker;
diff --git
a/flume-ng-core/src/main/java/org/apache/flume/channel/MultiplexingChannelSelector.java
b/flume-ng-core/src/main/java/org/apache/flume/channel/MultiplexingChannelSelector.java
index 2a500980..d92d4cb0 100644
---
a/flume-ng-core/src/main/java/org/apache/flume/channel/MultiplexingChannelSelector.java
+++
b/flume-ng-core/src/main/java/org/apache/flume/channel/MultiplexingChannelSelector.java
@@ -24,7 +24,9 @@ import org.apache.flume.Channel;
import org.apache.flume.Context;
import org.apache.flume.Event;
import org.apache.flume.FlumeException;
+import org.apache.flume.conf.internal.SuppressFBWarnings;
+@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public class MultiplexingChannelSelector extends AbstractChannelSelector {
public static final String CONFIG_MULTIPLEX_HEADER_NAME = "header";
diff --git
a/flume-ng-core/src/main/java/org/apache/flume/channel/RoutableProxyChannelSelector.java
b/flume-ng-core/src/main/java/org/apache/flume/channel/RoutableProxyChannelSelector.java
new file mode 100644
index 00000000..00369df1
--- /dev/null
+++
b/flume-ng-core/src/main/java/org/apache/flume/channel/RoutableProxyChannelSelector.java
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flume.channel;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.flume.Channel;
+import org.apache.flume.ChannelSelector;
+import org.apache.flume.Context;
+import org.apache.flume.Event;
+import org.apache.flume.conf.Configurables;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class RoutableProxyChannelSelector extends LoadBalancingChannelSelector
{
+ private static final Logger LOGGER =
LogManager.getLogger(RoutableProxyChannelSelector.class);
+ private static final String HEADER_NAME = "headerName";
+ private static final String SELECTOR = ".selector.";
+ private static final String CHANNELS = "channels";
+ private static final String DEFAULT = "default";
+ private static final String TYPE = "type";
+
+ private final Map<String, ChannelSelector> selectorMap = new HashMap<>();
+ private ChannelSelector defaultSelector;
+ private String headerName;
+
+ public void addSelector(String headerName, ChannelSelector selector) {
+ selectorMap.put(headerName, selector);
+ }
+
+ public void setDefaultSelector(ChannelSelector defaultSelector) {
+ this.defaultSelector = defaultSelector;
+ }
+
+ public ChannelSelector getDefaultSelector() {
+ return defaultSelector;
+ }
+
+ @Override
+ public void configure(Context context) {
+ Configurables.ensureRequiredNonNull(context, HEADER_NAME);
+ List<Channel> allChannels = getAllChannels();
+ for (Map.Entry<String, String> entry :
context.getParameters().entrySet()) {
+ if (entry.getKey().equals(HEADER_NAME)) {
+ this.headerName = entry.getValue();
+ } else if (!entry.getKey().equals(TYPE)) {
+ String key = StringUtils.substringBefore(entry.getKey(), ".");
+ Map<String, String> map = context.getSubProperties(key +
SELECTOR);
+ if (map != null) {
+ String channelNames = getRequiredNonNull(map, CHANNELS,
key);
+ Set<String> channelSet = new
HashSet<>(Arrays.asList(channelNames.split("\\s+")));
+ List<Channel> channels = new
ArrayList<>(channelSet.size());
+ for (String channelName : channelSet) {
+ for (Channel channel : allChannels) {
+ if (channelName.equals(channel.getName())) {
+ channels.add(channel);
+ }
+ }
+ }
+ ChannelSelector selector =
ChannelSelectorFactory.create(channels, map);
+ if (DEFAULT.equals(key)) {
+ defaultSelector = selector;
+ } else {
+ selectorMap.put(key, selector);
+ }
+ }
+ }
+ }
+ if (headerName == null) {
+ throw new IllegalArgumentException("No header name specified for
RoutableProxy");
+ }
+ }
+
+ @Override
+ public List<Channel> getRequiredChannels(Event event) {
+ ChannelSelector selector = getSelector(event);
+ if (selector != null) {
+ return selector.getRequiredChannels(event);
+ }
+ return new ArrayList<>();
+ }
+
+ @Override
+ public List<Channel> getOptionalChannels(Event event) {
+ ChannelSelector selector = getSelector(event);
+ if (selector != null) {
+ return selector.getOptionalChannels(event);
+ }
+ return new ArrayList<>();
+ }
+
+ private ChannelSelector getSelector(Event event) {
+ ChannelSelector channelSelector =
selectorMap.get(event.getHeaders().get(headerName));
+ if (channelSelector == null) {
+ channelSelector = defaultSelector;
+ }
+ return channelSelector;
+ }
+
+ private String getRequiredNonNull(Map<String, String> map, String keyName,
String prefix) {
+ String value = map.get(keyName);
+ if (value == null) {
+ throw new IllegalArgumentException(String.format("Missing key %s
in %s", keyName, prefix));
+ }
+ return value;
+ }
+}
diff --git
a/flume-ng-core/src/main/java/org/apache/flume/lifecycle/LifecycleSupervisor.java
b/flume-ng-core/src/main/java/org/apache/flume/lifecycle/LifecycleSupervisor.java
index 67ed39ac..66b96caa 100644
---
a/flume-ng-core/src/main/java/org/apache/flume/lifecycle/LifecycleSupervisor.java
+++
b/flume-ng-core/src/main/java/org/apache/flume/lifecycle/LifecycleSupervisor.java
@@ -26,9 +26,11 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.apache.flume.FlumeException;
+import org.apache.flume.conf.internal.SuppressFBWarnings;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public class LifecycleSupervisor implements LifecycleAware {
private static final Logger logger = LogManager.getLogger();
diff --git
a/flume-ng-core/src/main/java/org/apache/flume/sink/AbstractSingleSinkProcessor.java
b/flume-ng-core/src/main/java/org/apache/flume/sink/AbstractSingleSinkProcessor.java
index 343ee73b..f35a111a 100644
---
a/flume-ng-core/src/main/java/org/apache/flume/sink/AbstractSingleSinkProcessor.java
+++
b/flume-ng-core/src/main/java/org/apache/flume/sink/AbstractSingleSinkProcessor.java
@@ -20,11 +20,13 @@ import com.google.common.base.Preconditions;
import java.util.List;
import org.apache.flume.Sink;
import org.apache.flume.SinkProcessor;
+import org.apache.flume.conf.internal.SuppressFBWarnings;
import org.apache.flume.lifecycle.LifecycleState;
/**
* A Sink Processor that only accesses a single Sink.
*/
+@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public abstract class AbstractSingleSinkProcessor implements SinkProcessor {
protected Sink sink;
private LifecycleState lifecycleState;
diff --git
a/flume-ng-core/src/main/java/org/apache/flume/sink/AbstractSinkProcessor.java
b/flume-ng-core/src/main/java/org/apache/flume/sink/AbstractSinkProcessor.java
index 2be6b160..a9bbd500 100644
---
a/flume-ng-core/src/main/java/org/apache/flume/sink/AbstractSinkProcessor.java
+++
b/flume-ng-core/src/main/java/org/apache/flume/sink/AbstractSinkProcessor.java
@@ -21,11 +21,13 @@ import java.util.Collections;
import java.util.List;
import org.apache.flume.Sink;
import org.apache.flume.SinkProcessor;
+import org.apache.flume.conf.internal.SuppressFBWarnings;
import org.apache.flume.lifecycle.LifecycleState;
/**
* A convenience base class for sink processors.
*/
+@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public abstract class AbstractSinkProcessor implements SinkProcessor {
private LifecycleState state;
diff --git
a/flume-ng-core/src/main/java/org/apache/flume/sink/FailoverSinkProcessor.java
b/flume-ng-core/src/main/java/org/apache/flume/sink/FailoverSinkProcessor.java
index a09a3107..b12f555c 100644
---
a/flume-ng-core/src/main/java/org/apache/flume/sink/FailoverSinkProcessor.java
+++
b/flume-ng-core/src/main/java/org/apache/flume/sink/FailoverSinkProcessor.java
@@ -28,6 +28,7 @@ import org.apache.flume.Context;
import org.apache.flume.EventDeliveryException;
import org.apache.flume.Sink;
import org.apache.flume.Sink.Status;
+import org.apache.flume.conf.internal.SuppressFBWarnings;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -59,6 +60,7 @@ import org.apache.logging.log4j.Logger;
* host1.sinkgroups.group1.processor.maxpenalty = 10000
*
*/
+@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public class FailoverSinkProcessor extends AbstractSinkProcessor {
private static final int FAILURE_PENALTY = 1000;
private static final int DEFAULT_MAX_PENALTY = 30000;
diff --git
a/flume-ng-core/src/main/java/org/apache/flume/sink/LoadBalancingSinkProcessor.java
b/flume-ng-core/src/main/java/org/apache/flume/sink/LoadBalancingSinkProcessor.java
index 30943ca4..4ee638c6 100644
---
a/flume-ng-core/src/main/java/org/apache/flume/sink/LoadBalancingSinkProcessor.java
+++
b/flume-ng-core/src/main/java/org/apache/flume/sink/LoadBalancingSinkProcessor.java
@@ -25,6 +25,7 @@ import org.apache.flume.FlumeException;
import org.apache.flume.Sink;
import org.apache.flume.Sink.Status;
import org.apache.flume.conf.Configurable;
+import org.apache.flume.conf.internal.SuppressFBWarnings;
import org.apache.flume.lifecycle.LifecycleAware;
import org.apache.flume.util.OrderSelector;
import org.apache.flume.util.RandomOrderSelector;
@@ -75,6 +76,7 @@ import org.apache.logging.log4j.Logger;
* @see FailoverSinkProcessor
* @see LoadBalancingSinkProcessor.SinkSelector
*/
+@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public class LoadBalancingSinkProcessor extends AbstractSinkProcessor {
public static final String CONFIG_SELECTOR = "selector";
public static final String CONFIG_SELECTOR_PREFIX = CONFIG_SELECTOR + ".";
diff --git
a/flume-ng-core/src/main/java/org/apache/flume/source/ExecSource.java
b/flume-ng-core/src/main/java/org/apache/flume/source/ExecSource.java
index 3a6778a2..c99e8dd5 100644
--- a/flume-ng-core/src/main/java/org/apache/flume/source/ExecSource.java
+++ b/flume-ng-core/src/main/java/org/apache/flume/source/ExecSource.java
@@ -39,6 +39,7 @@ import org.apache.flume.SystemClock;
import org.apache.flume.channel.ChannelProcessor;
import org.apache.flume.conf.BatchSizeSupported;
import org.apache.flume.conf.Configurable;
+import org.apache.flume.conf.internal.SuppressFBWarnings;
import org.apache.flume.event.EventBuilder;
import org.apache.flume.instrumentation.SourceCounter;
import org.apache.logging.log4j.LogManager;
@@ -141,6 +142,7 @@ import org.apache.logging.log4j.Logger;
* TODO
* </p>
*/
+@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public class ExecSource extends AbstractSource implements EventDrivenSource,
Configurable, BatchSizeSupported {
private static final Logger logger = LogManager.getLogger();
diff --git
a/flume-ng-core/src/test/java/org/apache/flume/channel/TestRoutableProxyChannelSelector.java
b/flume-ng-core/src/test/java/org/apache/flume/channel/TestRoutableProxyChannelSelector.java
new file mode 100644
index 00000000..f1df71cb
--- /dev/null
+++
b/flume-ng-core/src/test/java/org/apache/flume/channel/TestRoutableProxyChannelSelector.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flume.channel;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import junit.framework.Assert;
+import org.apache.flume.Channel;
+import org.apache.flume.ChannelSelector;
+import org.apache.flume.Event;
+import org.apache.flume.event.SimpleEvent;
+import org.junit.Test;
+
+public class TestRoutableProxyChannelSelector {
+
+ private List<Channel> channels = new ArrayList<Channel>();
+ private static final String[] config = new String[] {
+ "headerName = processingMode",
+ "type = routable_proxy",
+ "normal.selector.type = load_balancing",
+ "normal.selector.channels = ch1 ch2",
+ "normal.selector.policy = round_robin",
+ "default.selector.type = load_balancing",
+ "default.selector.channels = ch3 ch4",
+ "default.selector.policy = round_robin"
+ };
+
+ private ChannelSelector selector;
+
+ @Test
+ public void testProxySelector() throws Exception {
+ channels.clear();
+ channels.add(MockChannel.createMockChannel("ch1"));
+ channels.add(MockChannel.createMockChannel("ch2"));
+ channels.add(MockChannel.createMockChannel("ch3"));
+ channels.add(MockChannel.createMockChannel("ch4"));
+ RoutableProxyChannelSelector selector =
+ (RoutableProxyChannelSelector)
ChannelSelectorFactory.create(channels, getConfig());
+ Assert.assertNotNull(selector);
+ Assert.assertNotNull(selector.getDefaultSelector());
+ Event event = new SimpleEvent();
+ event.getHeaders().put("processingMode", "normal");
+ List<Channel> channels = selector.getRequiredChannels(event);
+ Assert.assertNotNull(channels);
+ Assert.assertEquals(1, channels.size());
+ String channelName = channels.get(0).getName();
+ Assert.assertTrue(channelName.equals("ch1") ||
channelName.equals("ch2"));
+ }
+
+ @Test
+ public void testProxySelectorManualConfig() throws Exception {
+ channels.clear();
+ channels.add(MockChannel.createMockChannel("ch1"));
+ channels.add(MockChannel.createMockChannel("ch2"));
+ channels.add(MockChannel.createMockChannel("ch3"));
+ channels.add(MockChannel.createMockChannel("ch4"));
+ Map<String, String> config = new HashMap<>();
+ config.put("headerName", "processingMode");
+ config.put("type", "routable_proxy");
+ RoutableProxyChannelSelector selector =
+ (RoutableProxyChannelSelector)
ChannelSelectorFactory.create(channels, config);
+ config.clear();
+ config.put("policy", "round_robin");
+ config.put("type", "load_balancing");
+ List<Channel> channels1 = new ArrayList<>();
+ channels1.add(channels.get(0));
+ channels1.add(channels.get(1));
+ LoadBalancingChannelSelector loadBalancingSelector =
+ (LoadBalancingChannelSelector)
ChannelSelectorFactory.create(channels1, config);
+ selector.setDefaultSelector(loadBalancingSelector);
+ List<Channel> channels2 = new ArrayList<>();
+ channels2.add(channels.get(2));
+ channels2.add(channels.get(3));
+ loadBalancingSelector = (LoadBalancingChannelSelector)
ChannelSelectorFactory.create(channels2, config);
+ selector.addSelector("validation", loadBalancingSelector);
+ Assert.assertNotNull(selector);
+ Assert.assertNotNull(selector.getDefaultSelector());
+ Event event = new SimpleEvent();
+ event.getHeaders().put("processingMode", "normal");
+ List<Channel> channels = selector.getRequiredChannels(event);
+ Assert.assertNotNull(channels);
+ Assert.assertEquals(1, channels.size());
+ String channelName = channels.get(0).getName();
+ Assert.assertTrue(channelName.equals("ch1") ||
channelName.equals("ch2"));
+ }
+
+ private Map<String, String> getConfig() {
+ return Arrays.stream(config)
+ .map(line -> line.split("=", 2)) // Limit to 2 parts to keep
values with '=' intact
+ .filter(parts -> parts.length == 2)
+ .collect(Collectors.toMap(parts -> parts[0].trim(), parts ->
parts[1].trim()));
+ }
+}
diff --git a/flume-ng-node/pom.xml b/flume-ng-node/pom.xml
index c746cc4f..0542d117 100644
--- a/flume-ng-node/pom.xml
+++ b/flume-ng-node/pom.xml
@@ -54,22 +54,6 @@
<artifactId>flume-ng-core</artifactId>
</dependency>
- <!--
- <dependency>
- <groupId>org.apache.flume</groupId>
- <artifactId>flume-hdfs-sink</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.flume.flume-ng-sinks</groupId>
- <artifactId>flume-irc-sink</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.flume.flume-ng-channels</groupId>
- <artifactId>flume-jdbc-channel</artifactId>
- </dependency>-->
-
<dependency>
<groupId>org.apache.flume.flume-ng-channels</groupId>
<artifactId>flume-file-channel</artifactId>
@@ -120,13 +104,6 @@
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
- <version>${jsr305.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>com.github.spotbugs</groupId>
- <artifactId>spotbugs-annotations</artifactId>
<scope>provided</scope>
</dependency>
diff --git
a/flume-ng-node/src/main/java/org/apache/flume/node/AbstractConfigurationProvider.java
b/flume-ng-node/src/main/java/org/apache/flume/node/AbstractConfigurationProvider.java
index 58179eeb..cbf958de 100644
---
a/flume-ng-node/src/main/java/org/apache/flume/node/AbstractConfigurationProvider.java
+++
b/flume-ng-node/src/main/java/org/apache/flume/node/AbstractConfigurationProvider.java
@@ -21,7 +21,6 @@ import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -57,6 +56,7 @@ import org.apache.flume.conf.FlumeConfiguration;
import org.apache.flume.conf.FlumeConfiguration.AgentConfiguration;
import org.apache.flume.conf.TransactionCapacitySupported;
import org.apache.flume.conf.channel.ChannelSelectorConfiguration;
+import org.apache.flume.conf.internal.SuppressFBWarnings;
import org.apache.flume.conf.sink.SinkConfiguration;
import org.apache.flume.conf.sink.SinkGroupConfiguration;
import org.apache.flume.conf.source.SourceConfiguration;
diff --git a/flume-parent/pom.xml b/flume-parent/pom.xml
index 261737b6..ddebdd36 100644
--- a/flume-parent/pom.xml
+++ b/flume-parent/pom.xml
@@ -209,6 +209,7 @@
</ciManagement>
<properties>
+ <flume-project.version>2.0.0-SNAPSHOT</flume-project.version>
<!-- Update for year of distribution. Should be set by the
maven-release-plugin at release time. -->
<project.build.outputTimestamp>2022-01-02T00:00:00Z</project.build.outputTimestamp>
<!-- Set default encoding to UTF-8 to remove maven complaints -->
@@ -227,34 +228,10 @@
<stagingDirectory>${project.basedir}/target/docs</stagingDirectory>
<bundle-plugin.version>2.3.7</bundle-plugin.version>
- <commons-cli.version>1.5.0</commons-cli.version>
- <commons-codec.version>1.22.0</commons-codec.version>
- <commons-collections.version>3.2.2</commons-collections.version>
- <commons-compress.version>1.28.0</commons-compress.version>
- <commons-io.version>2.22.0</commons-io.version>
- <commons-lang.version>3.20.0</commons-lang.version>
- <commons-logging.version>1.4.0</commons-logging.version>
- <commons-text.version>1.15.0</commons-text.version>
<curator.version>5.9.0</curator.version>
- <derby.version>10.17.1.0</derby.version>
- <jackson-annotations.version>2.19.0</jackson-annotations.version>
- <fasterxml.jackson.version>2.21.1</fasterxml.jackson.version>
-
<fasterxml.jackson.databind.version>2.21.1</fasterxml.jackson.databind.version>
<fest-reflect.version>1.4.1</fest-reflect.version>
- <gson.version>2.14.0</gson.version>
- <guava.version>33.4.8-jre</guava.version>
<hadoop.version>3.5.0</hadoop.version>
- <httpcore.version>4.4.15</httpcore.version>
- <bouncycastle.version>1.84</bouncycastle.version>
- <httpclient.version>4.5.13</httpclient.version>
- <irclib.version>1.10</irclib.version>
- <jakarta-servlet.version>6.1.0</jakarta-servlet.version>
- <jetty.version>12.1.9</jetty.version>
<junit.version>4.13.2</junit.version>
- <jsr305.version>3.0.2</jsr305.version>
- <log4j.version>2.26.0</log4j.version>
- <mapdb.version>0.9.9</mapdb.version>
- <mina.version>2.2.8</mina.version>
<mockito.version>5.18.0</mockito.version>
<mvn-antrun-plugin.version>1.8</mvn-antrun-plugin.version>
<!-- Do not upgrade the assumbly plugin version until MASSEMBLY-941 is
fixed -->
@@ -272,31 +249,23 @@
<spotbugs.version>4.9.3</spotbugs.version>
<mvn-spotbugs-plugin.version>${spotbugs.version}.0</mvn-spotbugs-plugin.version>
<mvn-surefire-plugin.version>3.5.5</mvn-surefire-plugin.version>
- <netty-all.version>4.2.15.Final</netty-all.version>
<external.protobuf.version>4.35.0</external.protobuf.version>
<protobuf.plugin.version>0.6.1</protobuf.plugin.version>
- <prometheus.version>1.7.0</prometheus.version>
<rat.version>0.12</rat.version>
- <slf4j.version>2.0.17</slf4j.version>
- <snappy-java.version>1.1.10.8</snappy-java.version>
- <spotbugs-annotations.version>4.9.3</spotbugs-annotations.version>
- <system-rules.version>1.19.0</system-rules.version>
<wiremock.version>1.53</wiremock.version>
- <zlib.version>1.1.3</zlib.version>
- <zookeeper.version>3.8.6</zookeeper.version>
<os.maven.version>1.7.1</os.maven.version>
<redirectTestOutput>true</redirectTestOutput>
<spotless-maven-plugin.version>3.4.0</spotless-maven-plugin.version>
+ <system-rules.version>1.19.0</system-rules.version>
<palantir-java-format.version>2.90.0</palantir-java-format.version>
</properties>
<dependencyManagement>
<dependencies>
- <!-- Dependencies: build -->
<dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bc-jdk18on-bom</artifactId>
- <version>${bouncycastle.version}</version>
+ <groupId>org.apache.flume</groupId>
+ <artifactId>flume-third-party-dependencies</artifactId>
+ <version>${flume-project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -328,12 +297,6 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.flume</groupId>
- <artifactId>flume-rpc-avro</artifactId>
- <version>${project.version}</version>
- </dependency>
-
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-minikdc</artifactId>
@@ -364,185 +327,11 @@
<scope>test</scope>
</dependency>
- <!-- Dependencies: compile -->
-
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>${commons-cli.version}</version>
- </dependency>
-
- <!-- Pin commons-logging to a version with native Log4j API support -->
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>${commons-logging.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>${commons-lang.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-text</artifactId>
- <version>${commons-text.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>${guava.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-bom</artifactId>
- <version>${log4j.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <!-- Pin SLF4J to 2.x so transitive deps cannot downgrade it to 1.x -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-bom</artifactId>
- <version>${slf4j.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- <version>${external.protobuf.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>jakarta.servlet</groupId>
- <artifactId>jakarta.servlet-api</artifactId>
- <!-- Use 5.0.0 for Jetty 11 / EE9. Use 6.0.0 or 6.1.0 for Jetty 12
(EE10) -->
- <version>${jakarta-servlet.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jetty.ee11</groupId>
- <artifactId>jetty-ee11-servlet</artifactId>
- <version>${jetty.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-security</artifactId>
- <version>${jetty.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>${jetty.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>${jetty.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-jmx</artifactId>
- <version>${jetty.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>${httpclient.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- <version>${httpcore.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.mapdb</groupId>
- <artifactId>mapdb</artifactId>
- <version>${mapdb.version}</version>
- </dependency>
-
- <!-- Gson: Java to Json conversion -->
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson.version}</version>
- </dependency>
-
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${commons-codec.version}</version>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>${commons-io.version}</version>
- </dependency>
-
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>${commons-collections.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>${derby.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- <version>${jackson-annotations.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>${fasterxml.jackson.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>${fasterxml.jackson.databind.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.schwering</groupId>
- <artifactId>irclib</artifactId>
- <version>${irclib.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.jcraft</groupId>
- <artifactId>jzlib</artifactId>
- <version>${zlib.version}</version>
- </dependency>
-
<!-- internal module dependencies -->
<dependency>
<groupId>org.apache.flume</groupId>
<artifactId>flume-dependencies</artifactId>
- <version>${project.version}</version>
+ <version>${flume-project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -550,66 +339,17 @@
<dependency>
<groupId>org.apache.flume</groupId>
<artifactId>build-support</artifactId>
- <version>${project.version}</version>
+ <version>${flume-project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flume</groupId>
<artifactId>flume-ng-sdk</artifactId>
- <version>${project.version}</version>
+ <version>${flume-project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-compress</artifactId>
- <version>${commons-compress.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.mina</groupId>
- <artifactId>mina-core</artifactId>
- <version>${mina.version}</version>
- </dependency>
-
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- <version>${netty-all.version}</version>
- </dependency>
-
- <dependency>
- <groupId>io.prometheus</groupId>
- <artifactId>prometheus-metrics-core</artifactId>
- <version>${prometheus.version}</version>
- </dependency>
-
- <dependency>
- <groupId>io.prometheus</groupId>
- <artifactId>prometheus-metrics-exporter-servlet-jakarta</artifactId>
- <version>${prometheus.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.xerial.snappy</groupId>
- <artifactId>snappy-java</artifactId>
- <version>${snappy-java.version}</version>
- </dependency>
-
- <!-- Dependency for Zk provider -->
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-framework</artifactId>
- <version>${curator.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-recipes</artifactId>
- <version>${curator.version}</version>
- </dependency>
-
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
@@ -617,64 +357,6 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-common</artifactId>
- <version>${hadoop.version}</version>
- <optional>true</optional>
- <exclusions>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler</artifactId>
- </exclusion>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ch.qos.reload4j</groupId>
- <artifactId>reload4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-reload4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-hdfs</artifactId>
- <version>${hadoop.version}</version>
- <exclusions>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler</artifactId>
- </exclusion>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ch.qos.reload4j</groupId>
- <artifactId>reload4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-hdfs-client</artifactId>
- <version>${hadoop.version}</version>
- <exclusions>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler</artifactId>
- </exclusion>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-minicluster</artifactId>
@@ -699,31 +381,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-client</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-annotations</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-auth</artifactId>
- <version>${hadoop.version}</version>
- <exclusions>
- <exclusion>
- <groupId>ch.qos.reload4j</groupId>
- <artifactId>reload4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-reload4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
@@ -740,37 +397,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-distcp</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- <version>${zookeeper.version}</version>
- <exclusions>
- <exclusion>
- <groupId>ch.qos.logback</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- For ThreadSafe and GuardedBy annotations -->
- <dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- <version>${jsr305.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.github.spotbugs</groupId>
- <artifactId>spotbugs-annotations</artifactId>
- <version>${spotbugs-annotations.version}</version>
- </dependency>
-
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-netty</artifactId>
@@ -831,10 +457,10 @@
<archive>
<manifestEntries>
<Specification-Title>${project.name}</Specification-Title>
-
<Specification-Version>${project.version}</Specification-Version>
+
<Specification-Version>${flume-project.version}</Specification-Version>
<Specification-Vendor>${project.organization.name}</Specification-Vendor>
<Implementation-Title>${project.name}</Implementation-Title>
-
<Implementation-Version>${project.version}</Implementation-Version>
+
<Implementation-Version>${flume-project.version}</Implementation-Version>
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
<Implementation-Vendor-Id>org.apache</Implementation-Vendor-Id>
<X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK>
@@ -1202,38 +828,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
</plugin>
- <!-- Enable Parent POM flattening -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>flatten-maven-plugin</artifactId>
- <version>1.7.3</version>
- <executions>
- <execution>
- <id>flatten-bom</id>
- <goals>
- <goal>flatten</goal>
- </goals>
- <phase>process-resources</phase>
- <inherited>false</inherited>
- <configuration>
- <updatePomFile>true</updatePomFile>
- <flattenMode>bom</flattenMode>
- <pomElements>
- <dependencyManagement>resolve</dependencyManagement>
- <pluginManagement>resolve</pluginManagement>
- <properties>flatten</properties>
- </pomElements>
- </configuration>
- </execution>
- <!-- ensure proper cleanup -->
- <execution>
- <id>flatten.clean</id>
- <goals>
- <goal>clean</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
<!-- Ban logging implementations (not logging APIs) that dependencies
incorrectly add as compile dependencies -->
@@ -1270,6 +864,7 @@
<include>org.slf4j:slf4j-api</include>
<!-- As a test dependency -->
<include>org.apache.logging.log4j:log4j-core:*:jar:test</include>
+
<include>org.apache.logging.log4j:log4j-jcl:*:jar:test</include>
<include>org.apache.logging.log4j:log4j-slf4j2-impl:*:jar:test</include>
</includes>
</bannedDependencies>
diff --git a/flume-third-party/pom.xml b/flume-third-party/pom.xml
new file mode 100644
index 00000000..b92e7b5b
--- /dev/null
+++ b/flume-third-party/pom.xml
@@ -0,0 +1,520 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to you under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.flume</groupId>
+ <artifactId>flume-project</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.flume</groupId>
+ <artifactId>flume-third-party-dependencies</artifactId>
+ <packaging>pom</packaging>
+
+ <name>Apache Flume Third Party Dependencies</name>
+
+ <inceptionYear>2009</inceptionYear>
+
+ <organization>
+ <name>Apache Software Foundation</name>
+ <url>http://www.apache.org</url>
+ </organization>
+
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+
+ <scm>
+
<connection>scm:git:http://git-wip-us.apache.org/repos/asf/flume.git</connection>
+
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/flume.git</developerConnection>
+
<url>https://git-wip-us.apache.org/repos/asf?p=flume.git;a=tree;h=refs/heads/trunk;hb=trunk</url>
+ </scm>
+
+ <properties>
+ <flume-project.version>2.0.0-SNAPSHOT</flume-project.version>
+ <commons-cli.version>1.5.0</commons-cli.version>
+ <commons-codec.version>1.22.0</commons-codec.version>
+ <commons-collections.version>3.2.2</commons-collections.version>
+ <commons-compress.version>1.28.0</commons-compress.version>
+ <commons-io.version>2.22.0</commons-io.version>
+ <commons-lang.version>3.20.0</commons-lang.version>
+ <commons-logging.version>1.4.0</commons-logging.version>
+ <commons-text.version>1.15.0</commons-text.version>
+ <curator.version>5.9.0</curator.version>
+ <derby.version>10.17.1.0</derby.version>
+ <jackson-annotations.version>2.22</jackson-annotations.version>
+ <fasterxml.jackson.version>2.22.0</fasterxml.jackson.version>
+
<fasterxml.jackson.databind.version>2.22.0</fasterxml.jackson.databind.version>
+ <gson.version>2.14.0</gson.version>
+ <guava.version>33.4.8-jre</guava.version>
+ <hadoop.version>3.5.0</hadoop.version>
+ <httpcore.version>4.4.15</httpcore.version>
+ <bouncycastle.version>1.84</bouncycastle.version>
+ <httpclient.version>4.5.13</httpclient.version>
+ <irclib.version>1.10</irclib.version>
+ <jakarta-servlet.version>6.1.0</jakarta-servlet.version>
+ <jetty.version>12.1.9</jetty.version>
+ <jsr305.version>3.0.2</jsr305.version>
+ <log4j.version>2.26.0</log4j.version>
+ <mapdb.version>0.9.9</mapdb.version>
+ <mina.version>2.2.8</mina.version>
+ <spotbugs.version>4.9.3</spotbugs.version>
+ <netty-all.version>4.2.15.Final</netty-all.version>
+ <external.protobuf.version>4.35.0</external.protobuf.version>
+ <prometheus.version>1.7.0</prometheus.version>
+ <slf4j.version>2.0.17</slf4j.version>
+ <snappy-java.version>1.1.10.8</snappy-java.version>
+ <system-rules.version>1.19.0</system-rules.version>
+ <zlib.version>1.1.3</zlib.version>
+ <zookeeper.version>3.8.6</zookeeper.version>
+ <os.maven.version>1.7.1</os.maven.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Dependencies: build -->
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bc-jdk18on-bom</artifactId>
+ <version>${bouncycastle.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <!-- Dependencies: compile -->
+
+ <dependency>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ <version>${commons-cli.version}</version>
+ </dependency>
+
+ <!-- Pin commons-logging to a version with native Log4j API support -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${commons-logging.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>${commons-lang.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-text</artifactId>
+ <version>${commons-text.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>${guava.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-bom</artifactId>
+ <version>${log4j.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <!-- Pin SLF4J to 2.x so transitive deps cannot downgrade it to 1.x -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-bom</artifactId>
+ <version>${slf4j.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <version>${external.protobuf.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jakarta.servlet</groupId>
+ <artifactId>jakarta.servlet-api</artifactId>
+ <!-- Use 5.0.0 for Jetty 11 / EE9. Use 6.0.0 or 6.1.0 for Jetty 12
(EE10) -->
+ <version>${jakarta-servlet.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty.ee11</groupId>
+ <artifactId>jetty-ee11-servlet</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-security</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-jmx</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>${httpclient.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ <version>${httpcore.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mapdb</groupId>
+ <artifactId>mapdb</artifactId>
+ <version>${mapdb.version}</version>
+ </dependency>
+
+ <!-- Gson: Java to Json conversion -->
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>${gson.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>${commons-codec.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${commons-io.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>${commons-collections.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derby.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>${jackson-annotations.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>${fasterxml.jackson.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${fasterxml.jackson.databind.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.schwering</groupId>
+ <artifactId>irclib</artifactId>
+ <version>${irclib.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jzlib</artifactId>
+ <version>${zlib.version}</version>
+ </dependency>
+
+ <!-- internal module dependencies -->
+ <dependency>
+ <groupId>org.apache.flume</groupId>
+ <artifactId>flume-dependencies</artifactId>
+ <version>${flume-project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.flume</groupId>
+ <artifactId>build-support</artifactId>
+ <version>${flume-project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ <version>${commons-compress.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.mina</groupId>
+ <artifactId>mina-core</artifactId>
+ <version>${mina.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-all</artifactId>
+ <version>${netty-all.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.prometheus</groupId>
+ <artifactId>prometheus-metrics-core</artifactId>
+ <version>${prometheus.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.prometheus</groupId>
+ <artifactId>prometheus-metrics-exporter-servlet-jakarta</artifactId>
+ <version>${prometheus.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.xerial.snappy</groupId>
+ <artifactId>snappy-java</artifactId>
+ <version>${snappy-java.version}</version>
+ </dependency>
+
+ <!-- Dependency for Zk provider -->
+ <dependency>
+ <groupId>org.apache.curator</groupId>
+ <artifactId>curator-framework</artifactId>
+ <version>${curator.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.curator</groupId>
+ <artifactId>curator-recipes</artifactId>
+ <version>${curator.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.curator</groupId>
+ <artifactId>curator-test</artifactId>
+ <version>${curator.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ <version>${hadoop.version}</version>
+ <optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-compiler</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-runtime</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ch.qos.reload4j</groupId>
+ <artifactId>reload4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-reload4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-hdfs</artifactId>
+ <version>${hadoop.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-compiler</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-runtime</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ch.qos.reload4j</groupId>
+ <artifactId>reload4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-hdfs-client</artifactId>
+ <version>${hadoop.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-compiler</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-runtime</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-minicluster</artifactId>
+ <version>${hadoop.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-compiler</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-runtime</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ch.qos.reload4j</groupId>
+ <artifactId>reload4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-reload4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client</artifactId>
+ <version>${hadoop.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-annotations</artifactId>
+ <version>${hadoop.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-auth</artifactId>
+ <version>${hadoop.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ch.qos.reload4j</groupId>
+ <artifactId>reload4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-reload4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-distcp</artifactId>
+ <version>${hadoop.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.zookeeper</groupId>
+ <artifactId>zookeeper</artifactId>
+ <version>${zookeeper.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- For ThreadSafe and GuardedBy annotations -->
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <version>${jsr305.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+
+ <!-- Enable BOM flattening -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>flatten-maven-plugin</artifactId>
+ <version>1.7.3</version>
+ <executions>
+ <execution>
+ <id>flatten-bom</id>
+ <goals>
+ <goal>flatten</goal>
+ </goals>
+ <phase>process-resources</phase>
+ <inherited>false</inherited>
+ <configuration>
+ <updatePomFile>true</updatePomFile>
+ <flattenMode>bom</flattenMode>
+ <pomElements>
+ <dependencyManagement>resolve</dependencyManagement>
+ <properties>flatten</properties>
+ </pomElements>
+ </configuration>
+ </execution>
+ <!-- ensure proper cleanup -->
+ <execution>
+ <id>flatten.clean</id>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/pom.xml b/pom.xml
index c13d2727..1c2e2ca7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,7 @@
<modules>
<module>flume-bom</module>
+ <module>flume-third-party</module>
<module>flume-parent</module>
<module>flume-ng-core</module>
<module>flume-ng-configuration</module>