Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rice.p2p.splitstream
Class Channel

    java.lang.Object
      rice.p2p.splitstream.Channel

public class Channel
extends java.lang.Object

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.

Version:
  $Id: Channel.java,v 1.12 2005/03/11 00:57:59 jeffh Exp $
Author:
  Ansley Post, Alan Mislove, Atul Singh

Field Summary
`protected ChannelId` | `channelId` ChannelId for this channel
`protected Id` | `localId` The Id of the local node
`static int` | `STRIPE_BASE` The default number of stripes to create
`protected Stripe[]` | `stripes` The list of stripeIds for this channel

Constructor Summary
`Channel(ChannelId channelId, Scribe scribe, IdFactory factory, Id localId)` Constructor to create a new channel from scratch

Method Summary
`protected static 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.
`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

### channelId

    protected ChannelId channelId

  ChannelId for this channel

### stripes

    protected Stripe[] stripes

  The list of stripeIds for this channel

### localId

    protected Id localId

  The Id of the local node

### STRIPE_BASE

    public static int STRIPE_BASE

  The default number of stripes to create

Constructor Detail

### Channel

    public Channel(ChannelId channelId,
                   Scribe scribe,
                   IdFactory factory,
                   Id localId)

  Constructor to create a new channel from scratch

Parameters:
  `channelId` - The Id of the channel
  `scribe` - The underlying stripe object
  `factory` - The Id factory
  `localId` - The local Id

Method Detail

### getLocalId

    public Id getLocalId()

  Gets the local node id.

  Returns:
    The local node id

### getChannelId

    public ChannelId getChannelId()

  Gets the channelId for this channel

  Returns:
    ChannelId the channelId for this channel

### getStripes

    public Stripe[] getStripes()

  At any moment a node is subscribed to at least 1 but possibly more stripes. They will always be subscribed to their primary Stripe.

  Returns:
    Vector the Stripes this node is subscribed to.

### getPrimaryStripe

    protected Stripe getPrimaryStripe()

  The primary stripe is the stripe that the user must have.

  Returns:
    Stripe The Stripe object that is the primary stripe.

### generateStripeIds

    protected static StripeId[] generateStripeIds(ChannelId id,
                                                  IdFactory factory)

  Creates and returns the Ids associated with the provided channelId

  Parameters:
    `id` - DESCRIBE THE PARAMETER
    `factory` - DESCRIBE THE PARAMETER
  Returns:
    The array of stripeIds based on this channelId

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.