phet commented on code in PR #3904:
URL: https://github.com/apache/gobblin/pull/3904#discussion_r1541977818


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/LeaseAttemptStatus.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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.gobblin.service.modules.orchestration;
+
+import java.io.IOException;
+
+import lombok.AccessLevel;
+import lombok.Data;
+import lombok.Getter;
+
+
+/*
+ Class used to encapsulate status of lease acquisition attempt and derivations 
should contain information specific to
+ the status that results. The #getDagAction and 
#getMinimumLingerDurationMillis are meant to be overriden and used by

Review Comment:
   use javadoc `{@link ...}` syntax



##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/DagManagementDagActionStoreChangeMonitor.java:
##########
@@ -52,7 +52,7 @@ public DagManagementDagActionStoreChangeMonitor(Config 
config, int numThreads,
   }
 
   /**
-   * This implementation passes on the {@link 
org.apache.gobblin.runtime.api.DagActionStore.DagAction} to the
+   * This implementation passes on the {@link DagActionStore.DagAction} to the

Review Comment:
   nit: strike "the", so "to {@link DagManagement}"



##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManagementTaskStreamImpl.java:
##########
@@ -93,22 +91,22 @@ public DagTask next() {
       throw new RuntimeException("DagManagement not initialized in 
multi-active execution mode when required.");
     }
     try {
-      MultiActiveLeaseArbiter.LeaseAttemptStatus leaseAttemptStatus = null;
+      LeaseAttemptStatus leaseAttemptStatus = null;

Review Comment:
   since they're part and parcel of the MALA abstraction, I'd personally keep 
these as static inner classes.  did you find a particular motivation to move 
them?
   
   either way is not a big deal actually...



##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/LeaseAttemptStatus.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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.gobblin.service.modules.orchestration;
+
+import java.io.IOException;
+
+import lombok.AccessLevel;
+import lombok.Data;
+import lombok.Getter;
+
+
+/*
+ Class used to encapsulate status of lease acquisition attempt and derivations 
should contain information specific to
+ the status that results. The #getDagAction and 
#getMinimumLingerDurationMillis are meant to be overriden and used by
+ relevant derived classes.
+ */
+public abstract class LeaseAttemptStatus {
+  public DagActionStore.DagAction getDagAction() {
+    return null;
+  }
+
+  public long getMinimumLingerDurationMillis() {
+    return 0;
+  }
+
+  public static class NoLongerLeasingStatus extends LeaseAttemptStatus {}

Review Comment:
   this deserves javadoc (may have been an oversight previously)



##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/LeaseAttemptStatus.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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.gobblin.service.modules.orchestration;
+
+import java.io.IOException;
+
+import lombok.AccessLevel;
+import lombok.Data;
+import lombok.Getter;
+
+
+/*
+ Class used to encapsulate status of lease acquisition attempt and derivations 
should contain information specific to

Review Comment:
   this ought to link to the MALA, now that you've separated it into another 
file



##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/LeaseAttemptStatus.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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.gobblin.service.modules.orchestration;
+
+import java.io.IOException;
+
+import lombok.AccessLevel;
+import lombok.Data;
+import lombok.Getter;
+
+
+/*
+ Class used to encapsulate status of lease acquisition attempt and derivations 
should contain information specific to
+ the status that results. The #getDagAction and 
#getMinimumLingerDurationMillis are meant to be overriden and used by
+ relevant derived classes.
+ */
+public abstract class LeaseAttemptStatus {
+  public DagActionStore.DagAction getDagAction() {
+    return null;
+  }
+
+  public long getMinimumLingerDurationMillis() {
+    return 0;
+  }
+
+  public static class NoLongerLeasingStatus extends LeaseAttemptStatus {}
+
+  /*
+  The participant calling this method acquired the lease for the event in 
question. `Dag action`'s flow execution id
+  is the timestamp associated with the lease and the time the caller obtained 
the lease is stored within the
+  `leaseAcquisitionTimestamp` field. The `multiActiveLeaseArbiter` reference 
is used to recordLeaseSuccess for the
+  current LeaseObtainedStatus via the completeLease method from a caller 
without access to the {@link MultiActiveLeaseArbiter}.
+  */
+  @Data
+  public static class LeaseObtainedStatus extends LeaseAttemptStatus {

Review Comment:
   it's atypical to have a derived class defined inside the class it's 
extending.  is this borne of a desire to keep these all together, rather than 
having a separate top-level file for each?
   
   (I do agree that separating into four separate files would be far less 
comprehensible.)
   
   honestly, what I liked about having these defined inside 
`MultiActiveLeaseArbiter` was that they lived all together (as they do here) 
AND that they together resided along side the abstraction that uses them (the 
MALA itself).



-- 
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