[
https://issues.apache.org/jira/browse/GOBBLIN-2027?focusedWorklogId=911936&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-911936
]
ASF GitHub Bot logged work on GOBBLIN-2027:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 27/Mar/24 22:47
Start Date: 27/Mar/24 22:47
Worklog Time Spent: 10m
Work Description: arjun4084346 commented on code in PR #3904:
URL: https://github.com/apache/gobblin/pull/3904#discussion_r1542125950
##########
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:
After thinking about the structures, here's my opinion,
It maybe (?) atypical for a derived class be inside the parent class, but it
looks more atypical for an **interface** to contain an abstract parent class
and base class.
Being able to write `LeaseAttemptStatus.LeaseObtainedStatus` looked like a
determining factor for choosing this structure. This is like how enums are
addressed too.
Issue Time Tracking
-------------------
Worklog Id: (was: 911936)
Time Spent: 1h 10m (was: 1h)
> 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: 1h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)