Compare commits
12 Commits
feat/TBD-1
...
patch/7.3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab37af74fe | ||
|
|
8e09cbd65a | ||
|
|
743d863776 | ||
|
|
9a87e0c49e | ||
|
|
78522294dc | ||
|
|
2854fa80b5 | ||
|
|
7389610259 | ||
|
|
ae319f0d85 | ||
|
|
98a80d18b6 | ||
|
|
f878723f81 | ||
|
|
1ac0beea10 | ||
|
|
cc0cab9532 |
@@ -214,6 +214,36 @@ public class ConnParameterKeys {
|
||||
|
||||
/******************************************/
|
||||
|
||||
/*********** Azure Synapse keys ***************/
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_HOST = "CONN_PARA_KEY_SYNAPSE_HOST"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_AUTH_TOKEN = "CONN_PARA_KEY_SYNAPSE_AUTH_TOKEN"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_SPARK_POOLS = "CONN_PARA_KEY_SYNAPSE_SPARK_POOLS"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_HOSTNAME = "CONN_PARA_KEY_SYNAPSE_FS_HOSTNAME"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_CONTAINER = "CONN_PARA_KEY_SYNAPSE_FS_CONTAINER"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_USERNAME = "CONN_PARA_KEY_SYNAPSE_FS_USERNAME"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_PASSWORD = "CONN_PARA_KEY_SYNAPSE_FS_PASSWORD"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_STORAGE = "CONN_PARA_KEY_SYNAPSE_FS_STORAGE"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_DEPLOY_BLOB = "CONN_PARA_KEY_SYNAPSE_DEPLOY_BLOB"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_DRIVER_MEMORY = "CONN_PARA_KEY_DRIVER_MEMORY"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_DRIVER_CORES = "CONN_PARA_KEY_DRIVER_CORES"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_EXECUTOR_MEMORY = "CONN_PARA_KEY_EXECUTOR_MEMORY"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_TUNING_PROPERTIES = "CONN_PARA_KEY_TUNING_PROPERTIES"; //$NON-NLS-1$
|
||||
|
||||
/******************************************/
|
||||
|
||||
/**
|
||||
* HBase keys.
|
||||
*/
|
||||
@@ -321,6 +351,8 @@ public class ConnParameterKeys {
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_ENDPOINT="CONN_PARA_KEY_DATABRICKS_ENDPOINT";
|
||||
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER = "CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER";
|
||||
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_RUN_MODE = "CONN_PARA_KEY_DATABRICKS_RUN_MODE";
|
||||
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_CLUSTER_ID="CONN_PARA_KEY_DATABRICKS_CLUSTER_ID";
|
||||
|
||||
|
||||
@@ -101,22 +101,59 @@ public enum EHadoopProperties {
|
||||
HD_AZURE_DEPLOYBOLB,
|
||||
|
||||
HD_JOB_RESULT_FOLDER,
|
||||
|
||||
|
||||
SYNAPSE_ENDPOINT,
|
||||
|
||||
SYNAPSE_TOKEN,
|
||||
|
||||
SPARK_POOL_NAME,
|
||||
|
||||
SYNAPSE_STORAGE_HOST,
|
||||
|
||||
SYNAPSE_STORAGE_CONTAINER,
|
||||
|
||||
SYNAPSE_STORAGE_USERNAME,
|
||||
|
||||
SYNAPSE_STORAGE_PASSWORD,
|
||||
|
||||
DEPLOY_FOLDER,
|
||||
|
||||
SPARK_DRIVER_MEM,
|
||||
|
||||
SPARK_DRIVER_CORES,
|
||||
|
||||
SPARK_EXECUTOR_MEMORY,
|
||||
|
||||
QUBOLE_API_TOKEN,
|
||||
|
||||
QUBOLE_CLUSTER,
|
||||
|
||||
QUBOLE_CLUSTER_LABEL,
|
||||
|
||||
QUBOLE_ENDPOINT,
|
||||
|
||||
QUBOLE_ENDPOINT_URL,
|
||||
|
||||
QUBOLE_S3_ACCESS_KEY,
|
||||
|
||||
QUBOLE_S3_SECRET_KEY,
|
||||
|
||||
QUBOLE_S3_BUCKET_NAME,
|
||||
|
||||
QUBOLE_S3_BUCKET_KEY,
|
||||
|
||||
QUBOLE_S3_REGION,
|
||||
|
||||
DATABRICKS_ENDPOINT,
|
||||
|
||||
DATABRICKS_CLOUD_PROVIDER,
|
||||
|
||||
DATABRICKS_RUN_MODE,
|
||||
|
||||
DATABRICKS_CLUSTER_ID,
|
||||
|
||||
DATABRICKS_TOKEN,
|
||||
|
||||
DATABRICKS_DBFS_DEP_FOLDER;
|
||||
|
||||
public String getName() {
|
||||
|
||||
@@ -34,6 +34,8 @@ public enum EHadoopDistributions {
|
||||
PIVOTAL_HD("Pivotal HD"), //$NON-NLS-1$
|
||||
|
||||
MICROSOFT_HD_INSIGHT("Microsoft HD Insight"), //$NON-NLS-1$
|
||||
|
||||
AZURE_SYNAPSE("Azure Synapse Runtime for Apache Spark 3.0"), //$NON-NLS-1$
|
||||
|
||||
GOOGLE_CLOUD_DATAPROC("Google Cloud Dataproc"), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.hadoop.version;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum ESynapseStorage {
|
||||
|
||||
ADLS_GEN2("ADLS Gen2"); //$NON-NLS-1$
|
||||
|
||||
private String displayName;
|
||||
|
||||
ESynapseStorage(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name();
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public static List<String> getAllSynapseStorageDisplayNames() {
|
||||
return getAllSynapseStorageNames(true);
|
||||
}
|
||||
|
||||
public static List<String> getAllSynapseStorageNames(boolean display) {
|
||||
List<String> names = new ArrayList<String>();
|
||||
ESynapseStorage[] values = values();
|
||||
for (ESynapseStorage storage : values) {
|
||||
if (display) {
|
||||
names.add(storage.getDisplayName());
|
||||
} else {
|
||||
names.add(storage.getName());
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public static ESynapseStorage getSynapseStoragenByDisplayName(String name) {
|
||||
return getSynapseStorageByName(name, true);
|
||||
}
|
||||
|
||||
public static ESynapseStorage getSynapseStorageByName(String name, boolean display) {
|
||||
if (name != null) {
|
||||
for (ESynapseStorage storage : values()) {
|
||||
if (display) {
|
||||
if (name.equalsIgnoreCase(storage.getDisplayName())) {
|
||||
return storage;
|
||||
}
|
||||
} else {
|
||||
if (name.equalsIgnoreCase(storage.getName())) {
|
||||
return storage;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,8 @@ package org.talend.core.model.metadata.designerproperties;
|
||||
* DOC talend class global comment. Detailled comment
|
||||
*/
|
||||
public enum SapJcoVersion {
|
||||
SAP2("sap jco 2.*", "sapjco.jar"), //$NON-NLS-1$
|
||||
SAP3("sap jco 3.*", "sapjco3.jar");//$NON-NLS-1$
|
||||
SAP2("sap jco 2.*", "sapjco.jar"), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
SAP3("sap jco 3.*", "com.sap.conn.jco.sapjco.jar");//$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private String displayName;
|
||||
|
||||
|
||||
@@ -1492,4 +1492,29 @@ public class NodeUtil {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* TUP-32758:Used to judge if two components are compatible from name
|
||||
* for example tAmazonMysqlConnection and tMysqlConnection ,tAmazonOracleCommit and tOracleCommit
|
||||
*/
|
||||
public static boolean isCompatibleByName(String componentName1, String componentName2) {
|
||||
boolean isCompatable = false;
|
||||
if ( componentName1 ==null || componentName2 == null
|
||||
|| componentName1.length()<1 || componentName2.length() < 1) return false;
|
||||
if (componentName1.replaceFirst("t", "tAmazon").equals(componentName2) ||
|
||||
componentName2.replaceFirst("t", "tAmazon").equals(componentName1)) {
|
||||
isCompatable = true;
|
||||
}
|
||||
return isCompatable;
|
||||
}
|
||||
|
||||
public static boolean isDatabaseFamily(String orginalFamilyName) {
|
||||
boolean isDatabaseFamily = false;
|
||||
String rootFamily = "";
|
||||
rootFamily = orginalFamilyName != null ? orginalFamilyName.split("/")[0] : "";
|
||||
if (rootFamily.equals("Databases")) {
|
||||
isDatabaseFamily = true;
|
||||
}
|
||||
return isDatabaseFamily;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,6 +264,40 @@ public final class TalendQuoteUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isStartEndsWithQuotation(String expression, boolean checkStart, boolean checkEnd) {
|
||||
if (StringUtils.isBlank(expression)) {
|
||||
return false;
|
||||
}
|
||||
boolean startsWith = false;
|
||||
boolean endsWith = false;
|
||||
|
||||
ECodeLanguage language = LanguageManager.getCurrentLanguage();
|
||||
switch (language) {
|
||||
case JAVA:
|
||||
startsWith = expression.startsWith(QUOTATION_MARK);
|
||||
endsWith = expression.endsWith(QUOTATION_MARK);
|
||||
if (checkStart && checkEnd) {
|
||||
return startsWith & endsWith;
|
||||
} else if (checkStart) {
|
||||
return startsWith;
|
||||
} else if (checkEnd) {
|
||||
return endsWith;
|
||||
}
|
||||
default: // PERL
|
||||
startsWith = expression.startsWith(SINGLE_QUOTE);
|
||||
endsWith = expression.endsWith(SINGLE_QUOTE);
|
||||
if (checkStart && checkEnd) {
|
||||
return startsWith & endsWith;
|
||||
} else if (checkStart) {
|
||||
return startsWith;
|
||||
} else if (checkEnd) {
|
||||
return endsWith;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String removeQuotes(String text, String quotation) {
|
||||
if (text == null) {
|
||||
return null;
|
||||
|
||||
@@ -54,6 +54,17 @@
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
<artifactId>wagon-http</artifactId>
|
||||
<version>${wagon.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.14.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -94,6 +98,11 @@
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.14.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>studio-tacokit-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<tacokit.components.version>1.25.0</tacokit.components.version>
|
||||
<tacokit.components.version>1.26.0</tacokit.components.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<tcomp.version>1.36.1</tcomp.version>
|
||||
<tcomp.version>1.37.0</tcomp.version>
|
||||
<slf4j.version>1.7.32</slf4j.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// ============================================================================
|
||||
package routines.system;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.Date;
|
||||
|
||||
import routines.TalendDate;
|
||||
@@ -31,6 +32,8 @@ public class RuntimeUtils {
|
||||
public static String getRuntimeType(Object o) {
|
||||
return o.getClass().getName();
|
||||
}
|
||||
|
||||
private static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
/**
|
||||
* This function is in order to check the Date type in tRunJob when transmit the context to child job.
|
||||
@@ -45,11 +48,40 @@ public class RuntimeUtils {
|
||||
|
||||
// when tRunJob transmit the date to child job, it should format with "yyyy-MM-dd HH:mm:ss"
|
||||
if (isDateType(o)) {
|
||||
return TalendDate.formatDate("yyyy-MM-dd HH:mm:ss", (Date) o); //$NON-NLS-1$
|
||||
return TalendDate.formatDate(DEFAULT_DATE_PATTERN, (Date) o); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
public static Date getDate(String pattern, String dateString) {
|
||||
if (dateString == null || dateString.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// when tRunJob transmit the date to child job:
|
||||
//case 1: pass date string with pattern : yyyy-MM-dd HH:mm:ss
|
||||
//case 2: pass date long value
|
||||
//so here process two cases both and avoid exception
|
||||
try {
|
||||
return new java.text.SimpleDateFormat(pattern).parse(dateString);
|
||||
} catch(ParseException e) {
|
||||
//ignore exception
|
||||
}
|
||||
|
||||
try {
|
||||
return new Date(Long.valueOf(dateString));
|
||||
} catch(NumberFormatException e) {
|
||||
//ignore exception
|
||||
//System.err.println(String.format("Null value will be used for context parameter as can't parse this to date: %s", dateString));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Date getDate(String dateString) {
|
||||
return getDate(DEFAULT_DATE_PATTERN, dateString);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
int i = 10;
|
||||
|
||||
@@ -820,6 +820,8 @@ public class ModulesNeededProvider {
|
||||
IMPORTType importType = ComponentFactory.eINSTANCE.createIMPORTType();
|
||||
importType.setMODULEGROUP("esb-java-11-group");
|
||||
importType.setREQUIRED(true);
|
||||
|
||||
collectModuleNeeded("tRESTClient", importType, importNeedsListForRoutes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,6 +45,11 @@ public class ExtendedNodeConnectionContextUtils {
|
||||
ReplicaSets,
|
||||
ReplicaHost,
|
||||
ReplicaPort,
|
||||
|
||||
AuthenticationDatabase,
|
||||
UserPrincipal,
|
||||
Realm,
|
||||
KDCServer,
|
||||
|
||||
// Hadoop standard param
|
||||
NameNodeUri,
|
||||
@@ -84,6 +89,20 @@ public class ExtendedNodeConnectionContextUtils {
|
||||
KeyAzuresUser,
|
||||
KeyAzurePassword,
|
||||
KeyAzureDeployBlob,
|
||||
|
||||
// Azure Synapse param
|
||||
SynapseHostName,
|
||||
SynapseAuthToken,
|
||||
SynapseSparkPools,
|
||||
SynapseFsHostName,
|
||||
SynapseFsContainer,
|
||||
SynapseFsUserName,
|
||||
SynapseFsPassword,
|
||||
SynapseDeployBlob,
|
||||
SynapseDriverMemory,
|
||||
SynapseDriverCores,
|
||||
SynapseExecutorMemory,
|
||||
UseTuningProperties,
|
||||
|
||||
// Hcatalog param
|
||||
HCatalogHostName,
|
||||
@@ -135,6 +154,7 @@ public class ExtendedNodeConnectionContextUtils {
|
||||
|
||||
// DataBricks
|
||||
DataBricksEndpoint,
|
||||
DatabricksRunMode,
|
||||
DataBricksCloudProvider,
|
||||
DataBricksClusterId,
|
||||
DataBricksToken,
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.utils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
@@ -247,4 +249,25 @@ public class TalendQuoteUtilsTest {
|
||||
assertTrue("\"abcd\"".equals(resultStr));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsStartEndsWithQuotation() {
|
||||
String text = "\"prefix_\"+context.db+\".\"+context.schema+\"_suffix\"";
|
||||
assertTrue(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, false, false));
|
||||
|
||||
text = "\"prefix_\"+context.db+\".\"+context.schema";
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
|
||||
assertTrue(TalendQuoteUtils.isStartEndsWithQuotation(text, true, false));
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, false, true));
|
||||
|
||||
text = "context.db+\".\"+context.schema+\"_suffix\"";
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, false));
|
||||
assertTrue(TalendQuoteUtils.isStartEndsWithQuotation(text, false, true));
|
||||
|
||||
text = "context.db+\".\"+context.schema";
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, false));
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, false, true));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user