Package org.apache.pulsar.client.admin
Interface Sources
- All Known Subinterfaces:
Source
public interface Sources
Admin interface for Source management.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createSource
(SourceConfig sourceConfig, String fileName) Create a new source.createSourceAsync
(SourceConfig sourceConfig, String fileName) Create a new source asynchronously.void
createSourceWithUrl
(SourceConfig sourceConfig, String pkgUrl) Create a new source with package url.createSourceWithUrlAsync
(SourceConfig sourceConfig, String pkgUrl) Create a new source with package url asynchronously.void
deleteSource
(String tenant, String namespace, String source) Delete an existing source.deleteSourceAsync
(String tenant, String namespace, String source) Delete an existing source asynchronously.Fetches a list of supported Pulsar IO sources currently running in cluster mode.Fetches a list of supported Pulsar IO sources currently running in cluster mode asynchronously.Get the configuration for the specified source.getSourceAsync
(String tenant, String namespace, String source) Get the configuration for the specified source asynchronously.getSourceStatus
(String tenant, String namespace, String source) Gets the current status of a source.getSourceStatus
(String tenant, String namespace, String source, int id) Gets the current status of a source instance.getSourceStatusAsync
(String tenant, String namespace, String source) Gets the current status of a source asynchronously.getSourceStatusAsync
(String tenant, String namespace, String source, int id) Gets the current status of a source instance asynchronously.listSources
(String tenant, String namespace) Get the list of sources.listSourcesAsync
(String tenant, String namespace) Get the list of sources asynchronously.void
Reload the available built-in connectors, include Source and Source.Reload the available built-in connectors, include Source and Source asynchronously.void
restartSource
(String tenant, String namespace, String source) Restart all source instances.void
restartSource
(String tenant, String namespace, String source, int instanceId) Restart source instance.restartSourceAsync
(String tenant, String namespace, String source) Restart all source instances asynchronously.restartSourceAsync
(String tenant, String namespace, String source, int instanceId) Restart source instance asynchronously.void
startSource
(String tenant, String namespace, String source) Start all source instances.void
startSource
(String tenant, String namespace, String source, int instanceId) Start source instance.startSourceAsync
(String tenant, String namespace, String source) Start all source instances asynchronously.startSourceAsync
(String tenant, String namespace, String source, int instanceId) Start source instance asynchronously.void
stopSource
(String tenant, String namespace, String source) Stop all source instances.void
stopSource
(String tenant, String namespace, String source, int instanceId) Stop source instance.stopSourceAsync
(String tenant, String namespace, String source) Stop all source instances asynchronously.stopSourceAsync
(String tenant, String namespace, String source, int instanceId) Stop source instance asynchronously.void
updateSource
(SourceConfig sourceConfig, String fileName) Update the configuration for a source.void
updateSource
(SourceConfig sourceConfig, String fileName, UpdateOptions updateOptions) Update the configuration for a source.updateSourceAsync
(SourceConfig sourceConfig, String fileName) Update the configuration for a source asynchronously.updateSourceAsync
(SourceConfig sourceConfig, String fileName, UpdateOptions updateOptions) Update the configuration for a source asynchronously.void
updateSourceWithUrl
(SourceConfig sourceConfig, String pkgUrl) Update the configuration for a source.void
updateSourceWithUrl
(SourceConfig sourceConfig, String pkgUrl, UpdateOptions updateOptions) Update the configuration for a source.updateSourceWithUrlAsync
(SourceConfig sourceConfig, String pkgUrl) Update the configuration for a source asynchronously.updateSourceWithUrlAsync
(SourceConfig sourceConfig, String pkgUrl, UpdateOptions updateOptions) Update the configuration for a source asynchronously.
-
Method Details
-
listSources
Get the list of sources. Get the list of all the Pulsar Sources. Response Example:["f1", "f2", "f3"]
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException
- Unexpected error
-
listSourcesAsync
Get the list of sources asynchronously. Get the list of all the Pulsar Sources. Response Example:["f1", "f2", "f3"]
-
getSource
Get the configuration for the specified source. Response Example:{ serviceUrl : "http://my-broker.example.com:8080/" }
- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name- Returns:
- the source configuration
- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to get the configuration of the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
getSourceAsync
Get the configuration for the specified source asynchronously. Response Example:{ serviceUrl : "http://my-broker.example.com:8080/" }
- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name- Returns:
- the source configuration
-
createSource
Create a new source.- Parameters:
sourceConfig
- the source configuration object- Throws:
PulsarAdminException
- Unexpected error
-
createSourceAsync
Create a new source asynchronously.- Parameters:
sourceConfig
- the source configuration object
-
createSourceWithUrl
Create a new source with package url. Create a new source 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:
sourceConfig
- the source configuration objectpkgUrl
- url from which pkg can be downloaded- Throws:
PulsarAdminException
-
createSourceWithUrlAsync
Create a new source with package url asynchronously. Create a new source 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:
sourceConfig
- the source configuration objectpkgUrl
- url from which pkg can be downloaded
-
updateSource
Update the configuration for a source.- Parameters:
sourceConfig
- the source configuration object- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permission to create the clusterPulsarAdminException.NotFoundException
- Cluster doesn't existPulsarAdminException
- Unexpected error
-
updateSourceAsync
Update the configuration for a source asynchronously.- Parameters:
sourceConfig
- the source configuration object
-
updateSource
void updateSource(SourceConfig sourceConfig, String fileName, UpdateOptions updateOptions) throws PulsarAdminException Update the configuration for a source.- Parameters:
sourceConfig
- the source 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
-
updateSourceAsync
CompletableFuture<Void> updateSourceAsync(SourceConfig sourceConfig, String fileName, UpdateOptions updateOptions) Update the configuration for a source asynchronously.- Parameters:
sourceConfig
- the source configuration objectupdateOptions
- options for the update operations
-
updateSourceWithUrl
Update the configuration for a source. Update a source 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:
sourceConfig
- the source 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
-
updateSourceWithUrlAsync
Update the configuration for a source asynchronously. Update a source 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:
sourceConfig
- the source configuration objectpkgUrl
- url from which pkg can be downloaded
-
updateSourceWithUrl
void updateSourceWithUrl(SourceConfig sourceConfig, String pkgUrl, UpdateOptions updateOptions) throws PulsarAdminException Update the configuration for a source. Update a source 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:
sourceConfig
- the source 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
-
updateSourceWithUrlAsync
CompletableFuture<Void> updateSourceWithUrlAsync(SourceConfig sourceConfig, String pkgUrl, UpdateOptions updateOptions) Update the configuration for a source asynchronously. Update a source 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:
sourceConfig
- the source configuration objectpkgUrl
- url from which pkg can be downloadedupdateOptions
- options for the update operations
-
deleteSource
Delete an existing source. Delete a source- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name- Throws:
PulsarAdminException.NotAuthorizedException
- You don't have admin permissionPulsarAdminException.NotFoundException
- Cluster does not existPulsarAdminException.PreconditionFailedException
- Cluster is not emptyPulsarAdminException
- Unexpected error
-
deleteSourceAsync
Delete an existing source asynchronously. Delete a source- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name
-
getSourceStatus
SourceStatus getSourceStatus(String tenant, String namespace, String source) throws PulsarAdminException Gets the current status of a source.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name- Throws:
PulsarAdminException
- Unexpected error
-
getSourceStatusAsync
CompletableFuture<SourceStatus> getSourceStatusAsync(String tenant, String namespace, String source) Gets the current status of a source asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name
-
getSourceStatus
SourceStatus.SourceInstanceStatus.SourceInstanceStatusData getSourceStatus(String tenant, String namespace, String source, int id) throws PulsarAdminException Gets the current status of a source instance.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source nameid
- Source instance-id- Returns:
- Throws:
PulsarAdminException
-
getSourceStatusAsync
CompletableFuture<SourceStatus.SourceInstanceStatus.SourceInstanceStatusData> getSourceStatusAsync(String tenant, String namespace, String source, int id) Gets the current status of a source instance asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source nameid
- Source instance-id- Returns:
-
restartSource
void restartSource(String tenant, String namespace, String source, int instanceId) throws PulsarAdminException Restart source instance.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source nameinstanceId
- Source instanceId- Throws:
PulsarAdminException
- Unexpected error
-
restartSourceAsync
CompletableFuture<Void> restartSourceAsync(String tenant, String namespace, String source, int instanceId) Restart source instance asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source nameinstanceId
- Source instanceId
-
restartSource
Restart all source instances.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name- Throws:
PulsarAdminException
- Unexpected error
-
restartSourceAsync
Restart all source instances asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name
-
stopSource
void stopSource(String tenant, String namespace, String source, int instanceId) throws PulsarAdminException Stop source instance.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source nameinstanceId
- Source instanceId- Throws:
PulsarAdminException
- Unexpected error
-
stopSourceAsync
CompletableFuture<Void> stopSourceAsync(String tenant, String namespace, String source, int instanceId) Stop source instance asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source nameinstanceId
- Source instanceId
-
stopSource
Stop all source instances.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name- Throws:
PulsarAdminException
- Unexpected error
-
stopSourceAsync
Stop all source instances asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name
-
startSource
void startSource(String tenant, String namespace, String source, int instanceId) throws PulsarAdminException Start source instance.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source nameinstanceId
- Source instanceId- Throws:
PulsarAdminException
- Unexpected error
-
startSourceAsync
CompletableFuture<Void> startSourceAsync(String tenant, String namespace, String source, int instanceId) Start source instance asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source nameinstanceId
- Source instanceId
-
startSource
Start all source instances.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name- Throws:
PulsarAdminException
- Unexpected error
-
startSourceAsync
Start all source instances asynchronously.- Parameters:
tenant
- Tenant namenamespace
- Namespace namesource
- Source name
-
getBuiltInSources
Fetches a list of supported Pulsar IO sources currently running in cluster mode.- Throws:
PulsarAdminException
- Unexpected error
-
getBuiltInSourcesAsync
CompletableFuture<List<ConnectorDefinition>> getBuiltInSourcesAsync()Fetches a list of supported Pulsar IO sources currently running in cluster mode asynchronously. -
reloadBuiltInSources
Reload the available built-in connectors, include Source and Source.- Throws:
PulsarAdminException
- Unexpected error
-
reloadBuiltInSourcesAsync
CompletableFuture<Void> reloadBuiltInSourcesAsync()Reload the available built-in connectors, include Source and Source asynchronously.
-