Compare commits

...

11 Commits

Author SHA1 Message Date
cbadillo1603
5ad3ad3a08 fix(TBD-12863):Error component tImpalaConnection (#4498) (#4523)
* fix(TBD-12863):Error component tImpalaConnection

* fix(TBD-12863):Error component tImpalaConnection
2021-08-16 16:05:20 +02:00
apoltavtsev
baf574ea55 fix(APPINT-32979) Compile Route with child Jobs on codegen stage 2021-08-12 11:17:43 +02:00
qiongli
892065d2c4 fix(TDQ-19637):Check if it includes 'tdqReportRun' in main/sub-job when (#4504)
generate code

Co-authored-by: qiongli <qiongli@LT-6TNJ593.talend.com>
2021-08-11 15:48:45 +08:00
kjwang
724dc1b72d kjwang/Fix TUP-32327 CVE maven-core-[3.2.3-3.6.3] (#4484)
* kjwang/Fix TUP-32327 CVE maven-core-[3.2.3-3.6.3]
https://jira.talendforge.org/browse/TUP-32327
2021-08-11 14:33:23 +08:00
Jane Ding
132d794131 fix(TUP-32383):Migration executed at every logon (#4505)
* Revert "fix(TUP-32383):Migration executed at every logon (#4480)"

This reverts commit b06ee57323.

* fix(TUP-32383):Migration executed at every logon
https://jira.talendforge.org/browse/TUP-32383
2021-08-10 11:37:51 +08:00
pyzhou
2298c44339 fix(TDI-46373):Resuming logs refactor with NIO and FileLock (#4465)
* fix(TDI-46373):Resuming logs refactor with NIO and FileLock

* fix(TDI-46373):remove debug info

* Remove the double lock and release in finally

* Remove UTF-8 and refactor
2021-08-10 09:48:01 +08:00
Emmanuel GALLOIS
03e462f8ff chore(studio731): bump component-runtime to 1.35.1 (#4502) 2021-08-09 09:22:00 +02:00
cbadillo1603
f7fb174301 Revert "fix(TBD-12184):Password field missing for tImpalaRow (#4472)" (#4507)
This reverts commit b2c74643a7.
2021-08-09 08:28:03 +02:00
zyuan-talend
54fc6ecd51 feat(TUP-30465):remove older versions of job. (#4461) 2021-08-06 17:30:51 +08:00
Oleksandr Zhelezniak
779e9a8086 chore(TDI-46537): bump connectors 1.24.0 (#4500) 2021-08-05 23:04:18 +03:00
Max
f2d189c792 fix(TBD-12466): httpclient upgraded to 4.5.13 (#4422)
Co-authored-by: Svitlana Ponomarova <sponomarova@talend.com>
2021-08-05 19:36:22 +03:00
21 changed files with 558 additions and 70 deletions

View File

@@ -0,0 +1,172 @@
// ============================================================================
//
// Copyright (C) 2006-2021 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.commons.ui.swt.advanced.composite;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Sash;
/**
* This class is used for constructing 2 composites, putting 1 sashes in the middle composite, which is used for
* changing other 2 composites.
*
*/
public class TwoCompositesSashForm extends Composite {
public static final int SASH_WIDTH = 3;
private Composite leftComposite;
private Composite rightComposite;
private Sash midSash;
/**
* Initialize.
*
* @param parent
* @param style
*/
public TwoCompositesSashForm(Composite parent, int style) {
super(parent, style);
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 3;
gridLayout.marginBottom = 0;
gridLayout.marginHeight = 0;
gridLayout.marginLeft = 0;
gridLayout.marginRight = 0;
gridLayout.marginTop = 0;
gridLayout.marginWidth = 0;
gridLayout.horizontalSpacing = 0;
setLayout(gridLayout);
final GridData gridData = new GridData(GridData.FILL_BOTH);
setLayoutData(gridData);
addComponents();
addSashListeners();
}
/**
* Changes all widgets's position when sash was moved.
*
* @param shift
*/
private void setCompositesBounds(int shift) {
// Set mid Composite Width.
int midSashPreLocation = midSash.getBounds().x;
midSash.setLocation(midSashPreLocation + shift, midSash.getBounds().y);
if (midSash.getBounds().x > 0) {
if (midSashPreLocation < 0) {
leftComposite.setSize(leftComposite.getBounds().width + shift + midSashPreLocation, leftComposite
.getBounds().height);
} else {
leftComposite.setSize(leftComposite.getBounds().width + shift, leftComposite.getBounds().height);
}
} else {
leftComposite.setSize(0, leftComposite.getBounds().height);
}
// Set Right Composte Width.
rightComposite.setLocation(rightComposite.getBounds().x + shift, rightComposite.getBounds().y);
rightComposite.setSize(rightComposite.getBounds().width - shift, rightComposite.getBounds().height);
}
public Composite getLeftComposite() {
return this.leftComposite;
}
public Composite getRightComposite() {
return this.rightComposite;
}
private void addSashListeners() {
midSash.addListener(SWT.Selection, new Listener() {
/*
* (non-Java)
*
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
public void handleEvent(Event event) {
int shift = event.x - midSash.getBounds().x;
setCompositesBounds(shift);
}
});
}
private void addComponents() {
leftComposite = new Composite(this, SWT.NONE);
GridLayout gridLayout = new GridLayout();
gridLayout.marginBottom = 0;
gridLayout.marginHeight = 0;
gridLayout.marginLeft = 0;
gridLayout.marginRight = 0;
gridLayout.marginTop = 0;
gridLayout.marginWidth = 0;
gridLayout.horizontalSpacing = 0;
GridData gridData = new GridData(GridData.FILL_BOTH);
leftComposite.setLayout(gridLayout);
leftComposite.setLayoutData(gridData);
midSash = new Sash(this, SWT.VERTICAL | SWT.SMOOTH);
GridData gridData2 = new GridData(GridData.FILL_VERTICAL);
midSash.setLayoutData(gridData2);
midSash.setSize(SASH_WIDTH, midSash.getBounds().height);
rightComposite = new Composite(this, SWT.NONE);
GridLayout gridLayout3 = new GridLayout();
gridLayout3.marginBottom = 0;
gridLayout3.marginHeight = 0;
gridLayout3.marginLeft = 0;
gridLayout3.marginRight = 0;
gridLayout3.marginTop = 0;
gridLayout3.marginWidth = 0;
gridLayout3.horizontalSpacing = 0;
rightComposite.setLayout(gridLayout3);
GridData gridData4 = new GridData(GridData.FILL_BOTH);
rightComposite.setLayoutData(gridData4);
}
public void setGridDatas() {
Composite composite = (Composite) leftComposite.getChildren()[0];
GridLayout gridLayout2 = new GridLayout();
gridLayout2.marginBottom = 0;
gridLayout2.marginHeight = 0;
gridLayout2.marginLeft = 0;
gridLayout2.marginRight = 0;
gridLayout2.marginTop = 0;
gridLayout2.marginWidth = 0;
gridLayout2.horizontalSpacing = 0;
composite.setLayout(gridLayout2);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite composite2 = (Composite) rightComposite.getChildren()[0];
gridLayout2 = new GridLayout();
gridLayout2.marginBottom = 0;
gridLayout2.marginHeight = 0;
gridLayout2.marginLeft = 0;
gridLayout2.marginRight = 0;
gridLayout2.marginTop = 0;
gridLayout2.marginWidth = 0;
gridLayout2.horizontalSpacing = 0;
composite2.setLayout(gridLayout2);
composite2.setLayoutData(new GridData(GridData.FILL_BOTH));
}
}

View File

@@ -463,4 +463,8 @@ public interface IRepositoryFactory {
public boolean isRepositoryBusy();
public RepositoryWorkUnit getWorkUnitInProgress();
public void deleteOldVersionPhysical(Project project, IRepositoryViewObject objToDelete, String version) throws PersistenceException;
public void batchDeleteOldVersionsPhysical(Project project, List<IRepositoryViewObject> objToDeleteList, boolean isDeleteOnRemote, IProgressMonitor monitor) throws PersistenceException;
}

View File

@@ -2283,6 +2283,9 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
IRunProcessService runProcessService = getRunProcessService();
if (runProcessService != null) {
runProcessService.initMavenJavaProject(monitor, project);
// before afterLogon migration execute, check and update daikon dependency
runProcessService.checkAndUpdateDaikonDependencies();
}
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
@@ -2786,4 +2789,81 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
}
}
}
@Override
public void deleteOldVersionPhysical(Project project, IRepositoryViewObject objToDelete, String version) throws PersistenceException {
if (project == null || objToDelete == null || objToDelete.getProperty() == null) {
return;
}
// RepositoryViewObject is dynamic, so force to use in all case the RepositoryObject with fixed object.
IRepositoryViewObject object = new RepositoryObject(objToDelete.getProperty());
ERepositoryObjectType repositoryObjectType = object.getRepositoryObjectType();
ICoreService coreService = getCoreService();
if (coreService != null) {
if (repositoryObjectType == ERepositoryObjectType.PROCESS) {
// delete the job launch, for bug 8878
coreService.removeJobLaunch(object);
}
}
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService service = GlobalServiceRegister.getDefault()
.getService(IRunProcessService.class);
service.deleteOldVersionTalendJobProject(objToDelete);
}
this.repositoryFactoryFromProvider.deleteOldVersionPhysical(project, object, version);
// i18n
//log.info("Physical deletion [" + objToDelete + "] by " + getRepositoryContext().getUser() + ".");
String str[] = new String[] { object.toString()+ "_" + version, getRepositoryContext().getUser().toString() };
log.info(Messages.getString("ProxyRepositoryFactory.log.physicalDeletion", str)); //$NON-NLS-1$ }
}
@Override
public void batchDeleteOldVersionPhysical4Remote(Project project, List<IRepositoryViewObject> objToDeleteList, IProgressMonitor monitor) throws PersistenceException {
if (project == null || objToDeleteList == null || objToDeleteList.size() == 0) {
return;
}
List<String> idList = new ArrayList<>();
List<IRepositoryViewObject> repositoryObjectList = new ArrayList<>();
String label = "",lastLabel = "";
for (IRepositoryViewObject objToDelete : objToDeleteList) {
label = objToDelete.getProperty().getLabel();
String versionedLabel = objToDelete.getProperty().getLabel() + "_" + objToDelete.getProperty().getVersion();
monitor.setTaskName("Removing " + objToDelete.getRepositoryObjectType() + ":"+ versionedLabel);
IRepositoryViewObject object = new RepositoryObject(objToDelete.getProperty());
boolean isExtendPoint = false;
idList.add(object.getProperty().getId());
ERepositoryObjectType repositoryObjectType = object.getRepositoryObjectType();
ICoreService coreService = getCoreService();
if (coreService != null) {
if (repositoryObjectType == ERepositoryObjectType.PROCESS) {
// delete the job launch, for bug 8878
coreService.removeJobLaunch(object);
}
}
repositoryObjectList.add(object);
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService service = GlobalServiceRegister.getDefault()
.getService(IRunProcessService.class);
service.deleteOldVersionTalendJobProject(objToDelete);
}
this.repositoryFactoryFromProvider.deleteOldVersionPhysical(project, objToDelete,objToDelete.getProperty().getVersion());
if (label != null && !label.equals(lastLabel)) monitor.worked(1); //for different versions in progress bar
lastLabel = label;
}
// save project will handle git/svn update
this.repositoryFactoryFromProvider.saveProject(project);
}
}

View File

@@ -300,13 +300,20 @@ public class DatabaseConnStrUtil {
if (!url.endsWith(";")) { //$NON-NLS-1$
url = url + ";"; //$NON-NLS-1$
}
url = url + "ssl=true;"; //$NON-NLS-1$
boolean isHiveDriver = url.startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE);
url = url + ( isHiveDriver ? "ssl=true;" : "SSL=1;" ); //$NON-NLS-1$
String trustStorePath = dbConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_SSL_TRUST_STORE_PATH);
if (trustStorePath != null) {
url = url + "sslTrustStore=" + trustStorePath + ";"; //$NON-NLS-1$//$NON-NLS-2$
url = url + ( isHiveDriver ? "sslTrustStore=" : "SSLTrustStore=" ) + trustStorePath + ";"; //$NON-NLS-1$//$NON-NLS-2$
}
String trustStorePassword = null;
trustStorePassword = dbConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_SSL_TRUST_STORE_PASSWORD);
if (trustStorePassword != null) {
if (encryptPassword) {
trustStorePassword = "encrypted"; //$NON-NLS-1$
@@ -318,7 +325,7 @@ public class DatabaseConnStrUtil {
if (trustStorePassword == null) {
trustStorePassword = ""; //$NON-NLS-1$
}
url = url + "trustStorePassword=" + trustStorePassword; //$NON-NLS-1$
url = url + ( isHiveDriver ? "trustStorePassword=" : "SSLTrustStorePwd=" ) + trustStorePassword; //$NON-NLS-1$
}
if (url.endsWith(";")) { //$NON-NLS-1$
url = url.substring(0, url.length() - 1);
@@ -385,7 +392,8 @@ public class DatabaseConnStrUtil {
template = EDatabaseConnTemplate.IMPALA_IMPALA_DRIVER.getUrlTemplate(null);
}
String standardURlString = getImpalaURlString(template, supportContext, server, port, sid);
String principalSuffix = "principal="; //$NON-NLS-1$
String principalSuffix = "IMPALA".equals(driver) ? "AuthMech=1" : "principal="; //$NON-NLS-1$
boolean hasPrinc = false;
String[] urlArray = standardURlString.split(SEMICOLON);
if (urlArray[urlArray.length - 1].startsWith(principalSuffix)) {
@@ -397,7 +405,21 @@ public class DatabaseConnStrUtil {
}
} else {
if (Principal != null) {
standardURlString = urlArray[0].concat(SEMICOLON).concat(principalSuffix).concat(Principal);
if("IMPALA".equals(driver)) {
String krbServiceName = (Principal.split("/")[0]);
String krbHostFQDN = (Principal.split("/")[1].split("@")[0]);
String krbRealm = (Principal.split("/")[1].split("@")[1]);
String urlKerberosParameter = ";KrbServiceName=" + krbServiceName
+ ";KrbHostFQDN=" + krbHostFQDN
+ ";KrbRealm=" + krbRealm;
standardURlString = urlArray[0].concat(SEMICOLON).concat(principalSuffix).concat(urlKerberosParameter);
} else {
standardURlString = urlArray[0].concat(SEMICOLON).concat(principalSuffix).concat(Principal);
}
}
}

View File

@@ -728,6 +728,46 @@ public final class ProcessUtils {
}
return null;
}
private static boolean isRoute(Property property) {
return property!= null && (ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE) ||
ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE_MICROSERVICE));
}
public static boolean isRouteWithChildJobs(IProcess process) {
if (process instanceof IProcess2) {
Property p = ((IProcess2) process).getProperty();
if (isRoute(p)) {
return false;
}
Item item = p.getItem();
return isRouteWithChildJobs(item);
} else {
for (INode node : process.getGraphicalNodes()) {
if (node.getComponent().getName().equals("cTalendJob")) {
return true;
}
}
}
return false;
}
public static boolean isRouteWithChildJobs(Item item) {
if (item!= null && item instanceof ProcessItem) {
for (Object obj : ((ProcessItem) item).getProcess().getNode()) {
if (obj instanceof NodeType) {
if (((NodeType) obj).getComponentName().equals("cTalendJob")) {
return true;
}
}
}
}
return false;
}
public static int getAssertAmount(IProcess process) {
int count = 0;

View File

@@ -39,6 +39,7 @@ import org.talend.core.model.process.JobInfo;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Property;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.routines.CodesJarInfo;
import org.talend.core.runtime.process.ITalendProcessJavaProject;
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
@@ -271,5 +272,9 @@ public interface IRunProcessService extends IService {
void deleteTalendCodesJarProject(ERepositoryObjectType type, String projectTechName, String codesJarName,
boolean deleteContent);
public void deleteOldVersionTalendJobProject(IRepositoryViewObject object);
public void checkAndUpdateDaikonDependencies();
}

View File

@@ -19,6 +19,7 @@ import java.util.Map;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.talend.commons.exception.BusinessException;
import org.talend.commons.exception.LoginException;
import org.talend.commons.exception.PersistenceException;
@@ -565,4 +566,8 @@ public interface IProxyRepositoryFactory {
public void batchDeleteObjectPhysical4Remote(Project project, List<IRepositoryViewObject> objToDeleteList)
throws PersistenceException;
public void deleteOldVersionPhysical(Project project, IRepositoryViewObject objToDelete, String version) throws PersistenceException;
public void batchDeleteOldVersionPhysical4Remote(Project project, List<IRepositoryViewObject> objToDeleteList, IProgressMonitor monitor) throws PersistenceException;
}

View File

@@ -198,6 +198,8 @@ public class ProcessorUtilities {
private static boolean isDynamicJobAndCITest = false;
private static JobInfo mainJobInfo;
private static boolean needExportItemsForDQ = false;
public static void addOpenEditor(IEditorPart editor) {
openedEditors.add(editor);
@@ -699,7 +701,7 @@ public class ProcessorUtilities {
processor.setArguments(argumentsMap);
copyDQDroolsToSrc(selectedProcessItem);
handelDQComponents(selectedProcessItem, currentProcess);
// generate the code of the father after the childrens
// so the code won't have any error during the check, and it will help to check
// if the generation is really needed.
@@ -1243,7 +1245,7 @@ public class ProcessorUtilities {
processor.setArguments(argumentsMap);
copyDQDroolsToSrc(selectedProcessItem);
handelDQComponents(selectedProcessItem, currentProcess);
generateContextInfo(jobInfo, selectedContextName, statistics, trace, needContext, progressMonitor,
currentProcess, currentJobName, processor, isMainJob, codeGenerationNeeded);
@@ -1380,12 +1382,13 @@ public class ProcessorUtilities {
}
/**
*
* copy the current item's drools file from 'workspace/metadata/survivorship' to '.Java/src/resources'
*
*
* Specail operation for DQ components:
* - For tdqReportRun, set 'needExportItemsForDQ'to true so as the item folder can be exported
* - For tRuleSurvivorship, copy the current item's drools file from 'workspace/metadata/survivorship' to '.Java/src/resources'
* @param processItem
*/
private static void copyDQDroolsToSrc(ProcessItem processItem) {
private static void handelDQComponents(ProcessItem processItem,IProcess currentProcess) {
// 1.TDQ-12474 copy the "metadata/survivorship/rulePackage" to ".Java/src/main/resources/". so that it will be
// used by
// maven command 'include-survivorship-rules' to export.
@@ -1397,6 +1400,20 @@ public class ProcessorUtilities {
return;
}
try {
// TDQ-19637 if it includes 'tDqReportRun',must export item folder
if (!needExportItemsForDQ) {
for (INode node : currentProcess.getGeneratingNodes()) {
String componentName = node.getComponent().getName();
if ("tDqReportRun".equals(componentName)) {
needExportItemsForDQ = true;
break;
}
}
}
/* 1.TDQ-12474 copy the "metadata/survivorship/rulePackage" to ".Java/src/main/resources/". so that it will be
used by maven command 'include-survivorship-rules' to export.
2.TDQ-14308 current drools file in 'src/resourcesmetadata/survivorship/' should be included to job jar.
*/
ExportFileResource resouece = new ExportFileResource();
BuildExportManager.getInstance().exportDependencies(resouece, processItem);
if (resouece.getAllResources().isEmpty()) {
@@ -2920,4 +2937,8 @@ public class ProcessorUtilities {
public static boolean isDynamicJobAndCITest() {
return isDynamicJobAndCITest;
}
public static boolean isNeedExportItemsForDQ() {
return needExportItemsForDQ;
}
}

View File

@@ -35,6 +35,11 @@
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@@ -85,6 +85,11 @@
<artifactId>plexus-archiver</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@@ -10,6 +10,11 @@
<artifactId>talend-compiler-plugin-tos</artifactId>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-jdt</artifactId>
@@ -23,6 +28,10 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>

View File

@@ -30,6 +30,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@@ -39,6 +44,10 @@
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@@ -50,6 +59,10 @@
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@@ -61,6 +74,10 @@
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@@ -75,11 +92,15 @@
<exclusion>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
</exclusion>
</exclusion>
</exclusions>
</dependency>
<dependency>

View File

@@ -10,7 +10,7 @@
<artifactId>studio-tacokit-dependencies</artifactId>
<packaging>pom</packaging>
<properties>
<tacokit.components.version>1.23.0</tacokit.components.version>
<tacokit.components.version>1.24.0</tacokit.components.version>
</properties>
<repositories>
<repository>

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.34.1</tcomp.version>
<tcomp.version>1.35.1</tcomp.version>
<slf4j.version>1.7.28</slf4j.version>
</properties>

View File

@@ -66,6 +66,11 @@
<artifactId>plexus-archiver</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -83,6 +88,11 @@
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -115,6 +125,11 @@
<artifactId>plexus-io</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
<configuration>
<archive>
@@ -152,6 +167,11 @@
<artifactId>plexus-archiver</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -164,6 +184,11 @@
<artifactId>plexus-utils</artifactId>
<version>3.0.24</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>

View File

@@ -15,6 +15,7 @@ package org.talend.designer.maven.tools;
import static org.talend.designer.maven.model.TalendJavaProjectConstants.*;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -28,7 +29,9 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import org.apache.maven.model.Activation;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import org.apache.maven.model.Profile;
import org.eclipse.core.resources.IContainer;
@@ -1053,4 +1056,45 @@ public class AggregatorPomsHelper {
return null;
}
public void checkAndUpdateDaikonDependencies() {
try {
IFile rootPomFile = getProjectRootPom();
if (rootPomFile.exists()) {
boolean isRegeneratePoms = false;
Model model = MavenPlugin.getMaven().readModel(rootPomFile.getLocation().toFile());
if (model.getModules() != null) {
for (String module : model.getModules()) {
java.nio.file.Path modPath = Paths.get(rootPomFile.getLocation().toFile().getParent(), module, "pom.xml");
Model modModel = MavenPlugin.getMaven().readModel(modPath.toFile());
List<Dependency> deps = modModel.getDependencies();
if (deps != null && !deps.isEmpty()) {
DefaultArtifactVersion targetVersion = new DefaultArtifactVersion("0.31.12");
for (Dependency dep : deps) {
DefaultArtifactVersion actualVersion = new DefaultArtifactVersion(dep.getVersion());
int cmp = targetVersion.compareTo(actualVersion);
if (StringUtils.equals("org.talend.daikon", dep.getGroupId()) && cmp > 0) {
if (StringUtils.equals("crypto-utils", dep.getArtifactId())
|| StringUtils.equals("daikon", dep.getArtifactId())) {
isRegeneratePoms = true;
}
}
}
}
if (isRegeneratePoms) {
break;
}
}
}
if (isRegeneratePoms) {
syncAllPomsWithoutProgress(new NullProgressMonitor());
BuildCacheManager.getInstance().clearAllCodesCache();
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}

View File

@@ -13,10 +13,13 @@
package routines.system;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -53,7 +56,7 @@ public class ResumeUtil {
private static Object lock = new Object();
// step1: init the log file name
public ResumeUtil(String logFileName, boolean createNewFile, String root_pid) {
public ResumeUtil(String logFileName, boolean append, String root_pid) {
if (logFileName == null || logFileName.equals("null")) {
return;
}
@@ -70,7 +73,13 @@ public class ResumeUtil {
File file = new File(logFileName);
try {
if (sharedWriter == null) {
this.csvWriter = new SimpleCsvWriter(new FileWriter(logFileName, createNewFile));
FileChannel fc = new RandomAccessFile(logFileName, "rw").getChannel();
if(append){
fc.position(fc.size());
}else {
fc.truncate(0);
}
this.csvWriter = new SimpleCsvWriter(fc);
// output the header part
if (file.length() == 0) {
@@ -97,9 +106,6 @@ public class ResumeUtil {
csvWriter.write("dynamicData");// dynamicData
csvWriter.endRecord();
csvWriter.flush();
csvWriter.close();
// To avoid use File.delete() as it cannot make sure file being deleted.
this.csvWriter = new SimpleCsvWriter(new FileWriter(logFileName, true));
}
// shared
sharedWriterMap.put(this.root_pid, this.csvWriter);
@@ -138,8 +144,10 @@ public class ResumeUtil {
JobLogItem item = new JobLogItem(eventDate, type, partName, parentPart, threadId, logPriority, errorCode, message,
stackTrace, dynamicData);
FileLock fileLock = null;
try {
synchronized (csvWriter) {
fileLock = csvWriter.getlock();
if (genDynamicPart) {
csvWriter.write(item.eventDate);// eventDate--------------->???
csvWriter.write(commonInfo.pid);// pid
@@ -164,6 +172,7 @@ public class ResumeUtil {
csvWriter.write(item.dynamicData);// dynamicData--->it is the 17th field. @see:feature:11296
csvWriter.endRecord();
csvWriter.flush();
fileLock.release();
}
// for test the order
// System.out.print(item.partName + ",");// partName
@@ -173,6 +182,15 @@ public class ResumeUtil {
// System.out.println();
} catch (Exception e) {
e.printStackTrace();
}finally {
if (fileLock != null) {
try {
fileLock.release();
fileLock = null;
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
@@ -457,7 +475,11 @@ public class ResumeUtil {
*/
public class SimpleCsvWriter {
private Writer writer = null;
private FileChannel channel = null;
private ByteBuffer buf = null;
private boolean firstColumn = true;
@@ -467,11 +489,11 @@ public class ResumeUtil {
private static final int EscapeMode = ESCAPE_MODE_DOUBLED;
private static final char TextQualifier = '"';
private static final String TextQualifier = "\"";
private static final char BACKSLASH = '\\';
private static final String BACKSLASH = "\\";
private static final char Delimiter = ',';
private static final String Delimiter = ",";
// JDK1.5 can't pass compile
// private String lineSeparator = (String)
@@ -481,8 +503,9 @@ public class ResumeUtil {
private String lineSeparator = System.getProperty("line.separator");
public SimpleCsvWriter(Writer writer) {
this.writer = writer;
public SimpleCsvWriter(FileChannel channel) {
this.channel = channel;
buf = ByteBuffer.allocate(2<<14);//32k buffer size
}
/**
@@ -495,10 +518,10 @@ public class ResumeUtil {
}
if (!firstColumn) {
writer.write(Delimiter);
buf.put(Delimiter.getBytes());
}
writer.write(TextQualifier);
buf.put(TextQualifier.getBytes());
// support backslash mode
if (EscapeMode == ESCAPE_MODE_BACKSLASH) {
@@ -508,18 +531,22 @@ public class ResumeUtil {
content = replace(content, "" + TextQualifier, "" + TextQualifier + TextQualifier);
}
writer.write(content);
buf.put(content.getBytes());
writer.write(TextQualifier);
buf.put(TextQualifier.getBytes());
firstColumn = false;
}
public FileLock getlock() throws IOException {
return channel.lock();
}
/**
* finish a record, prepare the next one
*/
public void endRecord() throws IOException {
writer.write(lineSeparator);
buf.put(lineSeparator.getBytes());
firstColumn = true;
}
@@ -528,7 +555,13 @@ public class ResumeUtil {
*/
public void flush() {
try {
writer.flush();
buf.flip();
channel.position(channel.size());
while(buf.hasRemaining()) {
channel.write(buf);
}
channel.force(true);
buf.clear();
} catch (IOException e) {
e.printStackTrace();
}
@@ -539,7 +572,7 @@ public class ResumeUtil {
*/
public void close() {
try {
writer.close();
channel.close();
} catch (IOException e) {
e.printStackTrace();
}

View File

@@ -73,9 +73,8 @@
context="Hive wizard"
language="java"
message="Wizard for hive HDP 2.0"
name="httpclient-4.1.2.jar" mvn_uri="mvn:org.talend.libraries/httpclient-4.1.2/6.0.0"
required="true"
uripath="platform:/plugin/org.talend.libraries.apache.http/lib/httpclient-4.1.2.jar">
name="httpclient-4.5.13.jar" mvn_uri="mvn:org.apache.httpcomponents/httpclient/4.5.13"
required="true">
</libraryNeeded>
<libraryNeeded
context="Hive wizard"

View File

@@ -267,35 +267,20 @@ public class MigrationToolService implements IMigrationToolService {
nbMigrationsToDo++;
}
int migrationInEveryLogon = 0;
if (beforeLogon) {
// UpdateDaikonCryptoUtilsMigrationTask to execute every logon
MigrationUtil.removeMigrationTaskById(done,
"org.talend.repository.model.migration.UpdateDaikonCryptoUtilsMigrationTask");
migrationInEveryLogon++;
}
if (nbMigrationsToDo == 0 && migrationInEveryLogon == 0) {
if (nbMigrationsToDo == 0) {
return;
}
if (nbMigrationsToDo > 0) {
// only execute when migration exist
if (beforeLogon) {
// for migration exist only, force reset to default maven template
MigrationUtil.removeMigrationTaskById(done,
"org.talend.repository.model.migration.ResetMavenTemplateMigrationTask");
} else {
// force execute migration in case user copy-past items with diffrent path on the file system and
// refresh
// the studio,it may cause bug TDI-19229
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.FixProjectResourceLink");
// force to re-generate all job poms
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.GenerateJobPomMigrationTask");
}
}
// force execute migration in case user copy-past items with diffrent path on the file system and refresh
// the studio,it may cause bug TDI-19229
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.FixProjectResourceLink");
// force to re-generate all job poms
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.GenerateJobPomMigrationTask");
if (beforeLogon) {
// for every migration, force reset to default maven template
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.ResetMavenTemplateMigrationTask");
}
boolean haveAnyBinFolder = false; // to avoid some problems of migration, sometimes
for (ERepositoryObjectType type : (ERepositoryObjectType[]) ERepositoryObjectType.values()) {

View File

@@ -3905,4 +3905,24 @@ public class LocalRepositoryFactory extends AbstractEMFRepositoryFactory impleme
public byte[] getReferenceSettingContent(Project project, String branch) throws PersistenceException {
return null;
}
@Override
public void deleteOldVersionPhysical(Project project, IRepositoryViewObject objToDelete, String version ) throws PersistenceException {
Property currentProperty = objToDelete.getProperty();
List<Resource> affectedResources = xmiResourceManager.getAffectedResources(currentProperty);
for (Resource resource : affectedResources) {
deleteResource(resource, false);
}
}
@Override
public void batchDeleteOldVersionsPhysical(Project project, List<IRepositoryViewObject> objToDeleteList,
boolean isDeleteOnRemote, IProgressMonitor monitor) throws PersistenceException {
for (IRepositoryViewObject object : objToDeleteList) {
String versionedLabel = object.getProperty().getLabel() + "_" + object.getProperty().getVersion();
monitor.setTaskName("Removing " + object.getRepositoryObjectType() + ":"+ versionedLabel);
deleteOldVersionPhysical(project, object, object.getProperty().getVersion());
monitor.worked(1);
}
}
}

View File

@@ -4495,13 +4495,6 @@ public class DatabaseForm extends AbstractForm {
};
} else if (isImpalaDBConnSelected()) {
final IMetadataConnection metadataConn = ConvertionHelper.convert(connectionItem.getConnection(), true);
if( !"".equals( metadataConn.getPassword() ) ) {
String url = metadataConn.getUrl().replace(";auth=noSasl", "");
url = url + ";user=" + metadataConn.getUsername() + ";password=" + metadataConn.getPassword();
metadataConn.setUrl(url);
}
checkingDialog = new AProgressMonitorDialogWithCancel<Boolean>(getShell()) {
@Override