Interface Emitter

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
FileEmitter, KafkaEmitter, RestEmitter, S3Emitter

@ThreadSafe public interface Emitter extends Closeable
An interface implemented by all metadata emitters to DataHub. Typical usage: 1. Construct the emitter using the native constructor or builder for the Emitter. 2. Call `emitter.emit(mcpw, callback)` for each event you want to send 3. Wait for all events to be sent by inspecting the futures returned by each call or using callbacks 4. Call `emitter.close()` to finalize.
  • Method Details

    • emit

      Future<MetadataWriteResponse> emit(@Nonnull datahub.event.MetadataChangeProposalWrapper mcpw, Callback callback) throws IOException
      Asynchronously emit a MetadataChangeProposalWrapper event.
      Parameters:
      mcpw -
      callback - if not null, is called from the IO thread. Should be a quick operation.
      Returns:
      a Future for callers to inspect the result of the operation or block until one is available
      Throws:
      IOException
    • emit

      default Future<MetadataWriteResponse> emit(@Nonnull datahub.event.MetadataChangeProposalWrapper mcpw) throws IOException
      Asynchronously emit a MetadataChangeProposalWrapper event.
      Parameters:
      mcpw -
      Returns:
      a Future for callers to inspect the result of the operation or block until one is available
      Throws:
      IOException
    • emit

      Future<MetadataWriteResponse> emit(@Nonnull com.linkedin.mxe.MetadataChangeProposal mcp, Callback callback) throws IOException
      Asynchronously emit a MetadataChangeProposal event. Prefer using the sibling method that accepts a MetadataChangeProposalWrapper event as those are friendlier to construct.
      Parameters:
      mcp -
      callback - if not null, is called from the IO thread. Should be a quick operation.
      Returns:
      a Future for callers to inspect the result of the operation or block until one is available
      Throws:
      IOException
    • emit

      default Future<MetadataWriteResponse> emit(@Nonnull com.linkedin.mxe.MetadataChangeProposal mcp) throws IOException
      Asynchronously emit a MetadataChangeProposal event. Prefer using the sibling method that accepts a MetadataChangeProposalWrapper event as those are friendlier to construct.
      Parameters:
      mcp -
      Returns:
      a Future for callers to inspect the result of the operation or block until one is available
      Throws:
      IOException
    • testConnection

      boolean testConnection() throws IOException, ExecutionException, InterruptedException
      Test that the emitter can establish a valid connection to the DataHub platform
      Returns:
      true if a valid connection can be established, false or throws one of the exceptions otherwise
      Throws:
      IOException
      ExecutionException
      InterruptedException
    • emit

      Future<MetadataWriteResponse> emit(List<datahub.event.UpsertAspectRequest> request, Callback callback) throws IOException
      Asynchronously emit a UpsertAspectRequest.
      Parameters:
      request - request with with metadata aspect to upsert into DataHub
      Returns:
      a Future for callers to inspect the result of the operation or block until one is available
      Throws:
      IOException