public class KvStateLocation extends Object implements Serializable
InternalKvState
instance.
This is populated by the KvStateLocationRegistry
and used by the queryable state to
target queries.
Constructor and Description |
---|
KvStateLocation(JobID jobId,
JobVertexID jobVertexId,
int numKeyGroups,
String registrationName)
Creates the location information.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
JobID |
getJobId()
Returns the JobID the KvState instances belong to.
|
JobVertexID |
getJobVertexId()
Returns the JobVertexID the KvState instances belong to.
|
KvStateID |
getKvStateID(int keyGroupIndex)
Returns the registered KvStateID for the key group index or
null if none is
registered yet. |
InetSocketAddress |
getKvStateServerAddress(int keyGroupIndex)
Returns the registered server address for the key group index or
null if none is
registered yet. |
int |
getNumKeyGroups()
Returns the number of key groups of the operator the KvState instances belong to.
|
int |
getNumRegisteredKeyGroups()
Returns the current number of registered key groups.
|
String |
getRegistrationName()
Returns the name under which the KvState instances have been registered.
|
int |
hashCode() |
void |
registerKvState(KeyGroupRange keyGroupRange,
KvStateID kvStateId,
InetSocketAddress kvStateAddress)
Registers a KvState instance for the given key group index.
|
String |
toString() |
public KvStateLocation(JobID jobId, JobVertexID jobVertexId, int numKeyGroups, String registrationName)
jobId
- JobID the KvState instances belong tojobVertexId
- JobVertexID the KvState instances belong tonumKeyGroups
- Number of key groups of the operatorregistrationName
- Name under which the KvState instances have been registeredpublic JobID getJobId()
public JobVertexID getJobVertexId()
public int getNumKeyGroups()
public String getRegistrationName()
public int getNumRegisteredKeyGroups()
public KvStateID getKvStateID(int keyGroupIndex)
null
if none is
registered yet.keyGroupIndex
- Key group index to get ID for.null
if none is registered yetIndexOutOfBoundsException
- If key group index < 0 or >= Number of key groupspublic InetSocketAddress getKvStateServerAddress(int keyGroupIndex)
null
if none is
registered yet.keyGroupIndex
- Key group index to get server address for.null
if none is registered
yetIndexOutOfBoundsException
- If key group index < 0 or >= Number of key groupspublic void registerKvState(KeyGroupRange keyGroupRange, KvStateID kvStateId, InetSocketAddress kvStateAddress)
keyGroupRange
- Key group range to registerkvStateId
- ID of the KvState instance at the key group index.kvStateAddress
- Server address of the KvState instance at the key group index.IndexOutOfBoundsException
- If key group range start < 0 or key group range end >=
Number of key groupsCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.