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
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroupprivate org.apache.hbase.thirdparty.io.netty.channel.group.ChannelGroupprivate final org.apache.hadoop.conf.Configurationprivate AsyncConnectionprivate final intprivate org.apache.hbase.thirdparty.io.netty.channel.Channelprivate final org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
bossGroup
-
workerGroup
-
conf
-
port
-
conn
-
serverChannel
-
channelGroup
-
-
Constructor Details
-
HttpProxyExample
-
-
Method Details
-
start
-
join
-
port
-
stop
- Throws:
IOException
-
main
-