Class KafkaEmitter

  • All Implemented Interfaces:
    Emitter, java.io.Closeable, java.lang.AutoCloseable

    public class KafkaEmitter
    extends java.lang.Object
    implements Emitter
    • Field Detail

      • DEFAULT_MCP_KAFKA_TOPIC

        public static final java.lang.String DEFAULT_MCP_KAFKA_TOPIC
        See Also:
        Constant Field Values
    • Constructor Detail

      • KafkaEmitter

        public KafkaEmitter​(KafkaEmitterConfig config)
                     throws java.io.IOException
        The default constructor
        Parameters:
        config -
        Throws:
        java.io.IOException
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • emit

        public java.util.concurrent.Future<MetadataWriteResponse> emit​(MetadataChangeProposalWrapper mcpw,
                                                                       Callback datahubCallback)
                                                                throws java.io.IOException
        Description copied from interface: Emitter
        Asynchronously emit a MetadataChangeProposalWrapper event.
        Specified by:
        emit in interface Emitter
        datahubCallback - 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

        public java.util.concurrent.Future<MetadataWriteResponse> emit​(com.linkedin.mxe.MetadataChangeProposal mcp,
                                                                       Callback datahubCallback)
                                                                throws java.io.IOException
        Description copied from interface: Emitter
        Asynchronously emit a MetadataChangeProposal event. Prefer using the sibling method that accepts a MetadataChangeProposalWrapper event as those are friendlier to construct.
        Specified by:
        emit in interface Emitter
        datahubCallback - 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
      • testConnection

        public boolean testConnection()
                               throws java.io.IOException,
                                      java.util.concurrent.ExecutionException,
                                      java.lang.InterruptedException
        Description copied from interface: Emitter
        Test that the emitter can establish a valid connection to the DataHub platform
        Specified by:
        testConnection in interface Emitter
        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

        public java.util.concurrent.Future<MetadataWriteResponse> emit​(java.util.List<UpsertAspectRequest> request,
                                                                       Callback callback)
                                                                throws java.io.IOException
        Description copied from interface: Emitter
        Asynchronously emit a UpsertAspectRequest.
        Specified by:
        emit in interface Emitter
        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
      • getKafkaConfgiProperties

        public java.util.Properties getKafkaConfgiProperties()