You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by du...@apache.org on 2021/12/30 07:41:19 UTC
[rocketmq-streams] branch main updated: Delete DBSinkTest.java
This is an automated email from the ASF dual-hosted git repository.
duhengforever pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/rocketmq-streams.git
The following commit(s) were added to refs/heads/main by this push:
new 1f53d5d Delete DBSinkTest.java
1f53d5d is described below
commit 1f53d5d5a1aa6532ec4c72e99c4fab3af9851f48
Author: Heng Du <du...@apache.org>
AuthorDate: Thu Dec 30 15:41:16 2021 +0800
Delete DBSinkTest.java
---
.../apache/rocketmq/streams/client/DBSinkTest.java | 90 ----------------------
1 file changed, 90 deletions(-)
diff --git a/rocketmq-streams-clients/src/test/java/org/apache/rocketmq/streams/client/DBSinkTest.java b/rocketmq-streams-clients/src/test/java/org/apache/rocketmq/streams/client/DBSinkTest.java
deleted file mode 100644
index f1b0978..0000000
--- a/rocketmq-streams-clients/src/test/java/org/apache/rocketmq/streams/client/DBSinkTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.rocketmq.streams.client;
-
-import com.alibaba.fastjson.JSONObject;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Random;
-import org.apache.rocketmq.streams.client.source.DataStreamSource;
-import org.apache.rocketmq.streams.common.component.ComponentCreator;
-import org.apache.rocketmq.streams.common.configure.ConfigureFileKey;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * /**
- *
- * @description
- */
-public class DBSinkTest {
-
- DataStreamSource dataStream;
-
- // String url = "*";
-// String userName = "*";
-// String password = "*";
-// String tableName = "*";
- static String url = "";
- static String userName = "";
- static String password = "";
- static String tableName = "";
-
- @Before
- public void init() {
- dataStream = StreamBuilder.dataStream("test_namespace", "graph_pipeline");
- ComponentCreator.getProperties().put(ConfigureFileKey.CHECKPOINT_STORAGE_NAME, "db");
- }
-
- @Test
- public void testToMultiDB() {
- List<JSONObject> list = new ArrayList();
- String[] partitions = new String[] {
- "20210709000000",
- "20210710000000"
- };
- for (int i = 0; i < 100000; i++) {
- //0,1随机数,整数
- int index = (int) (2 * Math.random());
- JSONObject msg = new JSONObject();
- msg.put("ds", partitions[index]);
- msg.put("value", String.valueOf(Math.random()));
- msg.put("data_time", new Date());
- list.add(msg);
- }
- System.setProperty("log4j.home", System.getProperty("user.home") + "/logs");
- System.setProperty("log4j.level", "DEBUG");
- dataStream.fromArray(list.toArray()).toMultiDB(url, userName, password, tableName, "ds").start();
- }
-
- @Test
- public void testToEnhanceDB() {
- List<JSONObject> list = new ArrayList();
- for (int i = 0; i < 100000; i++) {
- //0,1随机数,整数
- int index = (int) (2 * Math.random());
- JSONObject msg = new JSONObject();
- msg.put("name", String.valueOf(Math.random()));
- msg.put("age", new Random().nextInt());
- msg.put("date_time", new Date());
- list.add(msg);
- }
- dataStream.fromArray(list.toArray()).toEnhanceDBSink(url, userName, password, "mock_table_name").start();
- }
-
-}