|
7 | 7 | import com.google.gson.Gson; |
8 | 8 | import com.google.gson.JsonArray; |
9 | 9 | import com.google.gson.JsonObject; |
| 10 | +import com.linkedin.cdi.factory.DefaultConnectionClientFactory; |
10 | 11 | import lombok.Getter; |
11 | 12 | import lombok.extern.slf4j.Slf4j; |
12 | 13 | import org.apache.commons.lang.StringUtils; |
13 | 14 | import org.apache.gobblin.configuration.State; |
14 | | -import com.linkedin.cdi.factory.DefaultS3ClientFactory; |
15 | 15 |
|
16 | 16 |
|
17 | 17 | /** |
@@ -168,6 +168,18 @@ public <T> T getDefaultValue() { |
168 | 168 | return (T) ","; |
169 | 169 | } |
170 | 170 | }, |
| 171 | + /** |
| 172 | + * By default, CsvExtractor tries to infer the true type of fields when inferring schema |
| 173 | + * However, in some cases, the inference is not accurate, and users may prefer to keep all fields as strings. |
| 174 | + * In this case ms.csv.default.field.type = string |
| 175 | + * Supported types: string | int | long | double | boolean | float |
| 176 | + */ |
| 177 | + MSTAGE_CSV_DEFAULT_FIELD_TYPE("ms.csv.default.field.type", String.class) { |
| 178 | + @Override |
| 179 | + public <T> T getDefaultValue() { |
| 180 | + return (T) StringUtils.EMPTY; |
| 181 | + } |
| 182 | + }, |
171 | 183 | /** |
172 | 184 | * if csv.column.header is true, csv.skip.lines will be 1 by default, if more than 1 |
173 | 185 | * row to be skipped, then set this parameter explicitly. |
@@ -345,13 +357,13 @@ public Long getMillis(State state) { |
345 | 357 | } |
346 | 358 | }, |
347 | 359 | /** |
348 | | - * http.client.factory define an indirect way to specify the type of HttpClient to use. |
349 | | - * default = {@link com.linkedin.cdi.factory.ApacheHttpClientFactory} |
| 360 | + * Define an indirect way to specify the type of connection clients |
| 361 | + * default = {@link DefaultConnectionClientFactory} |
350 | 362 | */ |
351 | | - MSTAGE_HTTP_CLIENT_FACTORY("ms.http.client.factory", String.class) { |
| 363 | + MSTAGE_CONNECTION_CLIENT_FACTORY("ms.connection.client.factory", String.class) { |
352 | 364 | @Override |
353 | 365 | public <T> T getDefaultValue() { |
354 | | - return (T) "com.linkedin.cdi.factory.ApacheHttpClientFactory"; |
| 366 | + return (T) "com.linkedin.cdi.factory.DefaultConnectionClientFactory"; |
355 | 367 | } |
356 | 368 | }, |
357 | 369 | /** |
@@ -400,17 +412,6 @@ public <T> T getDefaultValue() { |
400 | 412 | * Currently, we don't allow exceptions being made to revert errors by using reason code. |
401 | 413 | */ |
402 | 414 | MSTAGE_HTTP_STATUS_REASONS("ms.http.status.reasons", JsonObject.class), |
403 | | - /** |
404 | | - * jdbc.client.factory define an indirect way to specify the type of JDBC Client to use. |
405 | | - * default = {@link com.linkedin.cdi.factory.DefaultJdbcClientFactory} |
406 | | - */ |
407 | | - MSTAGE_JDBC_CLIENT_FACTORY("ms.jdbc.client.factory", String.class) { |
408 | | - @Override |
409 | | - public <T> T getDefaultValue() { |
410 | | - return (T) "com.linkedin.cdi.factory.DefaultJdbcClientFactory"; |
411 | | - } |
412 | | - }, |
413 | | - |
414 | 415 | MSTAGE_JDBC_SCHEMA_REFACTOR("ms.jdbc.schema.refactor", String.class) { |
415 | 416 | @Override |
416 | 417 | public <T> T getDefaultValue() { |
@@ -538,16 +539,6 @@ public <T> T getDefaultValue() { |
538 | 539 | return (T) retention; |
539 | 540 | } |
540 | 541 | }, |
541 | | - /** |
542 | | - * s3.client.factory define an indirect way to specify the type of S3 Client to use. |
543 | | - * default = {@link DefaultS3ClientFactory} |
544 | | - */ |
545 | | - MSTAGE_S3_CLIENT_FACTORY("ms.s3.client.factory", String.class) { |
546 | | - @Override |
547 | | - public <T> T getDefaultValue() { |
548 | | - return (T) "com.linkedin.cdi.factory.DefaultS3ClientFactory"; |
549 | | - } |
550 | | - }, |
551 | 542 | /** |
552 | 543 | * Schema cleansing will replace special characters in the schema element names based |
553 | 544 | * on a pattern. By default it will replace all blank spaces, $, and @ to underscores. |
@@ -764,6 +755,27 @@ public <T> T getDefaultValue() { |
764 | 755 | */ |
765 | 756 | MSTAGE_WATERMARK("ms.watermark", JsonArray.class), |
766 | 757 | MSTAGE_WATERMARK_GROUPS("ms.watermark.groups", JsonArray.class), |
| 758 | + /** |
| 759 | + * Minimum records to be present in order for the work unit to be successful, |
| 760 | + * below the minimum value, the work unit will be failed. |
| 761 | + */ |
| 762 | + MSTAGE_WORK_UNIT_MIN_RECORDS("ms.work.unit.min.records", Long.class) { |
| 763 | + @Override |
| 764 | + public <T> T getDefaultValue() { |
| 765 | + return (T) Long.valueOf(0); |
| 766 | + } |
| 767 | + }, |
| 768 | + /** |
| 769 | + * Minimum number of work units to be present in order for the job to proceed, |
| 770 | + * below the minimum value, the job will be failed. This parameter shold be used |
| 771 | + * only when there is a unit watermark. |
| 772 | + */ |
| 773 | + MSTAGE_WORK_UNIT_MIN_UNITS("ms.work.unit.min.units", Long.class) { |
| 774 | + @Override |
| 775 | + public <T> T getDefaultValue() { |
| 776 | + return (T) Long.valueOf(0); |
| 777 | + } |
| 778 | + }, |
767 | 779 | MSTAGE_WORK_UNIT_PARALLELISM_MAX("ms.work.unit.parallelism.max", Integer.class) { |
768 | 780 | @Override |
769 | 781 | public boolean validateNonblank(State state) { |
@@ -830,6 +842,16 @@ public <T> T getDefaultValue() { |
830 | 842 | return (T) Long.valueOf(500L); |
831 | 843 | } |
832 | 844 | }, |
| 845 | + MSTAGE_AUDIT_ENABLED("ms.audit.enabled", Boolean.class) { |
| 846 | + @Override |
| 847 | + public <T> T getDefaultValue() { |
| 848 | + return (T) Boolean.FALSE; |
| 849 | + } |
| 850 | + }, |
| 851 | + MSTAGE_KAFKA_BROKERS("ms.kafka.brokers", String.class), |
| 852 | + MSTAGE_KAFKA_SCHEMA_REGISTRY_URL("ms.kafka.schema.registry.url", String.class), |
| 853 | + MSTAGE_KAFKA_CLIENT_ID("ms.kafka.clientId", String.class), |
| 854 | + MSTAGE_KAFKA_TOPIC_NAME("ms.kafka.audit.topic.name", String.class), |
833 | 855 | // Properties defined in Gobblin, redefine here to leverage the new features like validation |
834 | 856 | CONVERTER_CLASSES("converter.classes", String.class), |
835 | 857 | DATASET_URN_KEY("dataset.urn", String.class), |
|
0 commit comments