Till Westmann has submitted this change and it was merged. Change subject: Add error message for malformed job ids. ......................................................................
Add error message for malformed job ids. Change-Id: I315e3aa798af791f41535279e8a983e857f2b14e Reviewed-on: https://asterix-gerrit.ics.uci.edu/1495 Sonar-Qube: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> Integration-Tests: Jenkins <[email protected]> Reviewed-by: Ian Maxon <[email protected]> --- M hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java M hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/job/JobId.java M hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties 3 files changed, 7 insertions(+), 2 deletions(-) Approvals: Ian Maxon: Looks good to me, approved Jenkins: Verified; No violations found; Verified Objections: Jenkins: Violations found diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java index 3826f01..8b24cc2 100644 --- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java +++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java @@ -54,6 +54,7 @@ public static final int RESULT_FAILURE_NO_EXCEPTION = 17; public static final int INCONSISTENT_RESULT_METADATA = 18; public static final int CANNOT_TRUNCATE_OR_DELETE_FILE = 19; + public static final int NOT_A_JOBID = 20; // Compilation error codes. public static final int RULECOLLECTION_NOT_INSTANCE_OF_LIST = 10001; diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/job/JobId.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/job/JobId.java index 7969700..47da24a 100644 --- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/job/JobId.java +++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/job/JobId.java @@ -23,6 +23,8 @@ import java.io.IOException; import java.io.Serializable; +import org.apache.hyracks.api.exceptions.ErrorCode; +import org.apache.hyracks.api.exceptions.HyracksDataException; import org.apache.hyracks.api.io.IWritable; public final class JobId implements IWritable, Serializable { @@ -70,12 +72,12 @@ return "JID:" + id; } - public static JobId parse(String str) { + public static JobId parse(String str) throws HyracksDataException { if (str.startsWith("JID:")) { str = str.substring(4); return new JobId(Long.parseLong(str)); } - throw new IllegalArgumentException(); + throw HyracksDataException.create(ErrorCode.NOT_A_JOBID, str); } @Override diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties b/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties index 931429a..2abca66 100644 --- a/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties +++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties @@ -38,4 +38,6 @@ 17 = No exception for failed result set %1$s for job %2$s 18 = Inconsistent metadata for result set %1$s" 19 = Can't truncate or delete the file: %1$s +20 = '%1$s' is not a valid job id. + 10000 = The given rule collection %1$s is not an instance of the List class. -- To view, visit https://asterix-gerrit.ics.uci.edu/1495 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I315e3aa798af791f41535279e8a983e857f2b14e Gerrit-PatchSet: 4 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Till Westmann <[email protected]> Gerrit-Reviewer: Ian Maxon <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]>
