Class HttpProxyExample
java.lang.Object
org.apache.hadoop.hbase.client.example.HttpProxyExample
A simple example on how to use
AsyncTable
to write a fully
asynchronous HTTP proxy server. The AsyncConnection
will share the same event loop with
the HTTP server.
The request URL is:
http://<host>:<port>/<table>/<rowgt;/<family>:<qualifier>Use HTTP GET to fetch data, and use HTTP PUT to put data. Encode the value as the request content when doing PUT.
Notice that, future class methods will all return a new Future, so you always have one future that will not been checked, so we need to suppress error-prone "FutureReturnValueIgnored" warnings on the methods such as join and stop. In your real production code, you should use your own convenient way to address the warning.
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static final class
private static final class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup
private org.apache.hbase.thirdparty.io.netty.channel.group.ChannelGroup
private final org.apache.hadoop.conf.Configuration
private AsyncConnection
private final int
private org.apache.hbase.thirdparty.io.netty.channel.Channel
private final org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup
-
Constructor Summary
-
Method Summary
-
Field Details
-
bossGroup
-
workerGroup
-
conf
-
port
-
conn
-
serverChannel
-
channelGroup
-
-
Constructor Details
-
HttpProxyExample
-
-
Method Details
-
start
-
join
-
port
-
stop
- Throws:
IOException
-
main
-