T
- type of the leader to retrieve@ChannelHandler.Sharable
public abstract class RedirectHandler<T extends RestfulGateway>
extends org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<org.apache.flink.shaded.netty4.io.netty.handler.codec.http.router.Routed>
SimpleChannelInboundHandler
which encapsulates the redirection logic for the
REST endpoints.Modifier and Type | Field and Description |
---|---|
protected GatewayRetriever<? extends T> |
leaderRetriever |
protected CompletableFuture<String> |
localAddressFuture |
protected org.slf4j.Logger |
logger |
protected Map<String,String> |
responseHeaders |
protected Time |
timeout |
Modifier | Constructor and Description |
---|---|
protected |
RedirectHandler(CompletableFuture<String> localAddressFuture,
GatewayRetriever<? extends T> leaderRetriever,
Time timeout,
Map<String,String> responseHeaders) |
Modifier and Type | Method and Description |
---|---|
protected void |
channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext,
org.apache.flink.shaded.netty4.io.netty.handler.codec.http.router.Routed routed) |
protected abstract void |
respondAsLeader(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext,
org.apache.flink.shaded.netty4.io.netty.handler.codec.http.router.Routed routed,
T gateway) |
acceptInboundMessage, channelRead
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
handlerAdded, handlerRemoved, isSharable
protected final org.slf4j.Logger logger
protected final CompletableFuture<String> localAddressFuture
protected final GatewayRetriever<? extends T extends RestfulGateway> leaderRetriever
protected final Time timeout
protected void channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext, org.apache.flink.shaded.netty4.io.netty.handler.codec.http.router.Routed routed) throws Exception
channelRead0
in class org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<org.apache.flink.shaded.netty4.io.netty.handler.codec.http.router.Routed>
Exception
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.