Rice Pastry API

rice.p2p.splitstream
Class SplitStreamImpl

java.lang.Object
  |
  +--rice.p2p.splitstream.SplitStreamImpl
All Implemented Interfaces:
SplitStream

public class SplitStreamImpl
extends java.lang.Object
implements SplitStream

This is the implementing class of the ISplitStream interface. It provides the functionality of creating and attaching to channels. This class is responsible for handling all channels that a local node is part of.

Version:
$Id: SplitStreamImpl.java,v 1.9 2003/10/22 03:22:57 amislove Exp $
Author:
Ansley Post, Alan Mislove

Field Summary
protected  java.util.Hashtable channels
          Hashtable of all the channels currently created on this node implicitly or explicitly.
protected  rice.p2p.commonapi.Node node
          The node that this application is running on
protected  rice.p2p.scribe.Scribe scribe
          The scribe instance for this SplitStream Object
 
Constructor Summary
SplitStreamImpl(rice.p2p.commonapi.Node node, java.lang.String instance)
          The constructor for building the splitStream object which internally creates it's own Scribe.
 
Method Summary
 rice.p2p.splitstream.Channel attachChannel(rice.p2p.splitstream.ChannelId id)
          This method is used by peers who wish to listen to content distributed by some other peer using SplitStream.
 rice.p2p.splitstream.Channel createChannel(rice.p2p.splitstream.ChannelId id)
          This method is used by a peer who wishes to distribute the content using SplitStream.
 rice.p2p.splitstream.Channel[] getChannels()
          Returns all of the channels on this local splitstream
 rice.p2p.splitstream.SplitStreamScribePolicy getPolicy()
          Returns the policy used to control Scribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scribe

protected rice.p2p.scribe.Scribe scribe
The scribe instance for this SplitStream Object


node

protected rice.p2p.commonapi.Node node
The node that this application is running on


channels

protected java.util.Hashtable channels
Hashtable of all the channels currently created on this node implicitly or explicitly.

Constructor Detail

SplitStreamImpl

public SplitStreamImpl(rice.p2p.commonapi.Node node,
                       java.lang.String instance)
The constructor for building the splitStream object which internally creates it's own Scribe.

Parameters:
node - the pastry node that we will use
instance - The instance name for this splitstream
Method Detail

createChannel

public rice.p2p.splitstream.Channel createChannel(rice.p2p.splitstream.ChannelId id)
This method is used by a peer who wishes to distribute the content using SplitStream. It creates a Channel Object consisting of numStripes number of Stripes, one for each stripe's content. A Channel object is responsible for implementing SplitStream functionality, like maintaining multiple multicast trees, bandwidth management and discovering parents having spare capacity. One Channel object should be created for each content distribution which wishes to use SplitStream.

Specified by:
createChannel in interface SplitStream
Parameters:
id - The id of the channel to create
Returns:
an instance of a Channel class.

attachChannel

public rice.p2p.splitstream.Channel attachChannel(rice.p2p.splitstream.ChannelId id)
This method is used by peers who wish to listen to content distributed by some other peer using SplitStream. It attaches the local node to the Channel which is being used by the source peer to distribute the content. Essentially, this method finds out the different parameters of Channel object which is created by the source, (the peer distributing the content) , and then creates a local Channel object with these parameters and returns it. This is a non-blocking call so the returned Channel object may not be initialized with all the parameters, so applications should wait for channelIsReady() notification made by channels when they are ready.

Specified by:
attachChannel in interface SplitStream
Parameters:
id - The id of the channel to create
Returns:
An instance of Channel object.

getChannels

public rice.p2p.splitstream.Channel[] getChannels()
Returns all of the channels on this local splitstream

Specified by:
getChannels in interface SplitStream
Returns:
All of the channels currently being received by this splitstream

getPolicy

public rice.p2p.splitstream.SplitStreamScribePolicy getPolicy()
Returns the policy used to control Scribe

Returns:
The Scribe policy

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection