|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.onionnetworks.fec.io.PacketPlacement
public class PacketPlacement
This class allocates and tracks how packets are written to disk. It is fully synchronized to safely support multi-threaded access. Its data structures and operations are fairly well optimized. (c) Copyright 2001 Onion Networks (c) Copyright 2000 OpenCola
Field Summary | |
---|---|
static short |
DECODED_BLOCK
|
Constructor Summary | |
---|---|
PacketPlacement(FECParameters params)
Creates a new PacketPlacement object. |
Method Summary | |
---|---|
int |
addPacketEntry(int blockNum,
int stripeNum)
Add a new entry to an available slot. |
int |
getDecodedBlockCount()
|
int |
getPacketCount(int blockNum)
|
int |
getPacketIndex(int blockNum,
int stripeNum)
Perform a reverse lookup on the index to find the index of a specific packet. |
int[] |
getStripeNums(int blockNum)
|
int[] |
getStripeNums(int blockNum,
int count)
|
int |
getWrittenCount()
|
boolean |
isBlockDecoded(int blockNum)
|
void |
setBlockDecoded(int blockNum)
Signify that this block has been decoded. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short DECODED_BLOCK
Constructor Detail |
---|
public PacketPlacement(FECParameters params)
params
- The FECParameters for this download.Method Detail |
---|
public int getDecodedBlockCount()
public void setBlockDecoded(int blockNum)
blockNum
- The blockNum of the decoded block.public boolean isBlockDecoded(int blockNum)
The
- blockNum of the block to check.
public int getPacketCount(int blockNum)
blockNum
- the blockNum for which to count packets.
public int getWrittenCount()
public int getPacketIndex(int blockNum, int stripeNum)
blockNum
- The blockNum of the packet.stripeNum
- The stripeNum of the packet.
public int addPacketEntry(int blockNum, int stripeNum)
blockNum
- The blockNum of the entry.stripeNum
- the stripeNum of the entry.
DuplicatePacketException
- When there is an attempt to write a
packet a second time.
BlockFullException
- When the desired block is already full.public int[] getStripeNums(int blockNum)
public int[] getStripeNums(int blockNum, int count)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |