-
Notifications
You must be signed in to change notification settings - Fork 3
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 #136 from orkes-io/remove_gson
Remove Gson, Jersey Dependencies and Usability fixes
- Loading branch information
Showing
67 changed files
with
2,516 additions
and
1,032 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
version=3.0.45 | ||
version=2.0.0 |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/google/gson/annotations/SerializedName.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,17 @@ | ||
/* | ||
* Copyright 2023 Orkes, Inc. | ||
* <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.google.gson.annotations; | ||
|
||
public @interface SerializedName { | ||
String value(); | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/com/netflix/conductor/client/config/ConductorClientConfiguration.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,50 @@ | ||
/* | ||
* Copyright 2018 Orkes, Inc. | ||
* <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.client.config; | ||
|
||
public interface ConductorClientConfiguration { | ||
|
||
/** | ||
* @return the workflow input payload size threshold in KB, beyond which the payload will be | ||
* processed based on {@link | ||
* ConductorClientConfiguration#isExternalPayloadStorageEnabled()}. | ||
*/ | ||
int getWorkflowInputPayloadThresholdKB(); | ||
|
||
/** | ||
* @return the max value of workflow input payload size threshold in KB, beyond which the | ||
* payload will be rejected regardless external payload storage is enabled. | ||
*/ | ||
int getWorkflowInputMaxPayloadThresholdKB(); | ||
|
||
/** | ||
* @return the task output payload size threshold in KB, beyond which the payload will be | ||
* processed based on {@link | ||
* ConductorClientConfiguration#isExternalPayloadStorageEnabled()}. | ||
*/ | ||
int getTaskOutputPayloadThresholdKB(); | ||
|
||
/** | ||
* @return the max value of task output payload size threshold in KB, beyond which the payload | ||
* will be rejected regardless external payload storage is enabled. | ||
*/ | ||
int getTaskOutputMaxPayloadThresholdKB(); | ||
|
||
/** | ||
* @return the flag which controls the use of external storage for storing workflow/task input | ||
* and output JSON payloads with size greater than threshold. If it is set to true, the | ||
* payload is stored in external location. If it is set to false, the payload is rejected | ||
* and the task/workflow execution fails. | ||
*/ | ||
boolean isExternalPayloadStorageEnabled(); | ||
} |
91 changes: 91 additions & 0 deletions
91
src/main/java/com/netflix/conductor/client/config/PropertyFactory.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,91 @@ | ||
/* | ||
* Copyright 2020 Orkes, Inc. | ||
* <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.client.config; | ||
|
||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
import com.netflix.config.DynamicProperty; | ||
|
||
/** Used to configure the Conductor workers using properties. */ | ||
public class PropertyFactory { | ||
|
||
private final DynamicProperty global; | ||
private final DynamicProperty local; | ||
|
||
private static final String PROPERTY_PREFIX = "conductor.worker"; | ||
|
||
private static final ConcurrentHashMap<String, PropertyFactory> PROPERTY_FACTORY_MAP = | ||
new ConcurrentHashMap<>(); | ||
|
||
private PropertyFactory(String prefix, String propName, String workerName) { | ||
this.global = DynamicProperty.getInstance(prefix + "." + propName); | ||
this.local = DynamicProperty.getInstance(prefix + "." + workerName + "." + propName); | ||
} | ||
|
||
/** | ||
* @param defaultValue Default Value | ||
* @return Returns the value as integer. If not value is set (either global or worker specific), | ||
* then returns the default value. | ||
*/ | ||
public Integer getInteger(int defaultValue) { | ||
Integer value = local.getInteger(); | ||
if (value == null) { | ||
value = global.getInteger(defaultValue); | ||
} | ||
return value; | ||
} | ||
|
||
/** | ||
* @param defaultValue Default Value | ||
* @return Returns the value as String. If not value is set (either global or worker specific), | ||
* then returns the default value. | ||
*/ | ||
public String getString(String defaultValue) { | ||
String value = local.getString(); | ||
if (value == null) { | ||
value = global.getString(defaultValue); | ||
} | ||
return value; | ||
} | ||
|
||
/** | ||
* @param defaultValue Default Value | ||
* @return Returns the value as Boolean. If not value is set (either global or worker specific), | ||
* then returns the default value. | ||
*/ | ||
public Boolean getBoolean(Boolean defaultValue) { | ||
Boolean value = local.getBoolean(); | ||
if (value == null) { | ||
value = global.getBoolean(defaultValue); | ||
} | ||
return value; | ||
} | ||
|
||
public static Integer getInteger(String workerName, String property, Integer defaultValue) { | ||
return getPropertyFactory(workerName, property).getInteger(defaultValue); | ||
} | ||
|
||
public static Boolean getBoolean(String workerName, String property, Boolean defaultValue) { | ||
return getPropertyFactory(workerName, property).getBoolean(defaultValue); | ||
} | ||
|
||
public static String getString(String workerName, String property, String defaultValue) { | ||
return getPropertyFactory(workerName, property).getString(defaultValue); | ||
} | ||
|
||
private static PropertyFactory getPropertyFactory(String workerName, String property) { | ||
String key = property + "." + workerName; | ||
return PROPERTY_FACTORY_MAP.computeIfAbsent( | ||
key, t -> new PropertyFactory(PROPERTY_PREFIX, property, workerName)); | ||
} | ||
} |
Oops, something went wrong.