From de724b4a6b669894658768815ed784ba10f780bd Mon Sep 17 00:00:00 2001 From: Chris Green Date: Fri, 15 Nov 2024 17:32:43 -0600 Subject: [PATCH] New completion signifier `taskCompletedWithNote()` --- .../src/main/java/org/dcache/pool/migration/Job.java | 12 ++++++++++++ .../dcache/pool/migration/TaskCompletionHandler.java | 1 + 2 files changed, 13 insertions(+) diff --git a/modules/dcache/src/main/java/org/dcache/pool/migration/Job.java b/modules/dcache/src/main/java/org/dcache/pool/migration/Job.java index 0043e17feb7..3679f42e37a 100644 --- a/modules/dcache/src/main/java/org/dcache/pool/migration/Job.java +++ b/modules/dcache/src/main/java/org/dcache/pool/migration/Job.java @@ -785,6 +785,18 @@ public void taskCompleted(Task task) { } } + @Override + public void taskCompletedWithNote(Task task, String msg) { + _lock.lock(); + try { + taskCompleted(task); + + addNote(new Note(task.getId(), task.getPnfsId(), msg)); + } finally { + _lock.unlock(); + } + } + public Object messageArrived(CellMessage envelope, PoolMigrationJobCancelMessage message) { DelayedReply reply = new DelayedReply(); _lock.lock(); diff --git a/modules/dcache/src/main/java/org/dcache/pool/migration/TaskCompletionHandler.java b/modules/dcache/src/main/java/org/dcache/pool/migration/TaskCompletionHandler.java index 8ed0083ce1d..94a29b4d288 100644 --- a/modules/dcache/src/main/java/org/dcache/pool/migration/TaskCompletionHandler.java +++ b/modules/dcache/src/main/java/org/dcache/pool/migration/TaskCompletionHandler.java @@ -26,4 +26,5 @@ public interface TaskCompletionHandler { * The task completed without error. */ void taskCompleted(Task task); + default void taskCompletedWithNote(Task task, String) { taskCompleted(task); } }