Skip to content

Commit

Permalink
Fix kroxylicious#1380: Remove deprecated FilterFactoryContext#eventLo…
Browse files Browse the repository at this point in the history
  • Loading branch information
k-wall authored Jan 22, 2025
1 parent 93fe6ba commit c74f51b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 29 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Format `<github issue/pr number>: <short description>`.

## SNAPSHOT

* [#1445](https://github.com/kroxylicious/kroxylicious/issues/1445) Remove deprecated ProduceValidationFilterFactory, replacement is RecordValidation.
* [#1380](https://github.com/kroxylicious/kroxylicious/issues/1380) Deprecated FilterFactoryContext#eventLoop() is removed.
* [#1747](https://github.com/kroxylicious/kroxylicious/pull/1747) Bump io.micrometer:micrometer-bom from 1.14.2 to 1.14.3
* [#1745](https://github.com/kroxylicious/kroxylicious/pull/1745) Bump com.github.ben-manes.caffeine:caffeine from 3.1.8 to 3.2.0
* [#1006](https://github.com/kroxylicious/kroxylicious/pull/1660) Allow CipherSuites and TLS Protocols to be passed via Configuration
Expand All @@ -23,6 +23,7 @@ Format `<github issue/pr number>: <short description>`.
* The top level `filters` configuration property is deprecated. Configurations should use `filterDefinitions` and `defaultFilters` instead.
* The `bootstrap_servers` property of a virtual cluster's `targetCluster` is deprecated. It is replaced by a property called `bootstrapServers`.
* As per deprecation notice made at 0.7.0, `ProduceValidationFilterFactory` filter is removed. Use `RecordValidation` instead.
* As per deprecation notice made at 0.7.0, `FilterFactoryContext#eventLoop()` is removed. Use `FilterFactoryContext#filterDispatchExecutor()` instead..

## 0.9.0

Expand Down
1 change: 1 addition & 0 deletions kroxylicious-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
<breakBuildBasedOnSemanticVersioningForMajorVersionZero>${ApiCompatability.EnforceForMajorVersionZero}</breakBuildBasedOnSemanticVersioningForMajorVersionZero>
<excludes>
<exclude>io.kroxylicious.proxy.config.secret.FilePasswordFilePath</exclude> <!-- used purely in config files and the name still exists (as a JSON alias) -->
<exclude>io.kroxylicious.proxy.filter.FilterFactoryContext#eventLoop()</exclude> <!-- https://github.com/kroxylicious/kroxylicious/issues/1380 scheduled removal of deprecated API method -->
</excludes>
<!-- see documentation -->
</parameter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package io.kroxylicious.proxy.filter;

import java.util.concurrent.ScheduledExecutorService;

import io.kroxylicious.proxy.plugin.UnknownPluginInstanceException;

import edu.umd.cs.findbugs.annotations.NonNull;
Expand All @@ -18,17 +16,6 @@
*/
public interface FilterFactoryContext {

/**
* The event loop that this Filter's channel is assigned to.
* Null if the factory is not bound to a channel yet.
* Should be safe
* to mutate Filter members from this executor.
* @return executor, or null
* @deprecated use {@link #filterDispatchExecutor()} instead
*/
@Deprecated(since = "0.7.0")
ScheduledExecutorService eventLoop();

/**
* An executor backed by the single Thread responsible for dispatching
* work to a Filter instance for a channel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;

import io.kroxylicious.proxy.config.NamedFilterDefinition;
Expand Down Expand Up @@ -95,10 +94,6 @@ public FilterChainFactory(PluginFactoryRegistry pfr, List<NamedFilterDefinition>
}
else {
FilterFactoryContext context = new FilterFactoryContext() {
@Override
public ScheduledExecutorService eventLoop() {
return null;
}

@Override
public FilterDispatchExecutor filterDispatchExecutor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package io.kroxylicious.proxy.internal.filter;

import java.util.concurrent.ScheduledExecutorService;

import io.netty.channel.EventLoop;

import io.kroxylicious.proxy.config.PluginFactory;
Expand All @@ -28,11 +26,6 @@ public NettyFilterContext(EventLoop eventLoop,
this.pluginFactoryRegistry = pluginFactoryRegistry;
}

@Override
public ScheduledExecutorService eventLoop() {
return filterDispatchExecutor();
}

@Override
public FilterDispatchExecutor filterDispatchExecutor() {
return dispatchExecutor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void testCreateFilter() {
assertThat(testFilterImpl.getContributorClass()).isEqualTo(TestFilterFactory.class);
FilterDispatchExecutor filterDispatchExecutor = testFilterImpl.getContext().filterDispatchExecutor();
assertThat(filterDispatchExecutor).isNotNull();
assertThat(testFilterImpl.getContext().eventLoop()).isSameAs(filterDispatchExecutor);
assertThat(testFilterImpl.getContext().filterDispatchExecutor()).isSameAs(filterDispatchExecutor);
assertThat(testFilterImpl.getExampleConfig()).isSameAs(config);
});
}
Expand All @@ -136,14 +136,14 @@ void shouldCreateMultipleFilters(Class<FilterFactory<?, ?>> factoryClass, Class<
assertThat(testFilterImpl.getContributorClass()).isEqualTo(factoryClass);
FilterDispatchExecutor filterDispatchExecutor = testFilterImpl.getContext().filterDispatchExecutor();
assertThat(filterDispatchExecutor).isNotNull();
assertThat(testFilterImpl.getContext().eventLoop()).isSameAs(filterDispatchExecutor);
assertThat(testFilterImpl.getContext().filterDispatchExecutor()).isSameAs(filterDispatchExecutor);
assertThat(testFilterImpl.getExampleConfig()).isSameAs(config);
});
listAssert.element(1).extracting(FilterAndInvoker::filter).isInstanceOfSatisfying(expectedFilterClass, testFilterImpl -> {
assertThat(testFilterImpl.getContributorClass()).isEqualTo(factoryClass);
FilterDispatchExecutor filterDispatchExecutor = testFilterImpl.getContext().filterDispatchExecutor();
assertThat(filterDispatchExecutor).isNotNull();
assertThat(testFilterImpl.getContext().eventLoop()).isSameAs(filterDispatchExecutor);
assertThat(testFilterImpl.getContext().filterDispatchExecutor()).isSameAs(filterDispatchExecutor);
assertThat(testFilterImpl.getExampleConfig()).isSameAs(config);
});
}
Expand Down

0 comments on commit c74f51b

Please sign in to comment.