You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2022/10/19 10:19:50 UTC

[incubator-eventmesh] branch storage-api updated: [ISSUE #1394] connector-storage-jdbc MySQL Obtain consumption coordinates

This is an automated email from the ASF dual-hosted git repository.

mikexue pushed a commit to branch storage-api
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git


The following commit(s) were added to refs/heads/storage-api by this push:
     new f0cdff92 [ISSUE #1394] connector-storage-jdbc MySQL Obtain consumption coordinates
     new 420e6c9e Merge pull request #1660 from githublaohu/jdbc-connector-storage
f0cdff92 is described below

commit f0cdff92531e6bd98acd6d5ddade464b3e0a333e
Author: githublaohu <23...@qq.com>
AuthorDate: Wed Oct 19 18:16:51 2022 +0800

    [ISSUE #1394] connector-storage-jdbc MySQL Obtain consumption coordinates
---
 .../storage/jdbc/SQL/MySQLStorageSQL.java          | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/eventmesh-connector-plugin/eventmesh-connector-storage-jdbc/src/main/java/org/apache/eventmesh/connector/storage/jdbc/SQL/MySQLStorageSQL.java b/eventmesh-connector-plugin/eventmesh-connector-storage-jdbc/src/main/java/org/apache/eventmesh/connector/storage/jdbc/SQL/MySQLStorageSQL.java
new file mode 100644
index 00000000..72c0ea21
--- /dev/null
+++ b/eventmesh-connector-plugin/eventmesh-connector-storage-jdbc/src/main/java/org/apache/eventmesh/connector/storage/jdbc/SQL/MySQLStorageSQL.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.connector.storage.jdbc.SQL;
+
+public class MySQLStorageSQL extends AbstractStorageSQL {
+
+	
+	
+	public String selectAppointTimeMessageSQL(String tableName,String time) {
+		return super.selectAppointTimeMessageSQL(tableName,time) + " limit 1 ";
+	}
+
+	@Override
+	public String queryTables() {
+		return "select table_schema, table_name from information_schema.tables where table_schema = ?";
+	}
+
+	@Override
+	public String consumerGroupTableCreateSQL() {
+		StringBuffer buffer = new StringBuffer();
+		buffer
+		.append("create table if not exists consumer_group(")
+		.append("  `cumsumer_group_id` bigint unsigned NOT NULL AUTO_INCREMENT, ")
+		.append("  `consumer_group_name` varchar(255)  NOT NULL,")
+		.append("  PRIMARY KEY (`cumsumer_group_id`),")
+		.append("  UNIQUE KEY (`consumer_group_name`)")
+		.append(") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci");
+		return buffer.toString();
+	}
+
+	@Override
+	public String topicTableCreateSQL(String table) {
+		StringBuffer buffer = new StringBuffer();
+		buffer
+		.append("create table if not exists event_")
+		.append(table)
+		.append("(")
+		.append("  `cumsumer_group_id` bigint unsigned NOT NULL AUTO_INCREMENT, ")
+		.append("  `consumer_group_name` varchar(255)  NOT NULL,")
+		.append("  PRIMARY KEY (`cumsumer_group_id`),")
+		.append("  UNIQUE KEY (`consumer_group_name`)")
+		.append(") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci");
+		return buffer.toString();
+	}
+
+
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org