Constructor and Description |
---|
Table(int tableID,
PartitionCombiner<P> combiner)
Constructor.
|
Table(int tableID,
PartitionCombiner<P> combiner,
int size) |
Modifier and Type | Method and Description |
---|---|
PartitionStatus |
addPartition(Partition<P> partition)
Add a partition into a table.
|
void |
free()
Free the partitions
|
PartitionCombiner<P> |
getCombiner()
Get the combiner
|
int |
getNumPartitions()
Get the number of partitions in this table
|
Partition<P> |
getPartition(int partitionID)
Get the partition by partitionID
|
IntSet |
getPartitionIDs()
Get the IDs of the partitions in this table
|
<any> |
getPartitions()
Get the partitions in this table
|
int |
getTableID()
Get the table ID
|
protected PartitionStatus |
insertPartition(Partition<P> partition)
Insert a partition to this table
|
boolean |
isEmpty()
If this table is empty, return true; else,
return false.
|
void |
release()
Release the partitions
|
Partition<P> |
removePartition(int partitionID)
Remove the partition from this table
|
public Table(int tableID, PartitionCombiner<P> combiner)
tableID
- a table is assigned with an ID which
is convenient for reference. Any ID
is allowed.combiner
- the combiner used for partitionspublic Table(int tableID, PartitionCombiner<P> combiner, int size)
public int getTableID()
public PartitionCombiner<P> getCombiner()
public final int getNumPartitions()
public final IntSet getPartitionIDs()
public final <any> getPartitions()
public final PartitionStatus addPartition(Partition<P> partition)
partition
- protected final PartitionStatus insertPartition(Partition<P> partition)
partition
- public final Partition<P> getPartition(int partitionID)
partitionID
- public final Partition<P> removePartition(int partitionID)
partitionID
- public final boolean isEmpty()
public final void release()
public final void free()