Package com.hazelcast.kubernetes
Class RuntimeContext
java.lang.Object
com.hazelcast.kubernetes.RuntimeContext
Models the state of a Kubernetes StatefulSet(s).
 Note that this class is not thread-safe when instantiated using 
RuntimeContext() or
 RuntimeContext(RuntimeContext).
 RuntimeContext(int, int, int, String) models a single StatefulSet.- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final longDeprecated, for removal: This API element is subject to removal in a future version.
- 
Constructor SummaryConstructorsConstructorDescriptionCreates aRuntimeContext(int, int, int, java.lang.String)that can track the state of multiple StatefulSets.RuntimeContext(int specifiedReplicaCount, int readyReplicas, int currentReplicas, String resourceVersion) Deprecated, for removal: This API element is subject to removal in a future version.RuntimeContext(RuntimeContext context) Creates aRuntimeContext(int, int, int, java.lang.String)whose state is derived from anotherRuntimeContext(int, int, int, java.lang.String).
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddStatefulSetInfo(String name, RuntimeContext.StatefulSetInfo info, String resourceVersion) Adds or updates StatefulSet information in this context.intReturns the total number of current replicas.intReturns the total number of ready replicas.Returns the last resource version specified viaaddStatefulSetInfo(java.lang.String, com.hazelcast.kubernetes.RuntimeContext.StatefulSetInfo, java.lang.String).intReturns the total number of specified replicas.intReturns the number of StatefulSets tracked by this context.toString()
- 
Field Details- 
UNKNOWNDeprecated, for removal: This API element is subject to removal in a future version.Unknown value- See Also:
 
 
- 
- 
Constructor Details- 
RuntimeContextpublic RuntimeContext()Creates aRuntimeContext(int, int, int, java.lang.String)that can track the state of multiple StatefulSets. The createdRuntimeContext(int, int, int, java.lang.String)is not thread-safe.- Since:
- 5.6
 
- 
RuntimeContextCreates aRuntimeContext(int, int, int, java.lang.String)whose state is derived from anotherRuntimeContext(int, int, int, java.lang.String). The createdRuntimeContext(int, int, int, java.lang.String)is not thread-safe.- Throws:
- UnsupportedOperationException- when copying a- RuntimeContext(int, int, int, java.lang.String)created using- RuntimeContext(int, int, int, String).
- Since:
- 5.6
 
- 
RuntimeContext@Deprecated(forRemoval=true, since="5.6") public RuntimeContext(int specifiedReplicaCount, int readyReplicas, int currentReplicas, @Nullable String resourceVersion) Deprecated, for removal: This API element is subject to removal in a future version.UseRuntimeContext()andaddStatefulSetInfo(String, StatefulSetInfo, String)instead. This constructor is provided for backward compatibility only.Creates a RuntimeContext(int, int, int, java.lang.String)that can model a single StatefulSet. The createdRuntimeContext(int, int, int, java.lang.String)is thread-safe. The view of state returned by this constructor supports the following API:All other method invocations will throw UnsupportedOperationException.
 
- 
- 
Method Details- 
getSpecifiedReplicaCountpublic int getSpecifiedReplicaCount()Returns the total number of specified replicas. If the context is empty, returns -1.
- 
getReadyReplicaspublic int getReadyReplicas()Returns the total number of ready replicas. If the context is empty, returns -1.
- 
getCurrentReplicaspublic int getCurrentReplicas()Returns the total number of current replicas. If the context is empty, returns -1.
- 
getResourceVersionReturns the last resource version specified viaaddStatefulSetInfo(java.lang.String, com.hazelcast.kubernetes.RuntimeContext.StatefulSetInfo, java.lang.String).
- 
getStatefulSetCountpublic int getStatefulSetCount()Returns the number of StatefulSets tracked by this context.- Returns:
- the number of StatefulSets
- Throws:
- UnsupportedOperationException- when the- RuntimeContext(int, int, int, java.lang.String)was created using- RuntimeContext(int, int, int, String).
- Since:
- 5.6
 
- 
addStatefulSetInfopublic void addStatefulSetInfo(String name, @Nonnull RuntimeContext.StatefulSetInfo info, String resourceVersion) Adds or updates StatefulSet information in this context.- Parameters:
- name- the name of the StatefulSet
- info- the StatefulSet information
- resourceVersion- the resource version
- Throws:
- UnsupportedOperationException- when the- RuntimeContext(int, int, int, java.lang.String)was created using- RuntimeContext(int, int, int, String).
- Since:
- 5.6
 
- 
toString
 
- 
RuntimeContext()andaddStatefulSetInfo(String, StatefulSetInfo, String)instead.