From 5b7fba6bd90d990e41fdaeb1ea86e339c32443c3 Mon Sep 17 00:00:00 2001 From: xiaojiebao Date: Wed, 27 Mar 2024 09:57:36 +0800 Subject: [PATCH] split mysql scripts --- build.gradle.kts | 1 + .../gravitino/storage/relational/TestRelationalEntityStore.java | 2 +- .../jdbc/h2/schema-0.5.0-h2.sql} | 0 docs/gravitino-server-config.md | 2 +- .../relational-entity-store/jdbc/mysql/schema-0.5.0-mysql.sql | 0 5 files changed, 3 insertions(+), 2 deletions(-) rename core/src/test/resources/{h2/h2-init.sql => relational-entity-store/jdbc/h2/schema-0.5.0-h2.sql} (100%) rename core/src/main/resources/mysql/mysql_init.sql => scripts/relational-entity-store/jdbc/mysql/schema-0.5.0-mysql.sql (100%) diff --git a/build.gradle.kts b/build.gradle.kts index b32b081b761..710f99a84d6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -563,6 +563,7 @@ tasks { from(projectDir.dir("conf")) { into("package/conf") } from(projectDir.dir("bin")) { into("package/bin") } from(projectDir.dir("web/build/libs/${rootProject.name}-web-$version.war")) { into("package/web") } + from(projectDir.dir("scripts")) { into("package/scripts") } into(outputDir) rename { fileName -> fileName.replace(".template", "") diff --git a/core/src/test/java/com/datastrato/gravitino/storage/relational/TestRelationalEntityStore.java b/core/src/test/java/com/datastrato/gravitino/storage/relational/TestRelationalEntityStore.java index 58430308ff9..5afe3c9dd8e 100644 --- a/core/src/test/java/com/datastrato/gravitino/storage/relational/TestRelationalEntityStore.java +++ b/core/src/test/java/com/datastrato/gravitino/storage/relational/TestRelationalEntityStore.java @@ -93,7 +93,7 @@ public static void setUp() { entityStore.initialize(config); // Read the ddl sql to create table - String scriptPath = "h2/h2-init.sql"; + String scriptPath = "relational-entity-store/jdbc/h2/schema-0.5.0-h2.sql"; try (SqlSession sqlSession = SqlSessionFactoryHelper.getInstance().getSqlSessionFactory().openSession(true); Connection connection = sqlSession.getConnection(); diff --git a/core/src/test/resources/h2/h2-init.sql b/core/src/test/resources/relational-entity-store/jdbc/h2/schema-0.5.0-h2.sql similarity index 100% rename from core/src/test/resources/h2/h2-init.sql rename to core/src/test/resources/relational-entity-store/jdbc/h2/schema-0.5.0-h2.sql diff --git a/docs/gravitino-server-config.md b/docs/gravitino-server-config.md index 7150c7fa8d7..83bfb08166b 100644 --- a/docs/gravitino-server-config.md +++ b/docs/gravitino-server-config.md @@ -52,7 +52,7 @@ You can also specify filter parameters by setting configuration entries of the f | `gravitino.entity.store.maxTransactionSkewTimeMs` | The maximum skew time of transactions in milliseconds. | `2000` | No | 0.3.0 | | `gravitino.entity.store.kv.deleteAfterTimeMs` | The maximum time in milliseconds that deleted and old-version data is kept. Set to at least 10 minutes and no longer than 30 days. | `604800000`(7 days) | No | 0.3.0 | | `gravitino.entity.store.relational` | Detailed implementation of Relational storage. `MySQL` is currently supported, and the implementation is `JDBCBackend`. | `JDBCBackend` | No | 0.5.0 | -| `gravitino.entity.store.relational.jdbcUrl` | The database url that the `JDBCBackend` needs to connect to. If you use `MySQL`, you should firstly initialize the database tables yourself by executing the file named `mysql_init.sql` in the `src/main/resources/mysql` directory of the `core` module. | (none) | Yes if you use `JdbcBackend` | 0.5.0 | +| `gravitino.entity.store.relational.jdbcUrl` | The database url that the `JDBCBackend` needs to connect to. If you use `MySQL`, you should firstly initialize the database tables yourself by executing the ddl scripts in the `${GRAVITINO_HOME}/scripts/relational-entity-store/jdbc/mysql` directory. | (none) | Yes if you use `JdbcBackend` | 0.5.0 | | `gravitino.entity.store.relational.jdbcDriver` | The jdbc driver name that the `JDBCBackend` needs to use. You should place the driver Jar package in the `${GRAVITINO_HOME}/libs/` directory. | (none) | Yes if you use `JdbcBackend` | 0.5.0 | | `gravitino.entity.store.relational.jdbcUser` | The username that the `JDBCBackend` needs to use when connecting the database. It is required for `MySQL`. | (none) | Yes if you use `JdbcBackend` | 0.5.0 | | `gravitino.entity.store.relational.jdbcPassword` | The password that the `JDBCBackend` needs to use when connecting the database. It is required for `MySQL`. | (none) | Yes if you use `JdbcBackend` | 0.5.0 | diff --git a/core/src/main/resources/mysql/mysql_init.sql b/scripts/relational-entity-store/jdbc/mysql/schema-0.5.0-mysql.sql similarity index 100% rename from core/src/main/resources/mysql/mysql_init.sql rename to scripts/relational-entity-store/jdbc/mysql/schema-0.5.0-mysql.sql