Skip to content

Commit

Permalink
removed new config from kafka connector
Browse files Browse the repository at this point in the history
  • Loading branch information
adkharat committed Dec 17, 2024
1 parent 87c8bbb commit fa4820a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,13 @@
package com.facebook.presto.kafka;

import com.facebook.airlift.configuration.Config;
import com.facebook.airlift.configuration.ConfigDescription;
import com.facebook.presto.kafka.schema.file.FileTableDescriptionSupplier;
import com.facebook.presto.kafka.server.file.FileKafkaClusterMetadataSupplier;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
import io.airlift.units.Duration;
import io.airlift.units.MinDuration;

import javax.validation.constraints.NotNull;

import java.io.File;
import java.util.List;

import static com.google.common.collect.ImmutableList.toImmutableList;

public class KafkaConnectorConfig
{
/**
Expand Down Expand Up @@ -66,8 +58,6 @@ public class KafkaConnectorConfig
*/
private String clusterMetadataSupplier = FileKafkaClusterMetadataSupplier.NAME;

private List<File> resourceConfigFiles = ImmutableList.of();

@NotNull
public String getDefaultSchema()
{
Expand Down Expand Up @@ -155,20 +145,4 @@ public KafkaConnectorConfig setHideInternalColumns(boolean hideInternalColumns)
this.hideInternalColumns = hideInternalColumns;
return this;
}

@NotNull
public List<File> getResourceConfigFiles()
{
return resourceConfigFiles;
}

@Config("kafka.config.resources")
@ConfigDescription("Optional config files")
public KafkaConnectorConfig setResourceConfigFiles(String files)
{
this.resourceConfigFiles = Splitter.on(',').trimResults().omitEmptyStrings().splitToList(files).stream()
.map(File::new)
.collect(toImmutableList());
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public void testDefaults()
.setTableDescriptionSupplier(FileTableDescriptionSupplier.NAME)
.setHideInternalColumns(true)
.setMaxPartitionFetchBytes(1048576)
.setMaxPollRecords(500)
.setResourceConfigFiles(""));
.setMaxPollRecords(500));
}

@Test
Expand All @@ -47,7 +46,6 @@ public void testExplicitPropertyMappings()
.put("kafka.hide-internal-columns", "false")
.put("kafka.max-partition-fetch-bytes", "1024")
.put("kafka.max-poll-records", "1000")
.put("kafka.config.resources", "test-config.file")
.build();

KafkaConnectorConfig expected = new KafkaConnectorConfig()
Expand All @@ -57,8 +55,7 @@ public void testExplicitPropertyMappings()
.setKafkaConnectTimeout("1h")
.setHideInternalColumns(false)
.setMaxPartitionFetchBytes(1024)
.setMaxPollRecords(1000)
.setResourceConfigFiles("test-config.file");
.setMaxPollRecords(1000);

ConfigAssertions.assertFullMapping(properties, expected);
}
Expand Down

0 comments on commit fa4820a

Please sign in to comment.