Package datahub.client
Interface Emitter
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
FileEmitter,KafkaEmitter,RestEmitter
@ThreadSafe public interface Emitter extends java.io.CloseableAn 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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.concurrent.Future<MetadataWriteResponse>emit(com.linkedin.mxe.MetadataChangeProposal mcp)Asynchronously emit aMetadataChangeProposalevent.java.util.concurrent.Future<MetadataWriteResponse>emit(com.linkedin.mxe.MetadataChangeProposal mcp, Callback callback)Asynchronously emit aMetadataChangeProposalevent.default java.util.concurrent.Future<MetadataWriteResponse>emit(MetadataChangeProposalWrapper mcpw)Asynchronously emit aMetadataChangeProposalWrapperevent.java.util.concurrent.Future<MetadataWriteResponse>emit(MetadataChangeProposalWrapper mcpw, Callback callback)Asynchronously emit aMetadataChangeProposalWrapperevent.java.util.concurrent.Future<MetadataWriteResponse>emit(java.util.List<UpsertAspectRequest> request, Callback callback)Asynchronously emit aUpsertAspectRequest.booleantestConnection()Test that the emitter can establish a valid connection to the DataHub platform
-
-
-
Method Detail
-
emit
java.util.concurrent.Future<MetadataWriteResponse> emit(@Nonnull MetadataChangeProposalWrapper mcpw, Callback callback) throws java.io.IOException
Asynchronously emit aMetadataChangeProposalWrapperevent.- Parameters:
mcpw-callback- if not null, is called from the IO thread. Should be a quick operation.- Returns:
- a
Futurefor 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 MetadataChangeProposalWrapper mcpw) throws java.io.IOException
Asynchronously emit aMetadataChangeProposalWrapperevent.- Parameters:
mcpw-- Returns:
- a
Futurefor 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 aMetadataChangeProposalevent. Prefer using the sibling method that accepts aMetadataChangeProposalWrapperevent 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
Futurefor 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 aMetadataChangeProposalevent. Prefer using the sibling method that accepts aMetadataChangeProposalWrapperevent as those are friendlier to construct.- Parameters:
mcp-- Returns:
- a
Futurefor 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.InterruptedExceptionTest 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.IOExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
emit
java.util.concurrent.Future<MetadataWriteResponse> emit(java.util.List<UpsertAspectRequest> request, Callback callback) throws java.io.IOException
Asynchronously emit aUpsertAspectRequest.- Parameters:
request- request with with metadata aspect to upsert into DataHub- Returns:
- a
Futurefor callers to inspect the result of the operation or block until one is available - Throws:
java.io.IOException
-
-