This is an automated email from the ASF dual-hosted git repository. rong pushed a commit to branch remove-sync-entry in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 6dc44ab831b0144b3995cf44d3dfab5629848a04 Author: Steve Yurong Su <[email protected]> AuthorDate: Sat Jun 17 02:33:12 2023 +0800 remove api --- iotdb-api/external-pipe-api/pom.xml | 35 ----- .../apache/iotdb/pipe/external/api/DataType.java | 51 ------ .../external/api/ExternalPipeSinkWriterStatus.java | 77 --------- .../pipe/external/api/IExternalPipeSinkWriter.java | 175 --------------------- .../api/IExternalPipeSinkWriterFactory.java | 63 -------- pom.xml | 1 - server/pom.xml | 5 - 7 files changed, 407 deletions(-) diff --git a/iotdb-api/external-pipe-api/pom.xml b/iotdb-api/external-pipe-api/pom.xml deleted file mode 100644 index e7aa6eaf416..00000000000 --- a/iotdb-api/external-pipe-api/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>iotdb-parent</artifactId> - <groupId>org.apache.iotdb</groupId> - <version>1.3.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - <artifactId>external-pipe-api</artifactId> - <properties> - <maven.compiler.source>8</maven.compiler.source> - <maven.compiler.target>8</maven.compiler.target> - </properties> -</project> diff --git a/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/DataType.java b/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/DataType.java deleted file mode 100644 index 32bf3ec2721..00000000000 --- a/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/DataType.java +++ /dev/null @@ -1,51 +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.iotdb.pipe.external.api; - -public enum DataType { - BOOLEAN, - INT32, - INT64, - FLOAT, - DOUBLE, - TEXT, - VECTOR; - - public static DataType fromTsDataType(byte tsDataType) { - switch (tsDataType) { - case 0: - return BOOLEAN; - case 1: - return INT32; - case 2: - return INT64; - case 3: - return FLOAT; - case 4: - return DOUBLE; - case 5: - return TEXT; - case 6: - return VECTOR; - default: - throw new IllegalArgumentException("Unrecognized TSDataType: " + tsDataType); - } - } -} diff --git a/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/ExternalPipeSinkWriterStatus.java b/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/ExternalPipeSinkWriterStatus.java deleted file mode 100644 index b9f93e23875..00000000000 --- a/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/ExternalPipeSinkWriterStatus.java +++ /dev/null @@ -1,77 +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.iotdb.pipe.external.api; - -import java.util.Map; - -/** Represents the status of an external pipe sink writer. */ -public class ExternalPipeSinkWriterStatus { - - private Long startTime; - private Long numOfBytesTransmitted; - private Long numOfRecordsTransmitted; - private Map<String, String> extendedFields; - - public void setStartTime(Long startTime) { - this.startTime = startTime; - } - - public Long getStartTime() { - return startTime; - } - - public void setNumOfBytesTransmitted(Long numOfBytesTransmitted) { - this.numOfBytesTransmitted = numOfBytesTransmitted; - } - - public Long getNumOfBytesTransmitted() { - return numOfBytesTransmitted; - } - - public void setNumOfRecordsTransmitted(Long numOfRecordsTransmitted) { - this.numOfRecordsTransmitted = numOfRecordsTransmitted; - } - - public Long getNumOfRecordsTransmitted() { - return numOfRecordsTransmitted; - } - - public void setExtendedFields(Map<String, String> extendedFields) { - this.extendedFields = extendedFields; - } - - public Map<String, String> getExtendedFields() { - return extendedFields; - } - - @Override - public String toString() { - return "ExternalPipeSinkWriterStatus{" - + "startTime=" - + startTime - + ", numOfBytesTransmitted=" - + numOfBytesTransmitted - + ", numOfRecordsTransmitted=" - + numOfRecordsTransmitted - + ", extendedFields=" - + extendedFields - + '}'; - } -} diff --git a/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/IExternalPipeSinkWriter.java b/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/IExternalPipeSinkWriter.java deleted file mode 100644 index c5d355b7700..00000000000 --- a/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/IExternalPipeSinkWriter.java +++ /dev/null @@ -1,175 +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.iotdb.pipe.external.api; - -import java.io.IOException; - -/** Responsible for forwarding the operations to the sink. */ -public interface IExternalPipeSinkWriter extends AutoCloseable { - - /** Initialize the writer. */ - void open() throws IOException; - - /** - * Insert a boolean data point to the sink. - * - * <p>The framework will retry if this method throws an {@link IOException}. - * - * @param sgName Storage-Group's name. - * @param path The parts of a path separated by '.'. For example, for a path root.a.b.c, the input - * argument would be ["root", "a", "b", "c"]. - * @param time Timestamp of the data point. Unit ms. - * @param value Value of the data point. - */ - void insertBoolean(String sgName, String[] path, long time, boolean value) throws IOException; - - /** - * Insert a 32-bit integer data point to the sink. - * - * <p>The framework will retry if this method throws an {@link IOException}. - * - * @param sgName Storage-Group's name. - * @param path The parts of a path separated by '.'. For example, for a path root.a.b.c, the input - * argument would be ["root", "a", "b", "c"]. - * @param time Timestamp of the data point. Unit ms. - * @param value Value of the data point. - */ - void insertInt32(String sgName, String[] path, long time, int value) throws IOException; - - /** - * Insert a 64-bit integer data point to the sink. - * - * <p>The framework will retry if this method throws an {@link IOException}. - * - * @param sgName Storage-Group's name. - * @param path The parts of a path separated by '.'. For example, for a path root.a.b.c, the input - * argument would be ["root", "a", "b", "c"]. - * @param time Timestamp of the data point. Unit ms. - * @param value Value of the data point. - */ - void insertInt64(String sgName, String[] path, long time, long value) throws IOException; - - /** - * Insert a float data point to the sink. - * - * @param sgName Storage-Group's name. - * @param path The parts of a path separated by '.'. For example, for a path root.a.b.c, the input - * argument would be ["root", "a", "b", "c"]. - * @param time Timestamp of the data point. Unit ms. - * @param value Value of the data point. - */ - void insertFloat(String sgName, String[] path, long time, float value) throws IOException; - - /** - * Insert a double data point to the sink. - * - * <p>The framework will retry if this method throws an {@link IOException}. - * - * @param sgName Storage-Group's name. - * @param path The parts of a path separated by '.'. For example, for a path root.a.b.c, the input - * argument would be ["root", "a", "b", "c"]. - * @param time Timestamp of the data point. Unit ms. - * @param value Value of the data point. - */ - void insertDouble(String sgName, String[] path, long time, double value) throws IOException; - - /** - * Insert a text data point to the sink. - * - * <p>The framework will retry if this method throws an {@link IOException}. - * - * @param sgName Storage-Group's name. - * @param path The parts of a path separated by '.'. For example, for a path root.a.b.c, the input - * argument would be ["root", "a", "b", "c"]. - * @param time Timestamp of the data point. Unit ms. - * @param value Value of the data point. - */ - void insertText(String sgName, String[] path, long time, String value) throws IOException; - - // /** - // * Insert a vector data point to the sink. - // * - // * <p>The framework will retry if this method throws an {@link IOException}. - // * - // * @param sgName Storage-Group's name. - // * @param path The parts of a path separated by '.'. For example, for a path root.a.b.c, the - // input - // * argument would be ["root", "a", "b", "c"]. - // * @param dataTypes Datatype of each element in the vector. - // * @param time Timestamp of the data point. Unit ms. - // * @param values Value of each element in the vector. - // */ - // void insertVector(String sgName, String[] path, DataType[] dataTypes, long time, Object[] - // values) - // throws IOException; - - /** - * Delete the data points whose timestamp is >= startTime and <= endTime from the sink. The - * parameter path indicates the path of deleted points, and it may be "root.a.b.c" or "root.a.b.*" - * or "root.**" etc. - * - * @param sgName Storage-Group's name. - * @param delPath The path of deletion action. For example, sg1.*, sg1.*.*. - * @param startTime Beginning timestamp of the deleted data points. Unit ms. - * @param endTime Ending timestamp of the deleted data points. Unit ms. - */ - void delete(String sgName, String delPath, long startTime, long endTime) throws IOException; - - // /** - // * Handle the creation of a timeseries. - // * - // * <p>The framework will retry if this method throws an {@link IOException}. - // * - // * @param path The parts of a path separated by '.'. For example, for a path root.a.b.c, the - // input - // * argument would be ["root", "a", "b", "c"]. - // * @param dataType Datatype of the timeseries. - // */ - // void createTimeSeries(String[] path, DataType dataType) throws IOException; - // - // /** - // * Handle the deletion of a timeseries. - // * - // * <p>The framework will retry if this method throws an {@link IOException}. - // * - // * @param path The parts of a path separated by '.'. For example, for a path root.a.b.c, the - // input - // * argument would be ["root", "a", "b", "c"]. - // */ - // void deleteTimeSeries(String[] path) throws IOException; - - /** - * Flush the data and metadata changes to the sink. - * - * <p>The framework will retry if this method throws an {@link IOException}. - */ - void flush() throws IOException; - - /** Get the status of this writer. This method should NOT throw any exception. */ - ExternalPipeSinkWriterStatus getStatus(); - - /** - * Close the writer. - * - * <p>The framework will NOT retry if this method throws an {@link IOException}. - */ - @Override - void close() throws IOException; -} diff --git a/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/IExternalPipeSinkWriterFactory.java b/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/IExternalPipeSinkWriterFactory.java deleted file mode 100644 index b158b77eede..00000000000 --- a/iotdb-api/external-pipe-api/src/main/java/org/apache/iotdb/pipe/external/api/IExternalPipeSinkWriterFactory.java +++ /dev/null @@ -1,63 +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.iotdb.pipe.external.api; - -import java.util.Map; -import java.util.function.Supplier; - -/** Responsible for creating {@link IExternalPipeSinkWriter} with the sink configuration. */ -public interface IExternalPipeSinkWriterFactory extends Supplier<IExternalPipeSinkWriter> { - /** - * Get the External PIPE's provider info. - * - * @return External PIPE s provider name - */ - String getProviderName(); - - /** - * Get the External PIPE's type name. For example: If customer self-defined getExternalPipeType() - * return "mySink", corresponding input CMD should be "CREATE PIPESINK mySink1 AS mySink (...)". - * Otherwise, the CMD will be refused. * - * - * @return External PIPE s type name - */ - String getExternalPipeType(); - - /** - * This function is used to validate the parameters in client CMD. For example: When customer - * input CMD: "CREATE PIPESINK mySink1 AS mySink (p1='111', p2='abc')", The parameters (p1=111, - * p2=abc) will be saved in sinkParams and then send it to validateSinkParams(sinkParams) for - * validation. If validateSinkParams() does not return Exception, the CMD will be processed. - * Otherwise, the CMD will be refused with prompt info that is from Exception.getMessage(); - * - * @param sinkParams Contains the parameters in CMD "CREATE PIPESINK ..." - * @return true means successful - * @throws Exception - */ - void validateSinkParams(Map<String, String> sinkParams) throws Exception; - - /** - * Initialize with the configuration of the corresponding sink, which may contain information to - * set up a connection to the third-party system. - * - * @param sinkParams Parameters of the corresponding sink. - */ - void initialize(Map<String, String> sinkParams) throws Exception; -} diff --git a/pom.xml b/pom.xml index d7da67d1b7b..4c2ba201827 100644 --- a/pom.xml +++ b/pom.xml @@ -113,7 +113,6 @@ <module>metrics</module> <module>integration-test</module> <module>consensus</module> - <module>iotdb-api/external-pipe-api</module> <module>library-udf</module> <module>iotdb-api/udf-api</module> <module>iotdb-api/trigger-api</module> diff --git a/server/pom.xml b/server/pom.xml index 691cab24fc7..f8b6959dc13 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -70,11 +70,6 @@ <artifactId>influxdb-thrift</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>org.apache.iotdb</groupId> - <artifactId>external-pipe-api</artifactId> - <version>${project.version}</version> - </dependency> <dependency> <groupId>org.apache.iotdb</groupId> <artifactId>external-api</artifactId>
