Skip to content

Commit

Permalink
Move TaskContext to kernel module (#2319)
Browse files Browse the repository at this point in the history
* Move TaskContext to kernel module

* Move TaskContext to kernel module
  • Loading branch information
terrymanu authored Oct 26, 2023
1 parent e3e9dec commit 125f06f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
/**
* Job status trace event.
*/
@RequiredArgsConstructor
@AllArgsConstructor
@RequiredArgsConstructor
@Getter
public final class JobStatusTraceEvent implements JobEvent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.elasticjob.infra.context;
package org.apache.shardingsphere.elasticjob.kernel.internal.context;

/**
* Execution type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.elasticjob.infra.context;
package org.apache.shardingsphere.elasticjob.kernel.internal.context;

import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.quartz.JobExecutionContext;

/**
* Lite job class.
* Lite job.
*/
@Setter
public final class LiteJob implements Job {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService;
import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService;
import org.apache.shardingsphere.elasticjob.executor.JobFacade;
import org.apache.shardingsphere.elasticjob.infra.context.TaskContext;
import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext;
import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener;
import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
* limitations under the License.
*/

package org.apache.shardingsphere.elasticjob.infra.context;
package org.apache.shardingsphere.elasticjob.kernel.internal.context;

import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo;
import org.apache.shardingsphere.elasticjob.infra.context.fixture.TaskNode;
import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext.MetaInfo;
import org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture.TaskNode;
import org.hamcrest.CoreMatchers;
import org.junit.jupiter.api.Test;

import java.util.Collections;
Expand All @@ -36,7 +37,7 @@ void assertNew() {
TaskContext actual = new TaskContext("test_job", Collections.singletonList(0), ExecutionType.READY, "slave-S0");
assertThat(actual.getMetaInfo().getJobName(), is("test_job"));
assertThat(actual.getMetaInfo().getShardingItems().get(0), is(0));
assertThat(actual.getType(), is(ExecutionType.READY));
assertThat(actual.getType(), CoreMatchers.is(ExecutionType.READY));
assertThat(actual.getSlaveId(), is("slave-S0"));
assertThat(actual.getId(), startsWith(TaskNode.builder().build().getTaskNodeValue().substring(0, TaskNode.builder().build().getTaskNodeValue().length() - 1)));
}
Expand All @@ -59,7 +60,7 @@ void assertTaskContextFrom() {
assertThat(actual.getId(), is(TaskNode.builder().build().getTaskNodeValue()));
assertThat(actual.getMetaInfo().getJobName(), is("test_job"));
assertThat(actual.getMetaInfo().getShardingItems().get(0), is(0));
assertThat(actual.getType(), is(ExecutionType.READY));
assertThat(actual.getType(), CoreMatchers.is(ExecutionType.READY));
assertThat(actual.getSlaveId(), is("slave-S0"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
* limitations under the License.
*/

package org.apache.shardingsphere.elasticjob.infra.context.fixture;
package org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture;

import lombok.Builder;
import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType;
import org.apache.shardingsphere.elasticjob.kernel.internal.context.ExecutionType;

@Builder
public final class TaskNode {
Expand Down

0 comments on commit 125f06f

Please sign in to comment.