public class SourcesImpl extends ComponentResource implements Sources, Source
auth, readTimeoutMs| Constructor and Description |
|---|
SourcesImpl(javax.ws.rs.client.WebTarget web,
org.apache.pulsar.client.api.Authentication auth,
org.asynchttpclient.AsyncHttpClient asyncHttpClient,
long readTimeoutMs) |
| Modifier and Type | Method and Description |
|---|---|
void |
createSource(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String fileName)
Create a new source.
|
CompletableFuture<Void> |
createSourceAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String fileName)
Create a new source asynchronously.
|
void |
createSourceWithUrl(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String pkgUrl)
Create a new source with package url.
|
CompletableFuture<Void> |
createSourceWithUrlAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String pkgUrl)
Create a new source with package url asynchronously.
|
void |
deleteSource(String cluster,
String namespace,
String function)
Delete an existing source.
|
CompletableFuture<Void> |
deleteSourceAsync(String tenant,
String namespace,
String function)
Delete an existing source asynchronously.
|
List<org.apache.pulsar.common.io.ConnectorDefinition> |
getBuiltInSources()
Fetches a list of supported Pulsar IO sources currently running in cluster mode.
|
CompletableFuture<List<org.apache.pulsar.common.io.ConnectorDefinition>> |
getBuiltInSourcesAsync()
Fetches a list of supported Pulsar IO sources currently running in cluster mode asynchronously.
|
org.apache.pulsar.common.io.SourceConfig |
getSource(String tenant,
String namespace,
String sourceName)
Get the configuration for the specified source.
|
CompletableFuture<org.apache.pulsar.common.io.SourceConfig> |
getSourceAsync(String tenant,
String namespace,
String sourceName)
Get the configuration for the specified source asynchronously.
|
org.apache.pulsar.common.policies.data.SourceStatus |
getSourceStatus(String tenant,
String namespace,
String sourceName)
Gets the current status of a source.
|
org.apache.pulsar.common.policies.data.SourceStatus.SourceInstanceStatus.SourceInstanceStatusData |
getSourceStatus(String tenant,
String namespace,
String sourceName,
int id)
Gets the current status of a source instance.
|
CompletableFuture<org.apache.pulsar.common.policies.data.SourceStatus> |
getSourceStatusAsync(String tenant,
String namespace,
String sourceName)
Gets the current status of a source asynchronously.
|
CompletableFuture<org.apache.pulsar.common.policies.data.SourceStatus.SourceInstanceStatus.SourceInstanceStatusData> |
getSourceStatusAsync(String tenant,
String namespace,
String sourceName,
int id)
Gets the current status of a source instance asynchronously.
|
List<String> |
listSources(String tenant,
String namespace)
Get the list of sources.
|
CompletableFuture<List<String>> |
listSourcesAsync(String tenant,
String namespace)
Get the list of sources asynchronously.
|
void |
reloadBuiltInSources()
Reload the available built-in connectors, include Source and Source.
|
CompletableFuture<Void> |
reloadBuiltInSourcesAsync()
Reload the available built-in connectors, include Source and Source asynchronously.
|
void |
restartSource(String tenant,
String namespace,
String functionName)
Restart all source instances.
|
void |
restartSource(String tenant,
String namespace,
String functionName,
int instanceId)
Restart source instance.
|
CompletableFuture<Void> |
restartSourceAsync(String tenant,
String namespace,
String functionName)
Restart all source instances asynchronously.
|
CompletableFuture<Void> |
restartSourceAsync(String tenant,
String namespace,
String functionName,
int instanceId)
Restart source instance asynchronously.
|
void |
startSource(String tenant,
String namespace,
String sourceName)
Start all source instances.
|
void |
startSource(String tenant,
String namespace,
String sourceName,
int instanceId)
Start source instance.
|
CompletableFuture<Void> |
startSourceAsync(String tenant,
String namespace,
String sourceName)
Start all source instances asynchronously.
|
CompletableFuture<Void> |
startSourceAsync(String tenant,
String namespace,
String sourceName,
int instanceId)
Start source instance asynchronously.
|
void |
stopSource(String tenant,
String namespace,
String sourceName)
Stop all source instances.
|
void |
stopSource(String tenant,
String namespace,
String sourceName,
int instanceId)
Stop source instance.
|
CompletableFuture<Void> |
stopSourceAsync(String tenant,
String namespace,
String sourceName)
Stop all source instances asynchronously.
|
CompletableFuture<Void> |
stopSourceAsync(String tenant,
String namespace,
String sourceName,
int instanceId)
Stop source instance asynchronously.
|
void |
updateSource(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String fileName)
Update the configuration for a source.
|
void |
updateSource(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String fileName,
org.apache.pulsar.common.functions.UpdateOptions updateOptions)
Update the configuration for a source.
|
CompletableFuture<Void> |
updateSourceAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String fileName)
Update the configuration for a source asynchronously.
|
CompletableFuture<Void> |
updateSourceAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String fileName,
org.apache.pulsar.common.functions.UpdateOptions updateOptions)
Update the configuration for a source asynchronously.
|
void |
updateSourceWithUrl(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String pkgUrl)
Update the configuration for a source.
|
void |
updateSourceWithUrl(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String pkgUrl,
org.apache.pulsar.common.functions.UpdateOptions updateOptions)
Update the configuration for a source.
|
CompletableFuture<Void> |
updateSourceWithUrlAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String pkgUrl)
Update the configuration for a source asynchronously.
|
CompletableFuture<Void> |
updateSourceWithUrlAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String pkgUrl,
org.apache.pulsar.common.functions.UpdateOptions updateOptions)
Update the configuration for a source asynchronously.
|
addAuthHeadersasyncDeleteRequest, asyncGetRequest, asyncPostRequest, asyncPutRequest, getApiException, getApiException, request, requestAsyncpublic SourcesImpl(javax.ws.rs.client.WebTarget web,
org.apache.pulsar.client.api.Authentication auth,
org.asynchttpclient.AsyncHttpClient asyncHttpClient,
long readTimeoutMs)
public List<String> listSources(String tenant, String namespace) throws PulsarAdminException
Sources
["f1", "f2", "f3"]
listSources in interface SourcesPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException - Unexpected errorpublic CompletableFuture<List<String>> listSourcesAsync(String tenant, String namespace)
Sources
["f1", "f2", "f3"]
listSourcesAsync in interface Sourcespublic org.apache.pulsar.common.io.SourceConfig getSource(String tenant, String namespace, String sourceName) throws PulsarAdminException
Sources
{ serviceUrl : "http://my-broker.example.com:8080/" }
getSource in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source namePulsarAdminException.NotAuthorizedException - You don't have admin permission to get the configuration of the clusterPulsarAdminException.NotFoundException - Cluster doesn't existPulsarAdminException - Unexpected errorpublic CompletableFuture<org.apache.pulsar.common.io.SourceConfig> getSourceAsync(String tenant, String namespace, String sourceName)
Sources
{ serviceUrl : "http://my-broker.example.com:8080/" }
getSourceAsync in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source namepublic org.apache.pulsar.common.policies.data.SourceStatus getSourceStatus(String tenant, String namespace, String sourceName) throws PulsarAdminException
SourcesgetSourceStatus in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source namePulsarAdminException - Unexpected errorpublic CompletableFuture<org.apache.pulsar.common.policies.data.SourceStatus> getSourceStatusAsync(String tenant, String namespace, String sourceName)
SourcesgetSourceStatusAsync in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source namepublic org.apache.pulsar.common.policies.data.SourceStatus.SourceInstanceStatus.SourceInstanceStatusData getSourceStatus(String tenant, String namespace, String sourceName, int id) throws PulsarAdminException
SourcesgetSourceStatus in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source nameid - Source instance-idPulsarAdminExceptionpublic CompletableFuture<org.apache.pulsar.common.policies.data.SourceStatus.SourceInstanceStatus.SourceInstanceStatusData> getSourceStatusAsync(String tenant, String namespace, String sourceName, int id)
SourcesgetSourceStatusAsync in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source nameid - Source instance-idpublic void createSource(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String fileName)
throws PulsarAdminException
SourcescreateSource in interface SourcessourceConfig - the source configuration objectPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> createSourceAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig, String fileName)
SourcescreateSourceAsync in interface SourcessourceConfig - the source configuration objectpublic void createSourceWithUrl(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String pkgUrl)
throws PulsarAdminException
SourcescreateSourceWithUrl in interface SourcessourceConfig - the source configuration objectpkgUrl - url from which pkg can be downloadedPulsarAdminExceptionpublic CompletableFuture<Void> createSourceWithUrlAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig, String pkgUrl)
SourcescreateSourceWithUrlAsync in interface SourcessourceConfig - the source configuration objectpkgUrl - url from which pkg can be downloadedpublic void deleteSource(String cluster, String namespace, String function) throws PulsarAdminException
SourcesdeleteSource in interface Sourcescluster - Tenant namenamespace - Namespace namefunction - Source namePulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Cluster does not existPulsarAdminException.PreconditionFailedException - Cluster is not emptyPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> deleteSourceAsync(String tenant, String namespace, String function)
SourcesdeleteSourceAsync in interface Sourcestenant - Tenant namenamespace - Namespace namefunction - Source namepublic void updateSource(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String fileName,
org.apache.pulsar.common.functions.UpdateOptions updateOptions)
throws PulsarAdminException
SourcesupdateSource in interface SourcessourceConfig - the source configuration objectupdateOptions - options for the update operationsPulsarAdminException.NotAuthorizedException - You don't have admin permission to create the clusterPulsarAdminException.NotFoundException - Cluster doesn't existPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> updateSourceAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig, String fileName, org.apache.pulsar.common.functions.UpdateOptions updateOptions)
SourcesupdateSourceAsync in interface SourcessourceConfig - the source configuration objectupdateOptions - options for the update operationspublic void updateSource(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String fileName)
throws PulsarAdminException
SourcesupdateSource in interface SourcessourceConfig - the source configuration objectPulsarAdminException.NotAuthorizedException - You don't have admin permission to create the clusterPulsarAdminException.NotFoundException - Cluster doesn't existPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> updateSourceAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig, String fileName)
SourcesupdateSourceAsync in interface SourcessourceConfig - the source configuration objectpublic void updateSourceWithUrl(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String pkgUrl,
org.apache.pulsar.common.functions.UpdateOptions updateOptions)
throws PulsarAdminException
SourcesupdateSourceWithUrl in interface SourcessourceConfig - the source configuration objectpkgUrl - url from which pkg can be downloadedupdateOptions - options for the update operationsPulsarAdminException.NotAuthorizedException - You don't have admin permission to create the clusterPulsarAdminException.NotFoundException - Cluster doesn't existPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> updateSourceWithUrlAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig, String pkgUrl, org.apache.pulsar.common.functions.UpdateOptions updateOptions)
SourcesupdateSourceWithUrlAsync in interface SourcessourceConfig - the source configuration objectpkgUrl - url from which pkg can be downloadedupdateOptions - options for the update operationspublic void updateSourceWithUrl(org.apache.pulsar.common.io.SourceConfig sourceConfig,
String pkgUrl)
throws PulsarAdminException
SourcesupdateSourceWithUrl in interface SourcessourceConfig - the source configuration objectpkgUrl - url from which pkg can be downloadedPulsarAdminException.NotAuthorizedException - You don't have admin permission to create the clusterPulsarAdminException.NotFoundException - Cluster doesn't existPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> updateSourceWithUrlAsync(org.apache.pulsar.common.io.SourceConfig sourceConfig, String pkgUrl)
SourcesupdateSourceWithUrlAsync in interface SourcessourceConfig - the source configuration objectpkgUrl - url from which pkg can be downloadedpublic void restartSource(String tenant, String namespace, String functionName, int instanceId) throws PulsarAdminException
SourcesrestartSource in interface Sourcestenant - Tenant namenamespace - Namespace namefunctionName - Source nameinstanceId - Source instanceIdPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> restartSourceAsync(String tenant, String namespace, String functionName, int instanceId)
SourcesrestartSourceAsync in interface Sourcestenant - Tenant namenamespace - Namespace namefunctionName - Source nameinstanceId - Source instanceIdpublic void restartSource(String tenant, String namespace, String functionName) throws PulsarAdminException
SourcesrestartSource in interface Sourcestenant - Tenant namenamespace - Namespace namefunctionName - Source namePulsarAdminException - Unexpected errorpublic CompletableFuture<Void> restartSourceAsync(String tenant, String namespace, String functionName)
SourcesrestartSourceAsync in interface Sourcestenant - Tenant namenamespace - Namespace namefunctionName - Source namepublic void stopSource(String tenant, String namespace, String sourceName, int instanceId) throws PulsarAdminException
SourcesstopSource in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source nameinstanceId - Source instanceIdPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> stopSourceAsync(String tenant, String namespace, String sourceName, int instanceId)
SourcesstopSourceAsync in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source nameinstanceId - Source instanceIdpublic void stopSource(String tenant, String namespace, String sourceName) throws PulsarAdminException
SourcesstopSource in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source namePulsarAdminException - Unexpected errorpublic CompletableFuture<Void> stopSourceAsync(String tenant, String namespace, String sourceName)
SourcesstopSourceAsync in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source namepublic void startSource(String tenant, String namespace, String sourceName, int instanceId) throws PulsarAdminException
SourcesstartSource in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source nameinstanceId - Source instanceIdPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> startSourceAsync(String tenant, String namespace, String sourceName, int instanceId)
SourcesstartSourceAsync in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source nameinstanceId - Source instanceIdpublic void startSource(String tenant, String namespace, String sourceName) throws PulsarAdminException
SourcesstartSource in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source namePulsarAdminException - Unexpected errorpublic CompletableFuture<Void> startSourceAsync(String tenant, String namespace, String sourceName)
SourcesstartSourceAsync in interface Sourcestenant - Tenant namenamespace - Namespace namesourceName - Source namepublic List<org.apache.pulsar.common.io.ConnectorDefinition> getBuiltInSources() throws PulsarAdminException
SourcesgetBuiltInSources in interface SourcesPulsarAdminException - Unexpected errorpublic CompletableFuture<List<org.apache.pulsar.common.io.ConnectorDefinition>> getBuiltInSourcesAsync()
SourcesgetBuiltInSourcesAsync in interface Sourcespublic void reloadBuiltInSources()
throws PulsarAdminException
SourcesreloadBuiltInSources in interface SourcesPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> reloadBuiltInSourcesAsync()
SourcesreloadBuiltInSourcesAsync in interface SourcesCopyright © 2017–2021 Apache Software Foundation. All rights reserved.