Skip to content

Commit 84ee332

Browse files
committed
Remove extra code
Signed-off-by: Sergei Ustimenko <[email protected]>
1 parent d8ed05b commit 84ee332

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

plugins/transport-reactor-netty4/src/main/java/org/opensearch/http/reactor/netty4/ReactorNetty4BaseHttpChannel.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
import reactor.netty.http.server.HttpServerRequest;
2020

2121
final class ReactorNetty4BaseHttpChannel {
22-
static final String CHANNEL_PROPERTY = "channel";
23-
22+
private static final String CHANNEL_PROPERTY = "channel";
2423
private static final String SSL_HANDLER_PROPERTY = "ssl_http";
2524
private static final String SSL_ENGINE_PROPERTY = "ssl_engine";
2625

plugins/transport-reactor-netty4/src/main/java/org/opensearch/transport/reactor/netty4/Netty4Utils.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.opensearch.ExceptionsHelper;
1313
import org.opensearch.common.Booleans;
1414
import org.opensearch.common.concurrent.CompletableContext;
15-
import org.opensearch.core.action.ActionListener;
1615
import org.opensearch.core.common.bytes.BytesArray;
1716
import org.opensearch.core.common.bytes.BytesReference;
1817

@@ -26,9 +25,7 @@
2625
import io.netty.buffer.ByteBuf;
2726
import io.netty.buffer.CompositeByteBuf;
2827
import io.netty.buffer.Unpooled;
29-
import io.netty.channel.Channel;
3028
import io.netty.channel.ChannelFuture;
31-
import io.netty.channel.ChannelPromise;
3229
import io.netty.util.NettyRuntime;
3330

3431
/**
@@ -142,29 +139,4 @@ public static void addListener(ChannelFuture channelFuture, CompletableContext<V
142139
}
143140
});
144141
}
145-
146-
/**
147-
* Creates a {@link ChannelPromise} for the given {@link Channel} and adds a listener that invokes the given {@link ActionListener}
148-
* on its completion.
149-
* @param listener lister to invoke
150-
* @param channel channel
151-
* @return write promise
152-
*/
153-
public static ChannelPromise addPromise(ActionListener<Void> listener, Channel channel) {
154-
ChannelPromise writePromise = channel.newPromise();
155-
writePromise.addListener(f -> {
156-
if (f.isSuccess()) {
157-
listener.onResponse(null);
158-
} else {
159-
final Throwable cause = f.cause();
160-
ExceptionsHelper.maybeDieOnAnotherThread(cause);
161-
if (cause instanceof Error) {
162-
listener.onFailure(new Exception(cause));
163-
} else {
164-
listener.onFailure((Exception) cause);
165-
}
166-
}
167-
});
168-
return writePromise;
169-
}
170142
}

0 commit comments

Comments
 (0)