diff options
Diffstat (limited to 'groot-common')
8 files changed, 52 insertions, 61 deletions
diff --git a/groot-common/src/main/java/com/geedgenetworks/common/Event.java b/groot-common/src/main/java/com/geedgenetworks/common/Event.java index 7733c66..20ecca7 100644 --- a/groot-common/src/main/java/com/geedgenetworks/common/Event.java +++ b/groot-common/src/main/java/com/geedgenetworks/common/Event.java @@ -12,17 +12,8 @@ public class Event implements Serializable { public static final String WINDOW_START_TIMESTAMP = "__window_start_timestamp"; public static final String WINDOW_END_TIMESTAMP = "__window_end_timestamp"; - private Map<String, Object> extractedFields; //Dropped flag, default is false. if set to true, indicates whether an event has been intentionally excluded and removed from further processing. private boolean isDropped = false; - - public Map<String, Object> getExtractedFields() { - return extractedFields; - } - - public void setExtractedFields(Map<String, Object> extractedFields) { - this.extractedFields = extractedFields; - } } diff --git a/groot-common/src/main/java/com/geedgenetworks/common/config/ClientSSLConfig.java b/groot-common/src/main/java/com/geedgenetworks/common/config/ClientSSLConfig.java new file mode 100644 index 0000000..aadeb70 --- /dev/null +++ b/groot-common/src/main/java/com/geedgenetworks/common/config/ClientSSLConfig.java @@ -0,0 +1,16 @@ +package com.geedgenetworks.common.config; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ClientSSLConfig implements Serializable { + private Boolean skipVerification = CommonConfigOptions.SSL_SKIP_VERIFICATION.defaultValue(); + + private String caCertificatePath = CommonConfigOptions.SSL_CA_CERTIFICATE_PATH.defaultValue(); + + private String certificatePath = CommonConfigOptions.SSL_CERTIFICATE_PATH.defaultValue(); + + private String privateKeyPath = CommonConfigOptions.SSL_PRIVATE_KEY_PATH.defaultValue(); +} diff --git a/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfig.java b/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfig.java index aeda71d..8790f47 100644 --- a/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfig.java +++ b/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfig.java @@ -18,7 +18,7 @@ public class CommonConfig implements Serializable { private Map<String,KmsConfig> kmsConfig = CommonConfigOptions.KMS.defaultValue(); - private SSLConfig sslConfig = CommonConfigOptions.SSL.defaultValue(); + private ClientSSLConfig sslConfig = CommonConfigOptions.SSL.defaultValue(); private Map<String,String> propertiesConfig = CommonConfigOptions.PROPERTIES.defaultValue(); @@ -32,7 +32,7 @@ public class CommonConfig implements Serializable { this.kmsConfig = kmsConfig; } - public void setSslConfig(SSLConfig sslConfig) { + public void setSslConfig(ClientSSLConfig sslConfig) { checkNotNull(sslConfig, CommonConfigOptions.SSL + " sslConfig should not be null"); this.sslConfig = sslConfig; } diff --git a/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfigDomProcessor.java b/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfigDomProcessor.java index b3b17e8..e80e1c4 100644 --- a/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfigDomProcessor.java +++ b/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfigDomProcessor.java @@ -83,17 +83,17 @@ public class CommonConfigDomProcessor extends AbstractDomConfigProcessor { return knowledgeBaseConfig; } - private SSLConfig parseSSLConfig(Node sslRootNode) { - SSLConfig sslConfig = new SSLConfig(); + private ClientSSLConfig parseSSLConfig(Node sslRootNode) { + ClientSSLConfig sslConfig = new ClientSSLConfig(); for (Node node : childElements(sslRootNode)) { String name = cleanNodeName(node); - if (CommonConfigOptions.SKIP_VERIFICATION.key().equals(name)) { + if (CommonConfigOptions.SSL_SKIP_VERIFICATION.key().equals(name)) { sslConfig.setSkipVerification(getBooleanValue(getTextContent(node))); - } else if (CommonConfigOptions.CA_CERTIFICATE_PATH.key().equals(name)) { + } else if (CommonConfigOptions.SSL_CA_CERTIFICATE_PATH.key().equals(name)) { sslConfig.setCaCertificatePath(getTextContent(node)); - } else if (CommonConfigOptions.CERTIFICATE_PATH.key().equals(name)) { + } else if (CommonConfigOptions.SSL_CERTIFICATE_PATH.key().equals(name)) { sslConfig.setCertificatePath(getTextContent(node)); - } else if (CommonConfigOptions.PRIVATE_KEY_PATH.key().equals(name)) { + } else if (CommonConfigOptions.SSL_PRIVATE_KEY_PATH.key().equals(name)) { sslConfig.setPrivateKeyPath(getTextContent(node)); } else { log.warn("Unrecognized SSL configuration element: {}", name); diff --git a/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfigOptions.java b/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfigOptions.java index 167fcba..20f5c55 100644 --- a/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfigOptions.java +++ b/groot-common/src/main/java/com/geedgenetworks/common/config/CommonConfigOptions.java @@ -9,6 +9,13 @@ import java.util.Map; public class CommonConfigOptions { + public static final Option<List<KnowledgeBaseConfig>> KNOWLEDGE_BASE = + Options.key("knowledge_base") + .type(new TypeReference<List<KnowledgeBaseConfig>>() { + }) + .noDefaultValue() + .withDescription("The knowledge base configuration."); + public static final Option<Map<String, String>> KNOWLEDGE_BASE_PROPERTIES = Options.key("properties") .mapType() @@ -35,22 +42,6 @@ public class CommonConfigOptions { .defaultValue(new ArrayList<String>()) .withDescription("The files of knowledge base."); - public static final Option<String> KNOWLEDGE_BASE_STORAGE_FS_TYPE = Options.key("fs_type") - .stringType() - .defaultValue("localfile") - .withDescription("The fs type of knowledge base storage."); - - public static final Option<String> KNOWLEDGE_BASE_STORAGE_FS_DEFAULT_PATH = Options.key("fs_default_path") - .stringType() - .defaultValue("") - .withDescription("The default path of knowledge base storage."); - - public static final Option<List<KnowledgeBaseConfig>> KNOWLEDGE_BASE = - Options.key("knowledge_base") - .type(new TypeReference<List<KnowledgeBaseConfig>>() { - }) - .noDefaultValue() - .withDescription("The knowledge base configuration."); public static final Option<Map<String, String>> PROPERTIES = Options.key("properties") @@ -95,28 +86,28 @@ public class CommonConfigOptions { .defaultValue("") .withDescription("The plugin key path of KMS."); - public static final Option<SSLConfig> SSL = Options.key("ssl") - .type(new TypeReference<SSLConfig>() { + public static final Option<ClientSSLConfig> SSL = Options.key("ssl") + .type(new TypeReference<ClientSSLConfig>() { }) .noDefaultValue() .withDescription("The ssl configuration."); - public static final Option<Boolean> SKIP_VERIFICATION = Options.key("skip_verification") + public static final Option<Boolean> SSL_SKIP_VERIFICATION = Options.key("skip_verification") .booleanType() .defaultValue(false) .withDescription("The skip certificate of the configuration."); - public static final Option<String> CA_CERTIFICATE_PATH = Options.key("ca_certificate_path") + public static final Option<String> SSL_CA_CERTIFICATE_PATH = Options.key("ca_certificate_path") .stringType() .defaultValue("") .withDescription("The ca certificate file path of the configuration."); - public static final Option<String> CERTIFICATE_PATH = Options.key("certificate_path") + public static final Option<String> SSL_CERTIFICATE_PATH = Options.key("certificate_path") .stringType() .defaultValue("") .withDescription("The certificate file path of the configuration."); - public static final Option<String> PRIVATE_KEY_PATH = Options.key("private_key_path") + public static final Option<String> SSL_PRIVATE_KEY_PATH = Options.key("private_key_path") .stringType() .defaultValue("") .withDescription("The private key file path of the configuration."); diff --git a/groot-common/src/main/java/com/geedgenetworks/common/config/SSLConfig.java b/groot-common/src/main/java/com/geedgenetworks/common/config/SSLConfig.java deleted file mode 100644 index 874c163..0000000 --- a/groot-common/src/main/java/com/geedgenetworks/common/config/SSLConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.geedgenetworks.common.config; - -import lombok.Data; - -import java.io.Serializable; - -@Data -public class SSLConfig implements Serializable { - private Boolean skipVerification = CommonConfigOptions.SKIP_VERIFICATION.defaultValue(); - - private String caCertificatePath = CommonConfigOptions.CA_CERTIFICATE_PATH.defaultValue(); - - private String certificatePath = CommonConfigOptions.CERTIFICATE_PATH.defaultValue(); - - private String privateKeyPath = CommonConfigOptions.PRIVATE_KEY_PATH.defaultValue(); -} diff --git a/groot-common/src/main/java/com/geedgenetworks/common/config/UDFContextConfigOptions.java b/groot-common/src/main/java/com/geedgenetworks/common/config/UDFContextConfigOptions.java index ac36b02..87bbf36 100644 --- a/groot-common/src/main/java/com/geedgenetworks/common/config/UDFContextConfigOptions.java +++ b/groot-common/src/main/java/com/geedgenetworks/common/config/UDFContextConfigOptions.java @@ -44,6 +44,15 @@ public interface UDFContextConfigOptions { .noDefaultValue() .withDescription("The geolocation field mapping."); + Option<String> PARAMETERS_IDENTIFIER = Options.key("identifier") + .stringType() + .noDefaultValue() + .withDescription("The identifier for the parameters of function."); + + Option<String> PARAMETERS_SECRET_KEY = Options.key("secret_key") + .stringType() + .noDefaultValue() + .withDescription("The secret key for the function."); Option<String> FUNCTION = Options.key("function") .stringType() diff --git a/groot-common/src/main/resources/grootstream.yaml b/groot-common/src/main/resources/grootstream.yaml index 26752e3..97da81e 100644 --- a/groot-common/src/main/resources/grootstream.yaml +++ b/groot-common/src/main/resources/grootstream.yaml @@ -17,17 +17,17 @@ grootstream: type: local vault: type: vault - url: https://192.168.40.223:8200 - username: tsg_olap - password: tsg_olap + url: https://192.168.44.12:8200 + username: galaxy + password: Galaxy2019# default_key_path: tsg_olap/transit plugin_key_path: tsg_olap/plugin/gmsm ssl: skip_verification: true - ca_certificate_path: ./config/ssl/root.pem - certificate_path: ./config/ssl/worker.pem - private_key_path: ./config/ssl/worker.key + ca_certificate_path: ./config/ssl/ca.crt + certificate_path: ./config/ssl/server.crt + private_key_path: ./config/ssl/server.key properties: hos.path: http://192.168.44.12:9098/hos |
