/** * Get the dot-separated namespace of the table. * * @return dot-separated namespace of the table */ public String getNamespace() { return getProp(ConfigurationKeys.EXTRACT_NAMESPACE_NAME_KEY, ""); }
/** * Get the name of the table. * * @return name of the table */ public String getTable() { return getProp(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY, ""); }
/** * Get a (non-globally) unique ID for this {@link Extract}. * * @return unique ID for this {@link Extract} */ public String getExtractId() { return getProp(ConfigurationKeys.EXTRACT_EXTRACT_ID_KEY, ""); }
@Override public String getProp(String key, String def) { String value = super.getProp(key); if (value == null) { value = this.extract.getProp(key, def); } return value; }
/** * Get the {@link TableType} of the table. * * @return {@link TableType} of the table */ public TableType getType() { return TableType.valueOf(getProp(ConfigurationKeys.EXTRACT_TABLE_TYPE_KEY)); }
/** * Add more primary keys to the existing set of primary keys. * * @param primaryKeyFieldName primary key names * @deprecated @deprecated It is recommended to add primary keys in {@code WorkUnit} instead of {@code Extract}. */ @Deprecated public void addPrimaryKey(String... primaryKeyFieldName) { StringBuilder sb = new StringBuilder(getProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, "")); Joiner.on(",").appendTo(sb, primaryKeyFieldName); setProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, sb.toString()); }
/** * Add more delta fields to the existing set of delta fields. * * @param deltaFieldName delta field names * @deprecated It is recommended to add delta fields in {@code WorkUnit} instead of {@code Extract}. */ @Deprecated public void addDeltaField(String... deltaFieldName) { StringBuilder sb = new StringBuilder(getProp(ConfigurationKeys.EXTRACT_DELTA_FIELDS_KEY, "")); Joiner.on(",").appendTo(sb, deltaFieldName); setProp(ConfigurationKeys.EXTRACT_DELTA_FIELDS_KEY, sb.toString()); }
/** * Get a (non-globally) unique ID for this {@link Extract}. * * @return unique ID for this {@link Extract} */ public String getExtractId() { return getProp(ConfigurationKeys.EXTRACT_EXTRACT_ID_KEY, ""); }
/** * Get the dot-separated namespace of the table. * * @return dot-separated namespace of the table */ public String getNamespace() { return getProp(ConfigurationKeys.EXTRACT_NAMESPACE_NAME_KEY, ""); }
/** * Get the name of the table. * * @return name of the table */ public String getTable() { return getProp(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY, ""); }
@Override public String getProp(String key, String def) { String value = super.getProp(key); if (value == null) { value = this.extract.getProp(key, def); } return value; }
/** * Get the {@link TableType} of the table. * * @return {@link TableType} of the table */ public TableType getType() { return TableType.valueOf(getProp(ConfigurationKeys.EXTRACT_TABLE_TYPE_KEY)); }
/** * Add more delta fields to the existing set of delta fields. * * @param deltaFieldName delta field names * @deprecated It is recommended to add delta fields in {@code WorkUnit} instead of {@code Extract}. */ @Deprecated public void addDeltaField(String... deltaFieldName) { StringBuilder sb = new StringBuilder(getProp(ConfigurationKeys.EXTRACT_DELTA_FIELDS_KEY, "")); Joiner.on(",").appendTo(sb, deltaFieldName); setProp(ConfigurationKeys.EXTRACT_DELTA_FIELDS_KEY, sb.toString()); }
/** * Add more primary keys to the existing set of primary keys. * * @param primaryKeyFieldName primary key names * @deprecated @deprecated It is recommended to add primary keys in {@code WorkUnit} instead of {@code Extract}. */ @Deprecated public void addPrimaryKey(String... primaryKeyFieldName) { StringBuilder sb = new StringBuilder(getProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, "")); Joiner.on(",").appendTo(sb, primaryKeyFieldName); setProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, sb.toString()); }