public class KeyGroupsStateHandle extends Object implements StreamStateHandle
Constructor and Description |
---|
KeyGroupsStateHandle(KeyGroupRangeOffsets groupRangeOffsets,
StreamStateHandle streamStateHandle) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKeyGroup(int keyGroupId) |
void |
discardState()
Discards the state referred to by this handle, to free up resources in
the persistent storage.
|
boolean |
equals(Object o) |
StreamStateHandle |
getDelegateStateHandle() |
KeyGroupRangeOffsets |
getGroupRangeOffsets() |
KeyGroupsStateHandle |
getKeyGroupIntersection(KeyGroupRange keyGroupRange) |
int |
getNumberOfKeyGroups() |
long |
getOffsetForKeyGroup(int keyGroupId) |
long |
getStateSize()
Returns the size of the state in bytes.
|
int |
hashCode() |
Iterable<Integer> |
keyGroups() |
FSDataInputStream |
openInputStream()
Returns an
FSDataInputStream that can be used to read back the data that
was previously written to the stream. |
String |
toString() |
public KeyGroupsStateHandle(KeyGroupRangeOffsets groupRangeOffsets, StreamStateHandle streamStateHandle)
groupRangeOffsets
- range of key-group ids that in the state of this handlestreamStateHandle
- handle to the actual state of the key-groupspublic Iterable<Integer> keyGroups()
public boolean containsKeyGroup(int keyGroupId)
keyGroupId
- the id of a key-grouppublic long getOffsetForKeyGroup(int keyGroupId)
keyGroupId
- the id of a key-group. the id must be contained in the range of this handle.public KeyGroupsStateHandle getKeyGroupIntersection(KeyGroupRange keyGroupRange)
keyGroupRange
- a key group range to intersect.public KeyGroupRangeOffsets getGroupRangeOffsets()
public int getNumberOfKeyGroups()
public void discardState() throws Exception
StateObject
discardState
in interface StateObject
Exception
public long getStateSize()
StateObject
If the the size is not known, return 0
.
getStateSize
in interface StateObject
public FSDataInputStream openInputStream() throws IOException
StreamStateHandle
FSDataInputStream
that can be used to read back the data that
was previously written to the stream.openInputStream
in interface StreamStateHandle
IOException
public StreamStateHandle getDelegateStateHandle()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.