类 AbstractFlinkResourceReconciler<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<SPEC,STATUS>,SPEC extends org.apache.flink.kubernetes.operator.api.spec.AbstractFlinkSpec,STATUS extends org.apache.flink.kubernetes.operator.api.status.CommonStatus<SPEC>>
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.reconciler.deployment.AbstractFlinkResourceReconciler<CR,SPEC,STATUS>
-
- 所有已实现的接口:
Reconciler<CR>
- 直接已知子类:
AbstractJobReconciler,SessionReconciler
public abstract class AbstractFlinkResourceReconciler<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<SPEC,STATUS>,SPEC extends org.apache.flink.kubernetes.operator.api.spec.AbstractFlinkSpec,STATUS extends org.apache.flink.kubernetes.operator.api.status.CommonStatus<SPEC>> extends java.lang.Object implements Reconciler<CR>
Base class for all Flink resource reconcilers. It contains the general flow of reconciling Flink related resources including initial deployments, upgrades, rollbacks etc.
-
-
字段概要
字段 修饰符和类型 字段 说明 protected java.time.Clockclockprotected EventRecordereventRecorderprotected io.fabric8.kubernetes.client.KubernetesClientkubernetesClientstatic java.lang.StringMSG_ROLLBACKstatic java.lang.StringMSG_SPEC_CHANGEDstatic java.lang.StringMSG_SUBMITstatic java.lang.StringMSG_SUSPENDEDprotected JobAutoScalerresourceScalerprotected StatusRecorder<CR,STATUS>statusRecorder
-
构造器概要
构造器 构造器 说明 AbstractFlinkResourceReconciler(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, EventRecorder eventRecorder, StatusRecorder<CR,STATUS> statusRecorder, JobAutoScalerFactory autoscalerFactory)
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 io.javaoperatorsdk.operator.api.reconciler.DeleteControlcleanup(FlinkResourceContext<CR> ctx)This is called when receiving the delete event of custom resource.protected abstract io.javaoperatorsdk.operator.api.reconciler.DeleteControlcleanupInternal(FlinkResourceContext<CR> ctx)Shut down and clean up all Flink job/cluster resources.abstract voiddeploy(FlinkResourceContext<CR> ctx, SPEC spec, org.apache.flink.configuration.Configuration deployConfig, java.util.Optional<java.lang.String> savepoint, boolean requireHaMetadata)Deploys the target resource spec to Kubernetes.protected booleanflinkVersionChanged(SPEC oldSpec, SPEC newSpec)protected abstract booleanreadyToReconcile(FlinkResourceContext<CR> ctx)Check whether the given Flink resource is ready to be reconciled or we are still waiting for any pending operation or condition first.voidreconcile(FlinkResourceContext<CR> ctx)This is called when receiving the create or update event of the custom resource.protected abstract booleanreconcileOtherChanges(FlinkResourceContext<CR> ctx)Reconcile any other changes required for this resource that are specific to the reconciler implementation.protected abstract booleanreconcileSpecChange(FlinkResourceContext<CR> ctx, org.apache.flink.configuration.Configuration deployConfig)Reconcile spec upgrade on the currently deployed/suspended Flink resource and update the status accordingly.voidsetClock(java.time.Clock clock)protected voidsetOwnerReference(CR owner, org.apache.flink.configuration.Configuration deployConfig)protected booleanshouldRecoverDeployment(org.apache.flink.configuration.Configuration conf, org.apache.flink.kubernetes.operator.api.FlinkDeployment deployment)Checks whether the JobManager Kubernetes Deployment recovery logic should be initiated.
-
-
-
字段详细资料
-
eventRecorder
protected final EventRecorder eventRecorder
-
statusRecorder
protected final StatusRecorder<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<SPEC,STATUS>,STATUS extends org.apache.flink.kubernetes.operator.api.status.CommonStatus<SPEC>> statusRecorder
-
kubernetesClient
protected final io.fabric8.kubernetes.client.KubernetesClient kubernetesClient
-
resourceScaler
protected final JobAutoScaler resourceScaler
-
MSG_SUSPENDED
public static final java.lang.String MSG_SUSPENDED
- 另请参阅:
- 常量字段值
-
MSG_SPEC_CHANGED
public static final java.lang.String MSG_SPEC_CHANGED
- 另请参阅:
- 常量字段值
-
MSG_ROLLBACK
public static final java.lang.String MSG_ROLLBACK
- 另请参阅:
- 常量字段值
-
MSG_SUBMIT
public static final java.lang.String MSG_SUBMIT
- 另请参阅:
- 常量字段值
-
clock
protected java.time.Clock clock
-
-
构造器详细资料
-
AbstractFlinkResourceReconciler
public AbstractFlinkResourceReconciler(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, EventRecorder eventRecorder, StatusRecorder<CR,STATUS> statusRecorder, JobAutoScalerFactory autoscalerFactory)
-
-
方法详细资料
-
reconcile
public void reconcile(FlinkResourceContext<CR> ctx) throws java.lang.Exception
从接口复制的说明:ReconcilerThis is called when receiving the create or update event of the custom resource.- 指定者:
reconcile在接口中Reconciler<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<SPEC,STATUS>>- 参数:
ctx- the context with which the operation is executed- 抛出:
java.lang.Exception- Error during reconciliation.
-
readyToReconcile
protected abstract boolean readyToReconcile(FlinkResourceContext<CR> ctx)
Check whether the given Flink resource is ready to be reconciled or we are still waiting for any pending operation or condition first.- 参数:
ctx- Reconciliation context.- 返回:
- True if the resource is ready to be reconciled.
-
reconcileSpecChange
protected abstract boolean reconcileSpecChange(FlinkResourceContext<CR> ctx, org.apache.flink.configuration.Configuration deployConfig) throws java.lang.Exception
Reconcile spec upgrade on the currently deployed/suspended Flink resource and update the status accordingly.- 参数:
ctx- Reconciliation context.deployConfig- Deployment configuration.- 返回:
- True if spec change reconciliation was executed
- 抛出:
java.lang.Exception- Error during spec upgrade.
-
reconcileOtherChanges
protected abstract boolean reconcileOtherChanges(FlinkResourceContext<CR> ctx) throws java.lang.Exception
Reconcile any other changes required for this resource that are specific to the reconciler implementation.- 参数:
ctx- Reconciliation context.- 返回:
- True if any further reconciliation action was taken.
- 抛出:
java.lang.Exception- Error during reconciliation.
-
cleanup
public io.javaoperatorsdk.operator.api.reconciler.DeleteControl cleanup(FlinkResourceContext<CR> ctx)
从接口复制的说明:ReconcilerThis is called when receiving the delete event of custom resource. This method is meant to cleanup the associated components like the Flink job components.- 指定者:
cleanup在接口中Reconciler<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<SPEC,STATUS>>- 参数:
ctx- the context with which the operation is executed- 返回:
- DeleteControl to manage the deletion behavior
-
deploy
@VisibleForTesting public abstract void deploy(FlinkResourceContext<CR> ctx, SPEC spec, org.apache.flink.configuration.Configuration deployConfig, java.util.Optional<java.lang.String> savepoint, boolean requireHaMetadata) throws java.lang.Exception
Deploys the target resource spec to Kubernetes.- 参数:
ctx- Reconciliation context.spec- Spec that should be deployed to Kubernetes.deployConfig- Flink conf for the deployment.savepoint- Optional savepoint path for applications and session jobs.requireHaMetadata- Flag used by application deployments to validate HA metadata- 抛出:
java.lang.Exception- Error during deployment.
-
cleanupInternal
protected abstract io.javaoperatorsdk.operator.api.reconciler.DeleteControl cleanupInternal(FlinkResourceContext<CR> ctx)
Shut down and clean up all Flink job/cluster resources.- 参数:
ctx- Current context.- 返回:
- DeleteControl object.
-
shouldRecoverDeployment
protected boolean shouldRecoverDeployment(org.apache.flink.configuration.Configuration conf, org.apache.flink.kubernetes.operator.api.FlinkDeployment deployment)Checks whether the JobManager Kubernetes Deployment recovery logic should be initiated. This is triggered only if, jm deployment missing, recovery config and HA enabled. This logic is only used by the Session and Application reconcilers.- 参数:
conf- Flink cluster configuration.deployment- FlinkDeployment object.- 返回:
- True if recovery should be executed.
-
setOwnerReference
protected void setOwnerReference(CR owner, org.apache.flink.configuration.Configuration deployConfig)
-
setClock
@VisibleForTesting public void setClock(java.time.Clock clock)
-
-