From 3b68f89a2a65d96862312c4ef8310433110d19f8 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Fri, 15 Nov 2024 17:30:44 -0600 Subject: [PATCH] Error -> Note --- .../java/org/dcache/pool/migration/Job.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) 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 1f609bb52bd..d71307743f3 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 @@ -81,7 +81,7 @@ enum State { private final Set _queued = new LinkedHashSet<>(); private final Map _sizes = new HashMap<>(); private final Map _running = new HashMap<>(); - private final BlockingQueue _errors = new ArrayBlockingQueue<>(15); + private final BlockingQueue _notes = new ArrayBlockingQueue<>(15); private final Map _cancelRequests = new HashMap<>(); @@ -189,11 +189,11 @@ public void setConcurrency(int concurrency) { } } - public void addError(Error error) { + public void addNote(Note note) { _lock.lock(); try { - while (!_errors.offer(error)) { - _errors.poll(); + while (!_notes.offer(note)) { + _notes.poll(); } } finally { _lock.unlock(); @@ -255,10 +255,10 @@ public void getInfo(PrintWriter pw) { task.getInfo(pw); } - if (!_errors.isEmpty()) { - pw.println("Most recent errors:"); - for (Error error : _errors) { - pw.println(error); + if (!_notes.isEmpty()) { + pw.println("Most recent notes:"); + for (Note note : _notes) { + pw.println(note); } } } finally { @@ -516,7 +516,7 @@ private void schedule() { PnfsId pnfsId = i.next(); if (!_context.lock(pnfsId)) { - addError(new Error(0, pnfsId, "File is locked")); + addNote(new Note(0, pnfsId, "File is locked")); continue; } @@ -742,7 +742,7 @@ public void taskFailed(Task task, int rc, String msg) { schedule(); } - addError(new Error(task.getId(), pnfsId, msg)); + addNote(new Note(task.getId(), pnfsId, msg)); } finally { _lock.unlock(); } @@ -761,7 +761,7 @@ public void taskFailedPermanently(Task task, int rc, String msg) { _context.unlock(pnfsId); schedule(); - addError(new Error(task.getId(), pnfsId, msg)); + addNote(new Note(task.getId(), pnfsId, msg)); } finally { _lock.unlock(); } @@ -939,23 +939,23 @@ public boolean evaluateLifetimePredicate(Expression expression) { return expression.evaluateBoolean(symbols); } - protected static class Error { + protected static class Note { private final long _id; private final long _time; private final PnfsId _pnfsId; - private final String _error; + private final String _note; - public Error(long id, PnfsId pnfsId, String error) { + public Note(long id, PnfsId pnfsId, String note) { _id = id; _time = System.currentTimeMillis(); _pnfsId = pnfsId; - _error = error; + _note = note; } public String toString() { return String.format("%tT [%d] %s: %s", - _time, _id, _pnfsId, _error); + _time, _id, _pnfsId, _note); } } }