@Test public void assertMetaInfoFromWithMetaInfo() { MetaInfo actual = MetaInfo.from("test_job@-@1"); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getShardingItems().get(0), is(1)); }
public static TaskContext from(final String id) { String[] result = id.split(DELIMITER); Preconditions.checkState(5 == result.length); return new TaskContext(id, MetaInfo.from(result[0] + DELIMITER + result[1]), ExecutionType.valueOf(result[2]), result[3]); }
TaskContext { public static TaskContext from(final String id) { String[] result = id.split(DELIMITER); Preconditions.checkState(5 == result.length); return new TaskContext(id, MetaInfo.from(result[0] + DELIMITER + result[1]), ExecutionType.valueOf(result[2]), result[3]); } }
TaskContext { public static TaskContext from(final String id) { String[] result = id.split(DELIMITER); Preconditions.checkState(5 == result.length); return new TaskContext(id, MetaInfo.from(result[0] + DELIMITER + result[1]), ExecutionType.valueOf(result[2]), result[3]); } TaskContext(final String jobName, final List<Integer> shardingItem, final ExecutionType type);  TaskContext(final String jobName, final List<Integer> shardingItem, final ExecutionType type, final String slaveId); private  TaskContext(final String id, final MetaInfo metaInfo, final ExecutionType type, final String slaveId); }
TaskContext { public static TaskContext from(final String id) { String[] result = id.split(DELIMITER); Preconditions.checkState(5 == result.length); return new TaskContext(id, MetaInfo.from(result[0] + DELIMITER + result[1]), ExecutionType.valueOf(result[2]), result[3]); } TaskContext(final String jobName, final List<Integer> shardingItem, final ExecutionType type);  TaskContext(final String jobName, final List<Integer> shardingItem, final ExecutionType type, final String slaveId); private  TaskContext(final String id, final MetaInfo metaInfo, final ExecutionType type, final String slaveId); static TaskContext from(final String id); static String getIdForUnassignedSlave(final String id); void setSlaveId(final String slaveId); String getTaskName(); String getExecutorId(final String appName); }
TaskContext { public static TaskContext from(final String id) { String[] result = id.split(DELIMITER); Preconditions.checkState(5 == result.length); return new TaskContext(id, MetaInfo.from(result[0] + DELIMITER + result[1]), ExecutionType.valueOf(result[2]), result[3]); } TaskContext(final String jobName, final List<Integer> shardingItem, final ExecutionType type);  TaskContext(final String jobName, final List<Integer> shardingItem, final ExecutionType type, final String slaveId); private  TaskContext(final String id, final MetaInfo metaInfo, final ExecutionType type, final String slaveId); static TaskContext from(final String id); static String getIdForUnassignedSlave(final String id); void setSlaveId(final String slaveId); String getTaskName(); String getExecutorId(final String appName);  }