see comment above. you can use TaskID.forName():

    new TaskAttemptID(TaskID.forName("task_123_0001_r_000001"), 2)