@Test public void testSnapshotMode() { String mode = "initial"; assertEquals(CassandraConnectorConfig.SnapshotMode.INITIAL, CassandraConnectorConfig.SnapshotMode.fromText(mode).get()); mode = "INITIAL"; assertEquals(CassandraConnectorConfig.SnapshotMode.INITIAL, CassandraConnectorConfig.SnapshotMode.fromText(mode).get()); mode = "Initial"; assertEquals(CassandraConnectorConfig.SnapshotMode.INITIAL, CassandraConnectorConfig.SnapshotMode.fromText(mode).get()); mode = "always"; assertEquals(CassandraConnectorConfig.SnapshotMode.ALWAYS, CassandraConnectorConfig.SnapshotMode.fromText(mode).get()); mode = "never"; assertEquals(CassandraConnectorConfig.SnapshotMode.NEVER, CassandraConnectorConfig.SnapshotMode.fromText(mode).get()); mode = null; assertFalse(CassandraConnectorConfig.SnapshotMode.fromText(mode).isPresent()); mode = ""; assertFalse(CassandraConnectorConfig.SnapshotMode.fromText(mode).isPresent()); mode = "invalid"; assertFalse(CassandraConnectorConfig.SnapshotMode.fromText(mode).isPresent()); }
public SnapshotMode snapshotMode() { String mode = this.getConfig().getString(SNAPSHOT_MODE); Optional<SnapshotMode> snapshotModeOpt = SnapshotMode.fromText(mode); return snapshotModeOpt.orElseThrow(() -> new CassandraConnectorConfigException(mode + " is not a valid SnapshotMode")); }
CassandraConnectorConfig extends CommonConnectorConfig { public SnapshotMode snapshotMode() { String mode = this.getConfig().getString(SNAPSHOT_MODE); Optional<SnapshotMode> snapshotModeOpt = SnapshotMode.fromText(mode); return snapshotModeOpt.orElseThrow(() -> new CassandraConnectorConfigException(mode + " is not a valid SnapshotMode")); } }
CassandraConnectorConfig extends CommonConnectorConfig { public SnapshotMode snapshotMode() { String mode = this.getConfig().getString(SNAPSHOT_MODE); Optional<SnapshotMode> snapshotModeOpt = SnapshotMode.fromText(mode); return snapshotModeOpt.orElseThrow(() -> new CassandraConnectorConfigException(mode + " is not a valid SnapshotMode")); } CassandraConnectorConfig(Configuration config); }
CassandraConnectorConfig extends CommonConnectorConfig { public SnapshotMode snapshotMode() { String mode = this.getConfig().getString(SNAPSHOT_MODE); Optional<SnapshotMode> snapshotModeOpt = SnapshotMode.fromText(mode); return snapshotModeOpt.orElseThrow(() -> new CassandraConnectorConfigException(mode + " is not a valid SnapshotMode")); } CassandraConnectorConfig(Configuration config); String connectorName(); String kafkaTopicPrefix(); Properties getKafkaConfigs(); Properties commitLogTransferConfigs(); boolean latestCommitLogOnly(); SnapshotMode snapshotMode(); ConsistencyLevel snapshotConsistencyLevel(); int httpPort(); String cassandraConfig(); String[] cassandraHosts(); int cassandraPort(); boolean cassandraSslEnabled(); String cassandraSslConfigPath(); String cassandraUsername(); String cassandraPassword(); String commitLogRelocationDir(); boolean postProcessEnabled(); boolean errorCommitLogReprocessEnabled(); CommitLogTransfer getCommitLogTransfer(); String offsetBackingStoreDir(); Duration offsetFlushIntervalMs(); long maxOffsetFlushSize(); int maxQueueSize(); int maxBatchSize(); Duration pollIntervalMs(); Duration schemaPollIntervalMs(); Duration cdcDirPollIntervalMs(); Duration snapshotPollIntervalMs(); List<String> fieldExcludeList(); boolean tombstonesOnDelete(); Converter getKeyConverter(); Converter getValueConverter(); @Override String toString(); @Override String getContextName(); @Override String getConnectorName(); }
CassandraConnectorConfig extends CommonConnectorConfig { public SnapshotMode snapshotMode() { String mode = this.getConfig().getString(SNAPSHOT_MODE); Optional<SnapshotMode> snapshotModeOpt = SnapshotMode.fromText(mode); return snapshotModeOpt.orElseThrow(() -> new CassandraConnectorConfigException(mode + " is not a valid SnapshotMode")); } CassandraConnectorConfig(Configuration config); String connectorName(); String kafkaTopicPrefix(); Properties getKafkaConfigs(); Properties commitLogTransferConfigs(); boolean latestCommitLogOnly(); SnapshotMode snapshotMode(); ConsistencyLevel snapshotConsistencyLevel(); int httpPort(); String cassandraConfig(); String[] cassandraHosts(); int cassandraPort(); boolean cassandraSslEnabled(); String cassandraSslConfigPath(); String cassandraUsername(); String cassandraPassword(); String commitLogRelocationDir(); boolean postProcessEnabled(); boolean errorCommitLogReprocessEnabled(); CommitLogTransfer getCommitLogTransfer(); String offsetBackingStoreDir(); Duration offsetFlushIntervalMs(); long maxOffsetFlushSize(); int maxQueueSize(); int maxBatchSize(); Duration pollIntervalMs(); Duration schemaPollIntervalMs(); Duration cdcDirPollIntervalMs(); Duration snapshotPollIntervalMs(); List<String> fieldExcludeList(); boolean tombstonesOnDelete(); Converter getKeyConverter(); Converter getValueConverter(); @Override String toString(); @Override String getContextName(); @Override String getConnectorName(); static final String KAFKA_PRODUCER_CONFIG_PREFIX; static final String KEY_CONVERTER_PREFIX; static final String VALUE_CONVERTER_PREFIX; static final String COMMIT_LOG_TRANSFER_CONFIG_PREFIX; static final Field CONNECTOR_NAME; static final Field KAFKA_TOPIC_PREFIX; static final Field KEY_CONVERTER_CLASS_CONFIG; static final Field VALUE_CONVERTER_CLASS_CONFIG; static final String DEFAULT_SNAPSHOT_MODE; static final Field SNAPSHOT_MODE; static final String DEFAULT_SNAPSHOT_CONSISTENCY; static final Field SNAPSHOT_CONSISTENCY; static final int DEFAULT_HTTP_PORT; static final Field HTTP_PORT; static final Field CASSANDRA_CONFIG; static final String DEFAULT_CASSANDRA_HOST; static final Field CASSANDRA_HOSTS; static final int DEFAULT_CASSANDRA_PORT; static final Field CASSANDRA_PORT; static final Field CASSANDRA_USERNAME; static final Field CASSANDRA_PASSWORD; static final boolean DEFAULT_CASSANDRA_SSL_ENABLED; static final Field CASSANDRA_SSL_ENABLED; static final Field CASSANDRA_SSL_CONFIG_PATH; static final Field COMMIT_LOG_RELOCATION_DIR; static final boolean DEFAULT_COMMIT_LOG_POST_PROCESSING_ENABLED; static final Field COMMIT_LOG_POST_PROCESSING_ENABLED; static final boolean DEFAULT_COMMIT_LOG_ERROR_REPROCESSING_ENABLED; static final Field COMMIT_LOG_ERROR_REPROCESSING_ENABLED; static final String DEFAULT_COMMIT_LOG_TRANSFER_CLASS; static final Field COMMIT_LOG_TRANSFER_CLASS; static final Field OFFSET_BACKING_STORE_DIR; static final int DEFAULT_OFFSET_FLUSH_INTERVAL_MS; static final Field OFFSET_FLUSH_INTERVAL_MS; static final int DEFAULT_MAX_OFFSET_FLUSH_SIZE; static final Field MAX_OFFSET_FLUSH_SIZE; static final int DEFAULT_SCHEMA_POLL_INTERVAL_MS; static final Field SCHEMA_POLL_INTERVAL_MS; static final int DEFAULT_CDC_DIR_POLL_INTERVAL_MS; static final Field CDC_DIR_POLL_INTERVAL_MS; static final int DEFAULT_SNAPSHOT_POLL_INTERVAL_MS; static final Field SNAPSHOT_POLL_INTERVAL_MS; static final Field FIELD_EXCLUDE_LIST; @Deprecated
    static final Field FIELD_BLACKLIST; static final boolean DEFAULT_LATEST_COMMIT_LOG_ONLY; static final Field LATEST_COMMIT_LOG_ONLY; static final int DEFAULT_POLL_INTERVAL_MS; static final boolean DEFAULT_TOMBSTONES_ON_DELETE; }