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
NonSerializedPartitions in a specific key range from this block. |
Iterable<SerializedPartition<K>> |
getSerializedPartitions(KeyRange<K> keyRange)
Retrieves the
SerializedPartitions in a specific key range. |
Optional<List<Long>> |
putPartitions(Iterable<NonSerializedPartition<K>> partitions)
Stores
NonSerializedPartitions to this block. |
List<Long> |
putSerializedPartitions(Iterable<SerializedPartition<K>> partitions)
Stores
SerializedPartitions to this block. |
Optional<List<Long>> putPartitions(Iterable<NonSerializedPartition<K>> partitions) throws IOException
NonSerializedPartitions to this block.
Invariant: This should not be invoked after this block is committed.partitions - the NonSerializedPartitions to store.IOException - if fail to store.List<Long> putSerializedPartitions(Iterable<SerializedPartition<K>> partitions) throws IOException
SerializedPartitions to this block.
Invariant: This should not be invoked after this block is committed.partitions - the SerializedPartitions to store.IOException - if fail to store.Iterable<NonSerializedPartition<K>> getPartitions(KeyRange<K> keyRange) throws IOException
NonSerializedPartitions 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.NonSerializedPartitions.IOException - if failed to retrieve.Iterable<SerializedPartition<K>> getSerializedPartitions(KeyRange<K> keyRange) throws IOException
SerializedPartitions in a specific key range.
Invariant: This should not be invoked before this block is committed.keyRange - the hash range to retrieve.SerializedPartitions.IOException - if failed to retrieve.void commit()
throws IOException
IOException - if failed to commit.Copyright © 2018. All rights reserved.