diff --git a/paimon-core/src/main/java/org/apache/paimon/jdbc/AbstractDistributedLockTable.java b/paimon-core/src/main/java/org/apache/paimon/jdbc/AbstractDistributedLockDialect.java similarity index 97% rename from paimon-core/src/main/java/org/apache/paimon/jdbc/AbstractDistributedLockTable.java rename to paimon-core/src/main/java/org/apache/paimon/jdbc/AbstractDistributedLockDialect.java index f63579a353ceb..f3469d0b5ba5a 100644 --- a/paimon-core/src/main/java/org/apache/paimon/jdbc/AbstractDistributedLockTable.java +++ b/paimon-core/src/main/java/org/apache/paimon/jdbc/AbstractDistributedLockDialect.java @@ -24,7 +24,7 @@ import java.sql.SQLException; /** Jdbc distributed lock interface. */ -public abstract class AbstractDistributedLockTable implements JdbcDistributedLockTable { +public abstract class AbstractDistributedLockDialect implements JdbcDistributedLockDialect { @Override public void createTable(JdbcClientPool connections) throws SQLException, InterruptedException { diff --git a/paimon-core/src/main/java/org/apache/paimon/jdbc/DistributedLockFactory.java b/paimon-core/src/main/java/org/apache/paimon/jdbc/DistributedLockDialectFactory.java similarity index 85% rename from paimon-core/src/main/java/org/apache/paimon/jdbc/DistributedLockFactory.java rename to paimon-core/src/main/java/org/apache/paimon/jdbc/DistributedLockDialectFactory.java index 2d558595e60be..1978456386c04 100644 --- a/paimon-core/src/main/java/org/apache/paimon/jdbc/DistributedLockFactory.java +++ b/paimon-core/src/main/java/org/apache/paimon/jdbc/DistributedLockDialectFactory.java @@ -18,14 +18,14 @@ package org.apache.paimon.jdbc; -class DistributedLockFactory { - static JdbcDistributedLockTable create(String protocol) { +class DistributedLockDialectFactory { + static JdbcDistributedLockDialect create(String protocol) { JdbcProtocol type = JdbcProtocol.valueOf(protocol.toUpperCase()); switch (type) { case SQLITE: - return new SqlLiteDistributedLockTable(); + return new SqlLiteDistributedLockDialect(); case MYSQL: - return new MysqlDistributedLockTable(); + return new MysqlDistributedLockDialect(); default: throw new UnsupportedOperationException( String.format("Distributed locks based on %s are not supported", protocol)); diff --git a/paimon-core/src/main/java/org/apache/paimon/jdbc/JdbcDistributedLockTable.java b/paimon-core/src/main/java/org/apache/paimon/jdbc/JdbcDistributedLockDialect.java similarity index 96% rename from paimon-core/src/main/java/org/apache/paimon/jdbc/JdbcDistributedLockTable.java rename to paimon-core/src/main/java/org/apache/paimon/jdbc/JdbcDistributedLockDialect.java index f0e053194680d..a691aac2295fd 100644 --- a/paimon-core/src/main/java/org/apache/paimon/jdbc/JdbcDistributedLockTable.java +++ b/paimon-core/src/main/java/org/apache/paimon/jdbc/JdbcDistributedLockDialect.java @@ -21,7 +21,7 @@ import java.sql.SQLException; /** Jdbc distributed lock interface. */ -public interface JdbcDistributedLockTable { +public interface JdbcDistributedLockDialect { void createTable(JdbcClientPool connections) throws SQLException, InterruptedException; boolean lockAcquire(JdbcClientPool connections, String lockId, long timeoutMillSeconds) diff --git a/paimon-core/src/main/java/org/apache/paimon/jdbc/JdbcUtils.java b/paimon-core/src/main/java/org/apache/paimon/jdbc/JdbcUtils.java index 7a2aa1b38d571..ce408e415544e 100644 --- a/paimon-core/src/main/java/org/apache/paimon/jdbc/JdbcUtils.java +++ b/paimon-core/src/main/java/org/apache/paimon/jdbc/JdbcUtils.java @@ -407,14 +407,14 @@ private static String insertPropertiesStatement(int size) { public static void createDistributedLockTable(JdbcClientPool connections) throws SQLException, InterruptedException { - DistributedLockFactory.create(connections.getProtocol()).createTable(connections); + DistributedLockDialectFactory.create(connections.getProtocol()).createTable(connections); } public static boolean acquire( JdbcClientPool connections, String lockId, long timeoutMillSeconds) throws SQLException, InterruptedException { - JdbcDistributedLockTable jdbcDistributedLockTable = - DistributedLockFactory.create(connections.getProtocol()); + JdbcDistributedLockDialect jdbcDistributedLockTable = + DistributedLockDialectFactory.create(connections.getProtocol()); // Check and clear expire lock. int affectedRows = jdbcDistributedLockTable.tryReleaseTimedOutLock(connections, lockId); if (affectedRows > 0) { @@ -425,6 +425,7 @@ public static boolean acquire( public static void release(JdbcClientPool connections, String lockId) throws SQLException, InterruptedException { - DistributedLockFactory.create(connections.getProtocol()).releaseLock(connections, lockId); + DistributedLockDialectFactory.create(connections.getProtocol()) + .releaseLock(connections, lockId); } } diff --git a/paimon-core/src/main/java/org/apache/paimon/jdbc/MysqlDistributedLockTable.java b/paimon-core/src/main/java/org/apache/paimon/jdbc/MysqlDistributedLockDialect.java similarity index 96% rename from paimon-core/src/main/java/org/apache/paimon/jdbc/MysqlDistributedLockTable.java rename to paimon-core/src/main/java/org/apache/paimon/jdbc/MysqlDistributedLockDialect.java index dd9e7aa72184b..903108762cc79 100644 --- a/paimon-core/src/main/java/org/apache/paimon/jdbc/MysqlDistributedLockTable.java +++ b/paimon-core/src/main/java/org/apache/paimon/jdbc/MysqlDistributedLockDialect.java @@ -19,7 +19,7 @@ package org.apache.paimon.jdbc; /** Distributed lock implementation based on sqlite table. */ -public class MysqlDistributedLockTable extends AbstractDistributedLockTable { +public class MysqlDistributedLockDialect extends AbstractDistributedLockDialect { @Override public String getCreateTableSql() { diff --git a/paimon-core/src/main/java/org/apache/paimon/jdbc/SqlLiteDistributedLockTable.java b/paimon-core/src/main/java/org/apache/paimon/jdbc/SqlLiteDistributedLockDialect.java similarity index 96% rename from paimon-core/src/main/java/org/apache/paimon/jdbc/SqlLiteDistributedLockTable.java rename to paimon-core/src/main/java/org/apache/paimon/jdbc/SqlLiteDistributedLockDialect.java index 0070165a55420..602fdd1d625e2 100644 --- a/paimon-core/src/main/java/org/apache/paimon/jdbc/SqlLiteDistributedLockTable.java +++ b/paimon-core/src/main/java/org/apache/paimon/jdbc/SqlLiteDistributedLockDialect.java @@ -19,7 +19,7 @@ package org.apache.paimon.jdbc; /** Distributed lock implementation based on sqlite table. */ -public class SqlLiteDistributedLockTable extends AbstractDistributedLockTable { +public class SqlLiteDistributedLockDialect extends AbstractDistributedLockDialect { @Override public String getCreateTableSql() {