Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotations to support config/counters documentation/validation #1593

Merged
merged 25 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b6f2e4c
[Java] initial work
nbradac Apr 23, 2024
36a6000
Merge branch 'master' into config_doc_gen
nbradac Apr 23, 2024
9023ddf
[Java] add basic aeron counter annotation/validation
nbradac Apr 29, 2024
6bc0e9f
Merge branch 'master' into config_doc_gen
nbradac Apr 29, 2024
149c608
[Java] appease checkstyle
nbradac Apr 30, 2024
ecd220e
[Java] add aeron-client tasks, annotate more elements
nbradac May 7, 2024
4ab6cca
Merge branch 'master' into config_doc_gen
nbradac May 7, 2024
ea4a3cb
[Java] more driver annotations
nbradac May 8, 2024
3014078
[JAVA] switch flow control group tag to long instead of string
nbradac May 8, 2024
17f9a99
[Java] refactor to use xml instead of json as intermediate data format
nbradac May 8, 2024
214fefb
[Java] use native java object serialization instead of xml
nbradac May 9, 2024
50b110d
[Java] store Objects as Serializable
nbradac May 9, 2024
454f9a8
[Java] store defaults as Strings
nbradac May 9, 2024
f2239cd
[Java] remove unused import
nbradac May 9, 2024
90d4a01
[Java] allow c default validation to be skipped
nbradac May 9, 2024
4d4425c
[Java] driver c validation complete
nbradac May 10, 2024
fbee032
[Java] refactor Grep object to avoid leaving a stream open
nbradac May 10, 2024
7502c0a
[Java] add config to refactored processor, update AeronCounters
nbradac May 15, 2024
f4c4091
[Java] add config annotation to cluster
nbradac May 16, 2024
e618608
[Java] add config annotation to archive
nbradac May 17, 2024
4a498eb
[Java] fix duplicate config ids
nbradac May 21, 2024
1dd3f28
Merge branch 'master' into config_doc_gen
nbradac May 21, 2024
af23a71
Merge branch 'master' into config_doc_gen
nbradac May 29, 2024
dfb3032
[Java] allow processors to be disabled via system property
nbradac Jun 3, 2024
8b55509
[Java] address CodeQL issues
nbradac Jun 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 59 additions & 0 deletions aeron-annotations/src/main/java/io/aeron/config/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright 2014-2024 Real Logic Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.aeron.config;

import java.lang.annotation.*;

/**
* Annotation to indicate this is a config option
*/
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.SOURCE)
@SuppressWarnings("checkstyle:MissingJavadocMethod")
public @interface Config
{
@SuppressWarnings("checkstyle:MissingJavadocType")
enum Type
{
UNDEFINED, PROPERTY_NAME, DEFAULT
}

Type configType() default Type.UNDEFINED;

String id() default "";

String uriParam() default "";

boolean existsInC() default true;

String expectedCEnvVarFieldName() default "";

String expectedCEnvVar() default "";

String expectedCDefaultFieldName() default "";

String expectedCDefault() default "";

DefaultType defaultType() default DefaultType.UNDEFINED;

boolean defaultBoolean() default false;

int defaultInt() default 0;

long defaultLong() default 0;

String defaultString() default "";
}
62 changes: 62 additions & 0 deletions aeron-annotations/src/main/java/io/aeron/config/ConfigInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright 2014-2024 Real Logic Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.aeron.config;

import com.fasterxml.jackson.annotation.JsonProperty;

@SuppressWarnings("checkstyle:MissingJavadocType")
public class ConfigInfo
{
@JsonProperty
public final String id;
@JsonProperty
public final ExpectedConfig expectations;

public ConfigInfo(@JsonProperty("id") final String id)
{
this.id = id;
expectations = new ExpectedConfig();
}

public boolean foundPropertyName = false;
public boolean foundDefault = false;
@JsonProperty
public String propertyNameDescription;
@JsonProperty
public String propertyNameFieldName;
@JsonProperty
public String propertyNameClassName;
@JsonProperty
public String propertyName;
@JsonProperty
public String defaultDescription;
@JsonProperty
public String defaultFieldName;
@JsonProperty
public String defaultClassName;
@JsonProperty
public Object defaultValue;
@JsonProperty
public DefaultType defaultValueType = DefaultType.UNDEFINED;
@JsonProperty
public Object overrideDefaultValue;
@JsonProperty
public DefaultType overrideDefaultValueType = DefaultType.UNDEFINED;
@JsonProperty
public String uriParam;
@JsonProperty
public String context;
}