Package datahub.client
Interface Emitter
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
FileEmitter,KafkaEmitter,RestEmitter,S3Emitter
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 Summary
Modifier and TypeMethodDescriptiondefault Future<MetadataWriteResponse>emit(com.linkedin.mxe.MetadataChangeProposal mcp) Asynchronously emit aMetadataChangeProposalevent.Asynchronously emit aMetadataChangeProposalevent.default Future<MetadataWriteResponse>emit(datahub.event.MetadataChangeProposalWrapper mcpw) Asynchronously emit aMetadataChangeProposalWrapperevent.Asynchronously emit aMetadataChangeProposalWrapperevent.Asynchronously emit aUpsertAspectRequest.booleanTest that the emitter can establish a valid connection to the DataHub platform
-
Method Details
-
emit
Future<MetadataWriteResponse> emit(@Nonnull datahub.event.MetadataChangeProposalWrapper mcpw, Callback callback) throws 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:
IOException
-
emit
default Future<MetadataWriteResponse> emit(@Nonnull datahub.event.MetadataChangeProposalWrapper mcpw) throws IOException Asynchronously emit aMetadataChangeProposalWrapperevent.- Parameters:
mcpw-- Returns:
- a
Futurefor 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 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:
IOException
-
emit
default Future<MetadataWriteResponse> emit(@Nonnull com.linkedin.mxe.MetadataChangeProposal mcp) throws 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:
IOException
-
testConnection
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:
IOExceptionExecutionExceptionInterruptedException
-
emit
Future<MetadataWriteResponse> emit(List<datahub.event.UpsertAspectRequest> request, Callback callback) throws 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:
IOException
-