Record Class PulsarSink
java.lang.Object
java.lang.Record
org.springframework.pulsar.function.PulsarSink
- Record Components:
config
- the sink detailsstopPolicy
- the action to take on the sink when the server is stoppedupdateOptions
- the options to use during an update operation (optional)
- All Implemented Interfaces:
PulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
public record PulsarSink(org.apache.pulsar.common.io.SinkConfig config, PulsarFunctionOperations.FunctionStopPolicy stopPolicy, @Nullable org.apache.pulsar.common.functions.UpdateOptions updateOptions)
extends Record
implements PulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
Represents a Pulsar Sink backed by a
SinkConfig
.- Author:
- Chris Bono
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.pulsar.function.PulsarFunctionOperations
PulsarFunctionOperations.FunctionStopPolicy, PulsarFunctionOperations.FunctionType
-
Field Summary
Fields inherited from interface org.springframework.pulsar.function.PulsarFunctionOperations
logger
-
Constructor Summary
ConstructorDescriptionPulsarSink
(org.apache.pulsar.common.io.SinkConfig config, org.apache.pulsar.common.functions.UpdateOptions updateOptions) PulsarSink
(org.apache.pulsar.common.io.SinkConfig config, PulsarFunctionOperations.FunctionStopPolicy stopPolicy, org.apache.pulsar.common.functions.UpdateOptions updateOptions) Creates an instance of aPulsarSink
record class. -
Method Summary
Modifier and TypeMethodDescriptionarchive()
Gets the url or path to the archive that represents the function.org.apache.pulsar.common.io.SinkConfig
config()
Returns the value of theconfig
record component.void
create
(org.apache.pulsar.client.admin.PulsarAdmin admin) Creates the function using the file-based create api.void
createWithUrl
(org.apache.pulsar.client.admin.PulsarAdmin admin) Creates the function using the url-based create api.void
delete
(org.apache.pulsar.client.admin.PulsarAdmin admin) Deletes the function.final boolean
Indicates whether some other object is "equal to" this one.org.apache.pulsar.common.io.SinkConfig
get
(org.apache.pulsar.client.admin.PulsarAdmin admin) Gets the configuration details for an existing function.final int
hashCode()
Returns a hash code value for this object.name()
Gets the name of the function.void
stop
(org.apache.pulsar.client.admin.PulsarAdmin admin) Stops the function.Returns the value of thestopPolicy
record component.final String
toString()
Returns a string representation of this record class.type()
Gets the type of function the operations handles.void
update
(org.apache.pulsar.client.admin.PulsarAdmin admin) Updates the function using the file-based update api.org.apache.pulsar.common.functions.UpdateOptions
Returns the value of theupdateOptions
record component.void
updateWithUrl
(org.apache.pulsar.client.admin.PulsarAdmin admin) Updates the function using the url-based update api.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.pulsar.function.PulsarFunctionOperations
functionExists, getIfExists
-
Constructor Details
-
PulsarSink
public PulsarSink(org.apache.pulsar.common.io.SinkConfig config, @Nullable org.apache.pulsar.common.functions.UpdateOptions updateOptions) -
PulsarSink
public PulsarSink(org.apache.pulsar.common.io.SinkConfig config, PulsarFunctionOperations.FunctionStopPolicy stopPolicy, @Nullable org.apache.pulsar.common.functions.UpdateOptions updateOptions) Creates an instance of aPulsarSink
record class.- Parameters:
config
- the value for theconfig
record componentstopPolicy
- the value for thestopPolicy
record componentupdateOptions
- the value for theupdateOptions
record component
-
-
Method Details
-
name
Description copied from interface:PulsarFunctionOperations
Gets the name of the function.- Specified by:
name
in interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
- Returns:
- the name of the function
-
type
Description copied from interface:PulsarFunctionOperations
Gets the type of function the operations handles.- Specified by:
type
in interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
- Returns:
- the type of the function
-
archive
Description copied from interface:PulsarFunctionOperations
Gets the url or path to the archive that represents the function.- Specified by:
archive
in interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
- Returns:
- the url or path to the archive that represents function
-
get
public org.apache.pulsar.common.io.SinkConfig get(org.apache.pulsar.client.admin.PulsarAdmin admin) throws org.apache.pulsar.client.admin.PulsarAdminException Description copied from interface:PulsarFunctionOperations
Gets the configuration details for an existing function.- Specified by:
get
in interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
- Parameters:
admin
- the admin client- Returns:
- the current config of the existing function
- Throws:
org.apache.pulsar.client.admin.PulsarAdminException.NotFoundException
- if function does not existorg.apache.pulsar.client.admin.PulsarAdminException
- if anything else goes wrong
-
updateWithUrl
public void updateWithUrl(org.apache.pulsar.client.admin.PulsarAdmin admin) throws org.apache.pulsar.client.admin.PulsarAdminException Description copied from interface:PulsarFunctionOperations
Updates the function using the url-based update api.- Specified by:
updateWithUrl
in interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
- Parameters:
admin
- the admin client- Throws:
org.apache.pulsar.client.admin.PulsarAdminException
- if anything goes wrong
-
update
public void update(org.apache.pulsar.client.admin.PulsarAdmin admin) throws org.apache.pulsar.client.admin.PulsarAdminException Description copied from interface:PulsarFunctionOperations
Updates the function using the file-based update api.- Specified by:
update
in interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
- Parameters:
admin
- the admin client- Throws:
org.apache.pulsar.client.admin.PulsarAdminException
- if anything goes wrong
-
createWithUrl
public void createWithUrl(org.apache.pulsar.client.admin.PulsarAdmin admin) throws org.apache.pulsar.client.admin.PulsarAdminException Description copied from interface:PulsarFunctionOperations
Creates the function using the url-based create api.- Specified by:
createWithUrl
in interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
- Parameters:
admin
- the admin client- Throws:
org.apache.pulsar.client.admin.PulsarAdminException
- if anything goes wrong
-
create
public void create(org.apache.pulsar.client.admin.PulsarAdmin admin) throws org.apache.pulsar.client.admin.PulsarAdminException Description copied from interface:PulsarFunctionOperations
Creates the function using the file-based create api.- Specified by:
create
in interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
- Parameters:
admin
- the admin client- Throws:
org.apache.pulsar.client.admin.PulsarAdminException
- if anything goes wrong
-
stop
public void stop(org.apache.pulsar.client.admin.PulsarAdmin admin) Description copied from interface:PulsarFunctionOperations
Stops the function.- Specified by:
stop
in interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
- Parameters:
admin
- the admin client
-
delete
public void delete(org.apache.pulsar.client.admin.PulsarAdmin admin) Description copied from interface:PulsarFunctionOperations
Deletes the function.- Specified by:
delete
in interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
- Parameters:
admin
- the admin client
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
config
public org.apache.pulsar.common.io.SinkConfig config()Returns the value of theconfig
record component.- Returns:
- the value of the
config
record component
-
stopPolicy
Returns the value of thestopPolicy
record component.- Specified by:
stopPolicy
in interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SinkConfig>
- Returns:
- the value of the
stopPolicy
record component
-
updateOptions
@Nullable public org.apache.pulsar.common.functions.UpdateOptions updateOptions()Returns the value of theupdateOptions
record component.- Returns:
- the value of the
updateOptions
record component
-