-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from conductor-oss/core_updates
Core updates
- Loading branch information
Showing
47 changed files
with
1,315 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
common/src/main/java/com/netflix/conductor/annotations/protogen/ProtoEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2022 Conductor Authors. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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 com.netflix.conductor.annotations.protogen; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* ProtoEnum annotates an enum type that will be exposed via the GRPC API as a native Protocol | ||
* Buffers enum. | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface ProtoEnum {} |
36 changes: 36 additions & 0 deletions
36
common/src/main/java/com/netflix/conductor/annotations/protogen/ProtoField.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2022 Conductor Authors. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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 com.netflix.conductor.annotations.protogen; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* ProtoField annotates a field inside an struct with metadata on how to expose it on its | ||
* corresponding Protocol Buffers struct. For a field to be exposed in a ProtoBuf struct, the | ||
* containing struct must also be annotated with a {@link ProtoMessage} or {@link ProtoEnum} tag. | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.FIELD) | ||
public @interface ProtoField { | ||
/** | ||
* Mandatory. Sets the Protocol Buffer ID for this specific field. Once a field has been | ||
* annotated with a given ID, the ID can never change to a different value or the resulting | ||
* Protocol Buffer struct will not be backwards compatible. | ||
* | ||
* @return the numeric ID for the field | ||
*/ | ||
int id(); | ||
} |
51 changes: 51 additions & 0 deletions
51
common/src/main/java/com/netflix/conductor/annotations/protogen/ProtoMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2022 Conductor Authors. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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 com.netflix.conductor.annotations.protogen; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* ProtoMessage annotates a given Java class so it becomes exposed via the GRPC API as a native | ||
* Protocol Buffers struct. The annotated class must be a POJO. | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface ProtoMessage { | ||
/** | ||
* Sets whether the generated mapping code will contain a helper to translate the POJO for this | ||
* class into the equivalent ProtoBuf object. | ||
* | ||
* @return whether this class will generate a mapper to ProtoBuf objects | ||
*/ | ||
boolean toProto() default true; | ||
|
||
/** | ||
* Sets whether the generated mapping code will contain a helper to translate the ProtoBuf | ||
* object for this class into the equivalent POJO. | ||
* | ||
* @return whether this class will generate a mapper from ProtoBuf objects | ||
*/ | ||
boolean fromProto() default true; | ||
|
||
/** | ||
* Sets whether this is a wrapper class that will be used to encapsulate complex nested type | ||
* interfaces. Wrapper classes are not directly exposed by the ProtoBuf API and must be mapped | ||
* manually. | ||
* | ||
* @return whether this is a wrapper class | ||
*/ | ||
boolean wrapper() default false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
common/src/main/java/com/netflix/conductor/common/metadata/SchemaDef.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright 2024 Conductor Authors. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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 com.netflix.conductor.common.metadata; | ||
|
||
import java.util.Map; | ||
|
||
import com.netflix.conductor.annotations.protogen.ProtoEnum; | ||
import com.netflix.conductor.annotations.protogen.ProtoField; | ||
import com.netflix.conductor.annotations.protogen.ProtoMessage; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
|
||
@EqualsAndHashCode(callSuper = true) | ||
@Builder | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@ProtoMessage | ||
public class SchemaDef extends Auditable { | ||
|
||
@ProtoEnum | ||
public enum Type { | ||
JSON, | ||
AVRO, | ||
PROTOBUF | ||
} | ||
|
||
@ProtoField(id = 1) | ||
@NotNull | ||
private String name; | ||
|
||
@ProtoField(id = 2) | ||
@NotNull | ||
@Builder.Default | ||
private int version = 1; | ||
|
||
@ProtoField(id = 3) | ||
@NotNull | ||
private Type type; | ||
|
||
// Schema definition stored here | ||
private Map<String, Object> data; | ||
|
||
// Externalized schema definition (eg. via AVRO, Protobuf registry) | ||
// If using Orkes Schema registry, this points to the name of the schema in the registry | ||
private String externalRef; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.