|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.p2p.splitstream.Channel
public class Channel
The channel controls all the meta data associated with a group of stripes. It contains the stripes themselves, and one of the stripe is the primary stripe for this channel. A stripe whose topicId matches some prefix with local node id, then it becomes its primary stripe. A channelId uniquely identifies a channel. Number of stripes is obtained by pow(2, STRIPE_BASE), so for STRIPE_BASE = 4, it is 16. Stripe identifiers are obtained by replacing first digit by every possible value of a digit and second digit by 8. So, if channelId is <0x1AB88..>, then stripe id's generated are <0x08B88..>, <0x18B88..>, <0x28B88..> etc.
Field Summary | |
---|---|
protected ChannelId |
channelId
ChannelId for this channel |
protected Id |
localId
The Id of the local node |
protected Stripe[] |
stripes
The list of stripeIds for this channel |
Constructor Summary | |
---|---|
Channel(ChannelId channelId,
Scribe scribe,
java.lang.String instance,
IdFactory factory,
Id localId,
int stripeBase,
int maxFailedSubscriptions)
Constructor to create a new channel from scratch |
Method Summary | |
---|---|
protected StripeId[] |
generateStripeIds(ChannelId id,
IdFactory factory)
Creates and returns the Ids associated with the provided channelId |
ChannelId |
getChannelId()
Gets the channelId for this channel |
Id |
getLocalId()
Gets the local node id. |
protected Stripe |
getPrimaryStripe()
The primary stripe is the stripe that the user must have. |
int |
getStripeBase()
|
Stripe[] |
getStripes()
At any moment a node is subscribed to at least 1 but possibly more stripes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ChannelId channelId
protected Stripe[] stripes
protected Id localId
Constructor Detail |
---|
public Channel(ChannelId channelId, Scribe scribe, java.lang.String instance, IdFactory factory, Id localId, int stripeBase, int maxFailedSubscriptions)
channelId
- The Id of the channelscribe
- The underlying stripe objectfactory
- The Id factorylocalId
- The local IdMethod Detail |
---|
public Id getLocalId()
public ChannelId getChannelId()
public Stripe[] getStripes()
protected Stripe getPrimaryStripe()
public int getStripeBase()
protected StripeId[] generateStripeIds(ChannelId id, IdFactory factory)
channelId
- The id of the channel
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |