Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move TaskContext to kernel module #2319

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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