Package org.apache.pulsar.client.admin
Interface Sinks
- All Known Subinterfaces:
Sink
public interface Sinks
Admin interface for Sink management.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createSink
(SinkConfig sinkConfig, String fileName) Create a new sink.createSinkAsync
(SinkConfig sinkConfig, String fileName) Create a new sink asynchronously.void
createSinkWithUrl
(SinkConfig sinkConfig, String pkgUrl) Create a new sink with package url.createSinkWithUrlAsync
(SinkConfig sinkConfig, String pkgUrl) Create a new sink with package url asynchronously.void
deleteSink
(String tenant, String namespace, String sink) Delete an existing sink.deleteSinkAsync
(String tenant, String namespace, String sink) Delete an existing sink asynchronously.Fetches a list of supported Pulsar IO sinks currently running in cluster mode.Fetches a list of supported Pulsar IO sinks currently running in cluster mode asynchronously.Get the configuration for the specified sink.getSinkAsync
(String tenant, String namespace, String sink) Get the configuration for the specified sink asynchronously.getSinkStatus
(String tenant, String namespace, String sink) Gets the current status of a sink.getSinkStatus
(String tenant, String namespace, String sink, int id) Gets the current status of a sink instance.getSinkStatusAsync
(String tenant, String namespace, String sink) Gets the current status of a sink asynchronously.getSinkStatusAsync
(String tenant, String namespace, String sink, int id) Gets the current status of a sink instance asynchronously.Get the list of sinks.listSinksAsync
(String tenant, String namespace) Get the list of sinks asynchronously.void
Reload the available built-in connectors, include Source and Sink.Reload the available built-in connectors, include Source and Sink asynchronously.void
restartSink
(String tenant, String namespace, String sink) Restart all sink instances.void
restartSink
(String tenant, String namespace, String sink, int instanceId) Restart sink instance.restartSinkAsync
(String tenant, String namespace, String sink) Restart all sink instances asynchronously.restartSinkAsync
(String tenant, String namespace, String sink, int instanceId) Restart sink instance asynchronously.void
Start all sink instances.void
Start sink instance.startSinkAsync
(String tenant, String namespace, String sink) Start all sink instances asynchronously.startSinkAsync
(String tenant, String namespace, String sink, int instanceId) Start sink instance asynchronously.void
Stop all sink instances.void
Stop sink instance.stopSinkAsync
(String tenant, String namespace, String sink) Stop all sink instances asynchronously.stopSinkAsync
(String tenant, String namespace, String sink, int instanceId) Stop sink instance asynchronously.void
updateSink
(SinkConfig sinkConfig, String fileName) Update the configuration for a sink.void
updateSink
(SinkConfig sinkConfig, String fileName, UpdateOptions updateOptions) Update the configuration for a sink.updateSinkAsync
(SinkConfig sinkConfig, String fileName) Update the configuration for a sink asynchronously.updateSinkAsync
(SinkConfig sinkConfig, String fileName, UpdateOptions updateOptions) Update the configuration for a sink asynchronously.void
updateSinkWithUrl
(SinkConfig sinkConfig, String pkgUrl) Update the configuration for a sink.void
updateSinkWithUrl
(SinkConfig sinkConfig, String pkgUrl, UpdateOptions updateOptions) Update the configuration for a sink.updateSinkWithUrlAsync
(SinkConfig sinkConfig, String pkgUrl) Update the configuration for a sink asynchronously.updateSinkWithUrlAsync
(SinkConfig sinkConfig, String pkgUrl, UpdateOptions updateOptions) Update the configuration for a sink asynchronously.
-
Method Details
-
listSinks
Get the list of sinks. Get the list of all the Pulsar Sinks. Response Example:["f1", "f2", "f3"]
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException
- Unexpected error
-
listSinksAsync
Get the list of sinks asynchronously. Get the list of all the Pulsar Sinks. Response Example:["f1", "f2", "f3"]
-
getSink
Get the configuration for the specified sink. Response Example:{ serviceUrl : "http://my-broker.example.com:8080/" }
- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name- Returns:
- the sink configuration
- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to get the configuration of the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
getSinkAsync
Get the configuration for the specified sink asynchronously. Response Example:{ serviceUrl : "http://my-broker.example.com:8080/" }
- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name- Returns:
- the sink configuration
-
createSink
Create a new sink.- Parameters:
sinkConfig
- the sink configuration object- Throws:
PulsarAdminException
- Unexpected error
-
createSinkAsync
Create a new sink asynchronously.- Parameters:
sinkConfig
- the sink configuration object
-
createSinkWithUrl
Create a new sink with package url. Create a new sink by providing url from which fun-pkg can be downloaded. supported url: http/file eg: File: file:/dir/fileName.jar Http: http://www.repo.com/fileName.jar- Parameters:
sinkConfig
- the sink configuration objectpkgUrl
- url from which pkg can be downloaded- Throws:
PulsarAdminException
-
createSinkWithUrlAsync
Create a new sink with package url asynchronously. Create a new sink by providing url from which fun-pkg can be downloaded. supported url: http/file eg: File: file:/dir/fileName.jar Http: http://www.repo.com/fileName.jar- Parameters:
sinkConfig
- the sink configuration objectpkgUrl
- url from which pkg can be downloaded
-
updateSink
Update the configuration for a sink.- Parameters:
sinkConfig
- the sink configuration object- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
updateSinkAsync
Update the configuration for a sink asynchronously.- Parameters:
sinkConfig
- the sink configuration object
-
updateSink
void updateSink(SinkConfig sinkConfig, String fileName, UpdateOptions updateOptions) throws PulsarAdminException Update the configuration for a sink.- Parameters:
sinkConfig
- the sink configuration objectupdateOptions
- options for the update operations- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
updateSinkAsync
CompletableFuture<Void> updateSinkAsync(SinkConfig sinkConfig, String fileName, UpdateOptions updateOptions) Update the configuration for a sink asynchronously.- Parameters:
sinkConfig
- the sink configuration objectupdateOptions
- options for the update operations
-
updateSinkWithUrl
Update the configuration for a sink. Update a sink by providing url from which fun-pkg can be downloaded. supported url: http/file eg: File: file:/dir/fileName.jar Http: http://www.repo.com/fileName.jar- Parameters:
sinkConfig
- the sink configuration objectpkgUrl
- url from which pkg can be downloaded- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
updateSinkWithUrlAsync
Update the configuration for a sink asynchronously. Update a sink by providing url from which fun-pkg can be downloaded. supported url: http/file eg: File: file:/dir/fileName.jar Http: http://www.repo.com/fileName.jar- Parameters:
sinkConfig
- the sink configuration objectpkgUrl
- url from which pkg can be downloaded
-
updateSinkWithUrl
void updateSinkWithUrl(SinkConfig sinkConfig, String pkgUrl, UpdateOptions updateOptions) throws PulsarAdminException Update the configuration for a sink. Update a sink by providing url from which fun-pkg can be downloaded. supported url: http/file eg: File: file:/dir/fileName.jar Http: http://www.repo.com/fileName.jar- Parameters:
sinkConfig
- the sink configuration objectpkgUrl
- url from which pkg can be downloadedupdateOptions
- options for the update operations- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
updateSinkWithUrlAsync
CompletableFuture<Void> updateSinkWithUrlAsync(SinkConfig sinkConfig, String pkgUrl, UpdateOptions updateOptions) Update the configuration for a sink asynchronously. Update a sink by providing url from which fun-pkg can be downloaded. supported url: http/file eg: File: file:/dir/fileName.jar Http: http://www.repo.com/fileName.jar- Parameters:
sinkConfig
- the sink configuration objectpkgUrl
- url from which pkg can be downloadedupdateOptions
- options for the update operations
-
deleteSink
Delete an existing sink. Delete a sink- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permissionPulsarAdminException.NotFoundException
- Cluster does not existPulsarAdminException.PreconditionFailedException
- Cluster is not emptyPulsarAdminException
- Unexpected error
-
deleteSinkAsync
Delete an existing sink asynchronously. Delete a sink- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name
-
getSinkStatus
Gets the current status of a sink.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name- Throws:
PulsarAdminException
- Unexpected error
-
getSinkStatusAsync
Gets the current status of a sink asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name
-
getSinkStatus
SinkStatus.SinkInstanceStatus.SinkInstanceStatusData getSinkStatus(String tenant, String namespace, String sink, int id) throws PulsarAdminException Gets the current status of a sink instance.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink nameid
- Sink instance-id- Returns:
- Throws:
PulsarAdminException
-
getSinkStatusAsync
CompletableFuture<SinkStatus.SinkInstanceStatus.SinkInstanceStatusData> getSinkStatusAsync(String tenant, String namespace, String sink, int id) Gets the current status of a sink instance asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink nameid
- Sink instance-id- Returns:
-
restartSink
void restartSink(String tenant, String namespace, String sink, int instanceId) throws PulsarAdminException Restart sink instance.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink nameinstanceId
- Sink instanceId- Throws:
PulsarAdminException
- Unexpected error
-
restartSinkAsync
CompletableFuture<Void> restartSinkAsync(String tenant, String namespace, String sink, int instanceId) Restart sink instance asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink nameinstanceId
- Sink instanceId
-
restartSink
Restart all sink instances.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name- Throws:
PulsarAdminException
- Unexpected error
-
restartSinkAsync
Restart all sink instances asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name
-
stopSink
void stopSink(String tenant, String namespace, String sink, int instanceId) throws PulsarAdminException Stop sink instance.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink nameinstanceId
- Sink instanceId- Throws:
PulsarAdminException
- Unexpected error
-
stopSinkAsync
Stop sink instance asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink nameinstanceId
- Sink instanceId
-
stopSink
Stop all sink instances.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name- Throws:
PulsarAdminException
- Unexpected error
-
stopSinkAsync
Stop all sink instances asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name
-
startSink
void startSink(String tenant, String namespace, String sink, int instanceId) throws PulsarAdminException Start sink instance.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink nameinstanceId
- Sink instanceId- Throws:
PulsarAdminException
- Unexpected error
-
startSinkAsync
CompletableFuture<Void> startSinkAsync(String tenant, String namespace, String sink, int instanceId) Start sink instance asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink nameinstanceId
- Sink instanceId
-
startSink
Start all sink instances.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name- Throws:
PulsarAdminException
- Unexpected error
-
startSinkAsync
Start all sink instances asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesink
- Sink name
-
getBuiltInSinks
Fetches a list of supported Pulsar IO sinks currently running in cluster mode.- Throws:
PulsarAdminException
- Unexpected error
-
getBuiltInSinksAsync
CompletableFuture<List<ConnectorDefinition>> getBuiltInSinksAsync()Fetches a list of supported Pulsar IO sinks currently running in cluster mode asynchronously. -
reloadBuiltInSinks
Reload the available built-in connectors, include Source and Sink.- Throws:
PulsarAdminException
- Unexpected error
-
reloadBuiltInSinksAsync
CompletableFuture<Void> reloadBuiltInSinksAsync()Reload the available built-in connectors, include Source and Sink asynchronously.
-