@Override protected Map<String, String> toConnectorProperties() { final DescriptorProperties properties = new DescriptorProperties(); properties.putProperties(internalProperties); final List<List<String>> hostValues = hosts.stream() .map(host -> Arrays.asList(host.hostname, String.valueOf(host.port), host.protocol)) .collect(Collectors.toList()); properties.putIndexedFixedProperties( CONNECTOR_HOSTS, Arrays.asList(CONNECTOR_HOSTS_HOSTNAME, CONNECTOR_HOSTS_PORT, CONNECTOR_HOSTS_PROTOCOL), hostValues); return properties.asMap(); } }
values.add(Arrays.asList(specificOffset.getKey().toString(), specificOffset.getValue().toString())); properties.putIndexedFixedProperties( CONNECTOR_SPECIFIC_OFFSETS, Arrays.asList(CONNECTOR_SPECIFIC_OFFSETS_PARTITION, CONNECTOR_SPECIFIC_OFFSETS_OFFSET), properties.putIndexedFixedProperties( CONNECTOR_PROPERTIES, Arrays.asList(CONNECTOR_PROPERTIES_KEY, CONNECTOR_PROPERTIES_VALUE),
/** * Adds a table schema under the given key. */ public void putTableSchema(String key, TableSchema schema) { checkNotNull(key); checkNotNull(schema); final String[] fieldNames = schema.getFieldNames(); final TypeInformation<?>[] fieldTypes = schema.getFieldTypes(); final List<List<String>> values = new ArrayList<>(); for (int i = 0; i < schema.getFieldCount(); i++) { values.add(Arrays.asList(fieldNames[i], TypeStringUtils.writeTypeInfo(fieldTypes[i]))); } putIndexedFixedProperties( key, Arrays.asList(TABLE_SCHEMA_NAME, TABLE_SCHEMA_TYPE), values); }
@Override protected Map<String, String> toConnectorProperties() { final DescriptorProperties properties = new DescriptorProperties(); properties.putProperties(internalProperties); final List<List<String>> hostValues = hosts.stream() .map(host -> Arrays.asList(host.hostname, String.valueOf(host.port), host.protocol)) .collect(Collectors.toList()); properties.putIndexedFixedProperties( CONNECTOR_HOSTS, Arrays.asList(CONNECTOR_HOSTS_HOSTNAME, CONNECTOR_HOSTS_PORT, CONNECTOR_HOSTS_PROTOCOL), hostValues); return properties.asMap(); } }
@Override protected Map<String, String> toConnectorProperties() { final DescriptorProperties properties = new DescriptorProperties(); properties.putProperties(internalProperties); final List<List<String>> hostValues = hosts.stream() .map(host -> Arrays.asList(host.hostname, String.valueOf(host.port), host.protocol)) .collect(Collectors.toList()); properties.putIndexedFixedProperties( CONNECTOR_HOSTS, Arrays.asList(CONNECTOR_HOSTS_HOSTNAME, CONNECTOR_HOSTS_PORT, CONNECTOR_HOSTS_PROTOCOL), hostValues); return properties.asMap(); } }
values.add(Arrays.asList(specificOffset.getKey().toString(), specificOffset.getValue().toString())); properties.putIndexedFixedProperties( CONNECTOR_SPECIFIC_OFFSETS, Arrays.asList(CONNECTOR_SPECIFIC_OFFSETS_PARTITION, CONNECTOR_SPECIFIC_OFFSETS_OFFSET), properties.putIndexedFixedProperties( CONNECTOR_PROPERTIES, Arrays.asList(CONNECTOR_PROPERTIES_KEY, CONNECTOR_PROPERTIES_VALUE),
values.add(Arrays.asList(specificOffset.getKey().toString(), specificOffset.getValue().toString())); properties.putIndexedFixedProperties( CONNECTOR_SPECIFIC_OFFSETS, Arrays.asList(CONNECTOR_SPECIFIC_OFFSETS_PARTITION, CONNECTOR_SPECIFIC_OFFSETS_OFFSET), properties.putIndexedFixedProperties( CONNECTOR_PROPERTIES, Arrays.asList(CONNECTOR_PROPERTIES_KEY, CONNECTOR_PROPERTIES_VALUE),
/** * Adds a table schema under the given key. */ public void putTableSchema(String key, TableSchema schema) { checkNotNull(key); checkNotNull(schema); final String[] fieldNames = schema.getFieldNames(); final InternalType[] fieldTypes = schema.getFieldTypes(); final List<List<String>> values = new ArrayList<>(); for (int i = 0; i < schema.getFieldCount(); i++) { values.add(Arrays.asList(fieldNames[i], TypeStringUtils.writeDataType(fieldTypes[i]))); } putIndexedFixedProperties( key, Arrays.asList(TABLE_SCHEMA_NAME, TABLE_SCHEMA_TYPE), values); }
/** * Adds a table schema under the given key. */ public void putTableSchema(String key, TableSchema schema) { checkNotNull(key); checkNotNull(schema); final String[] fieldNames = schema.getFieldNames(); final TypeInformation<?>[] fieldTypes = schema.getFieldTypes(); final List<List<String>> values = new ArrayList<>(); for (int i = 0; i < schema.getFieldCount(); i++) { values.add(Arrays.asList(fieldNames[i], TypeStringUtils.writeTypeInfo(fieldTypes[i]))); } putIndexedFixedProperties( key, Arrays.asList(TABLE_SCHEMA_NAME, TABLE_SCHEMA_TYPE), values); }