Rice Pastry API

rice.p2p.glacier
Class ErasureCodec

java.lang.Object
  extended by rice.p2p.glacier.ErasureCodec

public class ErasureCodec
extends java.lang.Object

DESCRIBE THE CLASS

Version:
$Id: ErasureCodec.java 3613 2007-02-15 14:45:14Z jstewart $
Author:
ahae

Field Summary
protected  Environment environment
           
protected  Logger logger
           
protected  int numFragments
           
protected  int numSurvivors
           
 
Constructor Summary
ErasureCodec(int _numFragments, int _numSurvivors, Environment env)
          Constructor for ErasureCodec.
 
Method Summary
 PastContent decode(Fragment[] frag, Endpoint endpoint, PastContentDeserializer pcd)
           
protected  void decodeChunk(int[] buffer, int nExtra, int[] RowInd, boolean[] haveFragment, long[][] InvMat, int[] ColInd)
           
protected  PastContent deserialize(byte[] bytes, Endpoint endpoint, PastContentDeserializer pcd)
           
 void dump(byte[] data)
           
 Fragment[] encode(byte[] bytes, int length, boolean[] generateFragment)
          Generates multiple fragments from the incoming bytes
protected  void encodeChunk(int[] buffer)
          Input: buffer of size ; first words contain message, rest is zeroes Output: buffer contains fragments
 Fragment[] encodeObject(PastContent obj, boolean[] generateFragment)
           
 Fragment[] encodeObject(RawPastContent obj, boolean[] generateFragment)
          Serializes the object.
protected  void initElt()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numFragments

protected int numFragments

numSurvivors

protected int numSurvivors

environment

protected Environment environment

logger

protected Logger logger
Constructor Detail

ErasureCodec

public ErasureCodec(int _numFragments,
                    int _numSurvivors,
                    Environment env)
Constructor for ErasureCodec.

Parameters:
_numFragments - DESCRIBE THE PARAMETER
_numSurvivors - DESCRIBE THE PARAMETER
Method Detail

dump

public void dump(byte[] data)

encodeObject

public Fragment[] encodeObject(PastContent obj,
                               boolean[] generateFragment)

encodeObject

public Fragment[] encodeObject(RawPastContent obj,
                               boolean[] generateFragment)
Serializes the object.

Parameters:
obj -
generateFragment -
Returns:

encodeChunk

protected void encodeChunk(int[] buffer)
Input: buffer of size ; first words contain message, rest is zeroes Output: buffer contains fragments


encode

public Fragment[] encode(byte[] bytes,
                         int length,
                         boolean[] generateFragment)
Generates multiple fragments from the incoming bytes

Parameters:
bytes -
length -
generateFragment -
Returns:

decodeChunk

protected void decodeChunk(int[] buffer,
                           int nExtra,
                           int[] RowInd,
                           boolean[] haveFragment,
                           long[][] InvMat,
                           int[] ColInd)

decode

public PastContent decode(Fragment[] frag,
                          Endpoint endpoint,
                          PastContentDeserializer pcd)

deserialize

protected PastContent deserialize(byte[] bytes,
                                  Endpoint endpoint,
                                  PastContentDeserializer pcd)
                           throws java.io.IOException,
                                  java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

initElt

protected void initElt()

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection