Interface Emitter

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    FileEmitter, KafkaEmitter, RestEmitter

    @ThreadSafe
    public interface Emitter
    extends java.io.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 Detail

      • emit

        java.util.concurrent.Future<MetadataWriteResponse> emit​(@Nonnull
                                                                MetadataChangeProposalWrapper mcpw,
                                                                Callback callback)
                                                         throws java.io.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:
        java.io.IOException
      • emit

        java.util.concurrent.Future<MetadataWriteResponse> emit​(@Nonnull
                                                                com.linkedin.mxe.MetadataChangeProposal mcp,
                                                                Callback callback)
                                                         throws java.io.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:
        java.io.IOException
      • emit

        default java.util.concurrent.Future<MetadataWriteResponse> emit​(@Nonnull
                                                                        com.linkedin.mxe.MetadataChangeProposal mcp)
                                                                 throws java.io.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:
        java.io.IOException
      • testConnection

        boolean testConnection()
                        throws java.io.IOException,
                               java.util.concurrent.ExecutionException,
                               java.lang.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:
        java.io.IOException
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • emit

        java.util.concurrent.Future<MetadataWriteResponse> emit​(java.util.List<UpsertAspectRequest> request,
                                                                Callback callback)
                                                         throws java.io.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:
        java.io.IOException