Interface Partition<T,K>
-
- Type Parameters:
T
- the type of the data stored in thisPartition
.K
- the type of key used forPartition
.
- All Known Implementing Classes:
NonSerializedPartition
,SerializedPartition
public interface Partition<T,K>
A collection of data elements. This is a unit of read / write towardsBlock
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
commit()
Commits a partition to prevent further data write.T
getData()
K
getKey()
boolean
isSerialized()
void
write(java.lang.Object element)
Writes an element to non-committed partition.
-
-
-
Method Detail
-
write
void write(java.lang.Object element) throws java.io.IOException
Writes an element to non-committed partition.- Parameters:
element
- element to write.- Throws:
java.io.IOException
- if the partition is already committed.
-
commit
void commit() throws java.io.IOException
Commits a partition to prevent further data write.- Throws:
java.io.IOException
- if fail to commit partition.
-
getKey
K getKey()
- Returns:
- the key value.
-
isSerialized
boolean isSerialized()
- Returns:
- whether the data in this
Partition
is serialized or not.
-
-