private void validateKafkaProperties(DescriptorProperties properties) { final Map<String, Consumer<String>> propertyValidators = new HashMap<>(); propertyValidators.put( CONNECTOR_PROPERTIES_KEY, key -> properties.validateString(key, false, 1)); propertyValidators.put( CONNECTOR_PROPERTIES_VALUE, key -> properties.validateString(key, false, 0)); properties.validateFixedIndexedProperties(CONNECTOR_PROPERTIES, true, propertyValidators); }
private void validateHosts(DescriptorProperties properties) { final Map<String, Consumer<String>> hostsValidators = new HashMap<>(); hostsValidators.put(CONNECTOR_HOSTS_HOSTNAME, (key) -> properties.validateString(key, false, 1)); hostsValidators.put(CONNECTOR_HOSTS_PORT, (key) -> properties.validateInt(key, false, 0, 65535)); hostsValidators.put(CONNECTOR_HOSTS_PROTOCOL, (key) -> properties.validateString(key, false, 1)); properties.validateFixedIndexedProperties(CONNECTOR_HOSTS, false, hostsValidators); }
/** * Validates a table schema property. */ public void validateTableSchema(String key, boolean isOptional) { final Consumer<String> nameValidation = (name) -> validateString(name, false, 1); final Consumer<String> typeValidation = (name) -> validateType(name, false, false); final Map<String, Consumer<String>> subKeys = new HashMap<>(); subKeys.put(TABLE_SCHEMA_NAME, nameValidation); subKeys.put(TABLE_SCHEMA_TYPE, typeValidation); validateFixedIndexedProperties( key, isOptional, subKeys ); }
private void validateStartupMode(DescriptorProperties properties) { final Map<String, Consumer<String>> specificOffsetValidators = new HashMap<>(); specificOffsetValidators.put( CONNECTOR_SPECIFIC_OFFSETS_PARTITION, (key) -> properties.validateInt( key, false, 0, Integer.MAX_VALUE)); specificOffsetValidators.put( CONNECTOR_SPECIFIC_OFFSETS_OFFSET, (key) -> properties.validateLong( key, false, 0, Long.MAX_VALUE)); final Map<String, Consumer<String>> startupModeValidation = new HashMap<>(); startupModeValidation.put(CONNECTOR_STARTUP_MODE_VALUE_GROUP_OFFSETS, noValidation()); startupModeValidation.put(CONNECTOR_STARTUP_MODE_VALUE_EARLIEST, noValidation()); startupModeValidation.put(CONNECTOR_STARTUP_MODE_VALUE_LATEST, noValidation()); startupModeValidation.put( CONNECTOR_STARTUP_MODE_VALUE_SPECIFIC_OFFSETS, key -> properties.validateFixedIndexedProperties(CONNECTOR_SPECIFIC_OFFSETS, false, specificOffsetValidators)); properties.validateEnum(CONNECTOR_STARTUP_MODE, true, startupModeValidation); }
private void validateKafkaProperties(DescriptorProperties properties) { final Map<String, Consumer<String>> propertyValidators = new HashMap<>(); propertyValidators.put( CONNECTOR_PROPERTIES_KEY, key -> properties.validateString(key, false, 1)); propertyValidators.put( CONNECTOR_PROPERTIES_VALUE, key -> properties.validateString(key, false, 0)); properties.validateFixedIndexedProperties(CONNECTOR_PROPERTIES, true, propertyValidators); }
private void validateKafkaProperties(DescriptorProperties properties) { final Map<String, Consumer<String>> propertyValidators = new HashMap<>(); propertyValidators.put( CONNECTOR_PROPERTIES_KEY, key -> properties.validateString(key, false, 1)); propertyValidators.put( CONNECTOR_PROPERTIES_VALUE, key -> properties.validateString(key, false, 0)); properties.validateFixedIndexedProperties(CONNECTOR_PROPERTIES, true, propertyValidators); }
/** * Validates a table schema property. */ public void validateTableSchema(String key, boolean isOptional) { final Consumer<String> nameValidation = (name) -> validateString(name, false, 1); final Consumer<String> typeValidation = (name) -> validateType(name, false, false); final Map<String, Consumer<String>> subKeys = new HashMap<>(); subKeys.put(TABLE_SCHEMA_NAME, nameValidation); subKeys.put(TABLE_SCHEMA_TYPE, typeValidation); validateFixedIndexedProperties( key, isOptional, subKeys ); }
private void validateHosts(DescriptorProperties properties) { final Map<String, Consumer<String>> hostsValidators = new HashMap<>(); hostsValidators.put(CONNECTOR_HOSTS_HOSTNAME, (key) -> properties.validateString(key, false, 1)); hostsValidators.put(CONNECTOR_HOSTS_PORT, (key) -> properties.validateInt(key, false, 0, 65535)); hostsValidators.put(CONNECTOR_HOSTS_PROTOCOL, (key) -> properties.validateString(key, false, 1)); properties.validateFixedIndexedProperties(CONNECTOR_HOSTS, false, hostsValidators); }
private void validateHosts(DescriptorProperties properties) { final Map<String, Consumer<String>> hostsValidators = new HashMap<>(); hostsValidators.put( CONNECTOR_HOSTS_HOSTNAME, (key) -> properties.validateString(key, false, 1)); hostsValidators.put( CONNECTOR_HOSTS_PORT, (key) -> properties.validateInt(key, false, 0, 65535)); hostsValidators.put(CONNECTOR_HOSTS_PROTOCOL, (key) -> properties.validateString(key, false, 1)); properties.validateFixedIndexedProperties(CONNECTOR_HOSTS, false, hostsValidators); }
/** * Validates a table schema property. */ public void validateTableSchema(String key, boolean isOptional) { final Consumer<String> nameValidation = (name) -> validateString(name, false, 1); final Consumer<String> typeValidation = (name) -> validateType(name, false, false); final Map<String, Consumer<String>> subKeys = new HashMap<>(); subKeys.put(TABLE_SCHEMA_NAME, nameValidation); subKeys.put(TABLE_SCHEMA_TYPE, typeValidation); validateFixedIndexedProperties( key, isOptional, subKeys ); }
private void validateStartupMode(DescriptorProperties properties) { final Map<String, Consumer<String>> specificOffsetValidators = new HashMap<>(); specificOffsetValidators.put( CONNECTOR_SPECIFIC_OFFSETS_PARTITION, (key) -> properties.validateInt( key, false, 0, Integer.MAX_VALUE)); specificOffsetValidators.put( CONNECTOR_SPECIFIC_OFFSETS_OFFSET, (key) -> properties.validateLong( key, false, 0, Long.MAX_VALUE)); final Map<String, Consumer<String>> startupModeValidation = new HashMap<>(); startupModeValidation.put(CONNECTOR_STARTUP_MODE_VALUE_GROUP_OFFSETS, noValidation()); startupModeValidation.put(CONNECTOR_STARTUP_MODE_VALUE_EARLIEST, noValidation()); startupModeValidation.put(CONNECTOR_STARTUP_MODE_VALUE_LATEST, noValidation()); startupModeValidation.put( CONNECTOR_STARTUP_MODE_VALUE_SPECIFIC_OFFSETS, key -> properties.validateFixedIndexedProperties(CONNECTOR_SPECIFIC_OFFSETS, false, specificOffsetValidators)); properties.validateEnum(CONNECTOR_STARTUP_MODE, true, startupModeValidation); }
private void validateStartupMode(DescriptorProperties properties) { final Map<String, Consumer<String>> specificOffsetValidators = new HashMap<>(); specificOffsetValidators.put( CONNECTOR_SPECIFIC_OFFSETS_PARTITION, (key) -> properties.validateInt( key, false, 0, Integer.MAX_VALUE)); specificOffsetValidators.put( CONNECTOR_SPECIFIC_OFFSETS_OFFSET, (key) -> properties.validateLong( key, false, 0, Long.MAX_VALUE)); final Map<String, Consumer<String>> startupModeValidation = new HashMap<>(); startupModeValidation.put(CONNECTOR_STARTUP_MODE_VALUE_GROUP_OFFSETS, noValidation()); startupModeValidation.put(CONNECTOR_STARTUP_MODE_VALUE_EARLIEST, noValidation()); startupModeValidation.put(CONNECTOR_STARTUP_MODE_VALUE_LATEST, noValidation()); startupModeValidation.put( CONNECTOR_STARTUP_MODE_VALUE_SPECIFIC_OFFSETS, key -> properties.validateFixedIndexedProperties(CONNECTOR_SPECIFIC_OFFSETS, false, specificOffsetValidators)); properties.validateEnum(CONNECTOR_STARTUP_MODE, true, startupModeValidation); }