gyfora commented on code in PR #176:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/176#discussion_r856945232


##########
docs/content/docs/custom-resource/reference.md:
##########
@@ -160,26 +160,41 @@ This page serves as a full reference for FlinkDeployment 
custom resource definit
 
 ## Status
 
+### CommonStatus
+**Class**: org.apache.flink.kubernetes.operator.crd.status.CommonStatus
+
+**Description**: Last observed common status of the Flink deployment/Flink 
SessionJob.
+
+| Parameter | Type | Docs |
+| ----------| ---- | ---- |
+| jobStatus | org.apache.flink.kubernetes.operator.crd.status.JobStatus | Last 
observed status of the Flink job on Application/Session cluster. |
+| error | java.lang.String | Error information about the 
FlinkDeployment/FlinkSessionJob. |

Review Comment:
   The inheritence structure breaks the (not very sophisticated) doc generation 
logic. We should either fix it here or open a blocker jira to track this



##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/crd/status/ReconciliationStatus.java:
##########
@@ -54,19 +49,20 @@ public class ReconciliationStatus {
     private ReconciliationState state = ReconciliationState.DEPLOYED;
 
     @JsonIgnore
-    public FlinkDeploymentSpec deserializeLastReconciledSpec() {
-        return ReconciliationUtils.deserializedSpecWithVersion(
-                lastReconciledSpec, FlinkDeploymentSpec.class);
+    public abstract Class<SPEC> getSpecClass();

Review Comment:
   interesting, I will take a look at this later :) 



##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/crd/spec/SpecView.java:
##########
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.crd.spec;
+
+/** The common view of the spec. */
+public interface SpecView {

Review Comment:
   Could this be an abstract class instead called `FlinkSpecBase` or 
`AbstractFlinkSpec` which could contain the job field (with the lombok 
annotation) that both deployment and sessionjobspec would extend?



##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/crd/status/CommonStatus.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.crd.status;
+
+import org.apache.flink.annotation.Experimental;
+import org.apache.flink.kubernetes.operator.crd.spec.SpecView;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/** Last observed common status of the Flink deployment/Flink SessionJob. */
+@Experimental
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public abstract class CommonStatus<SPEC extends SpecView> {
+
+    /** Last observed status of the Flink job on Application/Session cluster. 
*/
+    private JobStatus jobStatus = new JobStatus();
+
+    /** Error information about the FlinkDeployment/FlinkSessionJob. */
+    private String error;
+
+    public abstract ReconciliationStatus<SPEC> getReconciliationStatus();

Review Comment:
   Missing javadoc comment



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to