Class DataImportServerCommandChannel

java.lang.Object
com.illumon.iris.db.tables.dataimport.logtailer.DataImportServerCommandChannel
All Implemented Interfaces:
AutoCloseable

public class DataImportServerCommandChannel extends Object implements AutoCloseable
Open a socket to a DataImportServer, in preparation for sending commands. Unlike LogtailerDestinationManager, this connection is not tied to a specific table location and it doesn't have an ongoing job, or thread. TODO: this needs a maintenance thread (or something similar) that can close the socket after a period of inactivity
  • Constructor Details

    • DataImportServerCommandChannel

      public DataImportServerCommandChannel(com.fishlib.io.logger.Logger log, DataRoutingService.DeferredEndpoint remoteAddress, String disName)
      Construct a manager to log stream commands. Uses the default authentication manager.
      Parameters:
      log - the log to which errors will be sent
      remoteAddress - the address of the remote DataImportServer for this connection
      disName - the name of the targeted DataImportServer. Useful for logging
    • DataImportServerCommandChannel

      public DataImportServerCommandChannel(@NotNull com.fishlib.io.logger.Logger log, @NotNull DataRoutingService.DeferredEndpoint remoteAddress, @NotNull String disName, @NotNull io.deephaven.enterprise.auth.TokenFactoryFactory tokenAuthenticationManager)
      Construct a manager to log stream commands.
      Parameters:
      log - the log to which errors will be sent
      remoteAddress - the address of the remote DataImportServer for this connection
      disName - the name of the targeted DataImportServer. Useful for logging
      tokenAuthenticationManager - a new authentication client manager
  • Method Details

    • truncate

      public AckTruncateMessage truncate(FullTableLocationKey key) throws IOException, io.deephaven.enterprise.auth.AuthenticationFailure, ChannelException
      Delegate to truncate(FullTableLocationKey, boolean) with dryRun set to false.
      Throws:
      IOException
      io.deephaven.enterprise.auth.AuthenticationFailure
      ChannelException
    • truncate

      public AckTruncateMessage truncate(FullTableLocationKey key, boolean dryRun) throws IOException, io.deephaven.enterprise.auth.AuthenticationFailure, ChannelException
      Instruct the DataImportServer to truncate the specified location, and wait for confirmation.
      Parameters:
      key - FullTableLocationKey specifying the locations to be truncated; will be AggregateTableLocationKey in most cases.
      dryRun - if true, don't really truncate data, just say what would have happened
      Returns:
      An AckTruncateMessage containing detailed results of the operation
      Throws:
      IOException - for communication errors
      ChannelException - also for communication errors
      io.deephaven.enterprise.auth.AuthenticationFailure - if the truncation failed due to authentication or permission failure
    • delete

      public AckTruncateMessage delete(FullTableLocationKey key, boolean dryRun) throws IOException, io.deephaven.enterprise.auth.AuthenticationFailure, ChannelException
      Instruct the DataImportServer to delete the specified locations, and wait for confirmation. Locations may be deleted only after they have been truncated.
      Parameters:
      key - FullTableLocationKey specifying the locations to be deleted; will be AggregateTableLocationKey in most cases.
      dryRun - if true, don't really delete data, just say what would have happened
      Returns:
      An AckTruncateMessage containing detailed results of the operation
      Throws:
      IOException - for communication errors
      ChannelException - also for communication errors
      io.deephaven.enterprise.auth.AuthenticationFailure - if the truncation failed due to authentication or permission failure
    • rescan

      public AckRescanMessage rescan(@Nullable String namespace, @Nullable String tableName) throws IOException, ChannelException
      Instruct the DataImportServer to rescan the specified location (or all locations if null), and wait for confirmation.
      Parameters:
      namespace - (optional) namespace of the table to rescan. If specified, tableName is required.
      tableName - (optional) name of the table to rescan. If specified, namespace is required.
      Returns:
      An AckRescanMessage containing detailed results of the operation
      Throws:
      IOException - for communication errors
      ChannelException - also for communication errors
      io.deephaven.enterprise.auth.AuthException - if the truncation failed due to authentication or permission failure
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • getRemoteEndpointName

      protected String getRemoteEndpointName()