Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CONFIGURABLELINK-CONFIGJOB-CONFIG
CONNECTOR

(1)

LINK-CONFIG

MLinkConfigList

(2)

FROM-CONFIG

MFromConfigList

TO-CONFIG

MToConfigList

DRIVERNONE

(1)

DRIVER-CONFIG

MDriverConfigList

 

Requirements

  • Read  the Config Inputs by Type/SubType and By Job /Submission ( since SQOOP-2025 we may be able to have configs by submissionId)
  • Update the Config Inputs by Type/SubType for the latest/last submission in the job. We should not allow editing previous submissions and it should be read only
  • Only the "inputs" with attribute "USER-ONLY" or "ANY" as per SQOOP-1804 will be editable. Make sure to validate the condition of editable and adhere to cascading changes depending on the overrides attribute on each input.
  • Once the input values are edited, the new values will be used in the next job run, unless we maintain history as per SQOOP-2025.

NOTE : Support all the above in both shell command and Rest-API.

 

Non Goals

  • Supporting CD ( create / delete ) of Config Inputs via the REST or command line. It is only allowed via the configurable code and supported annotations on the classes today and it should remain so.
  • Editing submission history 

Design and Implementation Details

Terminology

Configuration : It refers to a class  in sqoop annotated with @ConfigurationClass and represents a grouping of related configs that the corresponding configurable that owns this configuration class exposes

Here is the code example. 

Code Block
@ConfigurationClass
public class FromJobConfiguration {
  @Config public FromJobConfig fromJobConfig;
  @Config public IncrementalExtractConfig incrementalExtractConfig;
  public FromJobConfiguration() {
    fromJobConfig = new FromJobConfig();
    incrementalExtractConfig = new IncrementalExtractConfig();
  }
}

 

Config or ConfigInputs  : They both mean the same in this wiki and are used interchangeably, i.e they represent a class in sqoop that are annotated with the @ConfigClass annotation and used in the @ConfigurationClass annotated class with @Config annotation

Code Block
@ConfigClass
public class IncrementalExtractConfig {
  @Input(size = 50, editable = InputEditable.USER_ONLY)
  public String key;
  // Optional tells the type of the key, if it s long, int, date, timestamp etc
  @Input
  public String dataType;
  @Input(size = 50, editable = InputEditable.USER_ONLY, overrides = "lastReadValue")
  public String value;
  @Input(editable = InputEditable.CONNECTOR_ONLY)
  public long lastReadValue;
}

 

Inputs  : They are represented by the @Input annotation on a variable inside a class annotated with @ConfigClass. 

Code Block
  @Input(size = 50, editable = InputEditable.USER_ONLY, overrides = "lastReadValue")
  public String value;
  @Input(editable = InputEditable.CONNECTOR_ONLY)
  public long lastReadValue;

 

Requirements

  • Configs should be treated as a top level entity as they become more sophisticated with the SQOOP-1804 and in future with the implementation of SQOOP-1643. Currently editing and reading config/ config inputs can only happen via a job or link. This proposal aims at making the config objects as first class citizens, so they can be read and edited by their unique name.
  • Config objects per type are lists. So ability to edit per "CONFIG" is easier than having to edit per "CONFIG LIST". Users do see the names when they list the configs per connector, we can also have a shell command/ rest-API to list all the configs per configurable to make it easier for users to reference configs by name
  • Read  the Config Inputs by Type/SubType and By Job /Submission ( since SQOOP-2025 we may be able to have configs by submissionId)
  • Update the Config Inputs by Type/SubType for the latest/last submission in the job. We should not allow editing previous submissions and it should be read only
  • Only the "inputs" with attribute "USER-ONLY" or "ANY" as per SQOOP-1804 will be editable. Make sure to validate the condition of editable and adhere to cascading changes depending on the overrides attribute on each input.
  • Once the input values are edited, the new values will be used in the next job run, unless we maintain history as per SQOOP-2025.

NOTE : Support all the above in both shell command and Rest-API.

 

Non Goals

  • Supporting CD ( create / delete ) of Config Inputs via the REST or command line. It is only allowed via the configurable code and supported annotations on the classes today and it should remain so.
  • Editing submission history 

Design and Implementation Details

Here are some details I considered when coming up with the subType and why it made sense.

 
At one point, I thought why not have direction as a parameter for type, JOB, but direction is not relevant to all configurables. i,e if for the driver configs, "direction" has no meaning. Similarly for the type "LINK" there is no concept of direction.
Hence I went with the subType, where subType is a second level hierarchy for distinguishing the types of configs that are supported in sqoop
Alternatives are possible, but we have to bear in mind that config/ config inputs are not associated with jobs and links,  They are associated with connectors/driver ( i,e configurables )
The config input values are associated with jobs and links rather, so when reading/ editing the config input values, either we can use JOB/ LINK entities  or rely more on the "CONFIGTYPE" enum, if we want to treat config as a first class citizen

SubType for MConfigType

SubTypes have been added to the MConfigType Enum to indicate the sub types

Code Block

/**
 * Represents the various config types supported by the system.
 */
@InterfaceAudience.Private
@InterfaceStability.Unstable
public enum MConfigType {
  /** Unknown config type */
  OTHER,
  @Deprecated
  // NOTE: only exists to support the connector data upgrade path
  CONNECTION,
  /** link config type */
  LINK("link"),
  /** Job config type */
  JOB("from", "to", "driver");
  
  private List<String> subType;
  
  MConfigType(String... aliases){
    this.subType = Arrays.asList(aliases);
  }
  
  List<String> getSubTypes(MConfigType type) {
    return type.subType;
  } 
}


...