[ 
https://issues.apache.org/jira/browse/GOBBLIN-2027?focusedWorklogId=911915&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-911915
 ]

ASF GitHub Bot logged work on GOBBLIN-2027:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Mar/24 20:34
            Start Date: 27/Mar/24 20:34
    Worklog Time Spent: 10m 
      Work Description: 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).





Issue Time Tracking
-------------------

    Worklog Id:     (was: 911915)
    Time Spent: 20m  (was: 10m)

> move DagActionStore from gobblin-runtime to gobblin-service
> -----------------------------------------------------------
>
>                 Key: GOBBLIN-2027
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-2027
>             Project: Apache Gobblin
>          Issue Type: Task
>            Reporter: Arjun Singh Bora
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to