diff --git a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/node/ReservationNode.java b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/node/ReservationNodePath.java similarity index 95% rename from kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/node/ReservationNode.java rename to kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/node/ReservationNodePath.java index 44611bdae95cc..45f7494b74604 100644 --- a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/node/ReservationNode.java +++ b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/node/ReservationNodePath.java @@ -21,10 +21,10 @@ import lombok.NoArgsConstructor; /** - * Reservation node. + * Reservation node path. */ @NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class ReservationNode { +public final class ReservationNodePath { private static final String ROOT_NODE = "reservation"; diff --git a/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/node/ReservationNodeTest.java b/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/node/ReservationNodePathTest.java similarity index 88% rename from kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/node/ReservationNodeTest.java rename to kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/node/ReservationNodePathTest.java index 6197822680eca..0f8782ae978b1 100644 --- a/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/node/ReservationNodeTest.java +++ b/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/node/ReservationNodePathTest.java @@ -22,10 +22,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -class ReservationNodeTest { +class ReservationNodePathTest { @Test void assertGetWorkerIdReservationPath() { - assertThat(ReservationNode.getWorkerIdReservationPath(1), is("/reservation/worker_id/1")); + assertThat(ReservationNodePath.getWorkerIdReservationPath(1), is("/reservation/worker_id/1")); } } diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ReservationPersistService.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ReservationPersistService.java index e946dc9156338..70f7b034bceaa 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ReservationPersistService.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ReservationPersistService.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.mode.manager.cluster.persist.service; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.metadata.persist.node.ReservationNode; +import org.apache.shardingsphere.metadata.persist.node.ReservationNodePath; import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository; import org.apache.shardingsphere.mode.repository.cluster.exception.ClusterRepositoryPersistException; @@ -41,7 +41,7 @@ public final class ReservationPersistService { */ public Optional reserveWorkerId(final Integer preselectedWorkerId, final String instanceId) { try { - return repository.persistExclusiveEphemeral(ReservationNode.getWorkerIdReservationPath(preselectedWorkerId), instanceId) ? Optional.of(preselectedWorkerId) : Optional.empty(); + return repository.persistExclusiveEphemeral(ReservationNodePath.getWorkerIdReservationPath(preselectedWorkerId), instanceId) ? Optional.of(preselectedWorkerId) : Optional.empty(); } catch (final ClusterRepositoryPersistException ignore) { return Optional.empty(); }