Skip to content

Commit a7d3327

Browse files
Merge branch '15.0.x' into master
2 parents d394475 + 48822a4 commit a7d3327

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/main/java/io/confluent/connect/elasticsearch/ElasticsearchSinkConnectorConfig.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,14 @@ public class ElasticsearchSinkConnectorConfig extends AbstractConfig {
434434
private static final String TOPIC_TO_EXTERNAL_RESOURCE_MAPPING_DEFAULT = "";
435435

436436
// Error message constants for topic-to-resource mapping validation
437-
public static final String INVALID_MAPPING_FORMAT_ERROR =
437+
public static final String INVALID_MAPPING_FORMAT_ERROR =
438438
"Invalid topic-to-resource mapping format. Expected format: topic:resource";
439-
439+
440440
public static final String DUPLICATE_TOPIC_MAPPING_ERROR_FORMAT =
441441
"Topic '%s' is mapped to multiple resources. "
442442
+ "Each topic must be mapped to exactly one resource.";
443-
444-
public static final String DUPLICATE_RESOURCE_MAPPING_ERROR_FORMAT =
443+
444+
public static final String DUPLICATE_RESOURCE_MAPPING_ERROR_FORMAT =
445445
"Resource '%s' is mapped from multiple topics. "
446446
+ "Each resource must be mapped to exactly one topic.";
447447

@@ -985,7 +985,7 @@ public Map<String, String> getTopicToExternalResourceMap() {
985985
List<String> mappings = topicToExternalResourceMapping();
986986
Map<String, String> topicToExternalResourceMap = new HashMap<>();
987987
Set<String> seenResources = new HashSet<>();
988-
988+
989989
for (String mapping : mappings) {
990990
String[] parts = mapping.split(":");
991991
if (parts.length != 2) {
@@ -1034,7 +1034,7 @@ public boolean isBasicProxyConfigured() {
10341034
/**
10351035
* Determines if data streams are being used. Checks the external
10361036
* resource usage approach first, then falls back to legacy data stream configs.
1037-
*
1037+
*
10381038
* @return true if data streams are configured, false otherwise
10391039
*/
10401040
public boolean isDataStream() {
@@ -1266,7 +1266,7 @@ public ExternalResourceUsage externalResourceUsage() {
12661266

12671267
/**
12681268
* Checks if external resource usage is enabled.
1269-
*
1269+
*
12701270
* @return true if external resource usage is configured, false if DISABLED
12711271
*/
12721272
public boolean isExternalResourceUsageEnabled() {

src/main/java/io/confluent/connect/elasticsearch/ElasticsearchSinkTaskConfig.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class ElasticsearchSinkTaskConfig extends ElasticsearchSinkConnectorConfi
2626
public static final String TASK_ID_CONFIG = "taskId";
2727
private static final ConfigDef.Type TASK_ID_TYPE = ConfigDef.Type.INT;
2828
public static final ConfigDef.Importance TASK_ID_IMPORTANCE = ConfigDef.Importance.LOW;
29+
public static final int TASK_ID_DEFAULT = 0;
2930

3031
/**
3132
* Return a ConfigDef object used to define this config's fields.
@@ -37,7 +38,7 @@ public static ConfigDef config() {
3738
.defineInternal(
3839
TASK_ID_CONFIG,
3940
TASK_ID_TYPE,
40-
ConfigDef.NO_DEFAULT_VALUE,
41+
TASK_ID_DEFAULT,
4142
TASK_ID_IMPORTANCE
4243
);
4344
}
@@ -47,7 +48,7 @@ public static ConfigDef config() {
4748
*/
4849
public ElasticsearchSinkTaskConfig(Map<String, String> properties) {
4950
super(config(), properties);
50-
taskId = getInt(TASK_ID_CONFIG);
51+
taskId = properties.containsKey(TASK_ID_CONFIG) ? getInt(TASK_ID_CONFIG) : 0;
5152
connectorName = originalsStrings().get("name");
5253
}
5354

0 commit comments

Comments
 (0)