Class FileNameFragment
java.lang.Object
io.aiven.kafka.connect.common.config.ConfigFragment
io.aiven.kafka.connect.common.config.FileNameFragment
Fragment to handle all file name extraction operations. Requires
OutputFormatFragment
and (@link
CompressionFragment}-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Setter for the FileNameFragment. -
Field Summary
FieldsFields inherited from class io.aiven.kafka.connect.common.config.ConfigFragment
cfg
-
Constructor Summary
ConstructorsConstructorDescriptionFileNameFragment
(org.apache.kafka.common.config.AbstractConfig cfg) Create an instance of this fragment wrapping the specified config. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the defined compression type.Returns the text of the filename template.Gets the filename template.Gets the timestamp source for the file name.Gets the filename timezoneint
Gets the maximum number of records allowed in a file.static FileNameFragment.Setter
Gets a setter for this properties in this fragment.static org.apache.kafka.common.config.ConfigDef
update
(org.apache.kafka.common.config.ConfigDef configDef) Adds the FileName properties to the configuration definition.static org.apache.kafka.common.config.ConfigDef
update
(org.apache.kafka.common.config.ConfigDef configDef, CompressionType defaultCompressionType) Adds the FileName properties to the configuration definition.void
validate()
Validate that the data in the configuration matches any restrictions.void
validateDistributionType
(DistributionType distributionType) Validate the distribution type works with the file name template.void
Validate that the record grouper works with the fileNameTemplate and the max records per file.Methods inherited from class io.aiven.kafka.connect.common.config.ConfigFragment
has, logDeprecated, logDeprecated, logDeprecated
-
Field Details
-
FILE_COMPRESSION_TYPE_CONFIG
- See Also:
-
FILE_NAME_TEMPLATE_CONFIG
- See Also:
-
FILE_PATH_PREFIX_TEMPLATE_CONFIG
- See Also:
-
-
Constructor Details
-
FileNameFragment
public FileNameFragment(org.apache.kafka.common.config.AbstractConfig cfg) Create an instance of this fragment wrapping the specified config.- Parameters:
cfg
- the configuration to read from.
-
-
Method Details
-
setter
Gets a setter for this properties in this fragment.- Parameters:
data
- the data to update.- Returns:
- the Setter.
-
validateDistributionType
Validate the distribution type works with the file name template.- Parameters:
distributionType
- the distribution type for the validator
-
validateRecordGrouper
public void validateRecordGrouper()Validate that the record grouper works with the fileNameTemplate and the max records per file. -
update
public static org.apache.kafka.common.config.ConfigDef update(org.apache.kafka.common.config.ConfigDef configDef) Adds the FileName properties to the configuration definition.- Parameters:
configDef
- the configuration definition to update.- Returns:
- the updated configuration definition.
-
update
public static org.apache.kafka.common.config.ConfigDef update(org.apache.kafka.common.config.ConfigDef configDef, CompressionType defaultCompressionType) Adds the FileName properties to the configuration definition.- Parameters:
configDef
- the configuration definition to update.defaultCompressionType
- The default compression type. May benull
.- Returns:
- the updated configuration definition.
-
validate
public void validate()Description copied from class:ConfigFragment
Validate that the data in the configuration matches any restrictions. Default implementation does nothing.- Overrides:
validate
in classConfigFragment
-
getFilename
Returns the text of the filename template. May throwConfigException
if the propertyFILE_NAME_TEMPLATE_CONFIG
is not set.- Returns:
- the text of the filename template.
-
getCompressionType
Retrieves the defined compression type.- Returns:
- the defined compression type or
CompressionType.NONE
if there is no defined compression type.
-
getFilenameTemplate
Gets the filename template.- Returns:
- the Filename template.
-
getFilenameTimezone
Gets the filename timezone- Returns:
- The timezone specified for filenames.
-
getFilenameTimestampSource
Gets the timestamp source for the file name.- Returns:
- the timestamp source for the file name.
-
getMaxRecordsPerFile
public int getMaxRecordsPerFile()Gets the maximum number of records allowed in a file.- Returns:
- the maximum number of records allowed in a file.
-
getSourceName
-
getPrefixTemplate
-