Interface | Description |
---|---|
HChannel |
A wrapper interface over netty
Channel to submit hedwig's
PubSubData requests. |
HChannelManager |
A manager manages 1) all channels established to hub servers,
2) the actions taken by the topic subscribers.
|
Class | Description |
---|---|
CleanupChannelMap<T> | |
FilterableMessageHandler |
Handlers used by a subscription.
|
HedwigClientImpl |
This is a top level Hedwig Client class that encapsulates the common
functionality needed for both Publish and Subscribe operations.
|
HedwigPublisher |
This is the Hedwig Netty specific implementation of the Publisher interface.
|
HedwigSubscriber |
This is the Hedwig Netty specific implementation of the Subscriber interface.
|
NetUtils |
Utilities for network operations.
|
SubscriptionEventEmitter | |
VoidCallbackAdapter<T> |
Adapts from Callback<T> to Callback<Void>.
|
HChannel
: A interface wrapper of netty Channel
to submit hedwig's PubSubProtocol.PubSubRequest
s
to target host.HChanneHandler
: A wrapper of netty ChannelHandler
to handle events of its underlying netty channel, such as responses received, channel
disconnected, etc. A HChannelHandler
is bound with a HChannel
.HChannelManager
: A manager manages all established HChannel
s.
It provides a clean interface for publisher/subscriber to send
PubSubProtocol.PubSubRequest
sHedwigPublisher
/HedwigSubscriber
delegates HChannelManager
to submit pub/sub requests.HChannelManager
find the owner hubs, establish a HChannel
to hub servers
and send the requests to them.HChannelHandler
dispatches responses to target
AbstractResponseHandler
to process.HChannelHandler
detects an underlying netty Channel
disconnected. It calles HChannelManager
to clear cached HChannel
that
it bound with. For non-subscritpion channels, it would fail all pending requests;
For subscription channels, it would fail all pending requests and retry to reconnect
those successful subscriptions.HChannel
s provided in current implementation. HChannelImpl
provides the ability to multiplex pub/sub requests in an underlying netty
Channel
, while DefaultServerChannel
provides the
ability to establish a netty channel Channel
for a pub/sub
request. After the underlying netty channel is estabilished, it would be converted into
a HChannelImpl
by HChannelManager#submitOpThruChannel(pubSubData, channel)
.
Although HChannelImpl
provides multiplexing ability, it still could be used for
one-channel-per-subscription case, which just sent only one subscribe request thru the
underlying channel.
HChannelHandler
is generic netty ChannelHandler
,
which handles events from the underlying channel. A HChannelHandler is bound with
a HChannel
as channel pipeplien when the underlying channel is established. It
takes the responsibility of dispatching response to target response handler. For a
non-subscription channel, it just handles PUBLISH and UNSUBSCRIBE responses.
For a subscription channel, it handles SUBSCRIBE response. For consume requests,
we treated them in a fire-and-forget way, so they are not need to be handled by any response
handler.
HChannelManager
manages all outstanding connections to target hub servers for a client.
Since a subscription channel acts quite different from a non-subscription channel, the basic
implementation AbstractHChannelManager
manages non-subscription channels and
subscription channels in different channel sets. Currently hedwig client provides
SimpleHChannelManager
which manages subscription channels in one-channel-per-subscription
way. In future, if we want to multiplex multiple subscriptions in one channel, we just need
to provide an multiplexing version of AbstractHChannelManager
which manages channels
in multiplexing way, and a multiplexing version of SubscribeResponseHandler
which handles multiple subscriptions in one channel.Copyright © 2015 The Apache Software Foundation. All rights reserved.