|
23 | 23 | import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient; |
24 | 24 | import org.apache.iotdb.confignode.rpc.thrift.TCreatePipeReq; |
25 | 25 | import org.apache.iotdb.db.it.utils.TestUtils; |
| 26 | +import org.apache.iotdb.it.env.EnvFactory; |
26 | 27 | import org.apache.iotdb.it.env.cluster.node.DataNodeWrapper; |
27 | 28 | import org.apache.iotdb.it.framework.IoTDBTestRunner; |
28 | 29 | import org.apache.iotdb.itbase.category.MultiClusterIT2AutoCreateSchema; |
|
33 | 34 | import org.junit.experimental.categories.Category; |
34 | 35 | import org.junit.runner.RunWith; |
35 | 36 |
|
| 37 | +import java.sql.Connection; |
| 38 | +import java.sql.Statement; |
36 | 39 | import java.util.Arrays; |
37 | 40 | import java.util.Collections; |
38 | 41 | import java.util.HashMap; |
@@ -200,30 +203,16 @@ public void testLegacyConnector() throws Exception { |
200 | 203 | final String receiverIp = receiverDataNode.getIp(); |
201 | 204 | final int receiverPort = receiverDataNode.getPort(); |
202 | 205 |
|
| 206 | + try (final Connection connection = EnvFactory.getEnv().getConnection(); |
| 207 | + final Statement statement = connection.createStatement()) { |
| 208 | + statement.execute( |
| 209 | + String.format( |
| 210 | + "create pipe testPipe ('sink'='iotdb-legacy-pipe-sink', 'ip'='%s', 'port'='%s', 'version'='1.3')", |
| 211 | + receiverIp, receiverPort)); |
| 212 | + } |
| 213 | + |
203 | 214 | try (final SyncConfigNodeIServiceClient client = |
204 | 215 | (SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) { |
205 | | - final Map<String, String> extractorAttributes = new HashMap<>(); |
206 | | - final Map<String, String> processorAttributes = new HashMap<>(); |
207 | | - final Map<String, String> connectorAttributes = new HashMap<>(); |
208 | | - |
209 | | - extractorAttributes.put("source.realtime.mode", "log"); |
210 | | - |
211 | | - connectorAttributes.put("sink", "iotdb-legacy-pipe-sink"); |
212 | | - connectorAttributes.put("sink.batch.enable", "false"); |
213 | | - connectorAttributes.put("sink.ip", receiverIp); |
214 | | - connectorAttributes.put("sink.port", Integer.toString(receiverPort)); |
215 | | - |
216 | | - // This version does not matter since it's no longer checked by the legacy receiver |
217 | | - connectorAttributes.put("sink.version", "1.3"); |
218 | | - |
219 | | - final TSStatus status = |
220 | | - client.createPipe( |
221 | | - new TCreatePipeReq("testPipe", connectorAttributes) |
222 | | - .setExtractorAttributes(extractorAttributes) |
223 | | - .setProcessorAttributes(processorAttributes)); |
224 | | - |
225 | | - Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode()); |
226 | | - |
227 | 216 | Assert.assertEquals( |
228 | 217 | TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("testPipe").getCode()); |
229 | 218 |
|
|
0 commit comments