Skip to content

Commit

Permalink
add javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
VGalaxies committed Jan 11, 2025
1 parent 133881b commit bf9a0cf
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,41 @@

package org.apache.iotdb.pipe.api;

/**
* {@link PipePlugin}
*
* <p>{@link PipePlugin} represents a customizable component that can serve as a data extraction
* plugin, data processing plugin, or data sending plugin within a pipeline framework.
*
* <p>Developers can implement different plugin functionalities according to specific requirements,
* such as collecting data from various sources, transforming the data, or forwarding the data to
* external systems.
*
* <p>Usage Model:
*
* <ul>
* <li>By default, a {@link PipePlugin} can operate under a tree model only, if no model
* annotation under {@link org.apache.iotdb.pipe.api.annotation} is specified.
* <li>To extend its applicability, a {@link PipePlugin} can be configured to support table model,
* or both tree and table models concurrently.
* </ul>
*
* <p>Lifecycle:
*
* <ul>
* <li>When the pipeline framework loads, the plugin's configuration is parsed and validated.
* <li>As part of the setup, methods can be provided to prepare connections or resources required
* by the plugin (e.g., reading external configurations, establishing data routes).
* <li>During data processing, the plugin performs its core functionality (extraction,
* transformation, or sending).
* <li>When the pipeline is stopped or destroyed, any allocated resources must be released
* accurately, and {@link #close()} will be invoked to ensure a clean shutdown.
* </ul>
*
* <p>Example: {@link org.apache.iotdb.CountPointProcessor}
*
* <p>Implementations of {@link PipePlugin} should follow best practices for resource management and
* gracefully handle exceptions, especially when running in long-lived or continuously operating
* environments.
*/
public interface PipePlugin extends AutoCloseable {}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Indicates that a plugin can be used in table model environments.
*
* <p>When implementing a custom {@link org.apache.iotdb.pipe.api.PipePlugin} that needs to operate
* under table model settings, declare this annotation on the plugin class. Through the {@code
* CREATE PIPEPLUGIN} statement, a plugin annotated with {@link TableModel} is valid for both tree
* model connections and table model connections.
*
* @since 2.0.0
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface TableModel {}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Indicates that a plugin can be used in tree model environments.
*
* <p>When implementing a custom {@link org.apache.iotdb.pipe.api.PipePlugin} that needs to operate
* under tree model settings, declare this annotation on the plugin class. Through the {@code CREATE
* PIPEPLUGIN} statement, a plugin annotated with {@link TreeModel} is valid for both tree model
* connections and tree model connections.
*
* @since 2.0.0
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface TreeModel {}

0 comments on commit bf9a0cf

Please sign in to comment.