Compare commits
16 Commits
patch/7.3.
...
vdrokov_fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56f19902d0 | ||
|
|
75176b6f45 | ||
|
|
11ecc1cbfd | ||
|
|
53efef8de0 | ||
|
|
db2eb01c38 | ||
|
|
f9af16ba90 | ||
|
|
23f2926741 | ||
|
|
48653aa380 | ||
|
|
d80fefc234 | ||
|
|
a0b395cd3a | ||
|
|
98bcc66479 | ||
|
|
a716257dd0 | ||
|
|
b164f8c447 | ||
|
|
dd352b4a8f | ||
|
|
08ac05c23e | ||
|
|
90a37f8418 |
@@ -114,7 +114,10 @@ public enum EDatabaseTypeName {
|
||||
"ParAccel", "ParAccel", Boolean.TRUE, "PARACCEL", "PARACCEL", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
NETEZZA(
|
||||
"Netezza", "Netezza", Boolean.FALSE, "NETEZZA", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
SAS("SAS", "SAS", Boolean.TRUE, "SAS", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
SAS("SAS", "SAS (Deprecated)", Boolean.TRUE, "SAS", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// General JDBC not support schema defalut
|
||||
GENERAL_JDBC(
|
||||
"General JDBC", "General JDBC", Boolean.FALSE, "JDBC", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
@@ -22,14 +22,14 @@ import org.talend.core.runtime.hd.hive.HiveMetadataHelper;
|
||||
*/
|
||||
public enum EImpalaDriver {
|
||||
|
||||
HIVE2("HIVE2", "HIVE2", "org.apache.hive.jdbc.HiveDriver"),
|
||||
IMPALA40("IMPALA40", "IMPALA40", "com.cloudera.impala.jdbc4.Driver"),
|
||||
IMPALA41("IMPALA41", "IMPALA41", "com.cloudera.impala.jdbc41.Driver");
|
||||
HIVE2("HIVE2", "HIVE2", "org.apache.hive.jdbc.HiveDriver", "doSupportHive2"),
|
||||
IMPALA("IMPALA", "IMPALA", "com.cloudera.impala.jdbc.Driver", "doSupportImpalaConnector");
|
||||
|
||||
EImpalaDriver(String displayName, String name, String driver) {
|
||||
EImpalaDriver(String displayName, String name, String driver, String supportDriverMethodName) {
|
||||
this.displayName = displayName;
|
||||
this.name = name;
|
||||
this.driver = driver;
|
||||
this.supportDriverMethodName = supportDriverMethodName;
|
||||
}
|
||||
|
||||
private String displayName;
|
||||
@@ -38,6 +38,8 @@ public enum EImpalaDriver {
|
||||
|
||||
private String driver;
|
||||
|
||||
private String supportDriverMethodName;
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
@@ -50,6 +52,10 @@ public enum EImpalaDriver {
|
||||
return driver;
|
||||
}
|
||||
|
||||
public String getSupportDriverMethodName() {
|
||||
return supportDriverMethodName;
|
||||
}
|
||||
|
||||
public static boolean isSupport(String distribution, String version, boolean byDisplay, String supportMethodName) {
|
||||
return HiveMetadataHelper.doSupportMethod(distribution, version, byDisplay, supportMethodName);
|
||||
}
|
||||
@@ -57,7 +63,7 @@ public enum EImpalaDriver {
|
||||
public static String[] getImpalaDriverDisplay(String distribution, String version, boolean byDisplay) {
|
||||
List<String> list = new ArrayList<>(0);
|
||||
for (EImpalaDriver driver : EImpalaDriver.values()) {
|
||||
if (isSupport(distribution, version, byDisplay, "doSupportImpalaConnector")) {
|
||||
if (isSupport(distribution, version, byDisplay, driver.getSupportDriverMethodName())) {
|
||||
list.add(driver.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,8 +228,10 @@ public class DatabaseConnStrUtil {
|
||||
.get(ConnParameterKeys.IMPALA_AUTHENTICATION_PRINCIPLA));
|
||||
}
|
||||
String url = null;
|
||||
if (template.startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE)) {
|
||||
url = getImpalaURLString(false, server, port, sidOrDatabase, impalaPrincipal);
|
||||
String driver = dbConn.getParameters().get(ConnParameterKeys.IMPALA_DRIVER);
|
||||
if (template.startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE)
|
||||
|| template.startsWith(DbConnStrForHive.URL_IMPALA_TEMPLATE)) {
|
||||
url = getImpalaURLString(false, server, port, sidOrDatabase, impalaPrincipal, driver);
|
||||
}
|
||||
url = attachAdditionalHiveParameters(url, dbConn, false);
|
||||
return url;
|
||||
@@ -376,9 +378,13 @@ public class DatabaseConnStrUtil {
|
||||
return s;
|
||||
}
|
||||
|
||||
private static String getImpalaURLString(boolean supportContext, String server, String port, String sid, String Principal) {
|
||||
String s = EDatabaseConnTemplate.IMPALA.getUrlTemplate(null);
|
||||
String standardURlString = getImpalaURlString(s, supportContext, server, port, sid);
|
||||
private static String getImpalaURLString(boolean supportContext, String server, String port, String sid, String Principal,
|
||||
String driver) {
|
||||
String template = EDatabaseConnTemplate.IMPALA.getUrlTemplate(null);
|
||||
if (EDatabaseTypeName.IMPALA.getDbType().equals(driver)) {
|
||||
template = EDatabaseConnTemplate.IMPALA_IMPALA_DRIVER.getUrlTemplate(null);
|
||||
}
|
||||
String standardURlString = getImpalaURlString(template, supportContext, server, port, sid);
|
||||
String principalSuffix = "principal="; //$NON-NLS-1$
|
||||
boolean hasPrinc = false;
|
||||
String[] urlArray = standardURlString.split(SEMICOLON);
|
||||
|
||||
@@ -30,6 +30,8 @@ public class DbConnStrForHive extends DbConnStr {
|
||||
|
||||
public static final String URL_HIVE_2_TEMPLATE = "jdbc:hive2://";//$NON-NLS-1$
|
||||
|
||||
public static final String URL_IMPALA_TEMPLATE = "jdbc:impala://";//$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* DOC Marvin DbConnStrForHive constructor comment.
|
||||
*
|
||||
|
||||
@@ -214,6 +214,9 @@ public enum EDatabaseConnTemplate {
|
||||
IMPALA(new DbConnStr(EDatabaseTypeName.IMPALA, "jdbc:hive2://<host>:<port>/<sid>;auth=noSasl", //$NON-NLS-1$
|
||||
"21050", null, null, "localhost", "default")), //$NON-NLS-1$
|
||||
|
||||
IMPALA_IMPALA_DRIVER(new DbConnStr(EDatabaseTypeName.IMPALA, "jdbc:impala://<host>:<port>/<sid>;auth=noSasl", //$NON-NLS-1$
|
||||
"21050", null, null, "localhost", "default")), //$NON-NLS-1$
|
||||
|
||||
HBASE(new DbConnStr(EDatabaseTypeName.HBASE, "127.0.0.1", //$NON-NLS-1$
|
||||
"2181")), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -418,6 +418,52 @@ public class NodeUtil {
|
||||
return conns;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC
|
||||
* <p>
|
||||
* The method searches for the incoming node connections of type
|
||||
* on a processing path and returns the first ones only
|
||||
* </p>
|
||||
*
|
||||
* @param node
|
||||
* @param type - node type to look for
|
||||
* @return
|
||||
*/
|
||||
public static List<? extends IConnection> getFirstIncomingLineConnectionsOfType(INode node, String type) {
|
||||
if (type == null)
|
||||
return new ArrayList<IConnection>();
|
||||
|
||||
Set<String> uniqueNamesDone = new HashSet<String>();
|
||||
List<? extends IConnection> allIncomingConnections = getFirstIncomingLineConnectionsOfType(node, uniqueNamesDone, type);
|
||||
|
||||
return allIncomingConnections;
|
||||
}
|
||||
|
||||
private static List<? extends IConnection> getFirstIncomingLineConnectionsOfType(INode node, Set<String> uniqueNamesDone, String type) {
|
||||
List<IConnection> conns = new ArrayList<IConnection>();
|
||||
|
||||
List<? extends IConnection> incomingConnections = node.getIncomingConnections();
|
||||
if (incomingConnections != null) {
|
||||
|
||||
for (int i = 0; i < incomingConnections.size(); i++) {
|
||||
|
||||
IConnection connection = incomingConnections.get(i);
|
||||
INode nextNode = connection.getSource();
|
||||
|
||||
if (!uniqueNamesDone.contains(nextNode.getUniqueName())) {
|
||||
uniqueNamesDone.add(nextNode.getUniqueName());
|
||||
|
||||
if (type.equals((String)nextNode.getElementParameter("COMPONENT_NAME").getValue())) {
|
||||
conns.add(connection);
|
||||
} else {
|
||||
conns.addAll(getFirstIncomingLineConnectionsOfType(nextNode, uniqueNamesDone, type)); // follow this way
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return conns;
|
||||
}
|
||||
|
||||
public static INode getFirstMergeNode(INode node) {
|
||||
INode mergeNode = null;
|
||||
for (IConnection connection : node.getOutgoingConnections()) {
|
||||
|
||||
@@ -196,8 +196,6 @@ public class ProcessorUtilities {
|
||||
|
||||
private static boolean isDebug = false;
|
||||
|
||||
private static boolean isCIMode = false;
|
||||
|
||||
private static boolean isDynamicJobAndCITest = false;
|
||||
|
||||
private static JobInfo mainJobInfo;
|
||||
@@ -1317,7 +1315,7 @@ public class ProcessorUtilities {
|
||||
checkMetadataDynamic(currentProcess, jobInfo);
|
||||
|
||||
int options = TalendProcessOptionConstants.MODULES_DEFAULT;
|
||||
if (isCIMode && BitwiseOptionUtils.containOption(option, GENERATE_MAIN_ONLY)) {
|
||||
if (isCIMode() && BitwiseOptionUtils.containOption(option, GENERATE_MAIN_ONLY)) {
|
||||
options |= TalendProcessOptionConstants.MODULES_WITH_CHILDREN;
|
||||
}
|
||||
Set<ModuleNeeded> neededLibraries = new HashSet<>();
|
||||
@@ -3044,13 +3042,11 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
public static boolean isCIMode() {
|
||||
return isCIMode;
|
||||
// if it's CI mode , then the system property of maven.local.repository will store the value of studio
|
||||
// m2 path,otherwise it's null
|
||||
return System.getProperty("maven.local.repository") != null;
|
||||
}
|
||||
|
||||
public static void setCIMode(boolean isCIMode) {
|
||||
ProcessorUtilities.isCIMode = isCIMode;
|
||||
}
|
||||
|
||||
public static boolean hasRoutelet(ProcessItem prItem, String routelet) {
|
||||
EList<NodeType> nodeList = prItem.getProcess().getNode();
|
||||
|
||||
|
||||
@@ -14,6 +14,12 @@
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -23,11 +23,23 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -38,6 +50,12 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>studio-tacokit-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<tacokit.components.version>1.20.0</tacokit.components.version>
|
||||
<tacokit.components.version>1.20.0</tacokit.components.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
@@ -35,7 +35,18 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.talend.components</groupId>
|
||||
<artifactId>connectors-se</artifactId>
|
||||
<version>${tacokit.components.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.talend.components</groupId>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<tcomp.version>1.31.2</tcomp.version>
|
||||
<tcomp.version>1.32.0</tcomp.version>
|
||||
<slf4j.version>1.7.25</slf4j.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
<properties>
|
||||
<talend.codes.package>@CodesPackage@</talend.codes.package>
|
||||
<allow.codes.compile.error>true</allow.codes.compile.error>
|
||||
<maven.compiler.failOnError>${allow.codes.compile.error}</maven.compiler.failOnError>
|
||||
<codes.compile.failOnError>true</codes.compile.failOnError>
|
||||
<maven.compiler.failOnError>${codes.compile.failOnError}</maven.compiler.failOnError>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<!-- This dependency provides the implementation of compiler "jdt": -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
<version>3.3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-compiler-jdt</artifactId>
|
||||
@@ -63,6 +68,11 @@
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.24</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
<version>3.3.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -80,6 +90,11 @@
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
<version>3.3.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<archive>
|
||||
@@ -92,6 +107,11 @@
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
<version>3.3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
@@ -107,7 +127,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20</version>
|
||||
<version>2.12.4</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
|
||||
@@ -97,7 +97,7 @@ public abstract class MavenCommandLauncher {
|
||||
|
||||
private Map<String, Object> argumentsMap;
|
||||
|
||||
private static final String REGEX_TEST_CASE_FAILURES_STR = "\\[ERROR\\] Tests run:.*\\[ERROR\\] There are test\\p{Print}+\n";
|
||||
private static final String REGEX_TEST_CASE_FAILURES_STR = "\\[ERROR\\] There are test failures.*\n";
|
||||
|
||||
private static final Pattern REGEX_TEST_CASE_FAILURES = Pattern.compile(REGEX_TEST_CASE_FAILURES_STR, Pattern.DOTALL);
|
||||
|
||||
|
||||
@@ -355,8 +355,9 @@ public class PomIdsHelper {
|
||||
|
||||
public static boolean skipFolders() {
|
||||
String projectTechName = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
|
||||
ProjectPreferenceManager manager = getPreferenceManager(projectTechName);
|
||||
return manager.getBoolean(MavenConstants.SKIP_FOLDERS);
|
||||
Project project = ProjectManager.getInstance().getProjectFromProjectTechLabel(projectTechName);
|
||||
ProjectPreferenceManager preferenceManager = new ProjectPreferenceManager(project, DesignerMavenPlugin.PLUGIN_ID, false);
|
||||
return preferenceManager.getBoolean(MavenConstants.SKIP_FOLDERS);
|
||||
}
|
||||
|
||||
public static boolean isValidGroupId(String text) {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -57,6 +57,16 @@
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.2.2</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.4</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.emf.common.util.EMap;
|
||||
import org.talend.commons.ui.utils.PathUtils;
|
||||
import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.EImpalaDriver;
|
||||
import org.talend.core.database.conn.ConnParameterKeys;
|
||||
import org.talend.core.database.conn.DatabaseConnStrUtil;
|
||||
import org.talend.core.database.conn.template.DbConnStrForHive;
|
||||
@@ -1418,8 +1419,12 @@ public final class DBConnectionContextUtils {
|
||||
// Added 20130311 TDQ-7000, when it is context mode and not general jdbc, reset the url.
|
||||
String newURL = null;
|
||||
if (EDatabaseTypeName.IMPALA.equals(EDatabaseTypeName.getTypeFromDbType(dbConn.getDatabaseType()))) {
|
||||
String template = DbConnStrForHive.URL_HIVE_2_TEMPLATE;
|
||||
if (EImpalaDriver.IMPALA.getName().equals(cloneConn.getParameters().get(ConnParameterKeys.IMPALA_DRIVER))) {
|
||||
template = DbConnStrForHive.URL_IMPALA_TEMPLATE;
|
||||
}
|
||||
newURL = DatabaseConnStrUtil.getImpalaString(cloneConn, cloneConn.getServerName(), cloneConn.getPort(),
|
||||
cloneConn.getSID(), DbConnStrForHive.URL_HIVE_2_TEMPLATE);
|
||||
cloneConn.getSID(), template);
|
||||
} else {
|
||||
newURL = DatabaseConnStrUtil.getURLString(cloneConn.getDatabaseType(), dbConn.getDbVersionString(), server, username,
|
||||
password, port, sidOrDatabase, filePath.toLowerCase(), datasource, dbRootPath, additionParam);
|
||||
|
||||
@@ -131,11 +131,8 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
|
||||
if (EImpalaDriver.HIVE2.getDisplayName().equalsIgnoreCase(driverType)) {
|
||||
driverClass = EImpalaDriver.HIVE2.getDriver();
|
||||
}
|
||||
if (EImpalaDriver.IMPALA40.getDisplayName().equalsIgnoreCase(driverType)) {
|
||||
driverClass = EImpalaDriver.IMPALA40.getDriver();
|
||||
}
|
||||
if (EImpalaDriver.IMPALA41.getDisplayName().equalsIgnoreCase(driverType)) {
|
||||
driverClass = EImpalaDriver.IMPALA41.getDriver();
|
||||
if (EImpalaDriver.IMPALA.getDisplayName().equalsIgnoreCase(driverType)) {
|
||||
driverClass = EImpalaDriver.IMPALA.getDriver();
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("impala can not work with Hive1");
|
||||
@@ -165,14 +162,18 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
|
||||
newThread.start();
|
||||
|
||||
Connection conn = null;
|
||||
String connectionInfo = new StringBuilder().append("JDBC Uri: ").append(metadataConn.getUrl()).append(" ").toString();
|
||||
try {
|
||||
conn = futureTask.get(getDBConnectionTimeout(), TimeUnit.SECONDS);
|
||||
if (conn == null) {
|
||||
throw new SQLException(connectionInfo);
|
||||
}
|
||||
} catch (TimeoutException e) {
|
||||
threadGroup.interrupt();
|
||||
addBackgroundJob(futureTask, newThread);
|
||||
throw new SQLException(Messages.getString("ImpalaConnectionManager.getConnection.timeout"), e); //$NON-NLS-1$
|
||||
throw new SQLException(connectionInfo + Messages.getString("ImpalaConnectionManager.getConnection.timeout"), e); //$NON-NLS-1$
|
||||
} catch (Throwable e1) {
|
||||
throw new SQLException(e1);
|
||||
throw new SQLException(connectionInfo, e1);
|
||||
}
|
||||
return conn;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
package org.talend.platform.logging;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.talend.utils.format.PresentableBox;
|
||||
|
||||
@@ -18,6 +26,8 @@ public class Activator extends AbstractUIPlugin {
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
private static String version = null;// studio version
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
@@ -33,6 +43,7 @@ public class Activator extends AbstractUIPlugin {
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
plugin = this;
|
||||
version = null;
|
||||
if (log.isInfoEnabled()) {
|
||||
Object version = getVersion();
|
||||
String mess = "Starting Talend's platform log system."; //$NON-NLS-1$
|
||||
@@ -51,6 +62,7 @@ public class Activator extends AbstractUIPlugin {
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
version = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
@@ -64,10 +76,43 @@ public class Activator extends AbstractUIPlugin {
|
||||
}
|
||||
|
||||
public static String getVersion() {
|
||||
String version = System.getProperty("talend.studio.version"); //$NON-NLS-1$
|
||||
if (version == null || "".equals(version.trim())) { //$NON-NLS-1$
|
||||
version = (String) getDefault().getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
|
||||
if (version == null) {
|
||||
try {
|
||||
File file = null;
|
||||
try {
|
||||
file = new File(Platform.getInstallLocation().getDataArea(".eclipseproduct").getPath());
|
||||
} catch (IOException e1) {
|
||||
//
|
||||
}
|
||||
Properties prop = new Properties();
|
||||
if (file != null && file.exists()) {
|
||||
try (FileInputStream fis = new FileInputStream(file)) {
|
||||
prop.load(fis);
|
||||
} catch (Exception e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
version = prop.getProperty("version");
|
||||
|
||||
if (StringUtils.isEmpty(version)) {
|
||||
version = System.getProperty("talend.studio.version"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(version)) {
|
||||
Bundle b = Platform.getBundle("org.talend.commons.runtime");
|
||||
if (b != null) {
|
||||
version = b.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
//
|
||||
}
|
||||
|
||||
if (version == null || "".equals(version.trim())) { //$NON-NLS-1$
|
||||
version = (String) getDefault().getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -151,9 +151,6 @@ import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.ui.dialog.AProgressMonitorDialogWithCancel;
|
||||
import org.talend.utils.sql.ConnectionUtils;
|
||||
|
||||
import com.ca.directory.jxplorer.editor.booleaneditor;
|
||||
import com.fasterxml.jackson.databind.node.BooleanNode;
|
||||
|
||||
/**
|
||||
* @author ocarbone
|
||||
*
|
||||
@@ -6440,10 +6437,16 @@ public class DatabaseForm extends AbstractForm {
|
||||
s = template;
|
||||
}
|
||||
} else if (isImpalaDBConnSelected()) {
|
||||
DatabaseConnection conn = getConnection();
|
||||
String template = DbConnStrForHive.URL_HIVE_2_TEMPLATE;
|
||||
s = DatabaseConnStrUtil.getImpalaString(getConnection(), getConnection().getServerName(), getConnection()
|
||||
.getPort(), getConnection().getSID(), template);
|
||||
getConnection().setUiSchema(getConnection().getSID());
|
||||
;
|
||||
String text = impalaDriverCombo.getText();
|
||||
if (EDatabaseTypeName.IMPALA.getDisplayName().equals(text)) {
|
||||
template = DbConnStrForHive.URL_IMPALA_TEMPLATE;
|
||||
}
|
||||
s = DatabaseConnStrUtil.getImpalaString(conn, conn.getServerName(), conn.getPort(), conn.getSID(), template);
|
||||
conn.setUiSchema(getConnection().getSID());
|
||||
// conn.setURL(s);
|
||||
} else {
|
||||
EDatabaseVersion4Drivers version = EDatabaseVersion4Drivers.indexOfByVersionDisplay(versionStr);
|
||||
if (version != null) {
|
||||
@@ -8391,12 +8394,12 @@ public class DatabaseForm extends AbstractForm {
|
||||
}
|
||||
|
||||
private void fillDefaultsWhenImpalaVersionChanged() {
|
||||
String distribution = getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_DISTRIBUTION);
|
||||
if (distribution == null) {
|
||||
return;
|
||||
}
|
||||
String version = getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_VERSION);
|
||||
if (isCreation && isNeedFillDefaults()) {
|
||||
String distribution = getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_DISTRIBUTION);
|
||||
String version = getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_VERSION);
|
||||
if (distribution == null) {
|
||||
return;
|
||||
}
|
||||
EDatabaseConnTemplate template = EDatabaseConnTemplate.indexOfTemplate(getConnection().getDatabaseType());
|
||||
if (template != null) {
|
||||
portText.setText(template.getDefaultPort());
|
||||
@@ -8404,6 +8407,19 @@ public class DatabaseForm extends AbstractForm {
|
||||
sidOrDatabaseText.setText(template.getDefaultDB(null));
|
||||
}
|
||||
initImpalaInfo();
|
||||
} else {
|
||||
// when edit,change distribution will update impala driver
|
||||
IHadoopDistributionService hadoopService = getHadoopDistributionService();
|
||||
if (hadoopService != null) {
|
||||
IHDistribution impalaDistribution = hadoopService.getImpalaDistributionManager().getDistribution(distribution,
|
||||
false);
|
||||
IHDistributionVersion hdVersion = null;
|
||||
if (impalaDistribution != null) {
|
||||
hdVersion = impalaDistribution.getHDVersion(version, false);
|
||||
}
|
||||
// updateImpalaVersionPart(impalaDistribution);
|
||||
updateImpalaDriverAndMakeSelection(impalaDistribution, hdVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8539,9 +8555,9 @@ public class DatabaseForm extends AbstractForm {
|
||||
|
||||
protected void doImpalaDriverSelected() {
|
||||
if (!isContextMode()) {
|
||||
modifyFieldValue();
|
||||
getConnection().getParameters().put(ConnParameterKeys.IMPALA_DRIVER,
|
||||
EImpalaDriver.getByDisplay(impalaDriverCombo.getText()).getName());
|
||||
modifyFieldValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8686,7 +8702,7 @@ public class DatabaseForm extends AbstractForm {
|
||||
String impalaDriver = conn.getParameters().get(ConnParameterKeys.IMPALA_DRIVER);
|
||||
if (impalaDriver != null) {
|
||||
EImpalaDriver driver = EImpalaDriver.getByName(impalaDriver);
|
||||
if (driver != null) {
|
||||
if (driver != null && Arrays.asList(impalaDriverDisplay).contains(impalaDriver)) {
|
||||
impalaDriverCombo.setText(driver.getDisplayName());
|
||||
} else {
|
||||
impalaDriverCombo.select(0);
|
||||
|
||||
Reference in New Issue
Block a user