...
org.apache.seatunnel.api.sink.SupportSaveMode
SupportSaveMode is an interface that Sink needs to implement if the SaveMode function is to be implemented. The interface defines an interface to obtain the saveMode actuator
Code Block |
---|
|
package org.apache.seatunnel.api.sink; |
...
/** The Sink Connectors which support schema and data SaveMode should implement this interface */ |
...
public interface SupportSaveMode { |
...
String DATA_SAVE_MODE_KEY = "data_save_mode"; |
...
String SCHEMA_SAVE_MODE_KEY = "schema_save_mode"; |
...
// This method defines the return of a specific save_mode handler |
...
SaveModeHandler getSaveModeHandler(); |
...
saveMode includes table structure saveMode and existing data saveMode. The different processing methods of respectively by two enumeration said org.apache.seatunnel.api.sink.SchemaSaveMode and org.apache.seatunnel.api.sink.DataSaveMode
Code Block |
---|
|
package org.apache.seatunnel.api.sink; |
...
public enum SchemaSaveMode { |
...
// Will create when the table does not exist, delete and rebuild when the table is saved |
...
...
// Will Created when the table does not exist, skipped when the table is saved |
...
CREATE_SCHEMA_WHEN_NOT_EXIST, |
...
// Error will be reported when the table does not exist |
...
ERROR_WHEN_SCHEMA_NOT_EXIST, |
...
Code Block |
---|
|
package org.apache.seatunnel.api.sink; |
...
...
* The SaveMode for the Sink connectors that use table or other table structures to organize data |
...
...
public enum DataSaveMode { |
...
// Preserve database structure and delete data |
...
...
// Preserve database structure, preserve data |
...
...
// User defined processing |
...
...
// When there is data, an error is reported |
...
...
org.apache.seatunnel.api.sink.SaveModeHandler
SaveModeHandler is an executor that executes saveMode functions. This interface is used to implement the specific logic of saveMode functions.
...