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

manirajv06 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 7930092a [YUNIKORN-3326] Change BackoffDeadline field in REST DAO to 
int64 (#1105)
7930092a is described below

commit 7930092a998ca28e886195d044e4e0179ac51c29
Author: PoiBlackTea <[email protected]>
AuthorDate: Fri Jul 24 17:17:52 2026 +0530

    [YUNIKORN-3326] Change BackoffDeadline field in REST DAO to int64 (#1105)
    
    Change BackoffDeadline field in ApplicationDAOInfo struct from *time.Time 
to *int64 (UnixNano) to align with YuniKorn REST DAO time encoding standards 
and ensure system-independent JSON output.
    
    Closes: #1105
    
    Signed-off-by: mani <[email protected]>
---
 pkg/webservice/dao/application_info.go | 4 +---
 pkg/webservice/handlers.go             | 8 +-------
 pkg/webservice/handlers_test.go        | 2 +-
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/pkg/webservice/dao/application_info.go 
b/pkg/webservice/dao/application_info.go
index d8e7113e..a4a31890 100644
--- a/pkg/webservice/dao/application_info.go
+++ b/pkg/webservice/dao/application_info.go
@@ -18,8 +18,6 @@
 
 package dao
 
-import "time"
-
 type ApplicationsDAOInfo struct {
        Applications []ApplicationDAOInfo `json:"applications,omitempty"`
 }
@@ -46,7 +44,7 @@ type ApplicationDAOInfo struct {
        MaxRequestPriority int32                   
`json:"maxRequestPriority,omitempty"`
        StartTime          int64                   `json:"startTime,omitempty"`
        ResourceHistory    ResourceHistory         
`json:"resourceHistory,omitempty"`
-       BackoffDeadline    *time.Time              
`json:"backoffDeadline,omitempty"`
+       BackoffDeadline    *int64                  
`json:"backoffDeadline,omitempty"`
 }
 
 type StateDAOInfo struct {
diff --git a/pkg/webservice/handlers.go b/pkg/webservice/handlers.go
index b3b1e465..f07ab098 100644
--- a/pkg/webservice/handlers.go
+++ b/pkg/webservice/handlers.go
@@ -353,12 +353,6 @@ func getApplicationDAO(app *objects.Application) 
*dao.ApplicationDAOInfo {
                PlaceholderResource: 
app.GetTrackedDAOMap("placeholderResource"),
        }
 
-       backoffDeadline := app.GetBackoffDeadline()
-       var backoffDeadlinePtr *time.Time
-       if !backoffDeadline.IsZero() {
-               backoffDeadlinePtr = &backoffDeadline
-       }
-
        return &dao.ApplicationDAOInfo{
                ApplicationID:      app.ApplicationID,
                UsedResource:       app.GetAllocatedResource().DAOMap(),
@@ -381,7 +375,7 @@ func getApplicationDAO(app *objects.Application) 
*dao.ApplicationDAOInfo {
                MaxRequestPriority: app.GetAskMaxPriority(),
                StartTime:          app.StartTime().UnixMilli(),
                ResourceHistory:    resHistory,
-               BackoffDeadline:    backoffDeadlinePtr,
+               BackoffDeadline:    
common.ZeroTimeInUnixNano(app.GetBackoffDeadline()),
        }
 }
 
diff --git a/pkg/webservice/handlers_test.go b/pkg/webservice/handlers_test.go
index 9a635ba8..e5e49898 100644
--- a/pkg/webservice/handlers_test.go
+++ b/pkg/webservice/handlers_test.go
@@ -1799,7 +1799,7 @@ func TestGetApplicationHandler(t *testing.T) {
        getApplication(resp, req)
        err = json.Unmarshal(resp.outputBytes, &appsDao)
        assert.NilError(t, err, unmarshalError)
-       assert.Assert(t, deadline.Equal(*appsDao.BackoffDeadline))
+       assert.Equal(t, *appsDao.BackoffDeadline, deadline.UnixNano())
 
        // test nonexistent partition
        var req1 *http.Request


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

Reply via email to