diff --git a/presto-main/src/main/java/com/facebook/presto/execution/StageExecutionId.java b/presto-main/src/main/java/com/facebook/presto/execution/StageExecutionId.java index ff9920c40855f..4de486abe194e 100644 --- a/presto-main/src/main/java/com/facebook/presto/execution/StageExecutionId.java +++ b/presto-main/src/main/java/com/facebook/presto/execution/StageExecutionId.java @@ -50,6 +50,7 @@ public static StageExecutionId valueOf(List ids) public StageExecutionId(StageId stageId, int id) { this.stageId = requireNonNull(stageId, "stageId is null"); + checkArgument(id >= 0, "id is negative: %s", id); this.id = id; } diff --git a/presto-main/src/main/java/com/facebook/presto/execution/StageId.java b/presto-main/src/main/java/com/facebook/presto/execution/StageId.java index bf01c0143718c..f0e60fafce939 100644 --- a/presto-main/src/main/java/com/facebook/presto/execution/StageId.java +++ b/presto-main/src/main/java/com/facebook/presto/execution/StageId.java @@ -48,6 +48,7 @@ public static StageId valueOf(List ids) public StageId(QueryId queryId, int id) { this.queryId = requireNonNull(queryId, "queryId is null"); + checkArgument(id >= 0, "id is negative: %s", id); this.id = id; } diff --git a/presto-main/src/main/java/com/facebook/presto/execution/TaskId.java b/presto-main/src/main/java/com/facebook/presto/execution/TaskId.java index 9334c1a834f38..40036ef94a042 100644 --- a/presto-main/src/main/java/com/facebook/presto/execution/TaskId.java +++ b/presto-main/src/main/java/com/facebook/presto/execution/TaskId.java @@ -52,7 +52,7 @@ public TaskId(StageExecutionId stageExecutionId, int id, int attemptNumber) { this.stageExecutionId = requireNonNull(stageExecutionId, "stageExecutionId"); this.attemptNumber = attemptNumber; - checkArgument(id >= 0, "id is negative"); + checkArgument(id >= 0, "id is negative: %s", id); this.id = id; }