This is an automated email from the ASF dual-hosted git repository.

ccondit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git


The following commit(s) were added to refs/heads/master by this push:
     new e3d94294 [YUNIKORN-2594] Remove unused field AllocationAsk.execTimeout 
(#859)
e3d94294 is described below

commit e3d94294b4ef741c44206e95e188f56a4da13fd4
Author: Craig Condit <[email protected]>
AuthorDate: Sat Apr 27 06:23:36 2024 -0500

    [YUNIKORN-2594] Remove unused field AllocationAsk.execTimeout (#859)
    
    The execTimeout field in AllocationAsk is populated but unused.
    
    Closes: #859
---
 pkg/scheduler/objects/allocation_ask.go      | 13 +++----------
 pkg/scheduler/objects/allocation_ask_test.go | 18 ------------------
 pkg/webservice/dao/allocation_ask_info.go    |  1 -
 pkg/webservice/handlers.go                   |  1 -
 4 files changed, 3 insertions(+), 30 deletions(-)

diff --git a/pkg/scheduler/objects/allocation_ask.go 
b/pkg/scheduler/objects/allocation_ask.go
index 9611b9f0..fc39a770 100644
--- a/pkg/scheduler/objects/allocation_ask.go
+++ b/pkg/scheduler/objects/allocation_ask.go
@@ -37,10 +37,9 @@ type AllocationAsk struct {
        allocationKey     string
        applicationID     string
        partitionName     string
-       taskGroupName     string        // task group this allocation ask 
belongs to
-       placeholder       bool          // is this a placeholder allocation ask
-       execTimeout       time.Duration // execTimeout for the allocation ask
-       createTime        time.Time     // the time this ask was created (used 
in reservations)
+       taskGroupName     string    // task group this allocation ask belongs to
+       placeholder       bool      // is this a placeholder allocation ask
+       createTime        time.Time // the time this ask was created (used in 
reservations)
        priority          int32
        requiredNode      string
        allowPreemptSelf  bool
@@ -95,7 +94,6 @@ func NewAllocationAskFromSI(ask *si.AllocationAsk) 
*AllocationAsk {
                tags:              CloneAllocationTags(ask.Tags),
                createTime:        time.Now(),
                priority:          ask.Priority,
-               execTimeout:       
common.ConvertSITimeout(ask.ExecutionTimeoutMilliSeconds),
                placeholder:       ask.Placeholder,
                taskGroupName:     ask.TaskGroupName,
                requiredNode:      common.GetRequiredNodeFromTag(ask.Tags),
@@ -199,11 +197,6 @@ func (aa *AllocationAsk) GetTaskGroup() string {
        return aa.taskGroupName
 }
 
-// GetTimeout returns the timeout for this ask
-func (aa *AllocationAsk) GetTimeout() time.Duration {
-       return aa.execTimeout
-}
-
 // GetRequiredNode gets the node (if any) required by this ask.
 func (aa *AllocationAsk) GetRequiredNode() string {
        return aa.requiredNode
diff --git a/pkg/scheduler/objects/allocation_ask_test.go 
b/pkg/scheduler/objects/allocation_ask_test.go
index 8c913ee0..b2667c7d 100644
--- a/pkg/scheduler/objects/allocation_ask_test.go
+++ b/pkg/scheduler/objects/allocation_ask_test.go
@@ -141,24 +141,6 @@ func TestPlaceHolder(t *testing.T) {
        assert.Equal(t, ask.GetTaskGroup(), "testgroup", "TaskGroupName not set 
as expected")
 }
 
-func TestGetTimeout(t *testing.T) {
-       siAsk := &si.AllocationAsk{
-               AllocationKey: "ask1",
-               ApplicationID: "app1",
-               PartitionName: "default",
-       }
-       ask := NewAllocationAskFromSI(siAsk)
-       assert.Equal(t, ask.GetTimeout(), time.Duration(0), "standard ask 
should not have timeout")
-       siAsk = &si.AllocationAsk{
-               AllocationKey:                "ask1",
-               ApplicationID:                "app1",
-               PartitionName:                "default",
-               ExecutionTimeoutMilliSeconds: 10,
-       }
-       ask = NewAllocationAskFromSI(siAsk)
-       assert.Equal(t, ask.GetTimeout(), 10*time.Millisecond, "ask timeout not 
set as expected")
-}
-
 func TestGetRequiredNode(t *testing.T) {
        tag := make(map[string]string)
        // unset case
diff --git a/pkg/webservice/dao/allocation_ask_info.go 
b/pkg/webservice/dao/allocation_ask_info.go
index 8097c5bc..5f865b6d 100644
--- a/pkg/webservice/dao/allocation_ask_info.go
+++ b/pkg/webservice/dao/allocation_ask_info.go
@@ -34,7 +34,6 @@ type AllocationAskDAOInfo struct {
        ApplicationID       string                     
`json:"applicationId,omitempty"`
        Partition           string                     
`json:"partition,omitempty"`
        Placeholder         bool                       
`json:"placeholder,omitempty"`
-       PlaceholderTimeout  int64                      
`json:"placeholderTimeout,omitempty"`
        TaskGroupName       string                     
`json:"taskGroupName,omitempty"`
        AllocationLog       []*AllocationAskLogDAOInfo 
`json:"allocationLog,omitempty"`
        TriggeredPreemption bool                       
`json:"triggeredPreemption,omitempty"`
diff --git a/pkg/webservice/handlers.go b/pkg/webservice/handlers.go
index 73c76019..17d09566 100644
--- a/pkg/webservice/handlers.go
+++ b/pkg/webservice/handlers.go
@@ -329,7 +329,6 @@ func getAllocationAskDAO(ask *objects.AllocationAsk) 
*dao.AllocationAskDAOInfo {
                ApplicationID:       ask.GetApplicationID(),
                Partition:           
common.GetPartitionNameWithoutClusterID(ask.GetPartitionName()),
                Placeholder:         ask.IsPlaceholder(),
-               PlaceholderTimeout:  ask.GetTimeout().Nanoseconds(),
                TaskGroupName:       ask.GetTaskGroup(),
                AllocationLog:       
getAllocationLogsDAO(ask.GetAllocationLog()),
                TriggeredPreemption: ask.HasTriggeredPreemption(),


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to