Skip to content

Commit c2d2e6f

Browse files
authored
Address JavaDoc warnings (#28)
Signed-off-by: Dan Siwiec <[email protected]>
1 parent d3b7f3b commit c2d2e6f

File tree

25 files changed

+110
-33
lines changed

25 files changed

+110
-33
lines changed

common-test/src/main/java/feast/common/it/BaseIT.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public ConsumerFactory<String, byte[]> testConsumerFactory() {
115115
/**
116116
* Truncates all tables in Database (between tests or flows). Retries on deadlock
117117
*
118-
* @throws SQLException
118+
* @throws SQLException when a SQL exception occurs
119119
*/
120120
public static void cleanTables() throws SQLException {
121121
Connection connection =
@@ -156,7 +156,12 @@ public static void cleanTables() throws SQLException {
156156
}
157157
}
158158

159-
/** Used to determine SequentialFlows */
159+
/**
160+
* Used to determine SequentialFlows
161+
*
162+
* @param testInfo test info
163+
* @return true if test is sequential
164+
*/
160165
public Boolean isSequentialTest(TestInfo testInfo) {
161166
try {
162167
testInfo.getTestClass().get().asSubclass(SequentialFlow.class);

common-test/src/main/java/feast/common/util/TestUtil.java

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ public static void setupAuditLogger() {
4444

4545
/**
4646
* Compare if two Feature Table specs are equal. Disregards order of features/entities in spec.
47+
*
48+
* @param spec one spec
49+
* @param otherSpec the other spec
50+
* @return true if specs equal
4751
*/
4852
public static boolean compareFeatureTableSpec(FeatureTableSpec spec, FeatureTableSpec otherSpec) {
4953
spec =

common/src/main/java/feast/common/auth/credentials/GoogleAuthCredentials.java

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public class GoogleAuthCredentials extends CallCredentials {
4545
*
4646
* @param options a map of options, Required unless specified: audience - Optional, Sets the
4747
* target audience of the token obtained.
48+
* @throws IOException if credentials are not available
4849
*/
4950
public GoogleAuthCredentials(Map<String, String> options) throws IOException {
5051
String targetAudience = options.getOrDefault("audience", "https://localhost");

common/src/main/java/feast/common/logging/AuditLogger.java

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public AuditLogger(LoggingProperties loggingProperties, BuildProperties buildPro
6565
/**
6666
* Log the handling of a Protobuf message by a service call.
6767
*
68+
* @param level log level
6869
* @param entryBuilder with all fields set except instance.
6970
*/
7071
public static void logMessage(Level level, MessageAuditLogEntry.Builder entryBuilder) {

common/src/main/java/feast/common/logging/entry/ActionAuditLogEntry.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
/** ActionAuditLogEntry records an action being taken on a specific resource */
2222
@AutoValue
2323
public abstract class ActionAuditLogEntry extends AuditLogEntry {
24-
/** The name of the action taken on the resource. */
24+
/** @return The name of the action taken on the resource. */
2525
public abstract String getAction();
2626

27-
/** The target resource of which the action was taken on. */
27+
/** @return The target resource of which the action was taken on. */
2828
public abstract LogResource getResource();
2929

3030
/**
@@ -34,6 +34,7 @@ public abstract class ActionAuditLogEntry extends AuditLogEntry {
3434
* @param version The version of Feast producing this {@link AuditLogEntry}.
3535
* @param resource The target resource of which the action was taken on.
3636
* @param action The name of the action being taken on the given resource.
37+
* @return log entry that records an action being taken on a specific resource
3738
*/
3839
public static ActionAuditLogEntry of(
3940
String component, String version, LogResource resource, String action) {

common/src/main/java/feast/common/logging/entry/AuditLogEntry.java

+15-3
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,27 @@ public abstract class AuditLogEntry {
2929

3030
public final String application = "Feast";
3131

32-
/** The name of the Feast component producing this {@link AuditLogEntry} */
32+
/**
33+
* The name of the Feast component producing this {@link AuditLogEntry}
34+
*
35+
* @return the component
36+
*/
3337
public abstract String getComponent();
3438

35-
/** The version of Feast producing this {@link AuditLogEntry} */
39+
/**
40+
* The version of Feast producing this {@link AuditLogEntry}
41+
*
42+
* @return version
43+
*/
3644
public abstract String getVersion();
3745

3846
public abstract AuditLogEntryKind getKind();
3947

40-
/** Return a structured JSON representation of this {@link AuditLogEntry} */
48+
/**
49+
* Return a structured JSON representation of this {@link AuditLogEntry}
50+
*
51+
* @return structured JSON representation
52+
*/
4153
public String toJSON() {
4254
Gson gson = new Gson();
4355
return gson.toJson(this);

common/src/main/java/feast/common/logging/entry/MessageAuditLogEntry.java

+13-10
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,35 @@
3434
/** MessageAuditLogEntry records the handling of a Protobuf message by a service call. */
3535
@AutoValue
3636
public abstract class MessageAuditLogEntry extends AuditLogEntry {
37-
/** Id used to identify the service call that the log entry is recording */
37+
/** @return Id used to identify the service call that the log entry is recording */
3838
public abstract UUID getId();
3939

40-
/** The name of the service that was used to handle the service call. */
40+
/** @return The name of the service that was used to handle the service call. */
4141
public abstract String getService();
4242

43-
/** The name of the method that was used to handle the service call. */
43+
/** @return The name of the method that was used to handle the service call. */
4444
public abstract String getMethod();
4545

46-
/** The request Protobuf {@link Message} that was passed to the Service in the service call. */
46+
/**
47+
* @return The request Protobuf {@link Message} that was passed to the Service in the service
48+
* call.
49+
*/
4750
public abstract Message getRequest();
4851

4952
/**
50-
* The response Protobuf {@link Message} that was passed to the Service in the service call. May
51-
* be an {@link Empty} protobuf no request could be collected due to an error.
53+
* @return The response Protobuf {@link Message} that was passed to the Service in the service
54+
* call. May be an {@link Empty} protobuf no request could be collected due to an error.
5255
*/
5356
public abstract Message getResponse();
5457

5558
/**
56-
* The authenticated identity that was assumed during the handling of the service call. For
57-
* example, the user id or email that identifies the user making the call. Empty if the service
58-
* call is not authenticated.
59+
* @return The authenticated identity that was assumed during the handling of the service call.
60+
* For example, the user id or email that identifies the user making the call. Empty if the
61+
* service call is not authenticated.
5962
*/
6063
public abstract String getIdentity();
6164

62-
/** The result status code of the service call. */
65+
/** @return The result status code of the service call. */
6366
public abstract Code getStatusCode();
6467

6568
@AutoValue.Builder

common/src/main/java/feast/common/logging/entry/TransitionAuditLogEntry.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
/** TransitionAuditLogEntry records a transition in state/status in a specific resource. */
2222
@AutoValue
2323
public abstract class TransitionAuditLogEntry extends AuditLogEntry {
24-
/** The resource which the state/status transition occured. */
24+
/** @return The resource which the state/status transition occured. */
2525
public abstract LogResource getResource();
2626

27-
/** The end status with the resource transition to. */
27+
/** @return The end status with the resource transition to. */
2828
public abstract String getStatus();
2929

3030
/**
@@ -35,6 +35,7 @@ public abstract class TransitionAuditLogEntry extends AuditLogEntry {
3535
* @param version The version of Feast producing this {@link AuditLogEntry}.
3636
* @param resource the resource which the transtion occured
3737
* @param status the end status which the resource transitioned to.
38+
* @return log entry to record a transition in state/status in a specific resource
3839
*/
3940
public static TransitionAuditLogEntry of(
4041
String component, String version, LogResource resource, String status) {

common/src/main/java/feast/common/models/FeatureTable.java

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class FeatureTable {
2525
* Accepts FeatureTableSpec object and returns its reference in String
2626
* "project/featuretable_name".
2727
*
28+
* @param project project name
2829
* @param featureTableSpec {@link FeatureTableSpec}
2930
* @return String format of FeatureTableReference
3031
*/
@@ -36,6 +37,7 @@ public static String getFeatureTableStringRef(String project, FeatureTableSpec f
3637
* Accepts FeatureReferenceV2 object and returns its reference in String
3738
* "project/featuretable_name".
3839
*
40+
* @param project project name
3941
* @param featureReference {@link FeatureReferenceV2}
4042
* @return String format of FeatureTableReference
4143
*/

common/src/main/java/feast/common/validators/OneOfStringValidator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class OneOfStringValidator implements ConstraintValidator<OneOfStrings, S
2929
/**
3030
* Initialize the OneOfStringValidator with a collection of allowed String values.
3131
*
32-
* @param constraintAnnotation
32+
* @param constraintAnnotation constraint annotation
3333
*/
3434
@Override
3535
public void initialize(OneOfStrings constraintAnnotation) {

common/src/main/java/feast/common/validators/OneOfStrings.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@
3838
/** @return Default error message that is returned if the incorrect value is set */
3939
String message() default "Field value must be one of the following: {value}";
4040

41-
/** Allows for the specification of validation groups to which this constraint belongs. */
41+
/** @return Allows for the specification of validation groups to which this constraint belongs. */
4242
Class<?>[] groups() default {};
4343

44-
/** An attribute payload that can be used to assign custom payload objects to a constraint. */
44+
/**
45+
* @return An attribute payload that can be used to assign custom payload objects to a constraint.
46+
*/
4547
Class<? extends Payload>[] payload() default {};
4648

4749
/** @return Default value that is returned if no allowed values are configured */

core/src/main/java/feast/core/config/WebSecurityConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public WebSecurityConfig(FeastProperties feastProperties) {
4343
* Allows for custom web security rules to be applied.
4444
*
4545
* @param http {@link HttpSecurity} for configuring web based security
46-
* @throws Exception
46+
* @throws Exception unexpected exception
4747
*/
4848
@Override
4949
protected void configure(HttpSecurity http) throws Exception {

core/src/main/java/feast/core/model/DataSource.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public DataSource(SourceType type) {
8787
* @param spec Protobuf representation of DataSource to construct from.
8888
* @throws IllegalArgumentException when provided with a invalid Protobuf spec
8989
* @throws UnsupportedOperationException if source type is unsupported.
90+
* @return data source
9091
*/
9192
public static DataSource fromProto(DataSourceProto.DataSource spec) {
9293
DataSource source = new DataSource(spec.getType());
@@ -132,7 +133,11 @@ public static DataSource fromProto(DataSourceProto.DataSource spec) {
132133
return source;
133134
}
134135

135-
/** Convert this DataSource to its Protobuf representation. */
136+
/**
137+
* Convert this DataSource to its Protobuf representation.
138+
*
139+
* @return protobuf representation
140+
*/
136141
public DataSourceProto.DataSource toProto() {
137142
DataSourceProto.DataSource.Builder spec = DataSourceProto.DataSource.newBuilder();
138143
spec.setType(getType());

core/src/main/java/feast/core/model/EntityV2.java

+5
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public EntityV2() {
6565
*
6666
* <p>This data model supports Scalar Entity and would allow ease of discovery of entities and
6767
* reasoning when used in association with FeatureTable.
68+
*
69+
* @param name name
70+
* @param description description
71+
* @param type type
72+
* @param labels labels
6873
*/
6974
public EntityV2(
7075
String name, String description, ValueType.Enum type, Map<String, String> labels) {

core/src/main/java/feast/core/model/FeatureTable.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ public static FeatureTable fromProto(
155155
/**
156156
* Update the FeatureTable from the given Protobuf representation.
157157
*
158+
* @param projectName project name
158159
* @param spec the Protobuf spec to update the FeatureTable from.
160+
* @param entityRepo repository
159161
* @throws IllegalArgumentException if the update will make prohibited changes.
160162
*/
161163
public void updateFromProto(
@@ -211,7 +213,11 @@ public void updateFromProto(
211213
this.revision++;
212214
}
213215

214-
/** Convert this Feature Table to its Protobuf representation */
216+
/**
217+
* Convert this Feature Table to its Protobuf representation
218+
*
219+
* @return protobuf representation
220+
*/
215221
public FeatureTableProto.FeatureTable toProto() {
216222
// Convert field types to Protobuf compatible types
217223
Timestamp creationTime = TypeConversion.convertTimestamp(getCreated());
@@ -319,6 +325,7 @@ private Map<String, FeatureV2> getFeaturesRefToFeaturesMap(List<FeatureV2> featu
319325
/**
320326
* Returns a list of Features if FeatureTable's Feature contains all labels in labelsFilter
321327
*
328+
* @param features features
322329
* @param labelsFilter contain labels that should be attached to FeatureTable's features
323330
* @return List of Features
324331
*/

core/src/main/java/feast/core/model/FeatureV2.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ public static FeatureV2 fromProto(FeatureTable table, FeatureSpecV2 spec) {
7575
return new FeatureV2(table, spec.getName(), spec.getValueType(), labelsJSON);
7676
}
7777

78-
/** Convert this Feature to its Protobuf representation. */
78+
/**
79+
* Convert this Feature to its Protobuf representation.
80+
*
81+
* @return protobuf representation
82+
*/
7983
public FeatureSpecV2 toProto() {
8084
Map<String, String> labels = TypeConversion.convertJsonStringToMap(getLabelsJSON());
8185
return FeatureSpecV2.newBuilder()

core/src/main/java/feast/core/service/SpecService.java

+3
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ public ListStoresResponse listStores(ListStoresRequest.Filter filter) {
262262
*
263263
* @param newEntitySpec EntitySpecV2 that will be used to create or update an Entity.
264264
* @param projectName Project namespace of Entity which is to be created/updated
265+
* @return response of the operation
265266
*/
266267
@Transactional
267268
public ApplyEntityResponse applyEntity(
@@ -314,6 +315,7 @@ public ApplyEntityResponse applyEntity(
314315
* Resolves the project name by returning name if given, autofilling default project otherwise.
315316
*
316317
* @param projectName name of the project to resolve.
318+
* @return project name
317319
*/
318320
public static String resolveProjectName(String projectName) {
319321
return (projectName.isEmpty()) ? Project.DEFAULT_NAME : projectName;
@@ -324,6 +326,7 @@ public static String resolveProjectName(String projectName) {
324326
*
325327
* @param updateStoreRequest containing the new store definition
326328
* @return UpdateStoreResponse containing the new store definition
329+
* @throws InvalidProtocolBufferException if protobuf exception occurs
327330
*/
328331
@Transactional
329332
public UpdateStoreResponse updateStore(UpdateStoreRequest updateStoreRequest)

core/src/main/java/feast/core/util/TypeConversion.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static Map<String, Enum> convertJsonStringToEnumMap(String jsonString) {
7979
/**
8080
* Marshals a given map into its corresponding json string
8181
*
82-
* @param map
82+
* @param map map to be converted
8383
* @return json string corresponding to given map
8484
*/
8585
public static String convertMapToJsonString(Map<String, String> map) {
@@ -89,7 +89,7 @@ public static String convertMapToJsonString(Map<String, String> map) {
8989
/**
9090
* Marshals a given Enum map into its corresponding json string
9191
*
92-
* @param map
92+
* @param map map to be converted
9393
* @return json string corresponding to given Enum map
9494
*/
9595
public static String convertEnumMapToJsonString(Map<String, Enum> map) {

core/src/main/java/feast/core/validators/DataSourceValidator.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
import feast.proto.core.DataSourceProto.DataSource;
2525

2626
public class DataSourceValidator {
27-
/** Validate if the given DataSource protobuf spec is valid. */
27+
/**
28+
* Validate if the given DataSource protobuf spec is valid.
29+
*
30+
* @param spec spec to be validated
31+
*/
2832
public static void validate(DataSource spec) {
2933
switch (spec.getType()) {
3034
case BATCH_FILE:

pom.xml

+3
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,9 @@
543543
</goals>
544544
</execution>
545545
</executions>
546+
<configuration>
547+
<excludePackageNames>feast.proto.*:io.grpc.*:org.tensorflow.*</excludePackageNames>
548+
</configuration>
546549
</plugin>
547550
<plugin>
548551
<groupId>com.diffplug.spotless</groupId>

sdk/java/src/main/java/com/gojek/feast/SecurityConfig.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,23 @@ public abstract class SecurityConfig {
2626
/**
2727
* Enables authentication If specified, the call credentials used to provide credentials to
2828
* authenticate with Feast.
29+
*
30+
* @return credentials
2931
*/
3032
public abstract Optional<CallCredentials> getCredentials();
3133

32-
/** Whether to use TLS transport security is use when connecting to Feast. */
34+
/**
35+
* Whether to use TLS transport security is use when connecting to Feast.
36+
*
37+
* @return true if enabled
38+
*/
3339
public abstract boolean isTLSEnabled();
3440

3541
/**
3642
* If specified and TLS is enabled, provides path to TLS certificate use the verify Service
3743
* identity.
44+
*
45+
* @return certificate path
3846
*/
3947
public abstract Optional<String> getCertificatePath();
4048

serving/src/main/java/feast/serving/config/FeastProperties.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,11 @@ public LoggingProperties getLogging() {
381381
return logging;
382382
}
383383

384-
/** Sets logging properties @@param logging the logging properties */
384+
/**
385+
* Sets logging properties
386+
*
387+
* @param logging the logging properties
388+
*/
385389
public void setLogging(LoggingProperties logging) {
386390
this.logging = logging;
387391
}

0 commit comments

Comments
 (0)