K
- the key type of its partitions.public interface Block<K extends Serializable>
Modifier and Type | Method and Description |
---|---|
void |
commit()
Commits this block to prevent further write.
|
Iterable<NonSerializedPartition<K>> |
getPartitions(KeyRange<K> keyRange)
Retrieves the
NonSerializedPartition s in a specific key range from this block. |
Iterable<SerializedPartition<K>> |
getSerializedPartitions(KeyRange<K> keyRange)
Retrieves the
SerializedPartition s in a specific key range. |
Optional<List<Long>> |
putPartitions(Iterable<NonSerializedPartition<K>> partitions)
Stores
NonSerializedPartition s to this block. |
List<Long> |
putSerializedPartitions(Iterable<SerializedPartition<K>> partitions)
Stores
SerializedPartition s to this block. |
Optional<List<Long>> putPartitions(Iterable<NonSerializedPartition<K>> partitions) throws IOException
NonSerializedPartition
s to this block.
Invariant: This should not be invoked after this block is committed.partitions
- the NonSerializedPartition
s to store.IOException
- if fail to store.List<Long> putSerializedPartitions(Iterable<SerializedPartition<K>> partitions) throws IOException
SerializedPartition
s to this block.
Invariant: This should not be invoked after this block is committed.partitions
- the SerializedPartition
s to store.IOException
- if fail to store.Iterable<NonSerializedPartition<K>> getPartitions(KeyRange<K> keyRange) throws IOException
NonSerializedPartition
s in a specific key range from this block.
If the data is serialized, deserializes it.
Invariant: This should not be invoked before this block is committed.keyRange
- the key range to retrieve.NonSerializedPartition
s.IOException
- if failed to retrieve.Iterable<SerializedPartition<K>> getSerializedPartitions(KeyRange<K> keyRange) throws IOException
SerializedPartition
s in a specific key range.
Invariant: This should not be invoked before this block is committed.keyRange
- the hash range to retrieve.SerializedPartition
s.IOException
- if failed to retrieve.void commit() throws IOException
IOException
- if failed to commit.Copyright © 2018. All rights reserved.