All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clickzetta.platform.client.api.multi.MultiStream Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.clickzetta.platform.client.api.multi;

import com.clickzetta.platform.client.BaseStream;
import com.clickzetta.platform.client.MultiRowCreate;
import com.clickzetta.platform.client.api.Row;

import java.io.IOException;

public interface MultiStream extends BaseStream, MultiRowCreate {

  /**
   * return this table options which hold by stream.
   *
   * @return
   */
  MultiTablesOptions getMultiTablesOptions();

  /**
   * return this session which hold by stream.
   *
   * @return
   */
  MultiSession getSession();

  default boolean dynamicAppendStream(String schemaName, String tableName) throws IOException {
    return dynamicAppendStream(schemaName, tableName, 1);
  }

  /**
   * append stream to target multi stream.
   * return true if append success, otherwise false if stream already exists.
   *
   * @param schemaName
   * @param tableName
   * @return
   */
  boolean dynamicAppendStream(String schemaName, String tableName, Integer tabletNum) throws IOException;

  /**
   * remove stream from target multi stream.
   * return true if remove success, otherwise false if stream already not exists.
   *
   * @param schemaName
   * @param tableName
   * @return
   */
  boolean dynamicRemoveStream(String schemaName, String tableName) throws IOException;

  /**
   * Append streams in batch to the target multi stream.
   */
  void dynamicBatchAppendStream(MultiTablesOptions newTableOptions) throws IOException;

  /**
   * apply rows to buffer.
   *
   * @param rows
   */
  void apply(Row... rows) throws IOException;

  /**
   * flush current rows.
   *
   * @throws IOException
   */
  void flush() throws IOException;

  /**
   * close current stream.
   */
  void close() throws IOException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy