Skip to content

Commit

Permalink
cleanup all properties to follow a namespaced pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
apanicker-nflx committed Dec 29, 2020
1 parent 467e039 commit bc66dfc
Show file tree
Hide file tree
Showing 167 changed files with 2,762 additions and 1,334 deletions.
282 changes: 268 additions & 14 deletions CHANGELOG.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
import com.netflix.conductor.azureblob.storage.AzureBlobPayloadStorage;
import com.netflix.conductor.common.utils.ExternalPayloadStorage;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Configuration
@ConditionalOnProperty(prefix = "workflow", name = "external.payload.storage", havingValue = "AZURE_BLOB")
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(AzureBlobProperties.class)
@ConditionalOnProperty(name = "conductor.external-payload-storage.type", havingValue = "azureblob")
public class AzureBlobConfiguration {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,77 +12,125 @@
*/
package com.netflix.conductor.azureblob.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import org.springframework.boot.context.properties.ConfigurationProperties;

@Component
@ConditionalOnProperty(prefix = "workflow", name = "external.payload.storage", havingValue = "AZURE_BLOB")
@ConfigurationProperties("conductor.external-payload-storage.azureblob")
public class AzureBlobProperties {

public static final String CONNECTION_STRING_PROPERTY_NAME = "workflow.external.payload.storage.azure_blob.connection_string";
public static final String ENDPOINT_PROPERTY_NAME = "workflow.external.payload.storage.azure_blob.endpoint";

@Value("${" + CONNECTION_STRING_PROPERTY_NAME + ":#{null}}")
private String connectionString;

@Value("${workflow.external.payload.storage.azure_blob.container_name:conductor-payloads}")
private String containerName;

@Value("${" + ENDPOINT_PROPERTY_NAME + ":#{null}}")
private String endpoint;

@Value("${workflow.external.payload.storage.azure_blob.sas_token:#{null}}")
private String sasToken;

@Value("${workflow.external.payload.storage.azure_blob.signedurlexpirationseconds:5}")
private int signedUrlExpirationSeconds;

@Value("${workflow.external.payload.storage.azure_blob.workflow_input_path:workflow/input/}")
private String workflowInputPath;

@Value("${workflow.external.payload.storage.azure_blob.workflow_output_path:workflow/output/}")
private String workflowOutputPath;

@Value("${workflow.external.payload.storage.azure_blob.task_input_path:task/input/}")
private String taskInputPath;

@Value("${workflow.external.payload.storage.azure_blob.task_output_path:task/output/}")
private String taskOutputPath;
/**
* The connection string to be used to connect to Azure Blob storage
*/
private String connectionString = null;

/**
* The name of the container where the payloads will be stored
*/
private String containerName = "conductor-payloads";

/**
* The endpoint to be used to connect to Azure Blob storage
*/
private String endpoint = null;

/**
* The sas token to be used for authenticating requests
*/
private String sasToken = null;

/**
* The time for which the shared access signature is valid
*/
private int signedUrlExpirationSeconds = 5;

/**
* The path at which the workflow inputs will be stored
*/
private String workflowInputPath = "workflow/input/";

/**
* The path at which the workflow outputs will be stored
*/
private String workflowOutputPath = "workflow/output/";

/**
* The path at which the task inputs will be stored
*/
private String taskInputPath = "task/input/";

/**
* The path at which the task outputs will be stored
*/
private String taskOutputPath = "task/output/";

public String getConnectionString() {
return connectionString;
}

public void setConnectionString(String connectionString) {
this.connectionString = connectionString;
}

public String getContainerName() {
return containerName;
}

public void setContainerName(String containerName) {
this.containerName = containerName;
}

public String getEndpoint() {
return endpoint;
}

public void setEndpoint(String endpoint) {
this.endpoint = endpoint;
}

public String getSasToken() {
return sasToken;
}

public void setSasToken(String sasToken) {
this.sasToken = sasToken;
}

public int getSignedUrlExpirationSeconds() {
return signedUrlExpirationSeconds;
}

public void setSignedUrlExpirationSeconds(int signedUrlExpirationSeconds) {
this.signedUrlExpirationSeconds = signedUrlExpirationSeconds;
}

public String getWorkflowInputPath() {
return workflowInputPath;
}

public void setWorkflowInputPath(String workflowInputPath) {
this.workflowInputPath = workflowInputPath;
}

public String getWorkflowOutputPath() {
return workflowOutputPath;
}

public void setWorkflowOutputPath(String workflowOutputPath) {
this.workflowOutputPath = workflowOutputPath;
}

public String getTaskInputPath() {
return taskInputPath;
}

public void setTaskInputPath(String taskInputPath) {
this.taskInputPath = taskInputPath;
}

public String getTaskOutputPath() {
return taskOutputPath;
}

public void setTaskOutputPath(String taskOutputPath) {
this.taskOutputPath = taskOutputPath;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@
import com.netflix.conductor.common.utils.ExternalPayloadStorage;
import com.netflix.conductor.core.exception.ApplicationException;
import com.netflix.conductor.core.utils.IDGenerator;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* An implementation of {@link ExternalPayloadStorage} using Azure Blob for storing large JSON payload data.
Expand Down Expand Up @@ -83,10 +82,7 @@ public AzureBlobPayloadStorage(AzureBlobProperties properties) {
sasTokenCredential = null;
}
} else {
String msg = "Missing property "
+ AzureBlobProperties.CONNECTION_STRING_PROPERTY_NAME
+ " OR "
+ AzureBlobProperties.ENDPOINT_PROPERTY_NAME;
String msg = "Missing property for connectionString OR endpoint";
LOGGER.error(msg);
throw new ApplicationException(ApplicationException.Code.BACKEND_ERROR, msg);
}
Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def javaProjects = subprojects.findAll {
it.name != "ui"
}

configure(javaProjects) {
compileJava.inputs.files(processResources)
}

apply from: "$rootDir/dependencies.gradle"

// change the ES version used by Spring Boot Dependency Management plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(name = "db", havingValue = "cassandra")
@EnableConfigurationProperties(CassandraProperties.class)
@ConditionalOnProperty(name = "conductor.db.type", havingValue = "cassandra")
public class CassandraConfiguration {

private static final Logger LOGGER = LoggerFactory.getLogger(CassandraConfiguration.class);
Expand Down Expand Up @@ -80,6 +82,6 @@ public EventHandlerDAO cassandraEventHandlerDAO(Session session, ObjectMapper ob

@Bean
public Statements statements(CassandraProperties cassandraProperties) {
return new Statements(cassandraProperties.getCassandraKeyspace());
return new Statements(cassandraProperties.getKeyspace());
}
}
Loading

0 comments on commit bc66dfc

Please sign in to comment.