Skip to content

Commit

Permalink
Move BlockUtils to kernel module
Browse files Browse the repository at this point in the history
Move BlockUtils to kernel module
  • Loading branch information
taojintianxia authored Oct 25, 2023
2 parents ed420cf + fbc066e commit 4d9014f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@

/**
* Executor context.
*
* @see org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerReloadable
* @see org.apache.shardingsphere.elasticjob.infra.concurrent.ExecutorServiceReloadable
*/
public final class ExecutorContext {

Expand Down
6 changes: 1 addition & 5 deletions kernel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@
<artifactId>elasticjob-infra</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-registry-center-api</artifactId>
<version>${project.parent.version}</version>
</dependency>

<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-registry-center-zookeeper-curator</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.kernel.api.listener;

import lombok.Setter;
import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils;
import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils;
import org.apache.shardingsphere.elasticjob.infra.env.TimeService;
import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage;
import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils;
import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils;

/**
* Leader service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import com.google.common.base.Strings;
import org.apache.commons.lang3.StringUtils;
import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils;
import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils;
import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode;
import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils;
import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils;
import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance;
import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy;
import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine;
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.concurrent;
package org.apache.shardingsphere.elasticjob.kernel.internal.util;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
Expand All @@ -26,21 +26,14 @@
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class BlockUtils {

/**
* Wait short time.
*/
public static void waitingShortTime() {
sleep(100L);
}
private static final long SLEEP_INTERVAL_MILLIS = 100L;

/**
* Sleep for the specified number of milliseconds.
*
* @param millis the duration of sleep in milliseconds
* Waiting short time.
*/
public static void sleep(final long millis) {
public static void waitingShortTime() {
try {
Thread.sleep(millis);
Thread.sleep(SLEEP_INTERVAL_MILLIS);
} catch (final InterruptedException ex) {
Thread.currentThread().interrupt();
}
Expand Down

0 comments on commit 4d9014f

Please sign in to comment.