17
17
18
18
package org .apache .seatunnel .connectors .seatunnel .kudu .config ;
19
19
20
- import org .apache .seatunnel .api .configuration .Option ;
21
- import org .apache .seatunnel .api .configuration .Options ;
22
20
import org .apache .seatunnel .api .configuration .ReadonlyConfig ;
23
21
24
- import org .apache .kudu .client .AsyncKuduClient ;
25
-
26
22
import lombok .Getter ;
27
23
import lombok .ToString ;
28
24
32
28
@ ToString
33
29
public class CommonConfig implements Serializable {
34
30
35
- public static final Option <String > MASTER =
36
- Options .key ("kudu_masters" )
37
- .stringType ()
38
- .noDefaultValue ()
39
- .withDescription ("Kudu master address. Separated by ','" );
40
-
41
- public static final Option <String > TABLE_NAME =
42
- Options .key ("table_name" )
43
- .stringType ()
44
- .noDefaultValue ()
45
- .withDescription ("Kudu table name" );
46
-
47
- public static final Option <Integer > WORKER_COUNT =
48
- Options .key ("client_worker_count" )
49
- .intType ()
50
- .defaultValue (2 * Runtime .getRuntime ().availableProcessors ())
51
- .withDescription (
52
- "Kudu worker count. Default value is twice the current number of cpu cores" );
53
-
54
- public static final Option <Long > OPERATION_TIMEOUT =
55
- Options .key ("client_default_operation_timeout_ms" )
56
- .longType ()
57
- .defaultValue (AsyncKuduClient .DEFAULT_OPERATION_TIMEOUT_MS )
58
- .withDescription ("Kudu normal operation time out" );
59
-
60
- public static final Option <Long > ADMIN_OPERATION_TIMEOUT =
61
- Options .key ("client_default_admin_operation_timeout_ms" )
62
- .longType ()
63
- .defaultValue (AsyncKuduClient .DEFAULT_OPERATION_TIMEOUT_MS )
64
- .withDescription ("Kudu admin operation time out" );
65
-
66
- public static final Option <Boolean > ENABLE_KERBEROS =
67
- Options .key ("enable_kerberos" )
68
- .booleanType ()
69
- .defaultValue (false )
70
- .withDescription ("Kerberos principal enable." );
71
- public static final Option <String > KERBEROS_PRINCIPAL =
72
- Options .key ("kerberos_principal" )
73
- .stringType ()
74
- .noDefaultValue ()
75
- .withDescription (
76
- "Kerberos principal. Note that all zeta nodes require have this file." );
77
-
78
- public static final Option <String > KERBEROS_KEYTAB =
79
- Options .key ("kerberos_keytab" )
80
- .stringType ()
81
- .noDefaultValue ()
82
- .withDescription (
83
- "Kerberos keytab. Note that all zeta nodes require have this file." );
84
-
85
- public static final Option <String > KERBEROS_KRB5_CONF =
86
- Options .key ("kerberos_krb5conf" )
87
- .stringType ()
88
- .noDefaultValue ()
89
- .withDescription (
90
- "Kerberos krb5 conf. Note that all zeta nodes require have this file." );
91
-
92
31
protected String masters ;
93
32
protected Integer workerCount ;
94
33
@@ -102,13 +41,13 @@ public class CommonConfig implements Serializable {
102
41
protected String krb5conf ;
103
42
104
43
public CommonConfig (ReadonlyConfig config ) {
105
- this .masters = config .get (MASTER );
106
- this .workerCount = config .get (WORKER_COUNT );
107
- this .operationTimeout = config .get (OPERATION_TIMEOUT );
108
- this .adminOperationTimeout = config .get (ADMIN_OPERATION_TIMEOUT );
109
- this .enableKerberos = config .get (ENABLE_KERBEROS );
110
- this .principal = config .get (KERBEROS_PRINCIPAL );
111
- this .keytab = config .get (KERBEROS_KEYTAB );
112
- this .krb5conf = config .get (KERBEROS_KRB5_CONF );
44
+ this .masters = config .get (KuduBaseOptions . MASTER );
45
+ this .workerCount = config .get (KuduBaseOptions . WORKER_COUNT );
46
+ this .operationTimeout = config .get (KuduBaseOptions . OPERATION_TIMEOUT );
47
+ this .adminOperationTimeout = config .get (KuduBaseOptions . ADMIN_OPERATION_TIMEOUT );
48
+ this .enableKerberos = config .get (KuduBaseOptions . ENABLE_KERBEROS );
49
+ this .principal = config .get (KuduBaseOptions . KERBEROS_PRINCIPAL );
50
+ this .keytab = config .get (KuduBaseOptions . KERBEROS_KEYTAB );
51
+ this .krb5conf = config .get (KuduBaseOptions . KERBEROS_KRB5_CONF );
113
52
}
114
53
}
0 commit comments