use of org.apache.kafka.common.config.AbstractConfig in project kafka-connect-storage-cloud by confluentinc.
the class AwsAssumeRoleCredentialsProvider method configure.
@Override
public void configure(Map<String, ?> configs) {
AbstractConfig config = new AbstractConfig(STS_CONFIG_DEF, configs);
roleArn = config.getString(ROLE_ARN_CONFIG);
roleExternalId = config.getString(ROLE_EXTERNAL_ID_CONFIG);
roleSessionName = config.getString(ROLE_SESSION_NAME_CONFIG);
}
use of org.apache.kafka.common.config.AbstractConfig in project kafka-connect-hdfs by confluentinc.
the class HdfsSinkConnectorConfig method plainValues.
public Map<String, ?> plainValues() {
Map<String, Object> map = new HashMap<>();
for (AbstractConfig config : allConfigs) {
map.putAll(config.values());
}
// Include any additional properties not defined by the ConfigDef
// that custom partitioners might need
Map<String, ?> originals = originals();
for (String originalKey : originals.keySet()) {
if (!map.containsKey(originalKey)) {
map.put(originalKey, originals.get(originalKey));
}
}
return map;
}
use of org.apache.kafka.common.config.AbstractConfig in project kafka by apache.
the class StreamsKafkaClientTest method testConfigFromStreamsConfig.
@Test
public void testConfigFromStreamsConfig() {
for (final String expectedMechanism : asList("PLAIN", "SCRAM-SHA-512")) {
final Properties props = new Properties();
props.setProperty(StreamsConfig.APPLICATION_ID_CONFIG, "some_app_id");
props.setProperty(SaslConfigs.SASL_MECHANISM, expectedMechanism);
props.setProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9000");
final StreamsConfig streamsConfig = new StreamsConfig(props);
final AbstractConfig config = StreamsKafkaClient.Config.fromStreamsConfig(streamsConfig);
assertEquals(expectedMechanism, config.values().get(SaslConfigs.SASL_MECHANISM));
assertEquals(expectedMechanism, config.getString(SaslConfigs.SASL_MECHANISM));
}
}
use of org.apache.kafka.common.config.AbstractConfig in project apache-kafka-on-k8s by banzaicloud.
the class FileStreamSinkConnector method start.
@Override
public void start(Map<String, String> props) {
AbstractConfig parsedConfig = new AbstractConfig(CONFIG_DEF, props);
filename = parsedConfig.getString(FILE_CONFIG);
}
use of org.apache.kafka.common.config.AbstractConfig in project apache-kafka-on-k8s by banzaicloud.
the class FileStreamSourceConnector method start.
@Override
public void start(Map<String, String> props) {
AbstractConfig parsedConfig = new AbstractConfig(CONFIG_DEF, props);
filename = parsedConfig.getString(FILE_CONFIG);
List<String> topics = parsedConfig.getList(TOPIC_CONFIG);
if (topics.size() != 1) {
throw new ConfigException("'topic' in FileStreamSourceConnector configuration requires definition of a single topic");
}
topic = topics.get(0);
batchSize = parsedConfig.getInt(TASK_BATCH_SIZE_CONFIG);
}
Aggregations