提交 fffd717e 编写于 作者: T tristaZero

use snowflake

上级 bff4189d
......@@ -30,7 +30,7 @@ import lombok.RequiredArgsConstructor;
@Getter
public enum KeyGeneratorType {
SNOWFLAKE("io.shardingsphere.core.keygen.DefaultKeyGenerator"),
SNOWFLAKE("io.shardingsphere.core.keygen.SnowflakeKeyGenerator"),
UUID(""),
LEAF("");
......
......@@ -23,7 +23,7 @@ import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
DefaultKeyGeneratorTest.class,
SnowflakeKeyGeneratorTest.class,
KeyGeneratorFactoryTest.class
})
public final class AllKeygenTests {
......
......@@ -33,7 +33,7 @@ public final class KeyGeneratorFactoryTest {
@Test
public void assertCreateKeyGeneratorSuccess() {
assertThat(KeyGeneratorFactory.newInstance(DefaultKeyGenerator.class.getName()), instanceOf(DefaultKeyGenerator.class));
assertThat(KeyGeneratorFactory.newInstance(SnowflakeKeyGenerator.class.getName()), instanceOf(SnowflakeKeyGenerator.class));
}
@Test(expected = IllegalArgumentException.class)
......
......@@ -17,7 +17,7 @@
package io.shardingsphere.core.keygen.fixture;
import io.shardingsphere.core.keygen.DefaultKeyGenerator;
import io.shardingsphere.core.keygen.SnowflakeKeyGenerator;
import io.shardingsphere.core.keygen.TimeService;
import lombok.RequiredArgsConstructor;
......@@ -30,7 +30,7 @@ public final class FixedTimeService extends TimeService {
private final AtomicInteger invokedTimes = new AtomicInteger();
private long current = DefaultKeyGenerator.EPOCH;
private long current = SnowflakeKeyGenerator.EPOCH;
@Override
public long getCurrentMillis() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册