JobId implements IWritable, Serializable, Comparable { public static JobId parse(String str) throws HyracksDataException { Matcher m = jobIdPattern.matcher(str); if (m.matches()) { int ccId = Integer.parseInt(m.group(1)); if (ccId <= 0xffff && ccId >= 0) { long jobId = Long.parseLong(m.group(2)) | (long) ccId << CcIdPartitionedLongFactory.ID_BITS; return new JobId(jobId); } } throw HyracksDataException.create(ErrorCode.NOT_A_JOBID, str); } private  JobId();  JobId(long id); static JobId create(DataInput dis); long getId(); CcId getCcId(); long getIdOnly(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); static JobId parse(String str); @Override void writeFields(DataOutput output); @Override void readFields(DataInput input); @Override int compareTo(Object other); static final JobId INVALID; }
@Test public void testParse() throws HyracksDataException { for (int ccId : Arrays.asList(0xFFFF, 0, (int) Short.MAX_VALUE)) { JobIdFactory factory = new JobIdFactory(CcId.valueOf(ccId)); for (int i = 0; i < 1000; i++) { final JobId jobId = factory.create(); Assert.assertEquals(jobId.getId(), JobId.parse(jobId.toString()).getId()); Assert.assertEquals(jobId, JobId.parse(jobId.toString())); Assert.assertFalse(jobId.toString(), jobId.toString().contains("-")); System.err.println(jobId.toString()); } } }