|
25 | 25 | import java.lang.annotation.RetentionPolicy;
|
26 | 26 | import java.lang.annotation.Target;
|
27 | 27 |
|
28 |
| -/** |
29 |
| - * Collection of annotations to modify the behavior of the documentation generators. |
30 |
| - */ |
| 28 | +/** Collection of annotations to modify the behavior of the documentation generators. */ |
31 | 29 | public final class Documentation {
|
32 | 30 |
|
33 |
| - /** |
34 |
| - * Annotation used on config option fields to override the documented default. |
35 |
| - */ |
36 |
| - @Target(ElementType.FIELD) |
37 |
| - @Retention(RetentionPolicy.RUNTIME) |
38 |
| - @Internal |
39 |
| - public @interface OverrideDefault { |
40 |
| - String value(); |
41 |
| - } |
42 |
| - |
43 |
| - /** |
44 |
| - * Annotation used on config option fields to include them in specific sections. Sections are groups of options |
45 |
| - * that are aggregated across option classes, with each group being placed into a dedicated file. |
46 |
| - * |
47 |
| - * <p>The {@link Section#position()} argument controls the position in the generated table, with lower values |
48 |
| - * being placed at the top. Fields with the same position are sorted alphabetically by key. |
49 |
| - */ |
50 |
| - @Target(ElementType.FIELD) |
51 |
| - @Retention(RetentionPolicy.RUNTIME) |
52 |
| - @Internal |
53 |
| - public @interface Section { |
54 |
| - |
55 |
| - /** |
56 |
| - * The sections in the config docs where this option should be included. |
57 |
| - */ |
58 |
| - String[] value() default {}; |
59 |
| - |
60 |
| - /** |
61 |
| - * The relative position of the option in its section. |
62 |
| - */ |
63 |
| - int position() default Integer.MAX_VALUE; |
64 |
| - } |
65 |
| - |
66 |
| - /** |
67 |
| - * Constants for section names. |
68 |
| - */ |
69 |
| - public static final class Sections { |
70 |
| - |
71 |
| - public static final String COMMON_HOST_PORT = "common_host_port"; |
72 |
| - public static final String COMMON_STATE_BACKENDS = "common_state_backends"; |
73 |
| - public static final String COMMON_HIGH_AVAILABILITY = "common_high_availability"; |
74 |
| - public static final String COMMON_HIGH_AVAILABILITY_ZOOKEEPER = "common_high_availability_zk"; |
75 |
| - public static final String COMMON_MEMORY = "common_memory"; |
76 |
| - public static final String COMMON_MISCELLANEOUS = "common_miscellaneous"; |
77 |
| - |
78 |
| - public static final String SECURITY_SSL = "security_ssl"; |
79 |
| - public static final String SECURITY_AUTH_KERBEROS = "security_auth_kerberos"; |
80 |
| - public static final String SECURITY_AUTH_ZOOKEEPER = "security_auth_zk"; |
81 |
| - |
82 |
| - public static final String STATE_BACKEND_ROCKSDB = "state_backend_rocksdb"; |
83 |
| - |
84 |
| - public static final String EXPERT_CLASS_LOADING = "expert_class_loading"; |
85 |
| - public static final String EXPERT_DEBUGGING_AND_TUNING = "expert_debugging_and_tuning"; |
86 |
| - public static final String EXPERT_SCHEDULING = "expert_scheduling"; |
87 |
| - public static final String EXPERT_FAULT_TOLERANCE = "expert_fault_tolerance"; |
88 |
| - public static final String EXPERT_STATE_BACKENDS = "expert_state_backends"; |
89 |
| - public static final String EXPERT_REST = "expert_rest"; |
90 |
| - public static final String EXPERT_HIGH_AVAILABILITY = "expert_high_availability"; |
91 |
| - public static final String EXPERT_ZOOKEEPER_HIGH_AVAILABILITY = "expert_high_availability_zk"; |
92 |
| - public static final String EXPERT_KUBERNETES_HIGH_AVAILABILITY = "expert_high_availability_k8s"; |
93 |
| - public static final String EXPERT_SECURITY_SSL = "expert_security_ssl"; |
94 |
| - public static final String EXPERT_ROCKSDB = "expert_rocksdb"; |
95 |
| - public static final String EXPERT_CLUSTER = "expert_cluster"; |
96 |
| - |
97 |
| - public static final String ALL_JOB_MANAGER = "all_jobmanager"; |
98 |
| - public static final String ALL_TASK_MANAGER = "all_taskmanager"; |
99 |
| - public static final String ALL_TASK_MANAGER_NETWORK = "all_taskmanager_network"; |
100 |
| - |
101 |
| - public static final String DEPRECATED_FILE_SINKS = "deprecated_file_sinks"; |
102 |
| - |
103 |
| - private Sections() {} |
104 |
| - } |
105 |
| - |
106 |
| - /** |
107 |
| - * Annotation used on table config options for adding meta data labels. |
108 |
| - * |
109 |
| - * <p>The {@link TableOption#execMode()} argument indicates the execution mode the config works for |
110 |
| - * (batch, streaming or both). |
111 |
| - */ |
112 |
| - @Target(ElementType.FIELD) |
113 |
| - @Retention(RetentionPolicy.RUNTIME) |
114 |
| - @Internal |
115 |
| - public @interface TableOption { |
116 |
| - ExecMode execMode(); |
117 |
| - } |
118 |
| - |
119 |
| - /** |
120 |
| - * The execution mode the config works for. |
121 |
| - */ |
122 |
| - public enum ExecMode { |
123 |
| - |
124 |
| - BATCH("Batch"), STREAMING("Streaming"), BATCH_STREAMING("Batch and Streaming"); |
125 |
| - |
126 |
| - private final String name; |
127 |
| - |
128 |
| - ExecMode(String name) { |
129 |
| - this.name = name; |
130 |
| - } |
131 |
| - |
132 |
| - @Override |
133 |
| - public String toString() { |
134 |
| - return name; |
135 |
| - } |
136 |
| - } |
137 |
| - |
138 |
| - /** |
139 |
| - * Annotation used on config option fields or options class to mark them as a suffix-option; i.e., a config option |
140 |
| - * where the key is only a suffix, with the prefix being dynamically provided at runtime. |
141 |
| - */ |
142 |
| - @Target({ElementType.FIELD, ElementType.TYPE}) |
143 |
| - @Retention(RetentionPolicy.RUNTIME) |
144 |
| - @Internal |
145 |
| - public @interface SuffixOption { |
146 |
| - } |
147 |
| - |
148 |
| - /** |
149 |
| - * Annotation used on config option fields or REST API message headers to exclude it from documentation. |
150 |
| - */ |
151 |
| - @Target({ElementType.FIELD, ElementType.TYPE}) |
152 |
| - @Retention(RetentionPolicy.RUNTIME) |
153 |
| - @Internal |
154 |
| - public @interface ExcludeFromDocumentation { |
155 |
| - /** |
156 |
| - * The optional reason why it is excluded from documentation. |
157 |
| - */ |
158 |
| - String value() default ""; |
159 |
| - } |
160 |
| - |
161 |
| - private Documentation(){ |
162 |
| - } |
| 31 | + /** Annotation used on config option fields to override the documented default. */ |
| 32 | + @Target(ElementType.FIELD) |
| 33 | + @Retention(RetentionPolicy.RUNTIME) |
| 34 | + @Internal |
| 35 | + public @interface OverrideDefault { |
| 36 | + String value(); |
| 37 | + } |
| 38 | + |
| 39 | + /** |
| 40 | + * Annotation used on config option fields to include them in specific sections. Sections are |
| 41 | + * groups of options that are aggregated across option classes, with each group being placed |
| 42 | + * into a dedicated file. |
| 43 | + * |
| 44 | + * <p>The {@link Section#position()} argument controls the position in the generated table, with |
| 45 | + * lower values being placed at the top. Fields with the same position are sorted alphabetically |
| 46 | + * by key. |
| 47 | + */ |
| 48 | + @Target(ElementType.FIELD) |
| 49 | + @Retention(RetentionPolicy.RUNTIME) |
| 50 | + @Internal |
| 51 | + public @interface Section { |
| 52 | + |
| 53 | + /** The sections in the config docs where this option should be included. */ |
| 54 | + String[] value() default {}; |
| 55 | + |
| 56 | + /** The relative position of the option in its section. */ |
| 57 | + int position() default Integer.MAX_VALUE; |
| 58 | + } |
| 59 | + |
| 60 | + /** Constants for section names. */ |
| 61 | + public static final class Sections { |
| 62 | + |
| 63 | + public static final String COMMON_HOST_PORT = "common_host_port"; |
| 64 | + public static final String COMMON_STATE_BACKENDS = "common_state_backends"; |
| 65 | + public static final String COMMON_HIGH_AVAILABILITY = "common_high_availability"; |
| 66 | + public static final String COMMON_HIGH_AVAILABILITY_ZOOKEEPER = |
| 67 | + "common_high_availability_zk"; |
| 68 | + public static final String COMMON_MEMORY = "common_memory"; |
| 69 | + public static final String COMMON_MISCELLANEOUS = "common_miscellaneous"; |
| 70 | + |
| 71 | + public static final String SECURITY_SSL = "security_ssl"; |
| 72 | + public static final String SECURITY_AUTH_KERBEROS = "security_auth_kerberos"; |
| 73 | + public static final String SECURITY_AUTH_ZOOKEEPER = "security_auth_zk"; |
| 74 | + |
| 75 | + public static final String STATE_BACKEND_ROCKSDB = "state_backend_rocksdb"; |
| 76 | + |
| 77 | + public static final String EXPERT_CLASS_LOADING = "expert_class_loading"; |
| 78 | + public static final String EXPERT_DEBUGGING_AND_TUNING = "expert_debugging_and_tuning"; |
| 79 | + public static final String EXPERT_SCHEDULING = "expert_scheduling"; |
| 80 | + public static final String EXPERT_FAULT_TOLERANCE = "expert_fault_tolerance"; |
| 81 | + public static final String EXPERT_STATE_BACKENDS = "expert_state_backends"; |
| 82 | + public static final String EXPERT_REST = "expert_rest"; |
| 83 | + public static final String EXPERT_HIGH_AVAILABILITY = "expert_high_availability"; |
| 84 | + public static final String EXPERT_ZOOKEEPER_HIGH_AVAILABILITY = |
| 85 | + "expert_high_availability_zk"; |
| 86 | + public static final String EXPERT_KUBERNETES_HIGH_AVAILABILITY = |
| 87 | + "expert_high_availability_k8s"; |
| 88 | + public static final String EXPERT_SECURITY_SSL = "expert_security_ssl"; |
| 89 | + public static final String EXPERT_ROCKSDB = "expert_rocksdb"; |
| 90 | + public static final String EXPERT_CLUSTER = "expert_cluster"; |
| 91 | + |
| 92 | + public static final String ALL_JOB_MANAGER = "all_jobmanager"; |
| 93 | + public static final String ALL_TASK_MANAGER = "all_taskmanager"; |
| 94 | + public static final String ALL_TASK_MANAGER_NETWORK = "all_taskmanager_network"; |
| 95 | + |
| 96 | + public static final String DEPRECATED_FILE_SINKS = "deprecated_file_sinks"; |
| 97 | + |
| 98 | + private Sections() {} |
| 99 | + } |
| 100 | + |
| 101 | + /** |
| 102 | + * Annotation used on table config options for adding meta data labels. |
| 103 | + * |
| 104 | + * <p>The {@link TableOption#execMode()} argument indicates the execution mode the config works |
| 105 | + * for (batch, streaming or both). |
| 106 | + */ |
| 107 | + @Target(ElementType.FIELD) |
| 108 | + @Retention(RetentionPolicy.RUNTIME) |
| 109 | + @Internal |
| 110 | + public @interface TableOption { |
| 111 | + ExecMode execMode(); |
| 112 | + } |
| 113 | + |
| 114 | + /** The execution mode the config works for. */ |
| 115 | + public enum ExecMode { |
| 116 | + BATCH("Batch"), |
| 117 | + STREAMING("Streaming"), |
| 118 | + BATCH_STREAMING("Batch and Streaming"); |
| 119 | + |
| 120 | + private final String name; |
| 121 | + |
| 122 | + ExecMode(String name) { |
| 123 | + this.name = name; |
| 124 | + } |
| 125 | + |
| 126 | + @Override |
| 127 | + public String toString() { |
| 128 | + return name; |
| 129 | + } |
| 130 | + } |
| 131 | + |
| 132 | + /** |
| 133 | + * Annotation used on config option fields or options class to mark them as a suffix-option; |
| 134 | + * i.e., a config option where the key is only a suffix, with the prefix being dynamically |
| 135 | + * provided at runtime. |
| 136 | + */ |
| 137 | + @Target({ElementType.FIELD, ElementType.TYPE}) |
| 138 | + @Retention(RetentionPolicy.RUNTIME) |
| 139 | + @Internal |
| 140 | + public @interface SuffixOption {} |
| 141 | + |
| 142 | + /** |
| 143 | + * Annotation used on config option fields or REST API message headers to exclude it from |
| 144 | + * documentation. |
| 145 | + */ |
| 146 | + @Target({ElementType.FIELD, ElementType.TYPE}) |
| 147 | + @Retention(RetentionPolicy.RUNTIME) |
| 148 | + @Internal |
| 149 | + public @interface ExcludeFromDocumentation { |
| 150 | + /** The optional reason why it is excluded from documentation. */ |
| 151 | + String value() default ""; |
| 152 | + } |
| 153 | + |
| 154 | + private Documentation() {} |
163 | 155 | }
|
0 commit comments