Skip to content

Commit

Permalink
Closes #159 :: Concatenates JobID with TaskIndex to generate an uniqu…
Browse files Browse the repository at this point in the history
…e ID

Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
  • Loading branch information
manoelcampos committed Nov 28, 2018
1 parent 64a6f50 commit eb48ad6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ public long getTaskIndex() {

/**
* An unique ID to be used to identify Cloudlets.
* The ID is composed of the {@link #getJobId() Job ID} plus the {@link #getTaskIndex() Task Index}.
* The ID is composed of the {@link #getJobId() Job ID}, concatenated with the {@link #getTaskIndex() Task Index}.
* @return
*/
public long getUniqueTaskId(){
return getJobId() + getTaskIndex();
final String uniqueId = String.format("%d%d", getJobId(), getTaskIndex());
return Integer.parseInt(uniqueId);
}
}

0 comments on commit eb48ad6

Please sign in to comment.