Compare commits
191 Commits
onimych/TD
...
bhe/bugfix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51f1f1ebd2 | ||
|
|
e4f1b8a6fd | ||
|
|
fafa0e3086 | ||
|
|
cf0477ac20 | ||
|
|
d680891e66 | ||
|
|
6b682f21b6 | ||
|
|
4e26cc4131 | ||
|
|
23016a2da5 | ||
|
|
036ed3c6ca | ||
|
|
28cecad34c | ||
|
|
955761f1a1 | ||
|
|
4672d438f0 | ||
|
|
3099932e4c | ||
|
|
10d41d2fde | ||
|
|
fb4fce2409 | ||
|
|
11f2a77064 | ||
|
|
b97e1fc955 | ||
|
|
3a33128bdd | ||
|
|
1d1c0a9551 | ||
|
|
4b99767b6a | ||
|
|
5a8ef4838a | ||
|
|
f815b15476 | ||
|
|
c362cc49a9 | ||
|
|
ea8eedc571 | ||
|
|
3ee3097e32 | ||
|
|
470175ccf6 | ||
|
|
93f4ff36ee | ||
|
|
80273d36e1 | ||
|
|
61493a76a4 | ||
|
|
afb9b3ff0c | ||
|
|
56f428c944 | ||
|
|
16fc19571c | ||
|
|
a68463d184 | ||
|
|
d04f7db182 | ||
|
|
dd201ac7fa | ||
|
|
7ce1c256dd | ||
|
|
199f4dde6e | ||
|
|
c029f53402 | ||
|
|
8aea05339a | ||
|
|
cf19586e10 | ||
|
|
c68419a4e2 | ||
|
|
819477f327 | ||
|
|
eab0938fb0 | ||
|
|
40da0e6196 | ||
|
|
8264ddedf8 | ||
|
|
b76af1a75a | ||
|
|
eecc3eff20 | ||
|
|
b8293db502 | ||
|
|
0efb40b4d5 | ||
|
|
21f5ac7771 | ||
|
|
1449055789 | ||
|
|
d1eeeb319d | ||
|
|
62bcd2d641 | ||
|
|
dbc3b0fb17 | ||
|
|
63587e1f14 | ||
|
|
cb9206e2de | ||
|
|
9e7e9c274c | ||
|
|
9c1e780550 | ||
|
|
2f14d6f7af | ||
|
|
ced9549634 | ||
|
|
12e06dcd43 | ||
|
|
b3c658190e | ||
|
|
2a152f780c | ||
|
|
e51a1be010 | ||
|
|
28df42e0fb | ||
|
|
a196cf3209 | ||
|
|
490b9df3d8 | ||
|
|
e5c48c0472 | ||
|
|
32380af191 | ||
|
|
df577338cd | ||
|
|
a56358308e | ||
|
|
0f28377fa4 | ||
|
|
9050d9050a | ||
|
|
81ea7aa0ea | ||
|
|
009e9d0cd6 | ||
|
|
d242a0e8f7 | ||
|
|
72390d4f27 | ||
|
|
9616a5028c | ||
|
|
bbc21acd80 | ||
|
|
cfcd57c65f | ||
|
|
cf9201c9d7 | ||
|
|
00b496bfba | ||
|
|
ad39bcc1f1 | ||
|
|
cbe87f5167 | ||
|
|
9bcafa150f | ||
|
|
cc400a4d22 | ||
|
|
1b1064ff73 | ||
|
|
8ea829ee81 | ||
|
|
feb4bce9b4 | ||
|
|
2c5e127de1 | ||
|
|
dfb82eb5a7 | ||
|
|
cda76045af | ||
|
|
cae9f32122 | ||
|
|
c91dd79086 | ||
|
|
f59119005e | ||
|
|
b6ca94c99c | ||
|
|
5ed5767f6a | ||
|
|
616f84c03f | ||
|
|
4bc6c7e482 | ||
|
|
53e17d9001 | ||
|
|
c36560570b | ||
|
|
7d093c2ff1 | ||
|
|
ea88e43485 | ||
|
|
9c526715b1 | ||
|
|
16c0283679 | ||
|
|
41033edd3b | ||
|
|
f77b21c2e0 | ||
|
|
f79e24d155 | ||
|
|
9859ecffab | ||
|
|
453fd4ba1d | ||
|
|
d152eb7b74 | ||
|
|
8ae03ccad0 | ||
|
|
0b79f42125 | ||
|
|
1e3453478e | ||
|
|
9cd3dea7f4 | ||
|
|
4214bc8d1e | ||
|
|
4a96843c74 | ||
|
|
65585cc5ca | ||
|
|
85da3cc1b8 | ||
|
|
fd17078a1a | ||
|
|
d5ac143b91 | ||
|
|
2b6f770fbb | ||
|
|
636bfa82a7 | ||
|
|
a2a60f163a | ||
|
|
2d13aeb955 | ||
|
|
8027f078ce | ||
|
|
31bac18a71 | ||
|
|
43ac06ee47 | ||
|
|
2ea8bdb18d | ||
|
|
3581d54bb5 | ||
|
|
8dd4052b1c | ||
|
|
895c37df7d | ||
|
|
fb4e90f5d0 | ||
|
|
2a4b027d35 | ||
|
|
59768ee766 | ||
|
|
4a49ce3774 | ||
|
|
a869bf9d97 | ||
|
|
0051ee2d70 | ||
|
|
17e6ecbee6 | ||
|
|
1e6d4bbb15 | ||
|
|
5f474c0238 | ||
|
|
f22d442cbd | ||
|
|
1d6e5d46fc | ||
|
|
56f900f470 | ||
|
|
4bbe901c00 | ||
|
|
d73e91b947 | ||
|
|
3db0fa1fbe | ||
|
|
8acb76e420 | ||
|
|
df7c9d2d4d | ||
|
|
e53716ba54 | ||
|
|
7ff2675b86 | ||
|
|
46471c878e | ||
|
|
42120c6db3 | ||
|
|
768c0247ca | ||
|
|
8bffe9239a | ||
|
|
d9a9934e2c | ||
|
|
25ae09285a | ||
|
|
38f0cdb4a8 | ||
|
|
8d31e21051 | ||
|
|
68b84b1590 | ||
|
|
be546937be | ||
|
|
a3359f65c5 | ||
|
|
8b3798a5cd | ||
|
|
ff6e1466ef | ||
|
|
7c23b55695 | ||
|
|
908016db95 | ||
|
|
b66a48d0e8 | ||
|
|
4263d6c113 | ||
|
|
568b699a66 | ||
|
|
c4939b8d17 | ||
|
|
cf37143e88 | ||
|
|
5025e1313e | ||
|
|
b4ff690dd4 | ||
|
|
8178c0ed6c | ||
|
|
e411bf27e9 | ||
|
|
bac868243d | ||
|
|
11759c0e39 | ||
|
|
4c5f8d2c6a | ||
|
|
6377917727 | ||
|
|
6470a49143 | ||
|
|
c4ed60ffe4 | ||
|
|
0a495661ec | ||
|
|
ac55c8a332 | ||
|
|
94137658bd | ||
|
|
fabaf19e9b | ||
|
|
5ab9f488ac | ||
|
|
ebd37ef57a | ||
|
|
890f446373 | ||
|
|
af6a19aed6 | ||
|
|
13ae1d14f3 | ||
|
|
3332b8a299 |
@@ -16,8 +16,8 @@ ContentProposalAdapterExtended.close=\u9589\u3058\u308B
|
||||
ContentProposalAdapterExtended.closeFocusout=Focusout\u3092\u9589\u3058\u308B
|
||||
ControlUtils.Unsupported1=\u3053\u306E\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB({0}) \u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3001\u5FC5\u8981\u3067\u3042\u308C\u3070\u30B1\u30FC\u30B9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044...
|
||||
CopyPushButton.CopyButton.Tip=\u9078\u629E\u3057\u305F\u30A2\u30A4\u30C6\u30E0\u306E\u30B3\u30D4\u30FC
|
||||
Curve2D.MaxNum.Be0=maximumSegments\u306F\u6B63\u307E\u305F\u306F0\u306B\u3057\u3066\u304F\u3060\u3055\u3044
|
||||
Curve2D.MinNum.Be0=minimumSegments\u306F\u6B63\u307E\u305F\u306F0\u306B\u3057\u3066\u304F\u3060\u3055\u3044
|
||||
Curve2D.MaxNum.Be0=maximumSegments\u306F\u6B63\u6570\u307E\u305F\u306F0\u306B\u3057\u3066\u304F\u3060\u3055\u3044
|
||||
Curve2D.MinNum.Be0=minimumSegments\u306F\u6B63\u6570\u307E\u305F\u306F0\u306B\u3057\u3066\u304F\u3060\u3055\u3044
|
||||
DateDialog.textContent=\u65E5\u4ED8\u3068\u6642\u9593\u306E\u9078\u629E
|
||||
DefaultCellModifier.tableItemDispose=\u7834\u68C4\u3055\u308C\u305F\u30C6\u30FC\u30D6\u30EB\u9805\u76EE
|
||||
DialogErrorForCellEditorListener.Error.MsgDialogTitle=\u30A8\u30E9\u30FC
|
||||
|
||||
@@ -45,3 +45,5 @@ VersionUtils.readPropertyFileError=Erreur de lecture de propri\u00E9t\u00E9 dans
|
||||
AS400ResultSet.unknowCloumn=Argument invalide\: nom de colonne inconnu
|
||||
AS400ResultSet.parameterIndex=Argument invalide\: index du param\u00E8tre
|
||||
AS400ResultSet.outofRange=\ est hors de la plage.
|
||||
TalendProxySelector.exception.badUriMap=URI du mapping invalide\u00A0: {0}
|
||||
TalendProxySelector.exception.proxySelectionError=Erreur lors de la s\u00E9lection du proxy pour {0}
|
||||
|
||||
@@ -12,7 +12,7 @@ ExtendedTablePasteCommand.Paste.Label=Paste data from the internal clipoard
|
||||
SelectContextVariablesPushButton.Label=Select context variables
|
||||
ExtendedTableModel.ModifiedObject.Error=ModifiedBeanListenable object must be set before use this method
|
||||
ImportPushButton.ImportButton.Tip=Replace all rows by import from xml file
|
||||
LabelledFileField.FileDialog.Text=Select a
|
||||
LabelledFileField.FileDialog.Text=Select a
|
||||
ModelSelectionDialog.Option=option
|
||||
ModelSelectionDialog.Update=Update repository connection.
|
||||
TableViewerCreator.Table.BeNull=table is null
|
||||
@@ -33,10 +33,10 @@ ModelSelectionDialog.ViewSchema=View schema (read only).
|
||||
LabelledFileField.BrowseButton.Text=Browse...
|
||||
ModelSelectionDialog.ViewQuery=View query (read only).
|
||||
MoveUpPushButton.MoveUpButton.Tip=Move up selected items
|
||||
AccessorUtils.Assert1=The 'BeanPropertyAccessors' of the column (with title '{0}' and id '{1}') is not configured correctly or the value set has not the correct type.
|
||||
AccessorUtils.Assert1=The 'BeanPropertyAccessors' of the column (with title '{0}' and id '{1}') is not configured correctly or the value set has not the correct type.
|
||||
exception.errorOccured=An error occured ({0}).\nSee log for more details.
|
||||
ColorStyledText.CopyItem.Text=Copy
|
||||
AccessorUtils.Assert0=The 'BeanPropertyAccessors' of the column (with title '{0}' and id '{1}') is not configured correctly. {2} is required for bean <B>
|
||||
AccessorUtils.Assert0=The 'BeanPropertyAccessors' of the column (with title '{0}' and id '{1}') is not configured correctly. {2} is required for bean <B>
|
||||
ExtendedTableMoveCommand.MoveLabel=Move up or down, one or more table entries
|
||||
CopyPushButton.CopyButton.Tip=Copy selected items
|
||||
ExtendedTableResetDBTypesCommand.ResetDBTypes.Label=Reset all DB Types to get the defaults
|
||||
@@ -55,7 +55,7 @@ DialogErrorForCellEditorListener.Error.MsgDialogTitle=Error
|
||||
ExportPushButton.ExportButton.Tip=Export all rows into XML file
|
||||
TableViewerCreator.CellModifier.ExError=The current CellModifier does'nt support this operation. \n Use '{0}' or a class which extends it to use this feature
|
||||
Curve2D.MinNum.Be0=minimumSegments be must positive or 0
|
||||
ModeReader.IgnoreElement=Ignore unknown element
|
||||
ModeReader.IgnoreElement=Ignore unknown element
|
||||
Curve2D.MaxNum.Be0=maximumSegments must be positive or 0
|
||||
CellEditorDialogBehavior.textContent=...
|
||||
CellEditorValueAdapterFactory.valueNotStringType=Bean value should be a class of String type \!
|
||||
|
||||
@@ -34,7 +34,7 @@ EConnectionType.onSubjobOkMenu=On Subjob Ok
|
||||
CorePreferencePage.groupBySource="Group by source" in context
|
||||
EConnectionType.onSubjobErrorMenu=On Subjob Error
|
||||
RepositoryUpdateManager.ItemsToUpdate=Check items to update
|
||||
SelectRepositoryContextDialog.Label=Select variables from repository contexts.
|
||||
SelectRepositoryContextDialog.Label=Select variables from repository contexts.
|
||||
EMetadataEncoding.Greek=Greek
|
||||
EMetadataEncoding.UTF16BE=Unicode BigEndian (16 bit)
|
||||
EConnectionType.synchronize=Synchronize
|
||||
@@ -46,13 +46,13 @@ EUpdateItemType.Components=Components
|
||||
EConnectionType.mergeMenu=Merge
|
||||
RepositoryUpdateManager.RenameContextTitle=Rename Question
|
||||
EUpdateItemType.Schema=Schema
|
||||
ContextValueErrorChecker.ErrorTitile=Context value error:
|
||||
ContextValueErrorChecker.ErrorTitile=Context value error:
|
||||
EMetadataEncoding.UTF8=Unicode 2.0 UTF-8
|
||||
EMetadataEncoding.UTF7=Unicode 2.0 UTF-7
|
||||
RepositoryUpdateManager.RenameContextMessages=Do you really want to propagate the rename variable to all jobs now? \n\n If yes, it might be quite long time to update.\n\n If no, the old variables will be change to built-in in the job.
|
||||
EUpdateItemType.Query=Query
|
||||
ExtractMetaDataFromDataBase.SchemaNoPresent=Schema not present in Database
|
||||
SelectRepositoryContextDialog.DuplicationMessage=You have selected the variable "{0}" in the Context "{1}".
|
||||
SelectRepositoryContextDialog.DuplicationMessage=You have selected the variable "{0}" in the Context "{1}".
|
||||
UpdatesConstants.Component=Component
|
||||
CorePreferencePage.perlInterpreter=Perl interpreter
|
||||
EMetadataEncoding.GB18030=Chinese National Standard
|
||||
@@ -82,7 +82,7 @@ EMetadataEncoding.Latin1=Latin1 (West European)
|
||||
ContextProcessSection.51=ContextProcessSection.15
|
||||
EMetadataEncoding.UTF16=Unicode 2.0 (16 bit)
|
||||
ContextProcessSection.50=ContextProcessSection.14
|
||||
CorePreferencePage.temporaryFiles=&Temporary files
|
||||
CorePreferencePage.temporaryFiles=&Temporary files
|
||||
EUpdateResult.Reload=Reload components
|
||||
RepositoryUpdateManager.Title=Modification
|
||||
ContextProcessSection.49=Default Context
|
||||
@@ -227,7 +227,7 @@ UpdatesConstants.JobVersion=JobVersion
|
||||
ProposalUtils.CellProposal.Error=Proposal of this type of CellEditor is unsupported \:
|
||||
ProposalUtils.CtrlProposal.ErrorMsg=Proposal for this type of Control is unsupported \:
|
||||
HTMLDocGenerator_generate_document=Generated documentation
|
||||
HTMLDocGenerator.author=AUTHOR
|
||||
HTMLDocGenerator.author=Author
|
||||
HTMLDocGenerator.author1=Author
|
||||
HTMLDocGenerator.column=Column
|
||||
HTMLDocGenerator.comment=Comment
|
||||
|
||||
@@ -49,7 +49,7 @@ EUpdateItemType.Schema=\u30B9\u30AD\u30FC\u30DE
|
||||
ContextValueErrorChecker.ErrorTitile=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306E\u5024\u30A8\u30E9\u30FC:
|
||||
EMetadataEncoding.UTF8=Unicode 2.0 UTF-8
|
||||
EMetadataEncoding.UTF7=Unicode 2.0 UTF-7
|
||||
RepositoryUpdateManager.RenameContextMessages=\u540D\u524D\u5909\u66F4\u5909\u6570\u3092\u4ECA\u3059\u3050\u5168\u3066\u306E\u30B8\u30E7\u30D6\u306B\u30D7\u30ED\u30D1\u30B2\u30FC\u30C8\u3057\u307E\u3059\u304B? \\n\\n [\u306F\u3044]\u3092\u9078\u629E\u3057\u305F\u5834\u5408\u3001\u66F4\u65B0\u306B\u975E\u5E38\u306B\u9577\u3044\u6642\u9593\u304C\u304B\u304B\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\\n\\n [\u3044\u3044\u3048]\u3092\u9078\u629E\u3059\u308B\u3068\u3001\u53E4\u3044\u5909\u6570\u304C\u30B8\u30E7\u30D6\u5185\u3067\u7D44\u307F\u8FBC\u307F\u306B\u5909\u308F\u308A\u307E\u3059\u3002
|
||||
RepositoryUpdateManager.RenameContextMessages=\u540D\u524D\u5909\u66F4\u306E\u5909\u6570\u3092\u3059\u3079\u3066\u306E\u30B8\u30E7\u30D6\u306B\u4ECA\u3059\u3050\u30D7\u30ED\u30D1\u30B2\u30FC\u30C8\u3057\u307E\u3059\u304B? \\n\\n [\u306F\u3044]\u3092\u9078\u629E\u3059\u308B\u3068\u3001\u66F4\u65B0\u306B\u975E\u5E38\u306B\u9577\u3044\u6642\u9593\u304C\u304B\u304B\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\\n\\n [\u3044\u3044\u3048]\u3092\u9078\u629E\u3059\u308B\u3068\u3001\u53E4\u3044\u5909\u6570\u304C\u30B8\u30E7\u30D6\u5185\u3067\u7D44\u307F\u8FBC\u307F\u306B\u5909\u308F\u308A\u307E\u3059\u3002
|
||||
EUpdateItemType.Query=\u30AF\u30A8\u30EA
|
||||
ExtractMetaDataFromDataBase.SchemaNoPresent=\u30B9\u30AD\u30FC\u30DE\u304C\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u5B58\u5728\u3057\u307E\u305B\u3093
|
||||
SelectRepositoryContextDialog.DuplicationMessage=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8"{1}"\u3067\u5909\u6570"{0}"\u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002
|
||||
|
||||
@@ -164,7 +164,7 @@ FunctionManager.PurePerl.ParaName=customize parameter
|
||||
GlobalServiceRegister.ServiceNotRegistered=The service {0} has not been registered.
|
||||
GroupByContextAction.groupContext=Group by Context
|
||||
GroupByVariableAction.groupVariable=Group by Variable
|
||||
JavaFunctionParser.checkMethod=Routines : "{0}.{1}\\" parse failed. please check your the Method.
|
||||
JavaFunctionParser.checkMethod=Routines : "{0}.{1}\" parse failed. please check your the Method.
|
||||
JavaGlobalVariableProposal.Description=Description\: {0}
|
||||
JavaGlobalVariableProposal.VariableName=\n\nVariable Name\: {1}
|
||||
JavaSimpleDateFormatProposalProvider.displaySingleQuote=\ ' : Display a single quote
|
||||
@@ -243,10 +243,10 @@ NodeReturnProposal.VariableName=\n\nVariable Name\: {5}
|
||||
PaletteContentDialog.connection=Format connection default:
|
||||
PaletteContentDialog.hint=Format hint default:
|
||||
PaletteContentDialog.lable=Format label default:
|
||||
Parameter.Comment=\ comment \:
|
||||
Parameter.Comment= comment :
|
||||
Parameter.Name=Parameter name
|
||||
Parameter.Type=\ type \:
|
||||
Parameter.Value=\ value \:
|
||||
Parameter.Type= type :
|
||||
Parameter.Value= value :
|
||||
PatternCalendar.dateFormat="yyyy-MM-dd HH:mm:ss"
|
||||
PatternCalendar.example=Example:
|
||||
PatternCalendar.pattern=Pattern:
|
||||
@@ -292,7 +292,6 @@ RepositoryUpdateManager.NoModificationTitle=No modification needed
|
||||
RepositoryUpdateManager.NoModificationMessages=There is no modification needed for update.
|
||||
RepositoryUpdateManager.NotFoundMessages=There is no relationship to find.
|
||||
RepositoryUpdateManager.NotFoundTitle=Not Found
|
||||
RepositoryUpdateManager.RenameContextMessages=Do you really want to propagate the rename variable to all jobs now? \n\n If yes, it might be quite long time to update.\n\n If no, the old variables will be change to built-in in the job.
|
||||
RepositoryUpdateManager.RenameContextTitle=Rename Question
|
||||
RepositoryUpdateManager.ItemsToUpdate=Check items to update
|
||||
RoutinesFunctionProposal.CreatedBy=Created By\:
|
||||
@@ -332,7 +331,7 @@ SelectRepositoryContextDialog.ExpandAll=Expand All
|
||||
SelectRepositoryContextDialog.Title=Select Context Variables
|
||||
SelectRepositoryContextDialog.View=View...
|
||||
SelectRepositoryContextGroupDialog.Default=default
|
||||
SelectRepositoryContextGroupDialog.Messages=\ In the Job, add a nonexistent context group from the repository context
|
||||
SelectRepositoryContextGroupDialog.Messages= In the Job, add a nonexistent context group from the repository context
|
||||
SelectRepositoryContextGroupDialog.Title=Add Context Group
|
||||
TalendDataCollectorPreferencePage_EnableCapture=Enable capture
|
||||
TalendDataCollectorPreferencePage_Description=The Usage Data Collector collects information about how individuals are using the Talend products. The intent is to use this data to help Talend better understand how users and organizations are using Talend products.
|
||||
@@ -519,7 +518,7 @@ HadoopVersionDialog.zipLocation=Zip:
|
||||
HadoopVersionDialog.importFromZip=Import from zip
|
||||
HadoopVersionDialog.title=Import custom definition
|
||||
HadoopVersionDialog.distribution=Distribution:
|
||||
HadoopVersionDialog.distribution.tooltip=Set the hadoop distribution
|
||||
HadoopVersionDialog.distribution.tooltip=Set the Hadoop distribution
|
||||
HadoopVersionDialog.version=Version:
|
||||
HadoopVersionDialog.version.tooltip=Set the distribution version
|
||||
HadoopVersionDialog.browseBtn=B&rowse...
|
||||
@@ -635,3 +634,5 @@ RepositoryUpdateManager.job.title=Updating items...
|
||||
BigDataBasicUtil.loadDynamicDistribution.IDynamicDistributionManager.notFound=Instance of {0} not found
|
||||
ComponentToRepositoryProperty.ImpossibleUseWALLET=Impossible to use WALLET type in the repository\!
|
||||
TalendLibsServerManager.connectUserLibraryFailureMessage=The user libraries artifact repository set in administrator cannot connect: Connection to {0} refused
|
||||
TalendLibsServerManager.cannotGetUserLibraryServer=Cannot get the user library server from remote administrator
|
||||
RepositoryUpdateManager.RenameContextMessagesNoBuiltIn=Do you really want to propagate the rename variable to all jobs now? \n\n If yes, it might be quite long time to update.
|
||||
|
||||
@@ -269,7 +269,6 @@ RepositoryUpdateManager.NoModificationTitle=Aucune modification n\u00E9cessaire
|
||||
RepositoryUpdateManager.NoModificationMessages=Aucune modification n\u00E9cessaire pour effectuer la mise \u00E0 jour.
|
||||
RepositoryUpdateManager.NotFoundMessages=Aucune relation \u00E0 trouver.
|
||||
RepositoryUpdateManager.NotFoundTitle=Introuvable
|
||||
RepositoryUpdateManager.RenameContextMessages=Voulez-vous vraiment propager la variable renomm\u00E9e \u00E0 tous les Jobs ? \n\nSi oui, la mise \u00E0 jour peut prendre un moment. \n\n Si non, les anciennes variables seront pass\u00E9es en Built-In dans les Jobs.
|
||||
RepositoryUpdateManager.RenameContextTitle=Renommer la question
|
||||
RepositoryUpdateManager.ItemsToUpdate=V\u00E9rification des \u00E9l\u00E9ments \u00E0 mettre \u00E0 jour
|
||||
RoutinesFunctionProposal.CreatedBy=Cr\u00E9\u00E9 par\n:
|
||||
@@ -565,3 +564,4 @@ EUpdateItemType.StructurePath=Chemin de la structure
|
||||
EComponentCategory_deployment=D\u00E9ploiement
|
||||
DynamicElement.incorrectInstance=L'objet JSON n'est pas une instance de {0} : {1}
|
||||
EComponentCategory_advanceSetting=Param\u00E8tres avanc\u00E9s
|
||||
TalendLibsServerManager.connectUserLibraryFailureMessage=\u00C9chec de la connexion au r\u00E9f\u00E9rentiel d\'artefacts des bilioth\u00E8ques utilisateurs configur\u00E9 en tant qu\'administrateur\u00A0: Connexion \u00E0 {0} refus\u00E9e.
|
||||
|
||||
@@ -292,7 +292,6 @@ RepositoryUpdateManager.NoModificationTitle=\u5909\u66F4\u306E\u5FC5\u8981\u306F
|
||||
RepositoryUpdateManager.NoModificationMessages=\u66F4\u65B0\u304C\u5FC5\u8981\u306A\u5BFE\u8C61\u306F\u3042\u308A\u307E\u305B\u3093\u3002
|
||||
RepositoryUpdateManager.NotFoundMessages=\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u30B7\u30C3\u30D7\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
|
||||
RepositoryUpdateManager.NotFoundTitle=\u898B\u3064\u304B\u308A\u307E\u305B\u3093
|
||||
RepositoryUpdateManager.RenameContextMessages=\u540D\u524D\u5909\u66F4\u5909\u6570\u3092\u4ECA\u3059\u3050\u3059\u3079\u3066\u306E\u30B8\u30E7\u30D6\u306B\u30D7\u30ED\u30D1\u30B2\u30FC\u30C8\u3057\u307E\u3059\u304B?[\u306F\u3044]\u3092\u9078\u629E\u3057\u305F\u5834\u5408\u3001\u66F4\u65B0\u306B\u975E\u5E38\u306B\u9577\u3044\u6642\u9593\u304C\u304B\u304B\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002[\u3044\u3044\u3048]\u3092\u9078\u629E\u3059\u308B\u3068\u3001\u53E4\u3044\u5909\u6570\u304C\u30B8\u30E7\u30D6\u5185\u3067\u7D44\u307F\u8FBC\u307F\u306B\u5909\u308F\u308A\u307E\u3059\u3002
|
||||
RepositoryUpdateManager.RenameContextTitle=\u8CEA\u554F\u306E\u540D\u79F0\u5909\u66F4
|
||||
RepositoryUpdateManager.ItemsToUpdate=\u66F4\u65B0\u3059\u308B\u9805\u76EE\u3092\u30C1\u30A7\u30C3\u30AF
|
||||
RoutinesFunctionProposal.CreatedBy=\u4F5C\u6210:
|
||||
|
||||
@@ -292,7 +292,6 @@ RepositoryUpdateManager.NoModificationTitle=\u6CA1\u6709\u9700\u8981\u7684\u4FEE
|
||||
RepositoryUpdateManager.NoModificationMessages=\u6CA1\u6709\u66F4\u65B0\u6240\u9700\u7684\u4FEE\u6539\u3002
|
||||
RepositoryUpdateManager.NotFoundMessages=\u6CA1\u6709\u53EF\u5BFB\u627E\u7684\u5173\u7CFB\u3002
|
||||
RepositoryUpdateManager.NotFoundTitle=\u627E\u4E0D\u5230
|
||||
RepositoryUpdateManager.RenameContextMessages=\u662F\u5426\u786E\u5B9A\u8981\u7ACB\u5373\u5C06\u91CD\u547D\u540D\u7684\u53D8\u91CF\u4F20\u64AD\u5230\u6240\u6709\u7684\u4F5C\u4E1A\uFF1F\\n\\n \u5982\u679C\u662F\uFF0C\u53EF\u80FD\u9700\u8981\u5F88\u957F\u65F6\u95F4\u8FDB\u884C\u66F4\u65B0\u3002\\n\\n \u5982\u679C\u4E0D\u662F\uFF0C\u65E7\u7684\u53D8\u91CF\u5C06\u6539\u4E3A\u5185\u7F6E\u4E8E\u4F5C\u4E1A\u4E2D\u3002
|
||||
RepositoryUpdateManager.RenameContextTitle=\u91CD\u547D\u540D\u95EE\u9898
|
||||
RepositoryUpdateManager.ItemsToUpdate=\u68C0\u67E5\u8981\u66F4\u65B0\u7684\u9879\u76EE
|
||||
RoutinesFunctionProposal.CreatedBy=\u521B\u5EFA\u4EBA:
|
||||
|
||||
@@ -21,8 +21,8 @@ ContextParameterProposal.ContextVariable=\n\nContext variable.
|
||||
ContextParameterProposal.Description=Description: {0}
|
||||
ContextValueErrorChecker.ErrorTitile=Context value error:
|
||||
ContextParameterProposal.NoCommentAvaiable=no comment available.
|
||||
ContextParameterProposal.Type=\nType\: {1}
|
||||
ContextParameterProposal.VariableName=\n\nVariable Name\: {2}
|
||||
ContextParameterProposal.Type=\nType: {1}
|
||||
ContextParameterProposal.VariableName=\n\nVariable Name: {2}
|
||||
ContextProcessSection.1=menuTable
|
||||
ContextProcessSection.12=Rename Context
|
||||
ContextProcessSection.13=Give a new name for the context {0}
|
||||
@@ -81,7 +81,7 @@ EComponentCategory_technical=Technical
|
||||
EComponentCategory_version=Version
|
||||
EComponentCategory_headerFooter=Header/Footer
|
||||
EComponentCategory_view=View
|
||||
EComponentCategory.advancedSettings=Advanced settings
|
||||
EComponentCategory.advancedSettings=Advanced Settings
|
||||
EComponentCategory.basicRun=Basic Run
|
||||
EComponentCategory.breakpoint=Breakpoint
|
||||
EComponentCategory.debugRun=Debug Run
|
||||
@@ -132,9 +132,9 @@ FunctionManager.PurePerl.ParaName=customize parameter
|
||||
GlobalServiceRegister.ServiceNotRegistered=The service {0} has not been registered.
|
||||
GroupByContextAction.groupContext=Group by Context
|
||||
GroupByVariableAction.groupVariable=Group by Variable
|
||||
JavaFunctionParser.checkMethod=Routines : "{0}.{1}\\" parse failed. please check your the Method.
|
||||
JavaFunctionParser.checkMethod=Routines : "{0}.{1}\" parse failed. please check your the Method.
|
||||
JavaGlobalVariableProposal.Description=Description\: {0}
|
||||
JavaGlobalVariableProposal.VariableName=\n\nVariable Name\: {1}
|
||||
JavaGlobalVariableProposal.VariableName=\n\nVariable Name: {1}
|
||||
JavaSimpleDateFormatProposalProvider.displaySingleQuote=\ ' : Display a single quote
|
||||
JavaSimpleDateFormatProposalProvider.quoteDisplayError=Two single quotes display only one single quote
|
||||
JavaTypesManager.bigDecimal=BIGDECIMAL is number:
|
||||
@@ -201,11 +201,11 @@ MetadataTool.schemaExist=The schema name aready exists.
|
||||
MetadataTool.schemaIn=The schema name is invalid.
|
||||
MetadataTool.schemaInvalid=Schema name is invalid.
|
||||
MetadataTool.schemaNull=Schema name is null.
|
||||
NodeReturnProposal.Availability=\nAvailability\: {4}
|
||||
NodeReturnProposal.Description=Description\: {0}
|
||||
NodeReturnProposal.Availability=\nAvailability: {4}
|
||||
NodeReturnProposal.Description=Description: {0}
|
||||
NodeReturnProposal.GlobalVariable=\n\nGlobal variable, property of component {1} [{2}].
|
||||
NodeReturnProposal.Type=\nType\: {3}
|
||||
NodeReturnProposal.VariableName=\n\nVariable Name\: {5}
|
||||
NodeReturnProposal.Type=\nType: {3}
|
||||
NodeReturnProposal.VariableName=\n\nVariable Name: {5}
|
||||
PaletteContentDialog.connection=Format connection default:
|
||||
PaletteContentDialog.hint=Format hint default:
|
||||
PaletteContentDialog.lable=Format label default:
|
||||
@@ -260,12 +260,12 @@ RepositoryUpdateManager.NotFoundTitle=Not Found
|
||||
RepositoryUpdateManager.RenameContextMessages=Do you really want to propagate the renamed variable to all jobs now? \n\n If yes, it might take a long time to update.\n\n If no, the old variables will be changed to built-in in the job.
|
||||
RepositoryUpdateManager.RenameContextTitle=Rename Question
|
||||
RepositoryUpdateManager.ItemsToUpdate=Check items to update
|
||||
RoutinesFunctionProposal.CreatedBy=Created By\:
|
||||
RoutinesFunctionProposal.Description=Description\:
|
||||
RoutinesFunctionProposal.ReturnType=Return Type\:
|
||||
RoutinesFunctionProposal.CreatedBy=Created By:
|
||||
RoutinesFunctionProposal.Description=Description:
|
||||
RoutinesFunctionProposal.ReturnType=Return Type:
|
||||
RoutinesFunctionProposal.System=System
|
||||
RoutinesFunctionProposal.User=User
|
||||
RoutinesFunctionProposal.VariableName=\n\nVariable Name\: {2}
|
||||
RoutinesFunctionProposal.VariableName=\n\nVariable Name: {2}
|
||||
RuleOperationChoiceDialog.editRules=Edit Rules
|
||||
RuleOperationChoiceDialog.rule=Rule:
|
||||
RuleOperationChoiceDialog.selectRulesFile=Select a rule from file
|
||||
@@ -296,7 +296,7 @@ SelectRepositoryContextDialog.ExpandAll=Expand All
|
||||
SelectRepositoryContextDialog.Title=Select Context Variables
|
||||
SelectRepositoryContextDialog.View=View...
|
||||
SelectRepositoryContextGroupDialog.Default=default
|
||||
SelectRepositoryContextGroupDialog.Messages=\ In the Job, add a nonexistent context group from the repository context
|
||||
SelectRepositoryContextGroupDialog.Messages= In the Job, add a nonexistent context group from the repository context
|
||||
SelectRepositoryContextGroupDialog.Title=Add Context Group
|
||||
TalendTabbedPropertyComposite.compactButton.toolTip=compact view
|
||||
TalendTabbedPropertyComposite.tableButton.toolTip=table view
|
||||
|
||||
@@ -541,4 +541,5 @@ EComponentCategory_advanceSetting=Param\u00E8tres avanc\u00E9s
|
||||
I18nPreferencePage.needRestart=Langage local (red\u00E9marrage requis)
|
||||
I18nPreferencePage.restart=Red\u00E9marrer
|
||||
I18nPreferencePage.wait_process=Le processus va prendre plusieurs minutes, patientez...
|
||||
MetadataPreferencePage.EnableBasic.name=Autorise l\'en-t\u00EAte d\'authentification simple
|
||||
MetadataPreferencePage.MessageDialog.Restart=Le Studio doit red\u00E9marrer pour que ce param\u00E8tre soit pris en compte.\\n\u00CAtes-vous s\u00FBr(e)\u00A0?
|
||||
|
||||
@@ -502,7 +502,7 @@ TalendDataCollectorUploadingPreferencePage_UploadPeriod=\u30A2\u30C3\u30D7\u30ED
|
||||
TalendDataCollectorUploadingPreferencePage_Days=\u65E5\u6570
|
||||
repository.servicesOperation=\u6F14\u7B97\u5B50
|
||||
repository.servicesPort=\u30DD\u30FC\u30C8
|
||||
RepositoryUpdateManager.MessagesForTDQ=\u5909\u66F4\u3092\u5168\u3066\u306E\u30B8\u30E7\u30D6\u306B\u30D7\u30ED\u30D1\u30B2\u30FC\u30C8\u3057\u307E\u3059\u304B?\\n\u4E00\u90E8\u306E\u5206\u6790\u4F9D\u5B58\u6027\u306E\u60C5\u5831\u304C\u5931\u308F\u308C\u307E\u3059\u3002\\n\u3053\u306E\u51E6\u7406\u306B\u306F\u6642\u9593\u304C\u304B\u304B\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002
|
||||
RepositoryUpdateManager.MessagesForTDQ=\u5909\u66F4\u3092\u3059\u3079\u3066\u306E\u30B8\u30E7\u30D6\u306B\u30D7\u30ED\u30D1\u30B2\u30FC\u30C8\u3057\u307E\u3059\u304B?\\n\u4E00\u90E8\u306E\u5206\u6790\u4F9D\u5B58\u6027\u306E\u60C5\u5831\u304C\u5931\u308F\u308C\u307E\u3059\u3002\\n\u3053\u306E\u51E6\u7406\u306B\u306F\u6642\u9593\u304C\u304B\u304B\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002
|
||||
EComponentCategory.executeJob=\u30B8\u30E7\u30D6\u5B9F\u884C
|
||||
EComponentCategory.monitoring=\u30E2\u30CB\u30BF\u30FC
|
||||
BinRepositoryNode.label=\u3054\u307F\u7BB1
|
||||
|
||||
@@ -9,7 +9,9 @@ ProjectPomProjectSettingPage_ConfirmTitle=Confirm
|
||||
ProjectPomProjectSettingPage_ConfirmMessage=Will apply and update for project POM with modifications immediately.
|
||||
ProjectPomProjectSettingPage_FilterPomLabel=Filter to use to generate poms:
|
||||
ProjectPomProjectSettingPage_FilterErrorMessage=Filter is invalid.
|
||||
ProjectPomProjectSettingPage.syncAllPomsButtonText=Force full re-synchronize poms
|
||||
ProjectPomProjectSettingPage.syncAllPomsButtonText=Force full re-synchronize POMs
|
||||
AbstractPersistentProjectSettingPage.syncAllPoms=Do you want to update all poms? \n This operation might take long time depends on your project size.
|
||||
MavenProjectSettingPage.filterExampleMessage=Filter examples:\nlabel=myJob \t\t\t\t=> Generate only the job named "myJob"\n!(label=myJob) \t\t\t\t=> Generate any job except the one named "myJob"\n(path=folder1/folder2) \t\t\t=> Generate any job in the folder "folder1/folder2"\n(path=folder1/folder2)or(label=myJob)\t=> Generate any job in the folder "folder1/folder2" or named "myJob"\n(label=myJob)and(version=0.2)\t\t=> Generate only the job named "myJob" with version 0.2\n!((label=myJob)and(version=0.1))\t\t=> Generate every jobs except the "myJob" version 0.1
|
||||
MavenProjectSettingPage.refModuleText=Set reference project modules in profile
|
||||
MavenProjectSettingPage.excludeDeletedItems=Exclude deleted items
|
||||
MavenProjectSettingPage.syncAllPomsWarning=Click the Force full re-synchronize POMs button to apply the new settings.
|
||||
|
||||
@@ -4,4 +4,7 @@ FolderMavenSettingPage_CreatingMavenSettingPath=Chemin :
|
||||
FolderMavenSettingPage_CreatingMavenSettingErrorTitle=Erreur
|
||||
ProjectPomProjectSettingPage_Titile=NOTE\: Les modules et les d\u00E9pendances seront conserv\u00E9s.
|
||||
ProjectPomProjectSettingPage_ConfirmTitle=Confirmer
|
||||
ProjectPomProjectSettingPage.syncAllPomsButtonText=Forcer la resynchronisation des POM
|
||||
AbstractPersistentProjectSettingPage.syncAllPoms=Mettre \u00E0 jour tous les fichiers pom ? \n Cette op\u00E9ration peut prendre du temps selon la taille de votre projet.
|
||||
MavenProjectSettingPage.refModuleText=Configurer les modules du projet de r\u00E9f\u00E9rence dans le profil
|
||||
MavenProjectSettingPage.syncAllPomsWarning=Cliquez sur le bouton Forcer la resynchronisation des POM pour appliquer les nouveaux param\u00E8tres.
|
||||
|
||||
@@ -13,3 +13,4 @@ ProjectPomProjectSettingPage.syncAllPomsButtonText=POM\u306E\u5168\u518D\u540C\u
|
||||
AbstractPersistentProjectSettingPage.syncAllPoms=\u3059\u3079\u3066\u306EPOM\u3092\u66F4\u65B0\u3057\u307E\u3059\u304B? \\n \u3053\u306E\u64CD\u4F5C\u306F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30B5\u30A4\u30BA\u306B\u3088\u3063\u3066\u306F\u6642\u9593\u304C\u304B\u304B\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002
|
||||
MavenProjectSettingPage.filterExampleMessage=\u30D5\u30A3\u30EB\u30BF\u30FC\u306E\u4F8B:\\nlabel=myJob \\t\\t\\t\\t=> \"myJob\"\u3068\u3044\u3046\u540D\u524D\u306E\u30B8\u30E7\u30D6\u306E\u307F\u3092\u751F\u6210\\n!(label=myJob) \\t\\t\\t\\t=> \"myJob\"\u3068\u3044\u3046\u540D\u524D\u306E\u30B8\u30E7\u30D6\u3092\u9664\u304D\u3001\u3042\u3089\u3086\u308B\u30B8\u30E7\u30D6\u3092\u751F\u6210\\n(path=folder1/folder2) \\t\\t\\t=> \u30D5\u30A9\u30EB\u30C0\u30FC\"folder1/folder2\"\u5185\u306B\u4EFB\u610F\u306E\u30B8\u30E7\u30D6\u3092\u751F\u6210\\n(path=folder1/folder2)or(label=myJob)\\t=> \u30D5\u30A9\u30EB\u30C0\u30FC\"folder1/folder2\"\u5185\u306B\u4EFB\u610F\u306E\u30B8\u30E7\u30D6\u3092\u3001\u307E\u305F\u306F\"myJob\"\u3068\u3044\u3046\u540D\u524D\u306E\u30B8\u30E7\u30D6\u3092\u751F\u6210\\n(label=myJob)and(version=0.2)\\t\\t=> \u30D0\u30FC\u30B8\u30E7\u30F30.2\u3067\"myJob\"\u3068\u3044\u3046\u540D\u524D\u306E\u30B8\u30E7\u30D6\u306E\u307F\u3092\u751F\u6210\\n!((label=myJob)and(version=0.1))\\t\\t=> \"myJob\"\u30D0\u30FC\u30B8\u30E7\u30F30.1\u3092\u9664\u304D\u3001\u3059\u3079\u3066\u306E\u30B8\u30E7\u30D6\u3092\u751F\u6210
|
||||
MavenProjectSettingPage.refModuleText=\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3067\u53C2\u7167\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u8A2D\u5B9A
|
||||
MavenProjectSettingPage.syncAllPomsWarning=[POM\u306E\u5168\u518D\u540C\u671F\u3092\u5F37\u5236]\u30DC\u30BF\u30F3\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3001\u65B0\u3057\u3044\u8A2D\u5B9A\u3092\u9069\u7528\u3057\u307E\u3059\u3002
|
||||
|
||||
@@ -23,3 +23,6 @@ modules.required=Requis pour utiliser ce composant.
|
||||
ShareLibsJob.message=Partager les biblioth\u00E8ques de Maven vers le serveur {0}
|
||||
ShareLibsJob.sharingLibraries=Partage des biblioth\u00E8ques : {0}
|
||||
ExtensionModuleManager.moduleGroup.cycleReference=Module group {0} was cycle referenced!
|
||||
NexusRepository.checkConnection.successMsg=Connexion \u00E9tablie.
|
||||
NexusRepository.checkConnection.invalidParam=Param\u00E8tre Nexus invalide.
|
||||
ShareLibsJob.monitor.cancelled=Annulation utilisateur.
|
||||
|
||||
@@ -25,3 +25,4 @@ ShareLibsJob.sharingLibraries=\u30E9\u30A4\u30D6\u30E9\u30EA\u306E\u5171\u6709:
|
||||
ExtensionModuleManager.moduleGroup.cycleReference=\u30E2\u30B8\u30E5\u30FC\u30EB\u30B0\u30EB\u30FC\u30D7{0}\u306F\u5FAA\u74B0\u53C2\u7167\u3055\u308C\u307E\u3057\u305F!
|
||||
NexusRepository.checkConnection.successMsg=\u63A5\u7D9A\u6210\u529F\u3002
|
||||
NexusRepository.checkConnection.invalidParam=Nexus\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002
|
||||
ShareLibsJob.monitor.cancelled=\u30E6\u30FC\u30B6\u30FC\u304C\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002
|
||||
|
||||
@@ -25,3 +25,4 @@ ShareLibsJob.sharingLibraries=\u6B63\u5728\u5171\u4EAB\u5E93\uFF1A{0}
|
||||
ExtensionModuleManager.moduleGroup.cycleReference=\u6A21\u5757\u7EC4 {0} \u662F\u5FAA\u73AF\u5F15\u7528\u7684\uFF01
|
||||
NexusRepository.checkConnection.successMsg=\u8FDE\u63A5\u6210\u529F\u3002
|
||||
NexusRepository.checkConnection.invalidParam=\u65E0\u6548\u7684 Nexus \u53C2\u6570\u3002
|
||||
ShareLibsJob.monitor.cancelled=\u7528\u6237\u5DF2\u53D6\u6D88\u3002
|
||||
|
||||
@@ -111,6 +111,13 @@ ConfigModuleDialog.findExistByNameBtn=Find by name
|
||||
ConfigModuleDialog.findExistByURIBtn=Find by Maven URI
|
||||
ConfigModuleDialog.moduleName.error=Please input a valid file name.
|
||||
ConfigModuleDialog.jarNotInstalled.error=This jar is not installed in the artifact repository, please install it !
|
||||
ConfigModuleDialog.moduleName=Module Name
|
||||
ConfigModuleDialog.shareInfo=The library can't be shared to remote artifact repository if the repository does not allow redeployment, continue to share ?
|
||||
ConfigModuleDialog.searchLocalBtn=Search Local
|
||||
ConfigModuleDialog.searchRemoteBtn=Search Remote
|
||||
ConfigModuleDialog.error.missingName=Please input a module name!
|
||||
ConfigModuleDialog.error.missingModule=Please select a module!
|
||||
ConfigModuleDialog.search.noModules=No modules found for search of: {0} !
|
||||
ImportCustomSettingsAction.title=Import custom settings
|
||||
ImportCustomSettingsAction.warning=Are you sure to overwrite the custom mvn uri settings with the selected file ?
|
||||
ExportCustomSettingsAction.title=Export custom settings
|
||||
@@ -118,3 +125,4 @@ ConfigModuleDialog.install.message=Install a module : {0}
|
||||
download.external.dialog.warning=Warning
|
||||
download.external.dialog.message=Select at least one module not installed.
|
||||
DownloadModuleRunnable.jar.download.failed=The Download failed for the following jars {0}
|
||||
InstallModuleDialog.error.invalidDefaultMvnURI=Can't generate default MVN URI.
|
||||
|
||||
@@ -150,7 +150,7 @@ FunctionManager.PurePerl.ParaName=customize parameter
|
||||
GlobalServiceRegister.ServiceNotRegistered=The service {0} has not been registered.
|
||||
GroupByContextAction.groupContext=Group by Context
|
||||
GroupByVariableAction.groupVariable=Group by Variable
|
||||
JavaFunctionParser.checkMethod=Routines : "{0}.{1}\\" parse failed. please check your the Method.
|
||||
JavaFunctionParser.checkMethod=Routines : "{0}.{1}\" parse failed. please check your the Method.
|
||||
JavaGlobalVariableProposal.Description=Description\: {0}
|
||||
JavaGlobalVariableProposal.VariableName=\n\nVariable Name\: {1}
|
||||
JavaSimpleDateFormatProposalProvider.displaySingleQuote=\ ' : Display a single quote
|
||||
@@ -320,7 +320,7 @@ SelectRepositoryContextDialog.ExpandAll=Expand All
|
||||
SelectRepositoryContextDialog.Title=Select Context Variables
|
||||
SelectRepositoryContextDialog.View=View...
|
||||
SelectRepositoryContextGroupDialog.Default=default
|
||||
SelectRepositoryContextGroupDialog.Messages=\ In the Job, add a nonexistent context group from the repository context
|
||||
SelectRepositoryContextGroupDialog.Messages= In the Job, add a nonexistent context group from the repository context
|
||||
SelectRepositoryContextGroupDialog.Title=Add Context Group
|
||||
TalendTabbedPropertyComposite.compactButton.toolTip=compact view
|
||||
TalendTabbedPropertyComposite.tableButton.toolTip=table view
|
||||
|
||||
@@ -325,7 +325,6 @@ SelectorTableForm.TableType=\u03A4\u03CD\u03C0\u03BF\u03C2
|
||||
SelectorTableForm.groupTableSettings=\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE \u03A3\u03C7\u03AE\u03BC\u03B1\u03C4\u03BF\u03C2 \u03B3\u03B9\u03B1 \u03B4\u03B7\u03BC\u03B9\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1
|
||||
SelectorTableForm.selectAllTables=\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE \u038C\u03BB\u03C9\u03BD
|
||||
SelectorTableForm.selectNoneTables=\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE \u039A\u03B1\u03BD\u03B5\u03BD\u03CC\u03C2
|
||||
ShowAddedContextdialog.Title=\u03A0\u03C1\u03BF\u03C3\u03C4\u03B9\u03B8\u03AD\u03BD \u03C0\u03BB\u03B1\u03AF\u03C3\u03B9\u03BF
|
||||
ShowAddedContextdialog.Variables=\u039C\u03B5\u03C4\u03B1\u03B2\u03BB\u03B7\u03C4\u03AD\u03C2
|
||||
StoppablePreviewLoader.inforLabelText.previewInterrupted=\u0394\u03B9\u03B1\u03BA\u03BF\u03C0\u03AE \u03C0\u03C1\u03BF\u03B5\u03C0\u03B9\u03C3\u03BA\u03CC\u03C0\u03B7\u03C3\u03B7\u03C2
|
||||
TableWizard.windowTitle=\u03A3\u03C7\u03AE\u03BC\u03B1
|
||||
|
||||
@@ -105,7 +105,7 @@ DatabaseTableFilterForm.view=VIEW
|
||||
DatabaseTableForm.AddTable=Add Schema
|
||||
DatabaseTableForm.checkConnection=Check Connection
|
||||
DatabaseTableForm.comment=Comment
|
||||
DatabaseTableForm.connectionFailure=Database connection failure \: "Retrieve Shema" is disable. Press "Check Connection" to restore the situation.
|
||||
DatabaseTableForm.connectionFailure=Database connection failure : "Retrieve Shema" is disable. Press "Check Connection" to restore the situation.
|
||||
DatabaseTableForm.connectionFailureTip=Connection failure, check the database settings or contact your database administrator.
|
||||
DatabaseTableForm.connectionIsDone=Connection successful.
|
||||
DatabaseTableForm.getDetailedSchema=Push this button to get a detailed schema.
|
||||
@@ -126,7 +126,7 @@ DatabaseTableForm.guessSchema=Guess Schema
|
||||
DatabaseTableForm.streamDetach=Stream Detach
|
||||
DatabaseTableForm.table=Based on table
|
||||
DatabaseTableForm.tableColumnText.talbe=Table
|
||||
DatabaseTableForm.tableNoExist=Database connection successful but no table exist \: "Retrieve Shema" is disabled.\nUse a SGBD to create tables and click on "Check Connection" to restore the situation.
|
||||
DatabaseTableForm.tableNoExist=Database connection successful but no table exist : "Retrieve Shema" is disabled.\nUse a SGBD to create tables and click on "Check Connection" to restore the situation.
|
||||
DatabaseTableForm.tableTip=Choose a table and use the Retrieve Button or define the Schema manually.
|
||||
DatabaseTableForm.type=Type \: {0}
|
||||
DatabaseTableForm.typeTable=Type \: TABLE
|
||||
@@ -404,8 +404,6 @@ SelectorTableForm.selectAllTables=Select All
|
||||
SelectorTableForm.selectNoneTables=Select None
|
||||
ShadowProcessHelper.logError.previewIsNull01=\nThe ShadowProcess use to extract data or metadata on a File don't run.
|
||||
ShadowProcessHelper.logError.previewIsNull02=\nConfigurationElementsFor("org.talend.repository.filepreview_provider").length \=\= 0 ??
|
||||
ShowAddedContextdialog.Messages=Should add the following context parameters to the jobs or not?
|
||||
ShowAddedContextdialog.Title=Added context
|
||||
ShowAddedContextdialog.Variables=Variables
|
||||
StoppablePreviewLoader.inforLabelText.previewInterrupted=Preview interrupted
|
||||
TableWizard.windowTitle=Schema
|
||||
@@ -546,3 +544,5 @@ DatabaseForm.DataBase=DataBase
|
||||
FileStep2.stop=Stop
|
||||
PropertiesWizard.VersionTitle=Change the parent version
|
||||
PropertiesWizard.PreviousVersion=The TestCases of {0} will point to the previous version. Please use "Edit TestCase Properties" to change the parent version.
|
||||
ShowAddedContextdialog.dialogMessages=Add the following context parameters to Jobs using this connection?
|
||||
ShowAddedContextdialog.dialogTitle=Add context parameters
|
||||
|
||||
@@ -396,8 +396,6 @@ SelectorTableForm.groupTableSettings=S\u00E9lectionnez le sch\u00E9ma \u00E0 cr\
|
||||
SelectorTableForm.nameFilter=Filtre sur nom\:
|
||||
SelectorTableForm.selectAllTables=S\u00E9lectionner tout
|
||||
SelectorTableForm.selectNoneTables=S\u00E9lectionner aucun(e)
|
||||
ShowAddedContextdialog.Messages=Ajouter les param\u00E8tres de contexte suivants aux Jobs ?
|
||||
ShowAddedContextdialog.Title=Contexte ajout\u00E9
|
||||
ShowAddedContextdialog.Variables=Variables
|
||||
StoppablePreviewLoader.inforLabelText.previewInterrupted=Aper\u00E7u interrompu
|
||||
TableWizard.windowTitle=Sch\u00E9ma
|
||||
@@ -534,4 +532,5 @@ SparkPropertiesDialog.desc=Configurations des propri\u00E9t\u00E9s Spark
|
||||
SparkPropertiesDialog.parentProperties.title=Propri\u00E9t\u00E9s Spark parent
|
||||
DatabaseForm.DataBase=Base de donn\u00E9es
|
||||
FileStep2.stop=Arr\u00EAter
|
||||
PropertiesWizard.VersionTitle=Modifier la version parente
|
||||
PropertiesWizard.PreviousVersion=Les TestCases de {0} vont pointer vers la version pr\u00E9c\u00E9dente. Utilisez \"Modifier les propri\u00E9t\u00E9s du TestCase\" pour modifier la version parente.
|
||||
|
||||
@@ -401,8 +401,6 @@ SelectorTableForm.nameFilter=Nome filtro\:
|
||||
SelectorTableForm.selectAllTables=Seleziona tutto
|
||||
SelectorTableForm.selectNoneTables=Seleziona nulla
|
||||
ShadowProcessHelper.logError.previewIsNull01=\nIl processo ombra utilizzato per estrarre dati o metadati su un file non \u00E8 stato eseguito.
|
||||
ShowAddedContextdialog.Messages=\u00C8 il caso di aggiungere i seguente parametri contesto al job oppure no?
|
||||
ShowAddedContextdialog.Title=Contesto aggiunto
|
||||
ShowAddedContextdialog.Variables=Variabili
|
||||
StoppablePreviewLoader.inforLabelText.previewInterrupted=Anteprima interrotta
|
||||
TableWizard.windowTitle=Schema
|
||||
|
||||
@@ -118,7 +118,7 @@ DatabaseTableForm.navigatorTree=\u30B9\u30AD\u30FC\u30DE
|
||||
DatabaseTableForm.retreiveButtonAlert=\u201D\u30B9\u30AD\u30FC\u30DE\u306E\u53D6\u5F97\u201D\u3092\u4F7F\u7528\u3059\u308B\u305F\u3081\u306B\u306F\u3001\u6700\u521D\u306B\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
||||
DatabaseTableForm.retreiveButtonConfirmation=\u5909\u66F4\u3092\u78BA\u8A8D\u3057\u307E\u3059\u304B\uFF1F
|
||||
DatabaseTableForm.retreiveButtonConfirmationMessage=\u30B9\u30AD\u30FC\u30DE\u306E\u8A2D\u5B9A\u3092\u5909\u66F4\u3059\u308B\u3068\u3001\u73FE\u5728\u306E\u30B9\u30AD\u30FC\u30DE\u30D7\u30EC\u30D3\u30E5\u30FC\u3068\u7570\u306A\u308A\u307E\u3059\u3002\u30B9\u30AD\u30FC\u30DE\u306E\u66F4\u65B0\u306F\u5168\u3066\u306E\u30AB\u30EC\u30F3\u30C8\u30C7\u30FC\u30BF\u306B\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\u3002\u7D99\u7D9A\u3057\u307E\u3059\u304B\uFF1F
|
||||
DatabaseTableForm.retreiveButtonIsAccessible=\"\u53D6\u5F97\u30DC\u30BF\u30F3\"\u304C\u4F7F\u7528\u53EF\u80FD\u306B\u306A\u308A\u307E\u3057\u305F\u3002
|
||||
DatabaseTableForm.retreiveButtonIsAccessible=\"\u53D6\u5F97\"\u30DC\u30BF\u30F3\u304C\u4F7F\u7528\u53EF\u80FD\u306B\u306A\u308A\u307E\u3057\u305F\u3002
|
||||
DatabaseTableForm.retreiveButtonTip=\u30B9\u30AD\u30FC\u30DE\u3092\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u300C\u30B9\u30AD\u30FC\u30DE\u60C5\u5831\u3092\u53D6\u5F97\u300D\u304C\u4F7F\u7528\u3067\u304D\u307E\u3059!
|
||||
DatabaseTableForm.retreiveButtonUse=\u300C\u30B9\u30AD\u30FC\u30DE\u60C5\u5831\u3092\u53D6\u5F97\u300D\u3067\u73FE\u5728\u306E\u30B9\u30AD\u30FC\u30DE\u60C5\u5831\u3092\u66F4\u65B0\u3067\u304D\u307E\u3059
|
||||
DatabaseTableForm.retreiveSchema=\u30B9\u30AD\u30FC\u30DE\u306E\u53D6\u5F97
|
||||
@@ -404,8 +404,6 @@ SelectorTableForm.selectAllTables=\u3059\u3079\u3066\u9078\u629E
|
||||
SelectorTableForm.selectNoneTables=\u4F55\u3082\u9078\u629E\u3057\u306A\u3044
|
||||
ShadowProcessHelper.logError.previewIsNull01=\n\u30D5\u30A1\u30A4\u30EB\u4E0A\u306E\u30C7\u30FC\u30BF\u307E\u305F\u306F\u30E1\u30BF\u30C7\u30FC\u30BF\u306E\u62BD\u51FA\u306B\u4F7F\u7528\u3055\u308C\u3066\u3044\u308BShadowProcess\u304C\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093\u3002
|
||||
ShadowProcessHelper.logError.previewIsNull02=\nConfigurationElementsFor('org.talend.repository.filepreview_provider').length == 0 ??
|
||||
ShowAddedContextdialog.Messages=\u30B8\u30E7\u30D6\u306B\u6B21\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3092\u52A0\u3048\u308B\u3079\u304D\u3067\u3042\u308B?
|
||||
ShowAddedContextdialog.Title=\u8FFD\u52A0\u3055\u308C\u305F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8
|
||||
ShowAddedContextdialog.Variables=\u5909\u6570
|
||||
StoppablePreviewLoader.inforLabelText.previewInterrupted=\u30D7\u30EC\u30D3\u30E5\u30FC\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F
|
||||
TableWizard.windowTitle=\u30B9\u30AD\u30FC\u30DE
|
||||
|
||||
@@ -209,8 +209,6 @@ SelectorTableForm.Success=\u0423\u0441\u043F\u0435\u0448\u043D\u043E
|
||||
SelectorTableForm.TableName=\u0418\u043C\u044F
|
||||
SelectorTableForm.TableType=\u0422\u0438\u043F
|
||||
SelectorTableForm.selectAllTables=\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435
|
||||
ShowAddedContextdialog.Messages=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u043B\u0443\u0434\u0443\u044E\u0449\u0438\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430 \u0432 \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u0437\u0430\u0434\u0430\u0447\u0443?
|
||||
ShowAddedContextdialog.Title=\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442
|
||||
ShowAddedContextdialog.Variables=\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435
|
||||
TableWizard.windowTitle=\u0421\u0445\u0435\u043C\u0430
|
||||
TableWizardPage.titleUpdate=\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0445\u0435\u043C\u0443
|
||||
|
||||
@@ -404,8 +404,6 @@ SelectorTableForm.selectAllTables=\u5168\u9009
|
||||
SelectorTableForm.selectNoneTables=\u53D6\u6D88\u5168\u9009
|
||||
ShadowProcessHelper.logError.previewIsNull01=\\n\u7528\u4E8E\u63D0\u53D6\u6587\u4EF6\u4E2D\u6570\u636E\u6216\u5143\u6570\u636E\u7684 ShadowProcess \u4E0D\u8FD0\u884C\u3002
|
||||
ShadowProcessHelper.logError.previewIsNull02=\\nConfigurationElementsFor(\"org.talend.repository.filepreview_provider\").length == 0 ??
|
||||
ShowAddedContextdialog.Messages=\u662F\u5426\u5E94\u5F53\u5C06\u4EE5\u4E0B\u4E0A\u4E0B\u6587\u53C2\u6570\u6DFB\u52A0\u5230\u4F5C\u4E1A\u4E2D\uFF1F
|
||||
ShowAddedContextdialog.Title=\u5DF2\u6DFB\u52A0\u7684\u4E0A\u4E0B\u6587
|
||||
ShowAddedContextdialog.Variables=\u53D8\u91CF
|
||||
StoppablePreviewLoader.inforLabelText.previewInterrupted=\u9884\u89C8\u4E2D\u65AD
|
||||
TableWizard.windowTitle=Schema
|
||||
|
||||
@@ -26,6 +26,7 @@ _UI_BusinessAssignment_type=Assignment
|
||||
_UI_BaseBusinessItemRelationship_source_feature=Source
|
||||
_UI_TalendItem_id_feature=Id
|
||||
_UI_BusinessItem_businessProcess_feature=Business Model
|
||||
_UI_BidirectionalBusinessItemRelationship_type=Bidirectional Business Item Relationship
|
||||
_UI_TalendItem_version_feature=Version
|
||||
_UI_BaseBusinessItemRelationship_target_feature=Target
|
||||
_UI_Documentation_type=Documentation
|
||||
|
||||
@@ -114,3 +114,4 @@ LinksToolbarItem_cloud=Link to Talend cloud
|
||||
WelcomePageDynamicContentProvider.LatestItemsServices.Title=Services
|
||||
ComponentsManager.form.install.dialog.restart.title=Restarting Studio
|
||||
ComponentsManager.form.install.dialog.restart.message=We need to restart studio to finish the installation.\n\nDo you want to restart studio right now?
|
||||
JavaVersion.CheckError=Java upgrade required, minimal required java version is {0}, current version is {1}.
|
||||
|
||||
@@ -10,3 +10,4 @@ ImportExportHandlersManager_importingItemsMessage=Import des \u00E9l\u00E9ments.
|
||||
ImportExportHandlersManager_importingItemsError=Erreurs lors de l'import
|
||||
ImportExportHandlersManager_deletingItemsMessage=Supprimer des \u00E9l\u00E9ments...
|
||||
AbstractImportHandler_nameUsed.differentRepositoryType=Un \u00E9l\u00E9ment du m\u00EAme nom existe d\u00E9j\u00E0. V\u00E9rifiez la Corbeille et videz-la si n\u00E9cessaire.
|
||||
ImportExportHandlersManager_overrideDelete=Suppression des \u00E9l\u00E9ments existants \u00E0 \u00E9craser...
|
||||
|
||||
@@ -27,4 +27,6 @@ ShowErrorsDuringImportItemsDialog_exportLogEntry=Exporter l'entr\u00E9e du log
|
||||
ShowErrorsDuringImportItemsDialog_confirmOverwrite_message=Le fichier "{0}" existe. L'\u00E9craser ?
|
||||
ImportItemsWizardPage_ErrorsMessage=L'\u00E9l\u00E9ment '{0}' existe dans une version diff\u00E9rente {1}. V\u00E9rifiez la Corbeille et videz-la si n\u00E9cessaire.
|
||||
ImportItemsWizardPage_ProgressDialog_ExecutingMessage=Pr\u00E9paration...
|
||||
ImportItemsWizardPage_internalIdGroup=ID interne
|
||||
ImportItemsWizardPage_internalIdGroup_alwaysRegenId=Toujours reg\u00E9n\u00E9rer l\'ID \u00E0 l\'import
|
||||
ImportItemsWizardPage_internalIdGroup_keepOrigId=Conserver l\'ID interne original
|
||||
|
||||
@@ -2,6 +2,6 @@ LocalRepositoryFactory.logRetrievingFiles=Retrieving {0} files in {1} sec
|
||||
LocalRepositoryFactory.illegalArgumentException03=Label cannot be null nor empty
|
||||
LocalRepositoryFactory.illegalArgumentException02=Path cannot be null
|
||||
LocalRepositoryFactory.illegalArgumentException01=Type cannot be null
|
||||
LocalRepositoryFactory.CannotLoadProperty=The Repository local provider was unable to load
|
||||
LocalRepositoryFactory.CannotLoadProperty=The Repository local provider was unable to load
|
||||
LocalRepositoryFactory.UserLoginCannotBeNull=User login cannot be null
|
||||
LocalRepositoryFactory.Property_File_Broken=The property file {0} is broken.
|
||||
|
||||
@@ -10,7 +10,7 @@ MdmConceptWizardPage1_select_model=Select one model to create MDM metadata
|
||||
MdmConceptWizardPage2_mdm_entity=MDM Entity
|
||||
MdmConceptWizardPage3_mdm_entity=MDM Entity
|
||||
MDMForm_check=Check
|
||||
MDMForm_connect_successful=MDM connected successfully\!
|
||||
MDMForm_connect_successful=MDM connected successfully!
|
||||
MDMForm_link_para=Link Parameter
|
||||
MDMForm_pass=Password
|
||||
MDMForm_pass_null=Password can not be null\!
|
||||
|
||||
@@ -2,7 +2,7 @@ repository.metadataFilePositional=File positional
|
||||
repository.metadataFilePositional.alias=POS
|
||||
repository.metadataFileRegexp=File regex
|
||||
repository.metadataFileRegexp.alias=REGX
|
||||
repository.metadataFileXml=File xml
|
||||
repository.metadataFileXml=File XML
|
||||
repository.metadataFileXml.alias=XML
|
||||
repository.metadataFileLdif=File ldif
|
||||
repository.metadataFileLdif.alias=LDIF
|
||||
|
||||
@@ -60,9 +60,9 @@ CreateFilePositionalAction.action.openTitle=Open file positional
|
||||
CreateFileRegexpAction.action.createTitle=Create file regex
|
||||
CreateFileRegexpAction.action.editTitle=Edit file regex
|
||||
CreateFileRegexpAction.action.openTitle=Open file regex
|
||||
CreateFileXmlAction.action.createTitle=Create file xml
|
||||
CreateFileXmlAction.action.editTitle=Edit file xml
|
||||
CreateFileXmlAction.action.openTitle=Open file xml
|
||||
CreateFileXmlAction.action.createTitle=Create file XML
|
||||
CreateFileXmlAction.action.editTitle=Edit file XML
|
||||
CreateFileXmlAction.action.openTitle=Open file XML
|
||||
CreateFolderAction.action.title=Create folder
|
||||
CreateFolderAction.action.toolTipText=Create folder
|
||||
CreateGenericSchemaAction.createGeneric=Create generic schema
|
||||
@@ -256,7 +256,7 @@ FileStep2.noresultDetailMessage=Please check right XPathExpression or XML source
|
||||
FileStep2.previewFailure=Preview error. Some settings must be changed.\nNote\: Preview errors are generally due to a wrong encoding setting.
|
||||
FileStep2.previewIsDone=Preview successful...
|
||||
FileStep2.previewProgress=Preview in progress...
|
||||
FileStep2.quoteDelimitedTip=You cannot use the character " without an escape character. Use \\"
|
||||
FileStep2.quoteDelimitedTip=You cannot use the character " without an escape character. Use \"
|
||||
FileStep2.refreshPreview=Refresh Preview
|
||||
FileStep2.removeEmptyRow=Skip empty row
|
||||
FileStep2.rowSeparator=Row Separator
|
||||
@@ -384,7 +384,7 @@ JobScriptsExportWizardPage.extractZipFile=Extract the zip file
|
||||
JobScriptsExportWizardPage.generatePerlFiles=Generate Perl Files
|
||||
JobScriptsExportWizardPage.jobPerlScripts=Perl scripts
|
||||
JobScriptsExportWizardPage.jobJavaScripts=Java classes
|
||||
JobScriptsExportWizardPage.requiredTalendPerlModules=Required talend modules
|
||||
JobScriptsExportWizardPage.requiredTalendPerlModules=Required Talend modules
|
||||
JobScriptsExportWizardPage.shellLauncher=Shell launcher
|
||||
JobScriptsExportWizardPage.sourceFiles=Source files
|
||||
JobScriptsExportWizardPage.systemRoutines=System routines
|
||||
@@ -461,8 +461,8 @@ LoginComposite.Workspace_inuse=Workspace in use, please choose another one.
|
||||
LoginComposite.TisWorkspace_welcome=Welcome to {0}!
|
||||
LoginComposite.welcomeTitle=Welcome to Talend Open Studio
|
||||
LoginComposite.detailMessage=Before you can begin working with Talend, you need to create a project. \nYou can start with a demo project that contains useful examples, or \ncreate an empty project of your own.
|
||||
LoginComposite.selectADemoProject=Select A Demo Project
|
||||
LoginComposite.projectTitleTemp=Create A New Project
|
||||
LoginComposite.selectADemoProject=Select a Demo Project
|
||||
LoginComposite.projectTitleTemp=Create a New Project
|
||||
LoginComposite.buttons.advanced=Advanced...
|
||||
LoginComposite.buttons.changeButton=Change
|
||||
LoginComposite.label.workspace=Workspace
|
||||
@@ -707,7 +707,7 @@ ImportItemUtil.message=Cannot import item {0} -> unknown task(s) {1}
|
||||
ImportItemUtil.persistenceException=A newer version of {0} already exist.
|
||||
ImportItemUtil.taskLogWarn=Task {0} found in project doesn't exist anymore \!
|
||||
ImportItemUtil.taskMonitor=apply migration task {0} on item {1}
|
||||
ImportItemUtil.tdqErrorInfor=Can't import tdq item {0}
|
||||
ImportItemUtil.tdqErrorInfor=Can't import TDQ item {0}
|
||||
ImportItemUtil.unknowException=Unknow language: {0}
|
||||
ImportItemWizardPage.0=The 2 following items haves the same ID, please unselect one of them : \n [{0}] [{1}]
|
||||
ImportItemWizardPage.ItemsList=Items List
|
||||
@@ -1116,7 +1116,7 @@ DatabaseForm.hiveEmbedded.metastore.connDriverJar=Connection Driver Jar
|
||||
DatabaseForm.hiveEmbedded.metastore.connDriverName=Connection Driver Name
|
||||
DatabaseForm.hbase.settings=Version
|
||||
DatabaseForm.hbase.distribution=Distribution
|
||||
DatabaseForm.hbase.distribution.tooltip=Set the hadoop distribution
|
||||
DatabaseForm.hbase.distribution.tooltip=Set the Hadoop distribution
|
||||
DatabaseForm.hbase.version=HBase version
|
||||
DatabaseForm.hbase.version.tooltip=Set the HBase version
|
||||
DatabaseForm.hbase.distributionAlert=Distribution must be specified
|
||||
@@ -1203,7 +1203,7 @@ DatabaseForm.hiveExecution.engine=Execution engine
|
||||
SelectorTableForm.Failed=Failed
|
||||
DatabaseForm.maprdb.settings=Version
|
||||
DatabaseForm.maprdb.distribution=Distribution
|
||||
DatabaseForm.maprdb.distribution.tooltip=Set the hadoop distribution
|
||||
DatabaseForm.maprdb.distribution.tooltip=Set the Hadoop distribution
|
||||
DatabaseForm.maprdb.version=MapR-DB version
|
||||
DatabaseForm.maprdb.version.tooltip=Set the MapR-DB version
|
||||
DatabaseForm.maprdb.distributionAlert=Distribution must be specified
|
||||
@@ -1253,3 +1253,6 @@ DatabaseForm.canNotUsableInDataProfiler=some database types are not usable in th
|
||||
XmlFileStep1Form.ImportSchemaNotExistError=Required reference schema files are missing.
|
||||
ImportTreeFromXMLAction.ImportSchemaNotExistError=Required reference schema files are missing.
|
||||
ImportTreeFromXMLAction.schemaFileNotExistDetailTitle=The following files do not exist:
|
||||
DatabaseForm.impala.driverVersion=Impala Driver
|
||||
DatabaseForm.impala.driverVersion.tip=Select a hive impala driver
|
||||
DatabaseForm.checkSchema=The Schema field must be filled when using context mode.\n Click Cancel to complete your connection parameters, click OK to go to the next step.
|
||||
|
||||
@@ -1186,6 +1186,7 @@ DatabaseForm.hbaseMaprTPasswordTxt.label=Mot de passe
|
||||
DatabaseForm.hbaseMaprTClusterTxt.label=Nom du cluster
|
||||
DatabaseForm.hbaseMaprTDurationTxt.label=Dur\u00E9e du ticket (en s)
|
||||
DatabaseForm.ZnodeParent.group=Znode parent
|
||||
DatabaseForm.ZnodeParent.checkBtn=Configurer le znode Zookeeper parent
|
||||
XmlFileStep1Form.limitToolTip=Limiter la profondeur de la hi\u00E9rarchie \u00E0 {0} niveaux.
|
||||
DatabaseForm.test=Tester la connexion
|
||||
DatabaseForm.encryption=Chiffrement
|
||||
|
||||
@@ -377,7 +377,7 @@ ParametersValuesDialog_Desc=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3059\u308B\u30
|
||||
JobScriptsExportWizardPage.newExportJob0=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8 {0}: {1}_{2}
|
||||
JobScriptsExportWizardPage.newExportJob1=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8 {0}: {1}_{2}
|
||||
JobScriptsExportWizardPage.newExportJobScript={0}\u306E\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u4E2D
|
||||
JobScriptsExportWizardPage.newExportJobSucessful=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8{0}: {1}_{2}\u304C\u6210\u529F\u3057\u307E\u3057\u305F!
|
||||
JobScriptsExportWizardPage.newExportJobSucessful=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8 {0}: {1}_{2}\u304C\u6210\u529F\u3057\u307E\u3057\u305F!
|
||||
JobScriptsExportWizardPage.exportResourceError=\u30EA\u30BD\u30FC\u30B9\u306E\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u306E\u30A8\u30E9\u30FC
|
||||
JobScriptsExportWizardPage.newExportSuccess={0} \u306E\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u306B\u6210\u529F\u3057\u307E\u3057\u305F\uFF01
|
||||
JobScriptsExportWizardPage.extractZipFile=ZIP\u30D5\u30A1\u30A4\u30EB\u306E\u89E3\u51CD
|
||||
|
||||
@@ -4,16 +4,7 @@
|
||||
<description url="http://www.example.com/description">[Enter Feature Description here.]</description>
|
||||
<copyright url="http://www.example.com/copyright">[Enter Copyright Description here.]</copyright>
|
||||
<license url="http://www.example.com/license">[Enter License Description here.]</license>
|
||||
<plugin id="org.talend.libraries.jdbc.access" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.as400" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.derby" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.exasol" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.h2" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.hsql" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.ingres" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.mysql" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.paraccel" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.postgresql" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.sqlite3" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.teradata" download-size="0" install-size="0" version="0.0.0"/>
|
||||
</feature>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<import plugin="com.thoughtworks.paranamer" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="jackson-core-asl" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="jackson-mapper-asl" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.codec" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.codec" version="1.14.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.compress" version="1.10.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.lang" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.lang3" version="0.0.0" match="greaterOrEqual"/>
|
||||
@@ -25,5 +25,6 @@
|
||||
<plugin id="org.talend.daikon" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.daikon.exception" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.daikon.crypto.utils" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.studio.studio-utils" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.utils" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
</feature>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -24,11 +24,11 @@ public interface ColorConstants {
|
||||
|
||||
static final Color GREY_COLOR = new Color(null, 215, 215, 215);
|
||||
|
||||
static final Color YELLOW_GREEN_COLOR = new Color(null, 138, 188, 0);// 143, 163, 35
|
||||
static final Color YELLOW_GREEN_COLOR = new Color(null, 88,153,24);// 143, 163, 35
|
||||
|
||||
static final Color YELLOW_COLOR = new Color(null, 255, 173, 37);// 254, 182, 84
|
||||
|
||||
static final Color RED_COLOR = new Color(null, new RGB(240, 0, 0));// 255
|
||||
static final Color RED_COLOR = new Color(null, new RGB(204,87,89));// 255
|
||||
|
||||
static final Color VERTICAL_SEPERATOR_LINE_COLOR = new Color(null, 162, 179, 195);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
@@ -38,6 +39,8 @@ public class ExceptionMessageDialog extends MessageDialog {
|
||||
|
||||
private String exceptionString = null;
|
||||
|
||||
private int[] diabledButtonIndex = new int[] {};
|
||||
|
||||
public ExceptionMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage,
|
||||
int dialogImageType, String[] dialogButtonLabels, int defaultIndex, Throwable ex) {
|
||||
super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
|
||||
@@ -147,4 +150,21 @@ public class ExceptionMessageDialog extends MessageDialog {
|
||||
this.exceptionString = exceptionString;
|
||||
}
|
||||
|
||||
public void setDisabledButtons(int[] index) {
|
||||
this.diabledButtonIndex = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
super.createButtonsForButtonBar(parent);
|
||||
if (diabledButtonIndex == null) {
|
||||
return;
|
||||
}
|
||||
for (int index : diabledButtonIndex) {
|
||||
Button button = super.getButton(index);
|
||||
button.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ public enum ECoreImage implements IImage {
|
||||
TRIANGLE("/icons1/triangle.gif"), // triangle.gif //$NON-NLS-1$
|
||||
COMPARE("/icons1/compare.gif"), //$NON-NLS-1$
|
||||
EXCHNAGETAB("/icons/exchangeTab.jpg"), //$NON-NLS-1$
|
||||
EXCHNAGEIMAGEMISSING("/icons/component_missing.gif"), //$NON-NLS-1$
|
||||
EXCHNAGEIMAGEMISSING("/icons/component_missing.png"), //$NON-NLS-1$
|
||||
STATUS_OK("/icons/ok.png"), //$NON-NLS-1$
|
||||
MRGREEBAR("/icons1/mrGreeBar.gif"), //$NON-NLS-1$
|
||||
MRMAP("/icons1/map.gif"), //$NON-NLS-1$
|
||||
|
||||
@@ -125,7 +125,7 @@ public enum EImage implements IImage {
|
||||
OPEN_IN_BROWSER("/icons/open.gif"), //$NON-NLS-1$
|
||||
DOWNLOAD_MODULE("/icons/download.gif"), //$NON-NLS-1$
|
||||
|
||||
COMPONENT_MISSING("/icons/component_missing.gif"), //$NON-NLS-1$
|
||||
COMPONENT_MISSING("/icons/component_missing.png"), //$NON-NLS-1$
|
||||
|
||||
FILTER_DEACTIVED_ICON("/icons/filter_deactivated.png"), //$NON-NLS-1$
|
||||
FILTER_ACTIVED_ICON("/icons/filter_activated.png"), //$NON-NLS-1$
|
||||
|
||||
@@ -4,7 +4,7 @@ Bundle-Name: Common Runtime Plug-in
|
||||
Bundle-SymbolicName: org.talend.commons.runtime;singleton:=true
|
||||
Bundle-Version: 7.4.1.qualifier
|
||||
Require-Bundle: org.apache.log4j;visibility:=reexport,
|
||||
org.apache.commons.beanutils,
|
||||
org.apache.commons.commons-beanutils,
|
||||
org.apache.commons.collections,
|
||||
org.apache.commons.httpclient,
|
||||
org.apache.commons.lang;visibility:=reexport,
|
||||
@@ -14,7 +14,10 @@ Require-Bundle: org.apache.log4j;visibility:=reexport,
|
||||
com.ibm.icu,
|
||||
org.apache.commons.io,
|
||||
org.talend.utils,
|
||||
org.eclipse.core.net
|
||||
org.eclipse.core.net,
|
||||
org.eclipse.m2e.core,
|
||||
org.eclipse.m2e.maven.runtime,
|
||||
org.eclipse.core.resources
|
||||
Export-Package: org.talend.commons,
|
||||
org.talend.commons.exception,
|
||||
org.talend.commons.i18n,
|
||||
@@ -51,7 +54,6 @@ Export-Package: org.talend.commons,
|
||||
org.talend.commons.utils.scalability,
|
||||
org.talend.commons.utils.system,
|
||||
org.talend.commons.utils.threading,
|
||||
org.talend.commons.utils.threading.lockerbykey,
|
||||
org.talend.commons.utils.time,
|
||||
org.talend.commons.utils.tracer,
|
||||
org.talend.commons.utils.workbench.extensions,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<!--
|
||||
Copyright (C) 2010 Talend Inc. - www.talend.com
|
||||
<!--
|
||||
Copyright (C) 2010 Talend Inc. - www.talend.com
|
||||
-->
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -30,7 +30,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.2</version>
|
||||
<version>1.9.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
@@ -92,7 +92,7 @@
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.11.0</version>
|
||||
<version>2.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
|
||||
@@ -111,7 +111,8 @@ public class CommonsPlugin implements BundleActivator {
|
||||
}
|
||||
|
||||
public static boolean isDebugMode() {
|
||||
return ArrayUtils.contains(Platform.getApplicationArgs(), TalendDebugHandler.TALEND_DEBUG);
|
||||
return Boolean.getBoolean("talendDebug") //$NON-NLS-1$
|
||||
|| ArrayUtils.contains(Platform.getApplicationArgs(), TalendDebugHandler.TALEND_DEBUG);
|
||||
}
|
||||
|
||||
public static boolean isJUnitTest() {
|
||||
|
||||
@@ -42,6 +42,8 @@ public interface ITaCoKitService {
|
||||
|
||||
boolean isNeedMigration(String componentName, Map<String, String> properties);
|
||||
|
||||
boolean isTaCoKitType(Object repoType);
|
||||
|
||||
public static ITaCoKitService getInstance() throws Exception {
|
||||
BundleContext bc = FrameworkUtil.getBundle(ITaCoKitService.class).getBundleContext();
|
||||
Collection<ServiceReference<ITaCoKitService>> tacokitServices = Collections.emptyList();
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.commons.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import org.eclipse.m2e.core.MavenPlugin;
|
||||
|
||||
public enum MojoType {
|
||||
|
||||
CI_BUILDER("org.talend.ci", "builder-maven-plugin", "ci.builder.version"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
CLOUD_PUBLISHER("org.talend.ci", "cloudpublisher-maven-plugin", "cloud.publisher.version"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
SIGNER("org.talend.ci", "signer-maven-plugin", "signer.version"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
OSGI_HELPER("org.talend.ci", "osgihelper-maven-plugin", "osgihelper.version"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
private String groupId;
|
||||
|
||||
private String artifactId;
|
||||
|
||||
private String versionKey;
|
||||
|
||||
private MojoType(String groupId, String artifactId, String versionKey) {
|
||||
this.groupId = groupId;
|
||||
this.artifactId = artifactId;
|
||||
this.versionKey = versionKey;
|
||||
}
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public String getArtifactId() {
|
||||
return artifactId;
|
||||
}
|
||||
|
||||
public String getVersionKey() {
|
||||
return versionKey;
|
||||
}
|
||||
|
||||
public String getMojoArtifactIdFolder() {
|
||||
Path basePath = new File(MavenPlugin.getMaven().getLocalRepositoryPath()).toPath();
|
||||
return basePath.resolve(getGroupId().replaceAll("\\.", "/")).resolve(getArtifactId()).toString(); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
public String getMojoGAV() {
|
||||
return getGroupId() + ":" + getArtifactId() + ":" + getVersionKey(); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,431 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2019 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.utils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.talend.commons.i18n.internal.Messages;
|
||||
|
||||
/**
|
||||
*
|
||||
* Utility class for strings. <br/>
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
public class StringUtils {
|
||||
|
||||
public static String repeat(String str, int repeat) {
|
||||
return org.apache.commons.lang.StringUtils.repeat(str, repeat);
|
||||
}
|
||||
|
||||
public static String join(Object[] array, String separator) {
|
||||
return org.apache.commons.lang.StringUtils.join(array, separator);
|
||||
}
|
||||
|
||||
public static String[] split(String string, char separator) {
|
||||
return org.apache.commons.lang.StringUtils.split(string, separator);
|
||||
}
|
||||
|
||||
public static String replace(String text, String repl, String with) {
|
||||
return org.apache.commons.lang.StringUtils.replace(text, repl, with);
|
||||
}
|
||||
|
||||
public static List<String> splitAsList(String string, char separator) {
|
||||
String[] strings = org.apache.commons.lang.StringUtils.split(string, separator);
|
||||
return Arrays.asList(strings);
|
||||
}
|
||||
|
||||
public static String capitalize(String str) {
|
||||
return org.apache.commons.lang.StringUtils.capitalize(str);
|
||||
}
|
||||
|
||||
public static String getMysqlProtectedColumnName(String colname) {
|
||||
return "`" + colname + "`"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
public static String getPostgresqlProtectedColumnName(String colname) {
|
||||
return "\\\"" + colname + "\\\""; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract string between the first delimiter and the second delimiter.
|
||||
*
|
||||
* @param text
|
||||
* @param delimiter
|
||||
* @return
|
||||
*/
|
||||
public static String extractFirstDelimitedString(String text, String delimiter) {
|
||||
|
||||
String returned = ""; //$NON-NLS-1$
|
||||
|
||||
int start = text.indexOf(delimiter, 0);
|
||||
|
||||
if (start != -1) {
|
||||
|
||||
int end = text.indexOf(delimiter, start + 1);
|
||||
|
||||
if (end != -1) {
|
||||
returned = text.substring(start + 1, end);
|
||||
}
|
||||
}
|
||||
|
||||
return returned;
|
||||
}
|
||||
|
||||
public static String protectMetachar(String input) {
|
||||
|
||||
input = replace(input, "\\", "\\\\\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = replace(input, "+", "\\\\+"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = replace(input, ".", "\\\\."); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = replace(input, "[", "\\\\["); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = replace(input, "]", "\\]"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = replace(input, "(", "\\\\("); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = replace(input, ")", "\\\\)"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = replace(input, "^", "\\\\^"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = replace(input, "$", "\\\\$"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
public static String removeSpecialCharsForPackage(String input) {
|
||||
input = input.replaceAll(" ", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll("/", "."); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll("&", "and"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll("<", "lt"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll(">", "gt"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll("'", "apos"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll("\"", "quot"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll("\\(", "_"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll("\\)", "_"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return input;
|
||||
}
|
||||
|
||||
public static String loadConvert(String inputStr, String language) {
|
||||
if (inputStr == null) {
|
||||
return null;
|
||||
}
|
||||
char[] inputChars = new char[inputStr.length()];
|
||||
inputStr.getChars(0, inputStr.length(), inputChars, 0);
|
||||
String loadConvert = null;
|
||||
if (language.equalsIgnoreCase("perl")) { //$NON-NLS-1$
|
||||
loadConvert = loadConvert(inputChars, 0, inputStr.length(), new char[inputStr.length()], 'x');
|
||||
} else {
|
||||
loadConvert = loadConvert(inputChars, 0, inputStr.length(), new char[inputStr.length()], 'u');
|
||||
}
|
||||
return loadConvert;
|
||||
}
|
||||
|
||||
/*
|
||||
* Converts encoded \uxxxx to unicode chars and changes special saved chars to their original forms. it can deal
|
||||
* with the unicode encode character and the octal encode character, for example: String s =
|
||||
* "\\u8C2D\\u5148\\u94FE\0022\22\022"; it is very useful in GUI, such as Text.getText(), and will to keep the input
|
||||
* string like: \22; it can support the perl String like this: \\x2\\x22
|
||||
*/
|
||||
private static String loadConvert(char[] in, int off, int len, char[] convtBuf, char preHex) {
|
||||
boolean limitLengthForHex = false;
|
||||
int limitLength = 0;
|
||||
if (preHex == 'u') {
|
||||
limitLengthForHex = true; // in java, it must be \\uxxxx
|
||||
|
||||
limitLength = 4;
|
||||
|
||||
} else if (preHex == 'x') {
|
||||
|
||||
limitLengthForHex = false; // in perl, it can like this \\xhh
|
||||
limitLength = 2;
|
||||
|
||||
} else {
|
||||
throw new IllegalArgumentException(Messages.getString("StringUtils.IllegalArgument0")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (convtBuf.length < len) {
|
||||
int newLen = len * 2;
|
||||
if (newLen < 0) {
|
||||
newLen = Integer.MAX_VALUE;
|
||||
}
|
||||
convtBuf = new char[newLen];
|
||||
}
|
||||
char aChar;
|
||||
char[] out = convtBuf;
|
||||
int outLen = 0;
|
||||
int end = off + len;
|
||||
|
||||
while (off < end) {
|
||||
aChar = in[off++];
|
||||
if (aChar == '\\') {
|
||||
if (off < len
|
||||
&& (in[off] == preHex || in[off] == 't' || in[off] == 'r' || in[off] == 'n' || in[off] == 'f' || Character
|
||||
.isDigit(in[off]))) {
|
||||
aChar = in[off++];
|
||||
}
|
||||
if (aChar == preHex) {
|
||||
// Read the xxxx
|
||||
int value = 0;
|
||||
for (int i = 0; i < limitLength; i++) {
|
||||
|
||||
if (off == len) {
|
||||
if (limitLengthForHex) {
|
||||
throw new IllegalArgumentException(Messages.getString("StringUtils.IllegalArgument1")); //$NON-NLS-1$
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (limitLengthForHex) {
|
||||
aChar = in[off++];
|
||||
} else if (Character.isDigit(in[off])) {
|
||||
aChar = in[off++];
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (aChar) {
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
value = (value << 4) + aChar - '0';
|
||||
break;
|
||||
case 'a':
|
||||
case 'b':
|
||||
case 'c':
|
||||
case 'd':
|
||||
case 'e':
|
||||
case 'f':
|
||||
value = (value << 4) + 10 + aChar - 'a';
|
||||
break;
|
||||
case 'A':
|
||||
case 'B':
|
||||
case 'C':
|
||||
case 'D':
|
||||
case 'E':
|
||||
case 'F':
|
||||
value = (value << 4) + 10 + aChar - 'A';
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException(Messages.getString("StringUtils.IllegalArgument2")); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
out[outLen++] = (char) value;
|
||||
} else {
|
||||
if (aChar == 't') {
|
||||
aChar = '\t';
|
||||
} else if (aChar == 'r') {
|
||||
aChar = '\r';
|
||||
} else if (aChar == 'n') {
|
||||
aChar = '\n';
|
||||
} else if (aChar == 'f') {
|
||||
aChar = '\f';
|
||||
} else if (Character.isDigit(aChar)) {
|
||||
|
||||
int value = 0;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
||||
switch (aChar) {
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
value = (value << 3) + aChar - '0';
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException(Messages.getString("StringUtils.IllegalArgument3")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (off < len && Character.isDigit(in[off])) {
|
||||
aChar = in[off++];
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
aChar = (char) value;
|
||||
|
||||
}
|
||||
out[outLen++] = aChar;
|
||||
}
|
||||
} else {
|
||||
out[outLen++] = aChar;
|
||||
}
|
||||
}
|
||||
return new String(out, 0, outLen);
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as routines.system.StringUtils.escapeChar(...).
|
||||
*
|
||||
* make \n to \\n. It will process these chars: \n, \r, \t, \f, \\, \", \', \b
|
||||
*
|
||||
*/
|
||||
public static String escapeChar(String s) {
|
||||
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int length = s.length();
|
||||
StringBuffer sb = new StringBuffer(length);
|
||||
for (int i = 0; i < length; i++) {
|
||||
|
||||
char c = s.charAt(i);
|
||||
|
||||
switch (c) {
|
||||
case '\n':
|
||||
sb.append("\\").append('n'); //$NON-NLS-1$
|
||||
break;
|
||||
case '\r':
|
||||
sb.append("\\").append('r'); //$NON-NLS-1$
|
||||
break;
|
||||
case '\t':
|
||||
sb.append("\\").append('t'); //$NON-NLS-1$
|
||||
break;
|
||||
case '\f':
|
||||
sb.append("\\").append('f'); //$NON-NLS-1$
|
||||
break;
|
||||
case '\b':
|
||||
sb.append("\\").append('b'); //$NON-NLS-1$
|
||||
break;
|
||||
case '\"':
|
||||
sb.append("\\").append('\"'); //$NON-NLS-1$
|
||||
break;
|
||||
case '\'':
|
||||
sb.append("\\").append('\''); //$NON-NLS-1$
|
||||
break;
|
||||
default:
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String subString(String str, int len) {
|
||||
if (len < 0) {
|
||||
return str;
|
||||
}
|
||||
if ("".equals(str) || str == null) {
|
||||
return null;
|
||||
} else if (str.length() <= len) {
|
||||
return str;
|
||||
} else {
|
||||
return str.substring(0, len);
|
||||
}
|
||||
}
|
||||
|
||||
private static final String OPEN_BRACE = "{";
|
||||
|
||||
private static final String CLOSE_BRACE = "}";
|
||||
|
||||
/**
|
||||
* Replace MessageFormat.format(..) because MessageFormat does'nt support single quote correctly This method replace
|
||||
* in the text all the patterns {0}, {1}, etc.. by all values in arguments array One or more values can be null, no
|
||||
* exception is thrown if a value is null.
|
||||
*
|
||||
* @param pattern
|
||||
* @param arguments
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
public static String replacePrms(String text, Object... arguments) {
|
||||
|
||||
for (int i = 0; i < arguments.length; i++) {
|
||||
text = replace(text, OPEN_BRACE + i + CLOSE_BRACE, String.valueOf(arguments[i]));
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private static final StringDigitComparator STR_DIGIT_COMPARATOR = new StringDigitComparator();
|
||||
|
||||
static class StringDigitComparator implements Comparator<String> {
|
||||
|
||||
final Pattern DIGIT_PATTERN = Pattern.compile("^(\\d+)"); //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
public int compare(String s1, String s2) {
|
||||
return compare(s1, s2, true);
|
||||
}
|
||||
|
||||
public int compare(String s1, String s2, boolean ignoreCase) {
|
||||
int n1 = s1.length(), n2 = s2.length();
|
||||
for (int i1 = 0, i2 = 0; i1 < n1 && i2 < n2; i1++, i2++) {
|
||||
char c1 = s1.charAt(i1);
|
||||
char c2 = s2.charAt(i2);
|
||||
// check the digit, all start by digit
|
||||
if (Character.isDigit(c1) && Character.isDigit(c2)) {
|
||||
// get the digit
|
||||
String tmp1 = s1.substring(i1);
|
||||
String tmp2 = s2.substring(i2);
|
||||
Matcher matcher1 = DIGIT_PATTERN.matcher(tmp1);
|
||||
Matcher matcher2 = DIGIT_PATTERN.matcher(tmp2);
|
||||
if (matcher1.find() && matcher2.find()) {
|
||||
String digit1 = matcher1.group(1);
|
||||
String digit2 = matcher2.group(1);
|
||||
int d1 = Integer.parseInt(digit1);
|
||||
int d2 = Integer.parseInt(digit2);
|
||||
if (d1 == d2) { // same digit, check the left strings
|
||||
String left1 = tmp1.substring(digit1.length());
|
||||
String left2 = tmp2.substring(digit2.length());
|
||||
return compare(left1, left2, ignoreCase);
|
||||
} else {
|
||||
return d1 - d2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if (c1 != c2) {
|
||||
if (ignoreCase) {
|
||||
c1 = Character.toUpperCase(c1);
|
||||
c2 = Character.toUpperCase(c2);
|
||||
if (c1 != c2) {
|
||||
c1 = Character.toLowerCase(c1);
|
||||
c2 = Character.toLowerCase(c2);
|
||||
if (c1 != c2) {
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return c1 - c2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return n1 - n2;
|
||||
}
|
||||
};
|
||||
|
||||
public static int compareStringDigit(String s1, String s2, boolean ignoreCase) {
|
||||
return STR_DIGIT_COMPARATOR.compare(s1, s2, ignoreCase);
|
||||
}
|
||||
|
||||
public static int compareStringDigit(String s1, String s2) {
|
||||
return STR_DIGIT_COMPARATOR.compare(s1, s2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,15 +15,17 @@ package org.talend.commons.utils;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
@@ -240,6 +242,28 @@ public class VersionUtils {
|
||||
if (localProductVersion == null) {
|
||||
localProductVersion = getInternalVersion();
|
||||
}
|
||||
if (skipCheckingNightlyBuilds(localProductVersion, remoteFullProductVersion)) {
|
||||
return false;
|
||||
}
|
||||
return localProductVersion.compareTo(getProductVersionWithoutBranding(remoteFullProductVersion)) < 0;
|
||||
}
|
||||
|
||||
public static boolean productVersionIsNewer(String remoteFullProductVersion) {
|
||||
String localProductVersion = getInternalVersion();
|
||||
return productVersionIsNewer(localProductVersion, remoteFullProductVersion);
|
||||
}
|
||||
|
||||
protected static boolean productVersionIsNewer(String localProductVersion, String remoteFullProductVersion) {
|
||||
if (remoteFullProductVersion == null) {
|
||||
return false;
|
||||
}
|
||||
if (skipCheckingNightlyBuilds(localProductVersion, remoteFullProductVersion)) {
|
||||
return false;
|
||||
}
|
||||
return localProductVersion.compareTo(getProductVersionWithoutBranding(remoteFullProductVersion)) > 0;
|
||||
}
|
||||
|
||||
private static boolean skipCheckingNightlyBuilds(String localProductVersion, String remoteFullProductVersion) {
|
||||
String separator = "-"; //$NON-NLS-1$
|
||||
String localSuffix = StringUtils.substringAfterLast(localProductVersion, separator);
|
||||
|
||||
@@ -251,10 +275,9 @@ public class VersionUtils {
|
||||
if ((localSuffix.equals(nightly) || localSuffix.startsWith(milestone))
|
||||
&& (remoteSuffix.equals(nightly) || remoteSuffix.startsWith(milestone))) {
|
||||
// skip checking between nightly/milestone build.
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
return localProductVersion.compareTo(remoteProductVersion) < 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getTalendVersion(String productVersion) {
|
||||
@@ -283,24 +306,28 @@ public class VersionUtils {
|
||||
return version;
|
||||
}
|
||||
|
||||
public static String getMojoVersion(String mojoKey) {
|
||||
String version = null;
|
||||
public static String getMojoVersion(MojoType mojoType) {
|
||||
String mojoKey = mojoType.getVersionKey();
|
||||
String version = System.getProperty(mojoKey);
|
||||
if (StringUtils.isNotBlank(version)) {
|
||||
return version;
|
||||
}
|
||||
String talendVersion = getTalendVersion();
|
||||
Properties properties = new Properties();
|
||||
File file = new Path(Platform.getConfigurationLocation().getURL().getPath()).append("mojo_version.properties").toFile(); //$NON-NLS-1$
|
||||
if (file.exists()) {
|
||||
try (InputStream inStream = new FileInputStream(file)) {
|
||||
properties.load(inStream);
|
||||
version = properties.getProperty(mojoKey);
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
if (version != null && !version.startsWith(talendVersion)) {
|
||||
ExceptionHandler
|
||||
.process(new Exception(
|
||||
"Incompatible Mojo version:" + mojoKey + "[" + version + "], use default version.")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
version = null;
|
||||
String majorVersion = StringUtils.substringBeforeLast(talendVersion, "."); //$NON-NLS-1$
|
||||
String artifactIdFolder = mojoType.getMojoArtifactIdFolder();
|
||||
Optional<File> optional = Stream.of(new File(artifactIdFolder).listFiles())
|
||||
.filter(f -> f.isDirectory() && f.getName().startsWith(majorVersion))
|
||||
.sorted((f1, f2) -> new DefaultArtifactVersion(f2.getName()).compareTo(new DefaultArtifactVersion(f1.getName())))
|
||||
.findFirst();
|
||||
if (optional.isPresent()) {
|
||||
File latestArtifact = optional.get();
|
||||
String fileName = mojoType.getArtifactId() + "-" + latestArtifact.getName(); //$NON-NLS-1$
|
||||
if (Stream.of(latestArtifact.listFiles())
|
||||
.filter(f -> f.getName().equals(fileName + ".jar") || f.getName().equals(fileName + ".pom")) //$NON-NLS-1$ //$NON-NLS-2$
|
||||
.count() != 2) {
|
||||
ExceptionHandler.process(new Exception("Can't find plugin artifact " + mojoType.getMojoGAV())); //$NON-NLS-1$
|
||||
}
|
||||
version = latestArtifact.getName();
|
||||
}
|
||||
// default version
|
||||
if (StringUtils.isBlank(version)) {
|
||||
@@ -314,6 +341,7 @@ public class VersionUtils {
|
||||
version += "-" + revision; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
System.setProperty(mojoKey, version);
|
||||
return version;
|
||||
}
|
||||
|
||||
@@ -323,4 +351,25 @@ public class VersionUtils {
|
||||
talendVersion = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSimplifiedPatchName(String projectPatchName) {
|
||||
|
||||
if (projectPatchName != null) {
|
||||
String result = null;
|
||||
if (projectPatchName.contains("_") && projectPatchName.split("_").length >= 3) {
|
||||
result = projectPatchName.split("_")[2];
|
||||
if (!result.startsWith("R")) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (projectPatchName.contains("-")) {
|
||||
String[] split = projectPatchName.split("-");
|
||||
if (split != null && split.length > 0) {
|
||||
return result + "-" + split[split.length - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.commons.utils.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* created by qiongli on 2013-11-13 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class Sybase16SADatabaseMetaData extends SybaseDatabaseMetaData {
|
||||
|
||||
private static Logger log = Logger.getLogger(Sybase16SADatabaseMetaData.class);
|
||||
|
||||
/**
|
||||
* DOC qiongli SybaseIQDatabaseMetaData constructor comment.
|
||||
*
|
||||
* @param connection
|
||||
* @throws SQLException
|
||||
*/
|
||||
public Sybase16SADatabaseMetaData(Connection connection) throws SQLException {
|
||||
super(connection);
|
||||
}
|
||||
|
||||
public ResultSet getCatalogs(String login, String database) throws SQLException {
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
|
||||
List<String> catList = new ArrayList<String>();
|
||||
if (!StringUtils.isEmpty(database)) {
|
||||
catList.add(database);
|
||||
}
|
||||
|
||||
for (String catalogName : catList) {
|
||||
String sql = createSqlByLoginAndCatalog(login, catalogName);
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
|
||||
while (rs.next()) {
|
||||
int temp = rs.getInt(1);
|
||||
if (temp > 0) {
|
||||
String[] r = new String[] { catalogName };
|
||||
list.add(r);
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.error(e);
|
||||
} finally {
|
||||
try {
|
||||
if (rs != null) {
|
||||
rs.close();
|
||||
}
|
||||
if (stmt != null) {
|
||||
stmt.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SybaseResultSet tableResultSet = new SybaseResultSet();
|
||||
tableResultSet.setMetadata(new String[] { "TABLE_CAT" }); //$NON-NLS-1$
|
||||
tableResultSet.setData(list);
|
||||
return tableResultSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
|
||||
throws SQLException {
|
||||
return super.getColumns(null, schemaPattern, tableNamePattern, columnNamePattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException {
|
||||
return super.getPrimaryKeys(null, schema, table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)
|
||||
throws SQLException {
|
||||
return super.getTables(null, schemaPattern, tableNamePattern, types);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get a sql query by login name and catalog name.
|
||||
*
|
||||
* @param loginName
|
||||
* @param catalogName
|
||||
* @return
|
||||
*/
|
||||
protected String createSqlByLoginAndCatalog(String loginName, String catalogName) {
|
||||
String sql = "select count(*) from " + catalogName
|
||||
+ ".dbo.sysusers where suid in (select suid from "+catalogName+".dbo.syslogins where name = '" + loginName
|
||||
+ "')";
|
||||
return sql;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.commons.utils.network;
|
||||
|
||||
public interface ITalendNexusPrefConstants {
|
||||
|
||||
public static final String NEXUS_TIMEOUT = "NEXUS_TIMEOUT"; //$NON-NLS-1$
|
||||
}
|
||||
@@ -26,6 +26,9 @@ import java.util.Enumeration;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.runtime.utils.io.FileCopyUtils;
|
||||
|
||||
/**
|
||||
@@ -44,7 +47,17 @@ public class NetworkUtil {
|
||||
|
||||
private static final String HTTP_NETWORK_URL = "https://talend-update.talend.com";
|
||||
|
||||
private static final int DEFAULT_TIMEOUT = 4000;
|
||||
|
||||
private static final int DEFAULT_NEXUS_TIMEOUT = 20000;// same as preference value
|
||||
|
||||
public static final String ORG_TALEND_DESIGNER_CORE = "org.talend.designer.core"; //$NON-NLS-1$
|
||||
|
||||
public static boolean isNetworkValid() {
|
||||
return isNetworkValid(DEFAULT_TIMEOUT);
|
||||
}
|
||||
|
||||
public static boolean isNetworkValid(Integer timeout) {
|
||||
String disableInternet = System.getProperty(TALEND_DISABLE_INTERNET);
|
||||
if ("true".equals(disableInternet)) { //$NON-NLS-1$
|
||||
return false;
|
||||
@@ -55,8 +68,9 @@ public class NetworkUtil {
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setDefaultUseCaches(false);
|
||||
conn.setUseCaches(false);
|
||||
conn.setConnectTimeout(4000);
|
||||
conn.setReadTimeout(4000);
|
||||
int conntimeout = timeout != null ? timeout.intValue() : DEFAULT_TIMEOUT;
|
||||
conn.setConnectTimeout(conntimeout);
|
||||
conn.setReadTimeout(conntimeout);
|
||||
conn.setRequestMethod("HEAD"); //$NON-NLS-1$
|
||||
String strMessage = conn.getResponseMessage();
|
||||
if (strMessage.compareTo("Not Found") == 0) { //$NON-NLS-1$
|
||||
@@ -73,22 +87,23 @@ public class NetworkUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isNetworkValid(String url) {
|
||||
public static boolean isNetworkValid(String url, Integer timeout) {
|
||||
if (url == null) {
|
||||
return isNetworkValid();
|
||||
return isNetworkValid(timeout);
|
||||
}
|
||||
return checkValidWithHttp(url);
|
||||
return checkValidWithHttp(url, timeout);
|
||||
}
|
||||
|
||||
private static boolean checkValidWithHttp(String urlString) {
|
||||
private static boolean checkValidWithHttp(String urlString, Integer timeout) {
|
||||
HttpURLConnection conn = null;
|
||||
try {
|
||||
URL url = new URL(urlString);
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setDefaultUseCaches(false);
|
||||
conn.setUseCaches(false);
|
||||
conn.setConnectTimeout(4000);
|
||||
conn.setReadTimeout(4000);
|
||||
int conntimeout = timeout != null ? timeout.intValue() : DEFAULT_TIMEOUT;
|
||||
conn.setConnectTimeout(conntimeout);
|
||||
conn.setReadTimeout(conntimeout);
|
||||
conn.setRequestMethod("HEAD"); //$NON-NLS-1$
|
||||
conn.getResponseMessage();
|
||||
} catch (Exception e) {
|
||||
@@ -101,6 +116,18 @@ public class NetworkUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static int getNexusTimeout() {
|
||||
int timeout = DEFAULT_NEXUS_TIMEOUT;
|
||||
try {
|
||||
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(ORG_TALEND_DESIGNER_CORE);
|
||||
timeout = node.getInt(ITalendNexusPrefConstants.NEXUS_TIMEOUT, DEFAULT_NEXUS_TIMEOUT);
|
||||
} catch (Throwable e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
return timeout;
|
||||
}
|
||||
|
||||
public static Authenticator getDefaultAuthenticator() {
|
||||
try {
|
||||
Field theAuthenticatorField = Authenticator.class.getDeclaredField("theAuthenticator");
|
||||
@@ -123,6 +150,28 @@ public class NetworkUtil {
|
||||
|
||||
@Override
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
String httpProxyHost = System.getProperty("http.proxyHost"); //$NON-NLS-1$
|
||||
String httpProxyPort = System.getProperty("http.proxyPort"); //$NON-NLS-1$
|
||||
String httpsProxyHost = System.getProperty("https.proxyHost"); //$NON-NLS-1$
|
||||
String httpsProxyPort = System.getProperty("https.proxyPort"); //$NON-NLS-1$
|
||||
String requestingHost = getRequestingHost();
|
||||
int requestingPort = getRequestingPort();
|
||||
String proxyHost = null;
|
||||
String proxyPort = null;
|
||||
boolean isHttp = false;
|
||||
if ("http".equalsIgnoreCase(getRequestingScheme())) {
|
||||
isHttp = true;
|
||||
}
|
||||
if (isHttp && StringUtils.isNotBlank(httpProxyHost)) {
|
||||
proxyHost = httpProxyHost;
|
||||
proxyPort = httpProxyPort;
|
||||
} else {
|
||||
proxyHost = httpsProxyHost;
|
||||
proxyPort = httpsProxyPort;
|
||||
}
|
||||
if (!StringUtils.equals(proxyHost, requestingHost) || !StringUtils.equals(proxyPort, "" + requestingPort)) {
|
||||
return null;
|
||||
}
|
||||
String httpProxyUser = System.getProperty("http.proxyUser"); //$NON-NLS-1$
|
||||
String httpProxyPassword = System.getProperty("http.proxyPassword"); //$NON-NLS-1$
|
||||
String httpsProxyUser = System.getProperty("https.proxyUser"); //$NON-NLS-1$
|
||||
@@ -140,7 +189,11 @@ public class NetworkUtil {
|
||||
proxyPassword = httpsProxyPassword.toCharArray();
|
||||
}
|
||||
}
|
||||
return new PasswordAuthentication(proxyUser, proxyPassword);
|
||||
if (StringUtils.isBlank(proxyUser)) {
|
||||
return null;
|
||||
} else {
|
||||
return new PasswordAuthentication(proxyUser, proxyPassword);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -19,15 +19,18 @@ import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashSet;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarInputStream;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.runtime.service.ITaCoKitService;
|
||||
|
||||
@@ -62,6 +65,10 @@ public class UpdatesHelper {
|
||||
|
||||
public static final String NEW_COMPONENT_PREFIX = "installer$$";
|
||||
|
||||
public static final String PRE_TALEND_PATCH = "talend.patch";
|
||||
|
||||
public static final String RECORD_SEPERATOR = ",";
|
||||
|
||||
public static boolean existArtifacts(File base) {
|
||||
return new File(base, FILE_ARTIFACTS).exists() || new File(base, FILE_JAR_ARTIFACTS).exists()
|
||||
|| new File(base, FILE_XZ_ARTIFACTS).exists();
|
||||
@@ -85,6 +92,9 @@ public class UpdatesHelper {
|
||||
* will check that existed the plugins folder only.
|
||||
*/
|
||||
public static boolean isPlainUpdate(File file) {
|
||||
if (skipPatchFile(file)) {
|
||||
return false;
|
||||
}
|
||||
if (file != null && file.exists()) {
|
||||
if (file.isFile() && file.getName().endsWith(FileExtensions.ZIP_FILE_SUFFIX)) {
|
||||
ZipFileStatus status = new ZipFileStatus(file);
|
||||
@@ -112,6 +122,9 @@ public class UpdatesHelper {
|
||||
* need check that contain "artifacts.xml", "content.xml" and "plugins" folder in same place.
|
||||
*/
|
||||
public static boolean isUpdateSite(File file) {
|
||||
if (skipPatchFile(file)) {
|
||||
return false;
|
||||
}
|
||||
if (file != null && file.exists()) {
|
||||
if (file.isFile() && file.getName().endsWith(FileExtensions.ZIP_FILE_SUFFIX)) {
|
||||
|
||||
@@ -173,7 +186,7 @@ public class UpdatesHelper {
|
||||
}
|
||||
|
||||
private static void findUpdateBaseFile(Set<File> foundUpdateFiles, File baseFile) {
|
||||
if (isPlainUpdate(baseFile) || isUpdateSite(baseFile) && !isComponentUpdateSite(baseFile)) {
|
||||
if (isPlainUpdate(baseFile) || isUpdateSite(baseFile)) {
|
||||
foundUpdateFiles.add(baseFile);
|
||||
} else if (baseFile.isDirectory()) {
|
||||
final File[] listFiles = baseFile.listFiles();
|
||||
@@ -186,6 +199,9 @@ public class UpdatesHelper {
|
||||
}
|
||||
|
||||
public static boolean isComponentUpdateSite(File file) {
|
||||
if (skipPatchFile(file)) {
|
||||
return false;
|
||||
}
|
||||
if (file != null && file.exists()) {
|
||||
if (file.isFile() && file.getName().endsWith(FileExtensions.ZIP_FILE_SUFFIX)) {
|
||||
ZipFileStatus status = new ZipFileStatus(file) {
|
||||
@@ -312,4 +328,53 @@ public class UpdatesHelper {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static File getProductFile() {
|
||||
try {
|
||||
return new File(Platform.getInstallLocation().getDataArea(FILE_ECLIPSE_PRODUCT).getPath());
|
||||
} catch (IOException e) {
|
||||
//
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Properties loadProductProperties(File productFile) {
|
||||
Properties prop = new Properties();
|
||||
if (productFile != null && productFile.exists()) {
|
||||
try (FileInputStream fis = new FileInputStream(productFile)) {
|
||||
prop.load(fis);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
return prop;
|
||||
}
|
||||
|
||||
public static Set<String> getPatchesInstalled() {
|
||||
Set<String> installed = new HashSet<String>();
|
||||
File productFile = getProductFile();
|
||||
Properties props = loadProductProperties(productFile);
|
||||
props.forEach((k, v) -> {
|
||||
String key = String.valueOf(k);
|
||||
if (key.startsWith(PRE_TALEND_PATCH)) {
|
||||
String val = String.valueOf(v);
|
||||
String[] vals = val.split(RECORD_SEPERATOR);
|
||||
if (vals.length > 1) {
|
||||
installed.add(vals[1]);
|
||||
} else {
|
||||
installed.add(val);
|
||||
}
|
||||
}
|
||||
});
|
||||
return installed;
|
||||
}
|
||||
|
||||
public static boolean skipPatchFile(File patchFile) {
|
||||
Set<String> installedPathNames = getPatchesInstalled();
|
||||
if (patchFile != null && patchFile.isFile()) {
|
||||
String patchName = FilenameUtils.getBaseName(patchFile.getName());
|
||||
return installedPathNames.contains(patchName);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,11 +49,17 @@ public class EclipseCommandLine {
|
||||
*/
|
||||
static public final String TALEND_PROJECT_TYPE_COMMAND = "-talendProjectType"; //$NON-NLS-1$
|
||||
|
||||
static public final String TALEND_LICENCE_PATH = "talend.licence.path"; //$NON-NLS-1$
|
||||
|
||||
static public final String ARG_TALEND_LICENCE_PATH = "-" + TALEND_LICENCE_PATH; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* for relaunch of the plugins when relaunching the Studio
|
||||
*/
|
||||
static public final String TALEND_RELOAD_COMMAND = "-talendReload"; //$NON-NLS-1$
|
||||
|
||||
static public final String LOGIN_ONLINE_UPDATE = "--loginOnlineUpdate";
|
||||
|
||||
static public final String ARG_TALEND_BUNDLES_CLEANED = "-talend.studio.bundles.cleaned"; //$NON-NLS-1$
|
||||
|
||||
static public final String PROP_TALEND_BUNDLES_DO_CLEAN = "-talend.studio.bundles.doclean"; //$NON-NLS-1$
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
package org.talend.commons.utils.threading.lockerbykey;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
*
|
||||
* CustomReentrantLock class.
|
||||
*
|
||||
* @see java.util.concurrent.locks.ReentrantLock
|
||||
*/
|
||||
public class CustomReentrantLock extends ReentrantLock {
|
||||
|
||||
private static final long serialVersionUID = 3730576759454516775L;
|
||||
|
||||
public CustomReentrantLock() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CustomReentrantLock(boolean fair) {
|
||||
super(fair);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.util.concurrent.locks.ReentrantLock#getQueuedThreads()
|
||||
*/
|
||||
@Override
|
||||
public Collection<Thread> getQueuedThreads() {
|
||||
return super.getQueuedThreads();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.concurrent.locks.ReentrantLock#getOwner()
|
||||
*/
|
||||
@Override
|
||||
public Thread getOwner() {
|
||||
return super.getOwner();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2019 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.utils.threading.lockerbykey;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* DOC amaumont class global comment. Detailled comment
|
||||
*/
|
||||
public interface ILockerByKey<KP> {
|
||||
|
||||
public abstract int getCleanPeriod();
|
||||
|
||||
public abstract void shutdownNow();
|
||||
|
||||
public abstract void shutdown();
|
||||
|
||||
public abstract LockerValue<KP> getLockerValue(KP key);
|
||||
|
||||
public abstract boolean unlock(KP key);
|
||||
|
||||
public abstract boolean tryLock(KP key, long timeout, TimeUnit unit) throws InterruptedException;
|
||||
|
||||
public abstract boolean tryLock(KP key, long timeout) throws InterruptedException;
|
||||
|
||||
public abstract boolean tryLock(KP key);
|
||||
|
||||
public abstract void lockInterruptibly(KP key) throws InterruptedException;
|
||||
|
||||
public abstract boolean isLocked(KP key);
|
||||
|
||||
public abstract void clean();
|
||||
|
||||
public abstract List<LockerValue<KP>> getSuspectLocks(long timeDetectionLimitMs);
|
||||
|
||||
public abstract void setDetectSuspectLocks(boolean detectSuspectLocks);
|
||||
|
||||
public abstract boolean isDetectSuspectLocks();
|
||||
|
||||
}
|
||||
@@ -1,617 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2019 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.utils.threading.lockerbykey;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.talend.commons.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* This class is useful to lock some part of code from the provided key.
|
||||
*
|
||||
* This class has the same behaviour that <code>java.util.concurrent.locks.ReentrantLock</code> except additionally it
|
||||
* expect keys to lock the parts of code.
|
||||
*
|
||||
* It uses internally a <code>java.util.concurrent.ConcurrentHashMap</code> to store locks from keys <code>KP</code> and
|
||||
* the <code>java.util.concurrent.locks.ReentrantLock</code> as properties of a value wrapper. <br/>
|
||||
*
|
||||
* @see java.util.concurrent.locks.ReentrantLock
|
||||
*
|
||||
* @param <KP> type of the key
|
||||
*/
|
||||
public class LockerByKey<KP> implements ILockerByKey<KP> {
|
||||
|
||||
private static Logger log = Logger.getLogger(LockerByKey.class);
|
||||
|
||||
private ConcurrentHashMap<InternalKeyLock<KP>, LockerValue<KP>> mapKeyLockToValueLock = new ConcurrentHashMap<InternalKeyLock<KP>, LockerValue<KP>>();
|
||||
|
||||
private final Object lockAllOperations = new Object();
|
||||
|
||||
private AtomicInteger counter = new AtomicInteger();
|
||||
|
||||
private AtomicInteger runningOperations = new AtomicInteger();
|
||||
|
||||
private final static int DEFAULT_CLEAN_PERIOD = 500;
|
||||
|
||||
private final static boolean DEFAULT_FAIR = true;
|
||||
|
||||
private int cleanPeriod;
|
||||
|
||||
private boolean fair;
|
||||
|
||||
private volatile boolean blockAllOperations;
|
||||
|
||||
private volatile boolean shuttingDown;
|
||||
|
||||
private volatile boolean stopped;
|
||||
|
||||
private static boolean detectSuspectLocksStatic = false;
|
||||
|
||||
private boolean detectSuspectLocks = false;
|
||||
|
||||
private boolean forceShutdown;
|
||||
|
||||
static {
|
||||
String optionKey = "detectSuspectLocks";
|
||||
String detectSuspectLocksStr = System.getProperty(optionKey);
|
||||
if (detectSuspectLocksStr != null && detectSuspectLocksStr.length() > 0) {
|
||||
detectSuspectLocksStatic = Boolean.parseBoolean(detectSuspectLocksStr);
|
||||
}
|
||||
if (detectSuspectLocksStatic) {
|
||||
log.info("System property \"" + optionKey + "\"=" + detectSuspectLocksStatic);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* LockerByKey constructor.
|
||||
*/
|
||||
public LockerByKey() {
|
||||
this(DEFAULT_FAIR, DEFAULT_CLEAN_PERIOD);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructor LockerByKey.
|
||||
*
|
||||
* @param fair {@code true} if this lock should use a fair ordering policy
|
||||
*/
|
||||
public LockerByKey(boolean fair) {
|
||||
this(fair, DEFAULT_CLEAN_PERIOD);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructor LockerByKey.
|
||||
*
|
||||
* @param cleanPeriod in number of operations, it means that an automatic clean will be done for each
|
||||
* <code>cleanPeriod</code> number of unlock operation.
|
||||
*/
|
||||
public LockerByKey(int cleanPeriod) {
|
||||
this(DEFAULT_FAIR, cleanPeriod);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructor LockerByKey.
|
||||
*
|
||||
* @param fair {@code true} if this lock should use a fair ordering policy
|
||||
* @param cleanPeriod in number of operations, it means that an automatic clean will be done after each
|
||||
* <code>cleanPeriod</code> number of unlock operation.
|
||||
*/
|
||||
public LockerByKey(boolean fair, int cleanPeriod) {
|
||||
super();
|
||||
this.fair = fair;
|
||||
if (cleanPeriod <= 0) {
|
||||
throw new IllegalArgumentException("The cleanPeriod value has to be greater than 0");
|
||||
}
|
||||
this.cleanPeriod = cleanPeriod;
|
||||
this.detectSuspectLocks = detectSuspectLocksStatic;
|
||||
if (this.detectSuspectLocks) {
|
||||
launchThreadDebugger();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructor LockerByKey.
|
||||
*
|
||||
* @param fair {@code true} if this lock should use a fair ordering policy
|
||||
* @param cleanDisabled true to disable the clean completely <code>cleanPeriod</code> number of unlock operation.
|
||||
*/
|
||||
protected LockerByKey(boolean fair, boolean cleanDisabled) {
|
||||
super();
|
||||
this.fair = fair;
|
||||
if (cleanDisabled) {
|
||||
this.cleanPeriod = 0;
|
||||
} else {
|
||||
this.cleanPeriod = DEFAULT_CLEAN_PERIOD;
|
||||
}
|
||||
this.detectSuspectLocks = detectSuspectLocksStatic;
|
||||
if (this.detectSuspectLocks) {
|
||||
launchThreadDebugger();
|
||||
}
|
||||
}
|
||||
|
||||
private void launchThreadDebugger() {
|
||||
new Thread(this.getClass().getSimpleName() + "-ThreadDebugger-" + this.hashCode()) {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Thread#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
while (!stopped && !shuttingDown) {
|
||||
try {
|
||||
Thread.sleep(30000);
|
||||
} catch (InterruptedException e) {
|
||||
break;
|
||||
}
|
||||
long timeDetectionLimitMs = 30000L;
|
||||
List<LockerValue<KP>> lockerValues = getSuspectLocks(timeDetectionLimitMs);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (LockerValue<KP> lockerValue : lockerValues) {
|
||||
long duration = System.currentTimeMillis() - lockerValue.getLockedTime();
|
||||
StackTraceElement[] stackTraceOfLocker = lockerValue.getStackTraceOfLocker();
|
||||
for (StackTraceElement trace : stackTraceOfLocker) {
|
||||
StackTraceElement stackTraceElement = trace;
|
||||
sb.append(stackTraceElement.toString());
|
||||
sb.append("\n");
|
||||
}
|
||||
log.warn("Suspect lock done since " + duration + " ms by: " + sb.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "isLocked".
|
||||
*
|
||||
* @param key
|
||||
* @return true if any thread holds this lock and false otherwise
|
||||
*
|
||||
* @see java.util.concurrent.locks.ReentrantLock#isLocked()
|
||||
*/
|
||||
@Override
|
||||
public boolean isLocked(KP key) {
|
||||
checkKey(key);
|
||||
LockerValue<KP> locker = getLockerValue(key);
|
||||
return locker != null && locker.getLock().isLocked();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Method "lockInterruptibly".
|
||||
*
|
||||
* @param key
|
||||
* @throws InterruptedException
|
||||
* @see java.util.concurrent.locks.ReentrantLock#lockInterruptibly()
|
||||
*/
|
||||
@Override
|
||||
public void lockInterruptibly(KP key) throws InterruptedException {
|
||||
checkStopped();
|
||||
checkKey(key);
|
||||
blockOperationIfRequired();
|
||||
incrementRunningOperations();
|
||||
LockerValue<KP> lockerValue = prepareInternalLock(key);
|
||||
decrementRunningOperations();
|
||||
lockerValue.getLock().lockInterruptibly();
|
||||
traceStackForDebugging(lockerValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "tryLock".
|
||||
*
|
||||
* @param key
|
||||
* @return {@code true} if the lock was free and was acquired by the current thread, or the lock was already held by
|
||||
* the current thread; and {@code false} otherwise
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalArgumentException if bean is null
|
||||
* @see java.util.concurrent.locks.ReentrantLock#tryLock()
|
||||
*/
|
||||
@Override
|
||||
public boolean tryLock(KP key) {
|
||||
if (stopped || shuttingDown) {
|
||||
return false;
|
||||
}
|
||||
checkKey(key);
|
||||
blockOperationIfRequired();
|
||||
incrementRunningOperations();
|
||||
LockerValue<KP> lockerValue = prepareInternalLock(key);
|
||||
decrementRunningOperations();
|
||||
boolean locked = lockerValue.getLock().tryLock();
|
||||
if (locked) {
|
||||
traceStackForDebugging(lockerValue);
|
||||
}
|
||||
return locked;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "tryLock".
|
||||
*
|
||||
* @param key
|
||||
* @param timeout the time to wait for the lock in milliseconds
|
||||
* @return true if the lock was free and was acquired by the current thread, or the lock was already held by the
|
||||
* current thread; and false if the waiting time elapsed before the lock could be acquired
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalArgumentException if bean is null
|
||||
* @see java.util.concurrent.locks.ReentrantLock#tryLock(long, java.util.concurrent.TimeUnit)
|
||||
*/
|
||||
@Override
|
||||
public boolean tryLock(KP key, long timeout) throws InterruptedException {
|
||||
return tryLock(key, timeout, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "tryLock".
|
||||
*
|
||||
* @param key
|
||||
* @param timeout the time to wait for the lock
|
||||
* @param unit the time unit of the timeout argument
|
||||
* @return true if the lock was free and was acquired by the current thread, or the lock was already held by the
|
||||
* current thread; and false if the waiting time elapsed before the lock could be acquired
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalArgumentException if bean is null
|
||||
*
|
||||
* @see java.util.concurrent.locks.ReentrantLock#tryLock(long, java.util.concurrent.TimeUnit)
|
||||
*/
|
||||
@Override
|
||||
public boolean tryLock(KP key, long timeout, TimeUnit unit) throws InterruptedException {
|
||||
checkStopped();
|
||||
checkKey(key);
|
||||
blockOperationIfRequired();
|
||||
incrementRunningOperations();
|
||||
LockerValue<KP> lockerValue = prepareInternalLock(key);
|
||||
decrementRunningOperations();
|
||||
interruptIfStopping();
|
||||
boolean locked = lockerValue.getLock().tryLock(timeout, unit);
|
||||
if (locked) {
|
||||
traceStackForDebugging(lockerValue);
|
||||
}
|
||||
return locked;
|
||||
}
|
||||
|
||||
private LockerValue<KP> prepareInternalLock(KP key) {
|
||||
InternalKeyLock<KP> internalKeyLock = new InternalKeyLock<KP>(key);
|
||||
LockerValue<KP> lockerValue = new LockerValue<KP>(key, fair);
|
||||
LockerValue<KP> previousLockerValue = null;
|
||||
previousLockerValue = mapKeyLockToValueLock.putIfAbsent(internalKeyLock, lockerValue);
|
||||
if (previousLockerValue != null) {
|
||||
lockerValue = previousLockerValue;
|
||||
}
|
||||
return lockerValue;
|
||||
}
|
||||
|
||||
private void interruptIfStopping() throws InterruptedException {
|
||||
if (shuttingDown) {
|
||||
throw new InterruptedException("This LockerByKey is shutting down...");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "unlock". Unlock the operations with the provided key.
|
||||
*
|
||||
* @param key
|
||||
* @return true if the key has been found to release the lock; and false otherwise
|
||||
* @see java.util.concurrent.locks.ReentrantLock#unlock()
|
||||
*/
|
||||
@Override
|
||||
public boolean unlock(KP key) {
|
||||
checkKey(key);
|
||||
blockOperationIfRequired();
|
||||
incrementRunningOperations();
|
||||
LockerValue<KP> lockerValue = getLockerValue(key);
|
||||
boolean returnValue = false;
|
||||
if (lockerValue != null) {
|
||||
lockerValue.getLock().unlock();
|
||||
returnValue = true;
|
||||
}
|
||||
decrementRunningOperations();
|
||||
cleanAccordingOperations();
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
void traceStackForDebugging(LockerValue<KP> lockerValue) {
|
||||
if (this.detectSuspectLocks) {
|
||||
lockerValue.setStackTraceOfLocker(Thread.currentThread().getStackTrace());
|
||||
lockerValue.setLockedTime(System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
|
||||
private void cleanAccordingOperations() {
|
||||
synchronized (lockAllOperations) {
|
||||
if (cleanPeriod > 0 && counter.incrementAndGet() % cleanPeriod == 0) {
|
||||
clean();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Method "clean".
|
||||
*
|
||||
* Clean the map which contains the lock wrappers.
|
||||
*
|
||||
* Removed lock wrappers are these where lock is not locked by a thread and no one thread is waiting to obtain the
|
||||
* lock.
|
||||
*
|
||||
* The default clean will do an automatic clean all 1000 unlock operation, you can disable or change this value from
|
||||
* the constructor.
|
||||
*/
|
||||
@Override
|
||||
public void clean() {
|
||||
synchronized (lockAllOperations) {
|
||||
blockAllOperations();
|
||||
if (!(forceShutdown && shuttingDown)) {
|
||||
waitForRunningOperationsEnded();
|
||||
}
|
||||
Collection<LockerValue<KP>> values = mapKeyLockToValueLock.values();
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("Cleaning " + this.toString() + " : " + values.size() + " keys/values ...");
|
||||
}
|
||||
InternalKeyLock<KP> internalKeyLock = new InternalKeyLock<KP>();
|
||||
for (LockerValue<KP> lockerValue : values) {
|
||||
ReentrantLock lock = lockerValue.getLock();
|
||||
LockerValueHandler handler = lockerValue.getHandler();
|
||||
if (!lock.hasQueuedThreads() && !lock.isLocked() && handler == null) {
|
||||
internalKeyLock.setKey(lockerValue.getKey());
|
||||
mapKeyLockToValueLock.remove(internalKeyLock);
|
||||
}
|
||||
}
|
||||
resumeAllOperations();
|
||||
}
|
||||
}
|
||||
|
||||
private void checkStopped() {
|
||||
if (stopped || shuttingDown) {
|
||||
throw new IllegalStateException("This locker is already stopped or is shutting down !");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "check". Check if the key is not null.
|
||||
*
|
||||
* @param key
|
||||
*/
|
||||
private void checkKey(KP key) {
|
||||
if (key == null) {
|
||||
throw new IllegalArgumentException("key can't be null"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
private void waitForRunningOperationsEnded() {
|
||||
while (runningOperations.get() > 0) {
|
||||
try {
|
||||
Thread.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void resumeAllOperations() {
|
||||
this.blockAllOperations = false;
|
||||
lockAllOperations.notifyAll();
|
||||
}
|
||||
|
||||
private void blockAllOperations() {
|
||||
this.blockAllOperations = true;
|
||||
}
|
||||
|
||||
private void blockOperationIfRequired() {
|
||||
if (blockAllOperations) {
|
||||
synchronized (lockAllOperations) {
|
||||
if (blockAllOperations) {
|
||||
try {
|
||||
lockAllOperations.wait();
|
||||
} catch (InterruptedException e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void decrementRunningOperations() {
|
||||
runningOperations.decrementAndGet();
|
||||
}
|
||||
|
||||
private void incrementRunningOperations() {
|
||||
runningOperations.incrementAndGet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get locker.
|
||||
*
|
||||
* @param bean
|
||||
* @return locker value.
|
||||
*/
|
||||
@Override
|
||||
public LockerValue<KP> getLockerValue(KP key) {
|
||||
checkKey(key);
|
||||
InternalKeyLock<KP> internalKeyLock = new InternalKeyLock<KP>(key);
|
||||
return mapKeyLockToValueLock.get(internalKeyLock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void shutdownNow() {
|
||||
forceShutdown = true;
|
||||
shutdown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void shutdown() {
|
||||
shuttingDown = true;
|
||||
blockAllOperations();
|
||||
if (!forceShutdown) {
|
||||
waitForRunningOperationsEnded();
|
||||
}
|
||||
Collection<LockerValue<KP>> values = mapKeyLockToValueLock.values();
|
||||
for (LockerValue<KP> lockerValue : values) {
|
||||
Collection<Thread> queuedThreads = lockerValue.getLock().getQueuedThreads();
|
||||
for (Thread thread : queuedThreads) {
|
||||
thread.interrupt();
|
||||
}
|
||||
}
|
||||
clean();
|
||||
stopped = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LockerByKey:" + super.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for cleanFrequency.
|
||||
*
|
||||
* @return the cleanFrequency
|
||||
*/
|
||||
@Override
|
||||
public int getCleanPeriod() {
|
||||
return cleanPeriod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for detectSuspectLocks.
|
||||
*
|
||||
* @return the detectSuspectLocks
|
||||
*/
|
||||
@Override
|
||||
public boolean isDetectSuspectLocks() {
|
||||
return this.detectSuspectLocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the detectSuspectLocks.
|
||||
*
|
||||
* @param detectSuspectLocks the detectSuspectLocks to set
|
||||
*/
|
||||
@Override
|
||||
public void setDetectSuspectLocks(boolean detectSuspectLocks) {
|
||||
this.detectSuspectLocks = detectSuspectLocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LockerValue<KP>> getSuspectLocks(long timeDetectionLimitMs) {
|
||||
if (this.detectSuspectLocks) {
|
||||
Collection<LockerValue<KP>> values = mapKeyLockToValueLock.values();
|
||||
List<LockerValue<KP>> stacks = new ArrayList<LockerValue<KP>>();
|
||||
for (LockerValue<KP> lockerValue : values) {
|
||||
long lockedTime = lockerValue.getLockedTime();
|
||||
long duration = System.currentTimeMillis() - lockedTime;
|
||||
if (lockedTime > 0 && duration > timeDetectionLimitMs && lockerValue.getLock().isLocked()) {
|
||||
stacks.add(lockerValue);
|
||||
}
|
||||
}
|
||||
return stacks;
|
||||
} else {
|
||||
throw new UnsupportedOperationException(
|
||||
"You have to enable the 'detectSuspectLocks' mode by using the JVM argument -DdetectSuspectLocks=true");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* LockerByKey class.<br/>
|
||||
*
|
||||
* @param <IKP> key
|
||||
*/
|
||||
class InternalKeyLock<IKP> {
|
||||
|
||||
private IKP key;
|
||||
|
||||
public InternalKeyLock() {
|
||||
}
|
||||
|
||||
/**
|
||||
* InternalKeyLock constructor comment.
|
||||
*
|
||||
* @param key2
|
||||
*/
|
||||
public InternalKeyLock(IKP key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((this.key == null) ? 0 : this.key.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final InternalKeyLock other = (InternalKeyLock) obj;
|
||||
if (this.key == null) {
|
||||
if (other.key != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.key.equals(other.key)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setKey(IKP key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return StringUtils.replacePrms(InternalKeyLock.class.getSimpleName() + ": key={0}", key); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for mapKeyLockToValueLock.
|
||||
*
|
||||
* @return the mapKeyLockToValueLock
|
||||
*/
|
||||
Map<InternalKeyLock<KP>, LockerValue<KP>> getMapKeyLockToValueLock() {
|
||||
return new HashMap<InternalKeyLock<KP>, LockerValue<KP>>(mapKeyLockToValueLock);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,669 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2019 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.utils.threading.lockerbykey;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.BrokenBarrierException;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.CyclicBarrier;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* Class LockerByKeyUnrestricted.
|
||||
*
|
||||
* This class has the same behaviours that {@link LockerByKey} except
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class LockerByKeyUnrestricted<KP> implements ILockerByKey<KP> {
|
||||
|
||||
private static final String NOT_ALREADY_LOCKED_MESSAGE = "Already unlocked by an other thread or never locked, ensure all the unlock() operations of this locker are called after their lock has really locked:";
|
||||
|
||||
private static Logger log = Logger.getLogger(LockerByKeyUnrestricted.class);
|
||||
|
||||
private ExecutorService threadPool;
|
||||
|
||||
private LockerByKey<KP> locker;
|
||||
|
||||
private final Object lockAllOperations = new Object();
|
||||
|
||||
private AtomicInteger counter = new AtomicInteger();
|
||||
|
||||
private AtomicInteger runningOperations = new AtomicInteger();
|
||||
|
||||
private final static int DEFAULT_CLEAN_PERIOD = 500;
|
||||
|
||||
private final static boolean DEFAULT_FAIR = true;
|
||||
|
||||
private volatile boolean blockAllOperations;
|
||||
|
||||
private volatile boolean shuttingDown;
|
||||
|
||||
private volatile boolean stopped;
|
||||
|
||||
private int cleanPeriod;
|
||||
|
||||
/**
|
||||
* LockerByKey constructor.
|
||||
*/
|
||||
public LockerByKeyUnrestricted() {
|
||||
this(DEFAULT_FAIR, DEFAULT_CLEAN_PERIOD);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructor LockerByKey.
|
||||
*
|
||||
* @param fair {@code true} if this lock should use a fair ordering policy
|
||||
*/
|
||||
public LockerByKeyUnrestricted(boolean fair) {
|
||||
this(fair, DEFAULT_CLEAN_PERIOD);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructor LockerByKey.
|
||||
*
|
||||
* @param cleanPeriod in number of operations, it means that an automatic clean will be done for each
|
||||
* <code>cleanPeriod</code> number of unlock operation.
|
||||
*/
|
||||
public LockerByKeyUnrestricted(int cleanPeriod) {
|
||||
this(DEFAULT_FAIR, cleanPeriod);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructor LockerByKey.
|
||||
*
|
||||
* @param fair {@code true} if this lock should use a fair ordering policy
|
||||
* @param cleanPeriod in number of operations, it means that an automatic clean will be done for each
|
||||
* <code>cleanPeriod</code> number of unlock operation.
|
||||
*/
|
||||
public LockerByKeyUnrestricted(boolean fair, int cleanPeriod) {
|
||||
super();
|
||||
if (cleanPeriod <= 0) {
|
||||
throw new IllegalArgumentException("The cleanPeriod value has to be greater than 0");
|
||||
}
|
||||
boolean cleanDisabled = true;
|
||||
this.locker = new LockerByKey<KP>(fair, cleanDisabled);
|
||||
this.threadPool = intializePool(LockerByKeyUnrestricted.class.getSimpleName());
|
||||
this.cleanPeriod = cleanPeriod;
|
||||
}
|
||||
|
||||
protected ExecutorService intializePool(final String poolName) {
|
||||
ExecutorService threadPool = Executors.newCachedThreadPool(new ThreadFactory() {
|
||||
|
||||
ThreadFactory defaultThreadFactory = Executors.defaultThreadFactory();
|
||||
|
||||
@Override
|
||||
public Thread newThread(Runnable r) {
|
||||
Thread newThread = defaultThreadFactory.newThread(r);
|
||||
newThread.setName(poolName + "_" + newThread.getName());
|
||||
return newThread;
|
||||
}
|
||||
|
||||
});
|
||||
return threadPool;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Method "lockInterruptibly".
|
||||
*
|
||||
* @param key
|
||||
* @throws InterruptedException
|
||||
* @see java.util.concurrent.locks.ReentrantLock#lockInterruptibly()
|
||||
*/
|
||||
@Override
|
||||
public void lockInterruptibly(final KP key) throws InterruptedException {
|
||||
blockOperationIfRequired();
|
||||
incrementRunningOperations();
|
||||
try {
|
||||
locker.lockInterruptibly(key);
|
||||
} finally {
|
||||
decrementRunningOperations();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Method "lockInterruptiblyUnrestricted".
|
||||
*
|
||||
* @param key
|
||||
* @throws InterruptedException
|
||||
* @see java.util.concurrent.locks.ReentrantLock#lockInterruptibly()
|
||||
*/
|
||||
public void lockInterruptiblyUnrestricted(final KP key) throws InterruptedException {
|
||||
checkStopped();
|
||||
blockOperationIfRequired();
|
||||
|
||||
LockerValue<KP> lockerValue = null;
|
||||
LockerValueHandler handler = null;
|
||||
|
||||
if (tryLockUnrestricted(key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
incrementRunningOperations();
|
||||
|
||||
/* Test if already locked by the same thread */
|
||||
lockerValue = locker.getLockerValue(key);
|
||||
if (locker != null) {
|
||||
handler = lockerValue.getHandler();
|
||||
if (handler != null && Thread.currentThread() == handler.getCallerThreadLocker()) {
|
||||
decrementRunningOperations();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
final Thread threadLocker = Thread.currentThread();
|
||||
final CyclicBarrier cyclicBarrier = new CyclicBarrier(2);
|
||||
final AtomicBoolean hasError = new AtomicBoolean();
|
||||
Callable<Boolean> callable = new Callable<Boolean>() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.concurrent.Callable#call()
|
||||
*/
|
||||
@Override
|
||||
public Boolean call() throws Exception {
|
||||
try {
|
||||
locker.lockInterruptibly(key);
|
||||
} catch (Exception e) {
|
||||
hasError.set(true);
|
||||
throw e;
|
||||
} finally {
|
||||
// STEP 1
|
||||
cyclicBarrier.await();
|
||||
}
|
||||
// STEP 2
|
||||
cyclicBarrier.await();
|
||||
boolean unlocked = locker.unlock(key);
|
||||
return unlocked;
|
||||
}
|
||||
|
||||
};
|
||||
Future<Boolean> futureTask = threadPool.submit(callable);
|
||||
try {
|
||||
// STEP 1
|
||||
cyclicBarrier.await();
|
||||
} catch (BrokenBarrierException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
if (hasError.get()) {
|
||||
try {
|
||||
futureTask.get();
|
||||
} catch (ExecutionException e) {
|
||||
Throwable cause = e.getCause();
|
||||
if (cause != null && cause instanceof InterruptedException) {
|
||||
throw (InterruptedException) cause;
|
||||
} else {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lockerValue = locker.getLockerValue(key);
|
||||
lockerValue.addHandler(new LockerValueHandler(futureTask, cyclicBarrier, threadLocker));
|
||||
} finally {
|
||||
decrementRunningOperations();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "tryLock".
|
||||
*
|
||||
* @param key
|
||||
* @return {@code true} if the lock was free and was acquired by the current thread, or the lock was already held by
|
||||
* the current thread; and {@code false} otherwise
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalArgumentException if bean is null
|
||||
* @see java.util.concurrent.locks.ReentrantLock#tryLock()
|
||||
*/
|
||||
@Override
|
||||
public boolean tryLock(final KP key) {
|
||||
blockOperationIfRequired();
|
||||
incrementRunningOperations();
|
||||
try {
|
||||
return locker.tryLock(key);
|
||||
} finally {
|
||||
decrementRunningOperations();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "tryLockUnrestricted".
|
||||
*
|
||||
* @param key
|
||||
* @return {@code true} if the lock was free and was acquired by the current thread, or the lock was already held by
|
||||
* the current thread; and {@code false} otherwise
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalArgumentException if bean is null
|
||||
* @see java.util.concurrent.locks.ReentrantLock#tryLock()
|
||||
*/
|
||||
public boolean tryLockUnrestricted(final KP key) {
|
||||
checkStopped();
|
||||
blockOperationIfRequired();
|
||||
incrementRunningOperations();
|
||||
boolean tryLockResultBoolean;
|
||||
try {
|
||||
final AtomicBoolean tryLockResult = new AtomicBoolean();
|
||||
final CyclicBarrier cyclicBarrier = new CyclicBarrier(2);
|
||||
Callable<Boolean> callable = new Callable<Boolean>() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.concurrent.Callable#call()
|
||||
*/
|
||||
@Override
|
||||
public Boolean call() throws Exception {
|
||||
boolean locked;
|
||||
try {
|
||||
locked = locker.tryLock(key);
|
||||
tryLockResult.set(locked);
|
||||
} finally {
|
||||
// STEP 1
|
||||
cyclicBarrier.await();
|
||||
}
|
||||
if (locked) {
|
||||
// STEP 2
|
||||
cyclicBarrier.await();
|
||||
return locker.unlock(key);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
Future<Boolean> futureTask = threadPool.submit(callable);
|
||||
try {
|
||||
// STEP 1
|
||||
cyclicBarrier.await();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
tryLockResultBoolean = tryLockResult.get();
|
||||
if (tryLockResultBoolean) {
|
||||
LockerValue<KP> lockerValue = locker.getLockerValue(key);
|
||||
Thread callerThreadLocker = Thread.currentThread();
|
||||
lockerValue.addHandler(new LockerValueHandler(futureTask, cyclicBarrier, callerThreadLocker));
|
||||
}
|
||||
} finally {
|
||||
decrementRunningOperations();
|
||||
}
|
||||
return tryLockResultBoolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "tryLock".
|
||||
*
|
||||
* @param key
|
||||
* @param timeout the time to wait for the lock in milliseconds
|
||||
* @return true if the lock was free and was acquired by the current thread, or the lock was already held by the
|
||||
* current thread; and false if the waiting time elapsed before the lock could be acquired
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalArgumentException if bean is null
|
||||
* @see java.util.concurrent.locks.ReentrantLock#tryLock(long, java.util.concurrent.TimeUnit)
|
||||
*/
|
||||
@Override
|
||||
public boolean tryLock(final KP key, final long timeout) throws InterruptedException {
|
||||
return locker.tryLock(key, timeout, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "tryLockUnrestricted".
|
||||
*
|
||||
* @param key
|
||||
* @param timeout the time to wait for the lock in milliseconds
|
||||
* @return true if the lock was free and was acquired by the current thread, or the lock was already held by the
|
||||
* current thread; and false if the waiting time elapsed before the lock could be acquired
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalArgumentException if bean is null
|
||||
* @see java.util.concurrent.locks.ReentrantLock#tryLock(long, java.util.concurrent.TimeUnit)
|
||||
*/
|
||||
public boolean tryLockUnrestricted(final KP key, final long timeout) throws InterruptedException {
|
||||
return tryLockUnrestricted(key, timeout, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "tryLock".
|
||||
*
|
||||
* @param key
|
||||
* @param timeout the time to wait for the lock
|
||||
* @param unit the time unit of the timeout argument
|
||||
* @return true if the lock was free and was acquired by the current thread, or the lock was already held by the
|
||||
* current thread; and false if the waiting time elapsed before the lock could be acquired
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalArgumentException if bean is null
|
||||
*
|
||||
* @see java.util.concurrent.locks.ReentrantLock#tryLock(long, java.util.concurrent.TimeUnit)
|
||||
*/
|
||||
@Override
|
||||
public boolean tryLock(final KP key, final long timeout, final TimeUnit unit) throws InterruptedException {
|
||||
blockOperationIfRequired();
|
||||
incrementRunningOperations();
|
||||
try {
|
||||
return locker.tryLock(key, timeout, unit);
|
||||
} finally {
|
||||
decrementRunningOperations();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "tryLockUnrestricted".
|
||||
*
|
||||
* @param key
|
||||
* @param timeout the time to wait for the lock
|
||||
* @param unit the time unit of the timeout argument
|
||||
* @return true if the lock was free and was acquired by the current thread, or the lock was already held by the
|
||||
* current thread; and false if the waiting time elapsed before the lock could be acquired
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalArgumentException if bean is null
|
||||
*
|
||||
* @see java.util.concurrent.locks.ReentrantLock#tryLock(long, java.util.concurrent.TimeUnit)
|
||||
*/
|
||||
public boolean tryLockUnrestricted(final KP key, final long timeout, final TimeUnit unit) throws InterruptedException {
|
||||
checkStopped();
|
||||
blockOperationIfRequired();
|
||||
incrementRunningOperations();
|
||||
boolean tryLockResultBoolean = false;
|
||||
try {
|
||||
final AtomicBoolean tryLockResult = new AtomicBoolean();
|
||||
final AtomicReference<InterruptedException> interruptedExceptionFromTryRef = new AtomicReference<InterruptedException>();
|
||||
final CyclicBarrier cyclicBarrier = new CyclicBarrier(2);
|
||||
Callable<Boolean> callable = new Callable<Boolean>() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.concurrent.Callable#call()
|
||||
*/
|
||||
@Override
|
||||
public Boolean call() throws Exception {
|
||||
boolean locked = false;
|
||||
try {
|
||||
locked = locker.tryLock(key, timeout, unit);
|
||||
tryLockResult.set(locked);
|
||||
} catch (InterruptedException e) {
|
||||
interruptedExceptionFromTryRef.set(e);
|
||||
return false;
|
||||
} finally {
|
||||
// STEP 1
|
||||
cyclicBarrier.await();
|
||||
}
|
||||
if (locked) {
|
||||
// STEP 2
|
||||
cyclicBarrier.await();
|
||||
return locker.unlock(key);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
Future<Boolean> futureTask = threadPool.submit(callable);
|
||||
try {
|
||||
// STEP 1
|
||||
cyclicBarrier.await();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
InterruptedException interruptedExceptionFromTry = interruptedExceptionFromTryRef.get();
|
||||
if (interruptedExceptionFromTry != null) {
|
||||
throw interruptedExceptionFromTry;
|
||||
}
|
||||
tryLockResultBoolean = tryLockResult.get();
|
||||
if (tryLockResultBoolean) {
|
||||
LockerValue<KP> lockerValue = locker.getLockerValue(key);
|
||||
Thread threadLocker = Thread.currentThread();
|
||||
lockerValue.addHandler(new LockerValueHandler(futureTask, cyclicBarrier, threadLocker));
|
||||
locker.traceStackForDebugging(lockerValue);
|
||||
}
|
||||
} finally {
|
||||
decrementRunningOperations();
|
||||
}
|
||||
|
||||
return tryLockResultBoolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "unlock". Unlock the operations with the provided key.
|
||||
*
|
||||
* To detect incorrect unlocking, this method may return an <code>IllegalStateException</code> when the lock has
|
||||
* been already unlocked or it never been locked.
|
||||
*
|
||||
* @param key
|
||||
* @return true if the key has been found to release the lock; and false otherwise
|
||||
* @throws IllegalStateException
|
||||
* @see java.util.concurrent.locks.ReentrantLock#unlock()
|
||||
*/
|
||||
@Override
|
||||
public boolean unlock(final KP key) {
|
||||
boolean returnedValue = false;
|
||||
try {
|
||||
checkStopped();
|
||||
blockOperationIfRequired();
|
||||
incrementRunningOperations();
|
||||
returnedValue = locker.unlock(key);
|
||||
} finally {
|
||||
decrementRunningOperations();
|
||||
}
|
||||
cleanAccordingOperations();
|
||||
return returnedValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "unlockUnrestricted". Unlock the operations with the provided key.
|
||||
*
|
||||
* To detect incorrect unlocking, this method may return an <code>IllegalStateException</code> when the lock has
|
||||
* been already unlocked or it never been locked.
|
||||
*
|
||||
* @param key
|
||||
* @return true if the key has been found to release the lock; and false otherwise
|
||||
* @throws IllegalStateException
|
||||
* @see java.util.concurrent.locks.ReentrantLock#unlock()
|
||||
*/
|
||||
public boolean unlockUnrestricted(final KP key) {
|
||||
checkStopped();
|
||||
blockOperationIfRequired();
|
||||
Boolean resultFuture;
|
||||
incrementRunningOperations();
|
||||
try {
|
||||
LockerValue<KP> lockerValue = locker.getLockerValue(key);
|
||||
if (lockerValue == null) {
|
||||
throw new IllegalStateException(NOT_ALREADY_LOCKED_MESSAGE + " key=" + key);
|
||||
}
|
||||
LockerValueHandler handler = lockerValue.getHandlerAndRemove();
|
||||
if (handler == null) {
|
||||
throw new UnsupportedOperationException(
|
||||
"Either you have to use the restricted unlock() method to unlock, or you have to use '*Lock*Unrestricted()' methods to lock !");
|
||||
}
|
||||
CyclicBarrier barrier = handler.getBarrier();
|
||||
try {
|
||||
// STEP 2
|
||||
barrier.await();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Future<Boolean> future = handler.getFuture();
|
||||
if (future.isCancelled()) {
|
||||
return false;
|
||||
}
|
||||
resultFuture = null;
|
||||
try {
|
||||
resultFuture = future.get();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} finally {
|
||||
decrementRunningOperations();
|
||||
}
|
||||
cleanAccordingOperations();
|
||||
return resultFuture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCleanPeriod() {
|
||||
return cleanPeriod;
|
||||
}
|
||||
|
||||
private void checkStopped() {
|
||||
if (stopped || shuttingDown) {
|
||||
throw new IllegalStateException("This locker is already stopped or is shutting down !");
|
||||
}
|
||||
}
|
||||
|
||||
private void cleanAccordingOperations() {
|
||||
synchronized (lockAllOperations) {
|
||||
int cleanPeriod = getCleanPeriod();
|
||||
if (cleanPeriod > 0 && counter.incrementAndGet() % cleanPeriod == 0) {
|
||||
clean();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Method "clean".
|
||||
*
|
||||
* Clean the map which contains the lock wrappers.
|
||||
*
|
||||
* Removed lock wrappers are these where lock is not locked by a thread and no one thread is waiting to obtain the
|
||||
* lock.
|
||||
*
|
||||
* The default clean will do an automatic clean all 1000 unlock operation, you can disable or change this value from
|
||||
* the constructor.
|
||||
*/
|
||||
@Override
|
||||
public void clean() {
|
||||
synchronized (lockAllOperations) {
|
||||
waitForRunningOperationsEnded();
|
||||
locker.clean();
|
||||
resumeAllOperations();
|
||||
}
|
||||
}
|
||||
|
||||
private void waitForRunningOperationsEnded() {
|
||||
blockAllOperations();
|
||||
boolean breakAtNext = false;
|
||||
while (true) {
|
||||
Collection<LockerValue<KP>> values = locker.getMapKeyLockToValueLock().values();
|
||||
int waitingThreads = 0;
|
||||
for (LockerValue<KP> lockerValue : values) {
|
||||
waitingThreads += lockerValue.getLock().getQueueLength();
|
||||
}
|
||||
if (runningOperations.get() - waitingThreads <= 0) {
|
||||
if (breakAtNext) {
|
||||
break;
|
||||
}
|
||||
breakAtNext = true;
|
||||
} else {
|
||||
breakAtNext = false;
|
||||
}
|
||||
try {
|
||||
Thread.sleep(10);
|
||||
} catch (InterruptedException e) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void resumeAllOperations() {
|
||||
this.blockAllOperations = false;
|
||||
lockAllOperations.notifyAll();
|
||||
}
|
||||
|
||||
private void blockAllOperations() {
|
||||
this.blockAllOperations = true;
|
||||
}
|
||||
|
||||
private void blockOperationIfRequired() {
|
||||
if (blockAllOperations) {
|
||||
synchronized (lockAllOperations) {
|
||||
if (blockAllOperations) {
|
||||
try {
|
||||
lockAllOperations.wait();
|
||||
} catch (InterruptedException e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void decrementRunningOperations() {
|
||||
runningOperations.decrementAndGet();
|
||||
}
|
||||
|
||||
private void incrementRunningOperations() {
|
||||
runningOperations.incrementAndGet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void shutdownNow() {
|
||||
shuttingDown = true;
|
||||
locker.shutdownNow();
|
||||
threadPool.shutdownNow();
|
||||
stopped = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void shutdown() {
|
||||
shuttingDown = true;
|
||||
locker.shutdown();
|
||||
threadPool.shutdown();
|
||||
stopped = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LockerValue<KP> getLockerValue(KP key) {
|
||||
return locker.getLockerValue(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLocked(KP key) {
|
||||
return locker.isLocked(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LockerValue<KP>> getSuspectLocks(long timeDetectionLimitMs) {
|
||||
return locker.getSuspectLocks(timeDetectionLimitMs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDetectSuspectLocks(boolean detectSuspectLocks) {
|
||||
locker.setDetectSuspectLocks(detectSuspectLocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDetectSuspectLocks() {
|
||||
return locker.isDetectSuspectLocks();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
package org.talend.commons.utils.threading.lockerbykey;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.commons.utils.StringUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
* LockerValue.<br/>
|
||||
*
|
||||
* @param <VKP> key
|
||||
*/
|
||||
public class LockerValue<VKP> {
|
||||
|
||||
private CustomReentrantLock lock;
|
||||
|
||||
private VKP key;
|
||||
|
||||
private List<LockerValueHandler> handlers;
|
||||
|
||||
private StackTraceElement[] stackTraceOfLocker;
|
||||
|
||||
private long lockedTime;
|
||||
|
||||
/**
|
||||
* LockerValue constructor.
|
||||
*
|
||||
* @param thread
|
||||
* @param contextInfo
|
||||
* @param fair
|
||||
*/
|
||||
public LockerValue(VKP key, boolean fair) {
|
||||
this.lock = new CustomReentrantLock(fair);
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return StringUtils.replacePrms("LockerValue: key={0}, lock={1}", String.valueOf(key), lock.toString()); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for key.
|
||||
*
|
||||
* @return the key
|
||||
*/
|
||||
public VKP getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for lock.
|
||||
*
|
||||
* @return the lock
|
||||
*/
|
||||
public CustomReentrantLock getLock() {
|
||||
return lock;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Method "addHandler". Add handler to internal list.
|
||||
*
|
||||
* @param handler
|
||||
*/
|
||||
public synchronized void addHandler(LockerValueHandler handler) {
|
||||
if (handlers == null) {
|
||||
handlers = new ArrayList<LockerValueHandler>();
|
||||
}
|
||||
handlers.add(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Method "getHandlerAndRemove".
|
||||
*
|
||||
* Return the next available handler then remove it from internal list, else null if not exist.
|
||||
*
|
||||
* @return the next available handler, else null if not exist
|
||||
*/
|
||||
public synchronized LockerValueHandler getHandler() {
|
||||
if (handlers != null && handlers.size() > 0) {
|
||||
LockerValueHandler lockerValueHandler = handlers.get(0);
|
||||
return lockerValueHandler;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Method "getHandlerAndRemove".
|
||||
*
|
||||
* Return the next available handler then remove it from internal list, else null if not exist.
|
||||
*
|
||||
* @return the next available handler, else null if not exist
|
||||
*/
|
||||
public synchronized LockerValueHandler getHandlerAndRemove() {
|
||||
if (handlers != null && handlers.size() > 0) {
|
||||
LockerValueHandler lockerValueHandler = handlers.get(0);
|
||||
handlers.remove(0);
|
||||
return lockerValueHandler;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for stackTraceElements.
|
||||
*
|
||||
* @return the stackTraceElements
|
||||
*/
|
||||
public StackTraceElement[] getStackTraceOfLocker() {
|
||||
return stackTraceOfLocker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the stackTraceElements.
|
||||
*
|
||||
* @param stackTraceElements the stackTraceElements to set
|
||||
*/
|
||||
public void setStackTraceOfLocker(StackTraceElement[] stackTraceElements) {
|
||||
this.stackTraceOfLocker = stackTraceElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for lockedTime.
|
||||
*
|
||||
* @return the lockedTime
|
||||
*/
|
||||
public long getLockedTime() {
|
||||
return lockedTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the lockedTime.
|
||||
*
|
||||
* @param lockedTime the lockedTime to set
|
||||
*/
|
||||
public void setLockedTime(long lockedTime) {
|
||||
this.lockedTime = lockedTime;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2019 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.utils.threading.lockerbykey;
|
||||
|
||||
import java.util.concurrent.CyclicBarrier;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
/**
|
||||
* class LockerValueHandler.
|
||||
*/
|
||||
public class LockerValueHandler {
|
||||
|
||||
private Future<Boolean> future;
|
||||
|
||||
private CyclicBarrier barrier;
|
||||
|
||||
private Thread callerThreadLocker;
|
||||
|
||||
public LockerValueHandler(Future<Boolean> future, CyclicBarrier barrier, Thread callerThreadLocker) {
|
||||
super();
|
||||
this.future = future;
|
||||
this.barrier = barrier;
|
||||
this.callerThreadLocker = callerThreadLocker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for future.
|
||||
*
|
||||
* @return the future
|
||||
*/
|
||||
public Future<Boolean> getFuture() {
|
||||
return future;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for barrier.
|
||||
*
|
||||
* @return the barrier
|
||||
*/
|
||||
public CyclicBarrier getBarrier() {
|
||||
return barrier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for callerThreadLocker.
|
||||
*
|
||||
* @return the callerThreadLocker
|
||||
*/
|
||||
public Thread getCallerThreadLocker() {
|
||||
return callerThreadLocker;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.commons.utils.time;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.log4j.Hierarchy;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.PropertyConfigurator;
|
||||
import org.apache.log4j.RollingFileAppender;
|
||||
import org.apache.log4j.spi.LoggerFactory;
|
||||
import org.apache.log4j.spi.RootLogger;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
|
||||
public class PerformanceLogManager {
|
||||
|
||||
private Hierarchy hierarchy;
|
||||
|
||||
public PerformanceLogManager() {
|
||||
Properties properties = new Properties();
|
||||
properties.put("log4j.rootCategory", ", A1");
|
||||
properties.put("log4j.appender.A1", RollingFileAppender.class.getName());
|
||||
IPath performanceLogPath = Platform.getLogFileLocation().removeLastSegments(1).append("performance.log");
|
||||
properties.put("log4j.appender.A1.File", performanceLogPath.toOSString());
|
||||
properties.put("log4j.appender.A1.MaxBackupIndex", "10");// same as .log's max backup log file count
|
||||
properties.put("log4j.appender.A1.MaxFileSize", "1000000");//1000*1000 byte, same as .log's max file size
|
||||
properties.put("log4j.appender.A1.layout", "org.apache.log4j.PatternLayout");
|
||||
properties.put("log4j.appender.A1.layout.ConversionPattern", "%d %-5p %c %x - %m%n");
|
||||
|
||||
this.hierarchy = new Hierarchy(new RootLogger(Level.INFO));
|
||||
new PropertyConfigurator().doConfigure(properties,hierarchy);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this PluginLogManager is disabled for this level.
|
||||
* @param level level value
|
||||
* @return boolean true if it is disabled
|
||||
*/
|
||||
public boolean isDisabled(int level) {
|
||||
return this.hierarchy.isDisabled(level);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable logging for logging requests with level l or higher.
|
||||
* By default all levels are enabled.
|
||||
* @param level level object
|
||||
*/
|
||||
public void setThreshold(Level level) {
|
||||
this.hierarchy.setThreshold(level);
|
||||
}
|
||||
|
||||
/**
|
||||
* The string version of setThreshold(Level level)
|
||||
* @param level level string
|
||||
*/
|
||||
public void setThreshold(String level) {
|
||||
this.hierarchy.setThreshold(level);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the repository-wide threshold.
|
||||
* @return Level
|
||||
*/
|
||||
public Level getThreshold() {
|
||||
return this.hierarchy.getThreshold();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new logger instance named as the first parameter
|
||||
* using the default factory. If a logger of that name already exists,
|
||||
* then it will be returned. Otherwise, a new logger will be instantiated
|
||||
* and then linked with its existing ancestors as well as children.
|
||||
* @param name logger name
|
||||
* @return Logger
|
||||
*/
|
||||
public Logger getLogger(String name) {
|
||||
return this.hierarchy.getLogger(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as getLogger(String name) but using a factory instance instead of
|
||||
* a default factory.
|
||||
* @param name logger name
|
||||
* @param factory factory instance
|
||||
* @return Logger
|
||||
*/
|
||||
public Logger getLogger(String name, LoggerFactory factory) {
|
||||
return this.hierarchy.getLogger(name,factory);
|
||||
}
|
||||
|
||||
public Logger getRootLogger() {
|
||||
return this.hierarchy.getRootLogger();
|
||||
}
|
||||
|
||||
public Logger exists(String name) {
|
||||
return this.hierarchy.exists(name);
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
this.hierarchy.shutdown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the loggers in this manager.
|
||||
* @return Enumeration logger enumeration
|
||||
*/
|
||||
public Enumeration getCurrentLoggers() {
|
||||
return this.hierarchy.getCurrentLoggers();
|
||||
}
|
||||
|
||||
public void resetConfiguration() {
|
||||
this.hierarchy.resetConfiguration();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,371 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.commons.utils.time;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Properties;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.Condition;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
|
||||
/**
|
||||
* DOC sbliu class global comment. Detailled comment
|
||||
*/
|
||||
public class PerformanceStatisticUtil {
|
||||
|
||||
private static final int MEGABYTE = 1024 * 1024;// MB = 1024*1024 byte
|
||||
|
||||
private static final int KILOBYTE = 1024;// kb=1024 byte
|
||||
|
||||
private static final int numOfBlocks = 256;
|
||||
|
||||
private static final int blockSizeKb = 512;
|
||||
|
||||
private static final String dataFile = "testio.data";
|
||||
|
||||
private static String recordingFileName = "performance_record";
|
||||
|
||||
private static File recordingFile = null;
|
||||
|
||||
private static enum BlockSequence {
|
||||
SEQUENTIAL,
|
||||
RANDOM;
|
||||
}
|
||||
|
||||
public static enum StatisticKeys {
|
||||
|
||||
IO_COUNT("I/O.count"), // io count
|
||||
IO_W_MB_SEC("I/O.write"), // write speed MB
|
||||
IO_R_MB_SEC("I/O.read"), // read speed MB
|
||||
IO_W_AVERAGE_MB_SEC("I/O.write.average"), // average speed of write MB
|
||||
IO_R_AVERAGE_MB_SEC("I/O.read.average"), // average speed of read
|
||||
|
||||
STARTUP_AVERAGE("startup.average"),
|
||||
STARTUP_MAX("startup.max"),
|
||||
STARTUP_COUNT("startup.count");
|
||||
|
||||
private String key;
|
||||
|
||||
StatisticKeys(String _key) {
|
||||
key = _key;
|
||||
}
|
||||
|
||||
public String get() {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
public static void recordStartupEpapsedTime(double elapsedTimeInSeconds) {
|
||||
File file = getRecordingFile();
|
||||
|
||||
Properties props = read(file, true);
|
||||
String propCount = props.getProperty(StatisticKeys.STARTUP_COUNT.get(), "0");
|
||||
String propMax = props.getProperty(StatisticKeys.STARTUP_MAX.get(), "0");
|
||||
String propAverage = props.getProperty(StatisticKeys.STARTUP_AVERAGE.get(), "0");
|
||||
|
||||
int iPropCount = Integer.parseInt(propCount);
|
||||
double iPropMax = Double.parseDouble(propMax);
|
||||
double iPropAverage = Double.parseDouble(propAverage);
|
||||
|
||||
iPropMax = iPropMax > elapsedTimeInSeconds ? iPropMax : elapsedTimeInSeconds;
|
||||
iPropAverage = (iPropAverage * iPropCount + elapsedTimeInSeconds) / (iPropCount + 1);
|
||||
iPropCount++;
|
||||
|
||||
props.setProperty(StatisticKeys.STARTUP_COUNT.get(), "" + iPropCount);
|
||||
props.setProperty(StatisticKeys.STARTUP_MAX.get(), "" + iPropMax);
|
||||
props.setProperty(StatisticKeys.STARTUP_AVERAGE.get(), "" + iPropAverage);
|
||||
|
||||
store(file, props);
|
||||
}
|
||||
|
||||
public static File getRecordingFile() {
|
||||
if (recordingFile != null) {
|
||||
return recordingFile;
|
||||
}
|
||||
|
||||
String configurationLocation = Platform.getConfigurationLocation().getURL().getPath();
|
||||
File file = new File(configurationLocation + "/" + recordingFileName);
|
||||
return file;
|
||||
}
|
||||
|
||||
public static void setRecordingFile(File _recordingFile) {
|
||||
recordingFile = _recordingFile;
|
||||
}
|
||||
|
||||
public static synchronized Properties read(File recordFile, boolean createIfNotExist) {
|
||||
Properties props = new Properties();
|
||||
if (recordFile != null && exist(recordFile, createIfNotExist)) {
|
||||
FileInputStream inStream = null;
|
||||
try {
|
||||
inStream = new FileInputStream(recordFile);
|
||||
props.load(inStream);
|
||||
} catch (Exception e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
} finally {
|
||||
if (inStream != null) {
|
||||
try {
|
||||
inStream.close();
|
||||
} catch (IOException e) {//
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
public static synchronized void store(File recordFile, Properties props) {
|
||||
if (props == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (recordFile != null && exist(recordFile, true)) {
|
||||
FileOutputStream outputStream = null;
|
||||
try {
|
||||
outputStream = new FileOutputStream(recordFile);
|
||||
props.store(outputStream, "");
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
} finally {
|
||||
if (outputStream != null) {
|
||||
try {
|
||||
outputStream.close();
|
||||
} catch (IOException e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean exist(File recordFile, boolean createIfNotExist) {
|
||||
boolean exists = recordFile.exists();
|
||||
if (!exists && createIfNotExist) {
|
||||
try {
|
||||
exists = recordFile.createNewFile();
|
||||
if (!exists) {
|
||||
throw new FileNotFoundException(recordFile.getName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return exists;
|
||||
}
|
||||
|
||||
private static Lock lock = new ReentrantLock();
|
||||
private static Condition condition = lock.newCondition();
|
||||
private static boolean measureIOFinished = true;
|
||||
|
||||
public static void waitUntilFinish() throws InterruptedException {
|
||||
lock.lock();
|
||||
|
||||
try {
|
||||
if(!measureIOFinished) {
|
||||
condition.await(20, TimeUnit.SECONDS);
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public static void measureIO() {
|
||||
new Thread() {
|
||||
public void run() {
|
||||
measureIOFinished = false;
|
||||
try {
|
||||
_measureIO();
|
||||
} finally {
|
||||
measureIOFinished = true;
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
private static void _measureIO() {
|
||||
File file = getRecordingFile();
|
||||
Properties props = read(file, true);
|
||||
|
||||
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
|
||||
File workspace = root.getLocation().makeAbsolute().toFile();
|
||||
File locationDir = new File(workspace, "temp"); // here is workspace/temp dir
|
||||
File testFile = detectTestDataFile(locationDir);
|
||||
|
||||
if (testFile != null) {
|
||||
measureWrite(props, testFile);
|
||||
measureRead(props, testFile);
|
||||
|
||||
store(file, props);
|
||||
}
|
||||
}
|
||||
|
||||
private static void measureWrite(Properties props, File testFile) {
|
||||
int blockSize = blockSizeKb * KILOBYTE;
|
||||
|
||||
long startTime = System.nanoTime();
|
||||
long totalBytesWrittenInMark = writeIO(numOfBlocks, BlockSequence.RANDOM, blockSize, testFile);
|
||||
totalBytesWrittenInMark = totalBytesWrittenInMark + writeIO(numOfBlocks, BlockSequence.SEQUENTIAL, blockSize, testFile);
|
||||
long endTime = System.nanoTime();
|
||||
|
||||
long elapsedTimeNs = endTime - startTime;
|
||||
double sec = (double) elapsedTimeNs / (double) 1000000000;
|
||||
double mbWritten = (double) totalBytesWrittenInMark / (double) MEGABYTE;
|
||||
double bwMbSec = mbWritten / sec;
|
||||
|
||||
String ioCount = props.getProperty(StatisticKeys.IO_COUNT.get(), "0");
|
||||
String ioWAverageMbSec = props.getProperty(StatisticKeys.IO_W_AVERAGE_MB_SEC.get(), "0");
|
||||
String ioWMbSec = props.getProperty(StatisticKeys.IO_W_MB_SEC.get(), "0");
|
||||
|
||||
int digital_ioCount = Integer.parseInt(ioCount);
|
||||
double digital_ioWAverageMbSec = Double.parseDouble(ioWAverageMbSec);
|
||||
double digital_ioWMbSec = Double.parseDouble(ioWMbSec);
|
||||
|
||||
digital_ioWAverageMbSec = (digital_ioWAverageMbSec * digital_ioCount + bwMbSec) / (digital_ioCount + 1);
|
||||
digital_ioWMbSec = bwMbSec;
|
||||
|
||||
props.setProperty(StatisticKeys.IO_W_AVERAGE_MB_SEC.get(), format(digital_ioWAverageMbSec));
|
||||
props.setProperty(StatisticKeys.IO_W_MB_SEC.get(), format(digital_ioWMbSec));
|
||||
}
|
||||
|
||||
private static long writeIO(int numOfBlocks, BlockSequence blockSequence, int blockSize, File testFile) {
|
||||
byte[] blockArr = new byte[blockSize];
|
||||
for (int b = 0; b < blockArr.length; b++) {
|
||||
if (b % 2 == 0) {
|
||||
blockArr[b] = (byte) 0xFF;
|
||||
}
|
||||
}
|
||||
String mode = "rwd";// "rwd"
|
||||
|
||||
long totalBytesWrittenInMark = 0;
|
||||
try {
|
||||
try (RandomAccessFile rAccFile = new RandomAccessFile(testFile, mode)) {
|
||||
for (int b = 0; b < numOfBlocks; b++) {
|
||||
if (blockSequence == BlockSequence.RANDOM) {
|
||||
int rLoc = randInt(0, numOfBlocks - 1);
|
||||
rAccFile.seek(rLoc * blockSize);
|
||||
} else {
|
||||
rAccFile.seek(b * blockSize);
|
||||
}
|
||||
rAccFile.write(blockArr, 0, blockSize);
|
||||
totalBytesWrittenInMark += blockSize;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
}
|
||||
|
||||
return totalBytesWrittenInMark;
|
||||
}
|
||||
|
||||
private static File detectTestDataFile(File location) {
|
||||
if (!location.exists()) {
|
||||
location.mkdirs();
|
||||
}
|
||||
|
||||
File testFile = null;
|
||||
try {
|
||||
testFile = new File(location.getAbsolutePath() + File.separator + dataFile);
|
||||
testFile.deleteOnExit();
|
||||
testFile.createNewFile();
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
}
|
||||
|
||||
return testFile;
|
||||
}
|
||||
|
||||
public static void measureRead(Properties props, File testFile) {
|
||||
int blockSize = blockSizeKb * KILOBYTE;
|
||||
|
||||
long startTime = System.nanoTime();
|
||||
long totalBytesReadInMark = readIO(numOfBlocks, BlockSequence.RANDOM, blockSize, testFile);
|
||||
totalBytesReadInMark = totalBytesReadInMark + readIO(numOfBlocks, BlockSequence.SEQUENTIAL, blockSize, testFile);
|
||||
long endTime = System.nanoTime();
|
||||
long elapsedTimeNs = endTime - startTime;
|
||||
double sec = (double) elapsedTimeNs / (double) 1000000000;
|
||||
double mbRead = (double) totalBytesReadInMark / (double) MEGABYTE;
|
||||
double bwMbSec = mbRead / sec;
|
||||
|
||||
String ioCount = props.getProperty(StatisticKeys.IO_COUNT.get(), "0");
|
||||
String ioRAverageMbSec = props.getProperty(StatisticKeys.IO_R_AVERAGE_MB_SEC.get(), "0");
|
||||
String ioRMbSec = props.getProperty(StatisticKeys.IO_R_MB_SEC.get(), "0");
|
||||
|
||||
int digital_ioCount = Integer.parseInt(ioCount);
|
||||
double digital_ioRAverageMbSec = Double.parseDouble(ioRAverageMbSec);
|
||||
double digital_ioRMbSec = Double.parseDouble(ioRMbSec);
|
||||
digital_ioRAverageMbSec = (digital_ioRAverageMbSec * digital_ioCount + bwMbSec) / (digital_ioCount + 1);
|
||||
digital_ioRMbSec = bwMbSec;
|
||||
digital_ioCount++;
|
||||
|
||||
props.setProperty(StatisticKeys.IO_R_AVERAGE_MB_SEC.get(), format(digital_ioRAverageMbSec));
|
||||
props.setProperty(StatisticKeys.IO_R_MB_SEC.get(), format(digital_ioRMbSec));
|
||||
props.setProperty(StatisticKeys.IO_COUNT.get(), "" + digital_ioCount);
|
||||
}
|
||||
|
||||
public static String format(double dvalue) {
|
||||
return BigDecimal.valueOf(dvalue).setScale(2, RoundingMode.HALF_UP).toString();
|
||||
}
|
||||
|
||||
private static long readIO(int numOfBlocks, BlockSequence blockSequence, int blockSize, File testFile) {
|
||||
long totalBytesReadInMark = 0;
|
||||
|
||||
byte[] blockArr = new byte[blockSize];
|
||||
for (int b = 0; b < blockArr.length; b++) {
|
||||
if (b % 2 == 0) {
|
||||
blockArr[b] = (byte) 0xFF;
|
||||
}
|
||||
}
|
||||
try {
|
||||
try (RandomAccessFile rAccFile = new RandomAccessFile(testFile, "r")) {
|
||||
for (int b = 0; b < numOfBlocks; b++) {
|
||||
if (blockSequence == BlockSequence.RANDOM) {
|
||||
int rLoc = randInt(0, numOfBlocks - 1);
|
||||
rAccFile.seek(rLoc * blockSize);
|
||||
} else {
|
||||
rAccFile.seek(b * blockSize);
|
||||
}
|
||||
rAccFile.readFully(blockArr, 0, blockSize);
|
||||
totalBytesReadInMark += blockSize;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
}
|
||||
return totalBytesReadInMark;
|
||||
}
|
||||
|
||||
private static int randInt(int min, int max) {
|
||||
// nextInt is normally exclusive of the top value,
|
||||
// so add 1 to make it inclusive
|
||||
int randomNum = new Random().nextInt((max - min) + 1) + min;
|
||||
|
||||
return randomNum;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.commons.utils.time;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* DOC sbliu class global comment. Detailled comment
|
||||
*/
|
||||
public class TimeMeasurePerformance extends TimeMeasure{
|
||||
static private Logger logger;
|
||||
|
||||
private static HashMap<String, TimeStack> timers;
|
||||
|
||||
private static long startTime = -1L;
|
||||
|
||||
private static int indent = 0;
|
||||
|
||||
public static void begin(String idTimer) {
|
||||
startTime = System.nanoTime();
|
||||
|
||||
init();
|
||||
if (timers.containsKey(idTimer)) {
|
||||
log(indent(indent) + "Warning (start): timer " + idTimer + " already exists"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} else {
|
||||
indent++;
|
||||
TimeStack times = new TimeStack();
|
||||
timers.put(idTimer, times);
|
||||
log(indent(indent) + "Start '" + idTimer + "' ..."); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
private static void init() {
|
||||
if (timers == null) {
|
||||
timers = new HashMap<String, TimeStack>();
|
||||
}
|
||||
|
||||
if(logger == null) {
|
||||
configureLogger();
|
||||
}
|
||||
}
|
||||
|
||||
private static void log (String message) {
|
||||
logger.info(message);
|
||||
}
|
||||
|
||||
public static long end(String idTimer) {
|
||||
init();
|
||||
if (!timers.containsKey(idTimer)) {
|
||||
log(indent(indent) + "Warning (end): timer " + idTimer + " doesn't exist"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return -1;
|
||||
} else {
|
||||
TimeStack timeStack = timers.get(idTimer);
|
||||
timers.remove(idTimer);
|
||||
long elapsedTimeSinceLastRequest = timeStack.getLastStepElapsedTime();
|
||||
log(indent(indent) + "End '" + idTimer + "', elapsed time since last request: " //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ elapsedTimeSinceLastRequest + " ms "); //$NON-NLS-1$
|
||||
|
||||
long totalElapsedTime = timeStack.getTotalElapsedTime();
|
||||
|
||||
log(indent(indent) + "End '" + idTimer + "', total elapsed time: " + totalElapsedTime + " ms "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
indent--;
|
||||
return totalElapsedTime;
|
||||
}
|
||||
}
|
||||
|
||||
public static long step(String idTimer, String stepName) {
|
||||
init();
|
||||
if (!timers.containsKey(idTimer)) {
|
||||
log(indent(indent) + "Warning (end): timer " + idTimer + " does'nt exist"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return -1;
|
||||
} else {
|
||||
TimeStack timeStack = timers.get(idTimer);
|
||||
timeStack.addStep();
|
||||
/*
|
||||
* trace the timeline of every step,problem is that the code below " Calendar ca = Calendar.getInstance();
|
||||
* Date now = ca.getTime();" will cost almost 13ms~15ms
|
||||
*/
|
||||
long time = timeStack.getLastStepElapsedTime();
|
||||
String timerStepName = idTimer + "', step name '" + stepName; //$NON-NLS-1$
|
||||
|
||||
log(indent(indent)
|
||||
+ "-> '" + timerStepName + "', elapsed time since previous step: " + time + " ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
return time;
|
||||
}
|
||||
}
|
||||
|
||||
private static void configureLogger() {
|
||||
try {
|
||||
PerformanceLogManager logManager = new PerformanceLogManager();
|
||||
logger = logManager.getLogger(TimeMeasurePerformance.class.getName());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Error while initializing log properties.", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void afterStartup() {
|
||||
double elapsedTimeInSeconds = (double)(System.nanoTime() - startTime)/1000000000;
|
||||
PerformanceStatisticUtil.recordStartupEpapsedTime(elapsedTimeInSeconds);
|
||||
PerformanceStatisticUtil.measureIO();
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@ public abstract class ExtendedPushButton implements IExtendedPushButton {
|
||||
if (extendedControlModel == null) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
return !extendedControlModel.isReadonly();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,5 +94,9 @@ public abstract class AbstractExtendedControlModel {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean isReadonly() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -398,4 +398,9 @@ public class ExtendedTableModel<B> extends AbstractExtendedControlModel {
|
||||
this.tableViewer = tableViewer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadonly() {
|
||||
return super.isReadonly();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -212,4 +212,8 @@ public class CommonTextCellEditorWithProposal {
|
||||
return this.contentProposalAdapter;
|
||||
}
|
||||
|
||||
public int getPreviousActivatedIndex() {
|
||||
return previousActivatedIndex;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -97,4 +97,7 @@ public class ExtendedTextCellEditorWithProposal extends ExtendedTextCellEditor i
|
||||
super.fireCancelEditor();
|
||||
}
|
||||
|
||||
public CommonTextCellEditorWithProposal getCommonTextEditor() {
|
||||
return commonTextEditor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +117,7 @@ public class JobAndNodesParametersRelationshipHandler implements IItemRelationsh
|
||||
}
|
||||
}
|
||||
}
|
||||
relationsMap.values().removeIf(value -> value.isEmpty());
|
||||
return relationsMap;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.talend.core.repository.handlers;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.talend.core.model.properties.Item;
|
||||
@@ -43,8 +44,13 @@ public class JobRoutinesItemRelationshipHandler extends AbstractJobItemRelations
|
||||
Set<Relation> relationSet = new HashSet<Relation>();
|
||||
|
||||
if (processType.getParameters() != null && processType.getParameters().getRoutinesParameter() != null) {
|
||||
Map<String, String> currentSystemRoutinesMap = RelationshipItemBuilder.getInstance().getCurrentSystemRoutinesMap();
|
||||
for (Object o : processType.getParameters().getRoutinesParameter()) {
|
||||
RoutinesParameterType itemInfor = (RoutinesParameterType) o;
|
||||
if (currentSystemRoutinesMap.containsValue(itemInfor.getName())) {
|
||||
// exclude system routines relation
|
||||
continue;
|
||||
}
|
||||
|
||||
Relation addedRelation = new Relation();
|
||||
addedRelation.setId(itemInfor.getName());
|
||||
|
||||
@@ -67,4 +67,9 @@ public class SyncLibrariesLoginTask extends AbstractLoginTask implements IRunnab
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRequiredAlways() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -837,8 +837,8 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
Object fullFolder = getFullFolder(project, type, relativeFolder);
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true);
|
||||
if (serializableAllVersion.isEmpty()) {
|
||||
// look in all folders
|
||||
serializableAllVersion = getSerializable(project, id, false, false);
|
||||
// look in all folders for this item type
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, true, true, true, true);
|
||||
}
|
||||
int size = serializableAllVersion.size();
|
||||
|
||||
|
||||
@@ -270,6 +270,8 @@ public interface IRepositoryFactory {
|
||||
|
||||
public void create(Project project, Item item, IPath path, boolean... isImportItem) throws PersistenceException;
|
||||
|
||||
public void save(Project project, Item item, boolean isMigrationTask) throws PersistenceException;
|
||||
|
||||
public void save(Project project, Item item) throws PersistenceException;
|
||||
|
||||
public void save(Project project, Property property) throws PersistenceException;
|
||||
|
||||
@@ -1066,6 +1066,9 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
}
|
||||
if (newProject != null && newProject.getEmfProject() != null) {
|
||||
List<FolderItem> folderItems = ProjectManager.getInstance().getFolders(newProject.getEmfProject());
|
||||
if (folderItems != null) {
|
||||
folderItems = new ArrayList<>(folderItems);
|
||||
}
|
||||
for (FolderItem folder : folderItems) {
|
||||
String folderName = folder.getProperty().getLabel();
|
||||
if (("process".equals(folderName) || "joblets".equals(folderName)) && folder.getChildren() != null
|
||||
|
||||
@@ -15,6 +15,7 @@ package org.talend.core.repository.model;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.beans.PropertyChangeSupport;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -71,7 +72,7 @@ import org.talend.commons.ui.gmf.util.DisplayUtils;
|
||||
import org.talend.commons.ui.runtime.exception.MessageBoxExceptionHandler;
|
||||
import org.talend.commons.utils.data.container.RootContainer;
|
||||
import org.talend.commons.utils.network.TalendProxySelector;
|
||||
import org.talend.commons.utils.time.TimeMeasure;
|
||||
import org.talend.commons.utils.time.TimeMeasurePerformance;
|
||||
import org.talend.commons.utils.workbench.resources.ResourceUtils;
|
||||
import org.talend.core.AbstractDQModelService;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
@@ -84,6 +85,7 @@ import org.talend.core.context.Context;
|
||||
import org.talend.core.context.RepositoryContext;
|
||||
import org.talend.core.exception.TalendInternalPersistenceException;
|
||||
import org.talend.core.hadoop.BigDataBasicUtil;
|
||||
import org.talend.core.model.general.ILibrariesService;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.metadata.MetadataTalendType;
|
||||
@@ -124,16 +126,20 @@ import org.talend.core.repository.constants.Constant;
|
||||
import org.talend.core.repository.constants.FileConstants;
|
||||
import org.talend.core.repository.i18n.Messages;
|
||||
import org.talend.core.repository.recyclebin.RecycleBinManager;
|
||||
import org.talend.core.repository.utils.LoginTaskRegistryReader;
|
||||
import org.talend.core.repository.utils.ProjectDataJsonProvider;
|
||||
import org.talend.core.repository.utils.RepositoryPathProvider;
|
||||
import org.talend.core.repository.utils.XmiResourceManager;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.repository.item.ItemProductKeys;
|
||||
import org.talend.core.runtime.services.IGenericWizardService;
|
||||
import org.talend.core.runtime.services.IMavenUIService;
|
||||
import org.talend.core.runtime.util.ItemDateParser;
|
||||
import org.talend.core.service.ICoreUIService;
|
||||
import org.talend.cwm.helper.SubItemHelper;
|
||||
import org.talend.cwm.helper.TableHelper;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.login.ILoginTask;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.ReferenceProjectProblemManager;
|
||||
import org.talend.repository.ReferenceProjectProvider;
|
||||
@@ -175,6 +181,8 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
|
||||
private boolean isCancelled;
|
||||
|
||||
private static final LoginTaskRegistryReader LOGIN_TASK_REGISTRY_READER = new LoginTaskRegistryReader();
|
||||
|
||||
@Override
|
||||
public synchronized void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (l == null) {
|
||||
@@ -224,6 +232,13 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
private ILibrariesService getLibrariesService() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibrariesService.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(ILibrariesService.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -874,6 +889,9 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
}
|
||||
|
||||
this.repositoryFactoryFromProvider.deleteObjectPhysical(project, object, version, fromEmptyRecycleBin);
|
||||
if (isFullLogonFinished()) {
|
||||
fireRepositoryPropertyChange(ERepositoryActionName.AFTER_DELETE.getName(), null, object);
|
||||
}
|
||||
// i18n
|
||||
// log.info("Physical deletion [" + objToDelete + "] by " + getRepositoryContext().getUser() + ".");
|
||||
String str[] = new String[] { object.toString(), getRepositoryContext().getUser().toString() };
|
||||
@@ -1208,6 +1226,28 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
return this.repositoryFactoryFromProvider.getLastVersion(project, ProcessUtils.getPureItemId(id), folderPath, type);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IRepositoryViewObject getLastVersion(String id, ERepositoryObjectType type)
|
||||
throws PersistenceException {
|
||||
return getLastVersion(id , "", type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryViewObject getLastVersion(String id, List<ERepositoryObjectType> types) throws PersistenceException {
|
||||
if (types != null) {
|
||||
IRepositoryViewObject object = null;
|
||||
for (ERepositoryObjectType type : types) {
|
||||
object = getLastVersion(id, type);
|
||||
if (object != null) {
|
||||
return object;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryViewObject getLastVersion(String id, String folderPath, ERepositoryObjectType type)
|
||||
throws PersistenceException {
|
||||
String objId = id;
|
||||
@@ -1219,7 +1259,25 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
return this.repositoryFactoryFromProvider.getLastVersion(project, objId, folderPath, type);
|
||||
}
|
||||
}
|
||||
return this.repositoryFactoryFromProvider.getLastVersion(projectManager.getCurrentProject(), objId , folderPath, type);
|
||||
return getLastRefVersion(projectManager.getCurrentProject(), objId , folderPath, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryViewObject getLastRefVersion(Project project, String id, String folderPath, ERepositoryObjectType type) throws PersistenceException {
|
||||
String projectLabel = ProcessUtils.getProjectLabelFromItemId(id);
|
||||
IRepositoryViewObject lastVersion = getLastVersion(project, ProcessUtils.getPureItemId(id), folderPath, type);
|
||||
if (lastVersion == null) {
|
||||
for (Project p : projectManager.getReferencedProjects(project)) {
|
||||
if (projectLabel != null && !projectLabel.equals(p.getTechnicalLabel())) {
|
||||
continue;
|
||||
}
|
||||
lastVersion = getLastRefVersion(p, id);
|
||||
if (lastVersion != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return lastVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1437,7 +1495,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
String folderName = parentPath.append(folderLabel).toString();
|
||||
boolean found = false;
|
||||
for (String existedFolder : folders) {
|
||||
if (folderName.toUpperCase().equals(existedFolder.toUpperCase())) {
|
||||
if (folderName.equalsIgnoreCase(existedFolder)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@@ -1541,14 +1599,15 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
|
||||
@Override
|
||||
public void save(Project project, Item item, boolean... isMigrationTask) throws PersistenceException {
|
||||
this.repositoryFactoryFromProvider.save(project, item);
|
||||
if (isMigrationTask == null || isMigrationTask.length == 0 || !isMigrationTask[0]) {
|
||||
this.repositoryFactoryFromProvider.save(project, item);
|
||||
boolean avoidGenerateProm = false;
|
||||
if (isMigrationTask != null && isMigrationTask.length == 2) {
|
||||
avoidGenerateProm = isMigrationTask[1];
|
||||
}
|
||||
fireRepositoryPropertyChange(ERepositoryActionName.SAVE.getName(), avoidGenerateProm, item);
|
||||
|
||||
} else {
|
||||
this.repositoryFactoryFromProvider.save(project, item, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2030,11 +2089,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
*/
|
||||
public void logOnProject(Project project, IProgressMonitor monitor) throws LoginException, PersistenceException {
|
||||
try {
|
||||
TimeMeasure.display = CommonsPlugin.isDebugMode();
|
||||
TimeMeasure.displaySteps = CommonsPlugin.isDebugMode();
|
||||
TimeMeasure.measureActive = CommonsPlugin.isDebugMode();
|
||||
|
||||
TimeMeasure.begin("logOnProject"); //$NON-NLS-1$
|
||||
TimeMeasurePerformance.begin("logOnProject"); //$NON-NLS-1$
|
||||
try {
|
||||
/**
|
||||
* init/check proxy selector, in case default proxy selector is not registed yet
|
||||
@@ -2078,6 +2133,20 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
this.repositoryFactoryFromProvider.beforeLogon(project);
|
||||
ProjectManager.getInstance().getBeforeLogonRecords().clear();
|
||||
ProjectManager.getInstance().getUpdatedRemoteHandlerRecords().clear();
|
||||
ILibrariesService librariesService = getLibrariesService();
|
||||
if (librariesService != null) {
|
||||
librariesService.setForceReloadCustomUri();
|
||||
}
|
||||
|
||||
ProjectDataJsonProvider.checkAndRectifyRelationShipSetting(project.getEmfProject());
|
||||
|
||||
// load additional jdbc
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
|
||||
IGenericWizardService service = GlobalServiceRegister.getDefault().getService(IGenericWizardService.class);
|
||||
if (service != null) {
|
||||
service.loadAdditionalJDBC();
|
||||
}
|
||||
}
|
||||
|
||||
// init dynamic distirbution after `beforeLogon`, before loading libraries.
|
||||
initDynamicDistribution(monitor);
|
||||
@@ -2099,7 +2168,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
throw new OperationCanceledException(""); //$NON-NLS-1$
|
||||
}
|
||||
// monitorWrap.worked(1);
|
||||
TimeMeasure.step("logOnProject", "beforeLogon"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
TimeMeasurePerformance.step("logOnProject", "beforeLogon"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Check project compatibility
|
||||
checkProjectCompatibility(project);
|
||||
@@ -2117,7 +2186,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
|
||||
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.synchronizeLibraries"), 1); //$NON-NLS-1$
|
||||
coreService.syncLibraries(currentMonitor);
|
||||
TimeMeasure.step("logOnProject", "Sync components libraries"); //$NON-NLS-1$
|
||||
TimeMeasurePerformance.step("logOnProject", "Sync components libraries"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
|
||||
@@ -2126,7 +2195,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
executeMigrations(project, true, currentMonitor);
|
||||
ProjectManager.getInstance().getMigrationRecords().clear();
|
||||
// monitorWrap.worked(1);
|
||||
TimeMeasure.step("logOnProject", "executeMigrations(beforeLogonTasks)"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
TimeMeasurePerformance.step("logOnProject", "executeMigrations(beforeLogonTasks)"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
|
||||
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.logonInProgress"), 1); //$NON-NLS-1$
|
||||
@@ -2134,7 +2203,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
this.repositoryFactoryFromProvider.logOnProject(project);
|
||||
ProjectManager.getInstance().getLogonRecords().clear();
|
||||
// monitorWrap.worked(1);
|
||||
TimeMeasure.step("logOnProject", "logOnProject"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
TimeMeasurePerformance.step("logOnProject", "logOnProject"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
emptyTempFolder(project);
|
||||
|
||||
@@ -2160,7 +2229,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
ProjectManager.getInstance().getMigrationRecords().clear();
|
||||
executeMigrations(project, false, currentMonitor);
|
||||
ProjectManager.getInstance().getMigrationRecords().clear();
|
||||
TimeMeasure.step("logOnProject", "executeMigrations(afterLogonTasks)"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
TimeMeasurePerformance.step("logOnProject", "executeMigrations(afterLogonTasks)"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if (monitor != null && monitor.isCanceled()) {
|
||||
throw new OperationCanceledException(""); //$NON-NLS-1$
|
||||
}
|
||||
@@ -2176,12 +2245,12 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
// clean workspace
|
||||
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.cleanWorkspace"), 1); //$NON-NLS-1$
|
||||
|
||||
TimeMeasure.step("logOnProject", "clean Java project"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
TimeMeasurePerformance.step("logOnProject", "clean Java project"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
if (workspace instanceof Workspace) {
|
||||
((Workspace) workspace).getFileSystemManager().getHistoryStore().clean(currentMonitor);
|
||||
}
|
||||
TimeMeasure.step("logOnProject", "clean workspace history"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
TimeMeasurePerformance.step("logOnProject", "clean workspace history"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
|
||||
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.synch.repo.items"), 1); //$NON-NLS-1$
|
||||
@@ -2207,12 +2276,12 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
if (monitor != null && monitor.isCanceled()) {
|
||||
throw new OperationCanceledException(""); //$NON-NLS-1$
|
||||
}
|
||||
TimeMeasure.step("logOnProject", "sync repository (routines/rules/beans)"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
TimeMeasurePerformance.step("logOnProject", "sync repository (routines/rules/beans)"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// log4j prefs
|
||||
if (coreUiService != null && coreService != null) {
|
||||
coreService.syncLog4jSettings(null);
|
||||
TimeMeasure.step("logOnProject", "sync log4j"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
TimeMeasurePerformance.step("logOnProject", "sync log4j"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -2221,6 +2290,8 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
// set the project mappings url
|
||||
System.setProperty("talend.mappings.url", url.toString()); // $NON-NLS-1$
|
||||
}
|
||||
// for new added mapping file, sync to project mapping folder
|
||||
MetadataTalendType.syncNewMappingFileToProject();
|
||||
} catch (SystemException e) {
|
||||
// ignore
|
||||
ExceptionHandler.process(e);
|
||||
@@ -2229,7 +2300,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
if (runProcessService != null && !isCommandLineLocalRefProject) {
|
||||
runProcessService.initializeRootPoms(monitor);
|
||||
|
||||
TimeMeasure.step("logOnProject", "install / setup root poms"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
TimeMeasurePerformance.step("logOnProject", "install / setup root poms"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
|
||||
ITDQRepositoryService tdqRepositoryService = GlobalServiceRegister.getDefault()
|
||||
@@ -2246,10 +2317,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
fullLogonFinished = true;
|
||||
this.repositoryFactoryFromProvider.afterLogon(monitor);
|
||||
} finally {
|
||||
TimeMeasure.end("logOnProject"); //$NON-NLS-1$
|
||||
TimeMeasure.display = false;
|
||||
TimeMeasure.displaySteps = false;
|
||||
TimeMeasure.measureActive = false;
|
||||
TimeMeasurePerformance.end("logOnProject"); //$NON-NLS-1$
|
||||
}
|
||||
String str[] = new String[] { getRepositoryContext().getUser() + "", projectManager.getCurrentProject() + "" }; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
log.info(Messages.getString("ProxyRepositoryFactory.log.loggedOn", str)); //$NON-NLS-1$
|
||||
@@ -2650,4 +2718,13 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
public RepositoryWorkUnit getWorkUnitInProgress() {
|
||||
return repositoryFactoryFromProvider.getWorkUnitInProgress();
|
||||
}
|
||||
|
||||
public void executeRequiredLoginTasks(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
ILoginTask[] allLoginTasks = LOGIN_TASK_REGISTRY_READER.getAllTaskListInstance();
|
||||
for (ILoginTask task : allLoginTasks) {
|
||||
if (task.isRequiredAlways()) {
|
||||
task.run(monitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,14 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.repository.model.dnd;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.components.IComponent;
|
||||
import org.talend.core.model.components.IComponentsService;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.SalesforceSchemaConnectionItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
@@ -28,6 +32,8 @@ import org.talend.repository.model.RepositoryNode;
|
||||
*/
|
||||
public class SalesforceComponentDndFilter extends DefaultRepositoryComponentDndFilter {
|
||||
|
||||
public static final String SALSEFORCE = "salesforce"; //$NON-NLS-1$
|
||||
|
||||
public static final String COMPONENT_T_SALSEFORCE_CONNECTION = "tSalesforceConnection"; //$NON-NLS-1$
|
||||
|
||||
public static final String COMPONENT_T_SALSEFORCE_WAVE_BULK_EXEC = "tSalesforceWaveBulkExec"; //$NON-NLS-1$
|
||||
@@ -98,7 +104,16 @@ public class SalesforceComponentDndFilter extends DefaultRepositoryComponentDndF
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (item instanceof ConnectionItem && SALSEFORCE.equalsIgnoreCase(((ConnectionItem) item).getTypeName())) {
|
||||
// Special for Javajet components: tSalesforceEinsteinBulkExec/tSalesforceEinsteinOutputBulkExec
|
||||
IComponentsService service = GlobalServiceRegister.getDefault().getService(IComponentsService.class);
|
||||
Collection<IComponent> componentAll = service.getComponentsFactory().readComponents();
|
||||
for (IComponent component : componentAll) {
|
||||
if (component.getName().startsWith("tSalesforceEinstein") && !components.contains(component)) { //$NON-NLS-1$
|
||||
components.add(component);
|
||||
}
|
||||
}
|
||||
}
|
||||
return components;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.talend.core.repository.recyclebin;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -26,6 +27,7 @@ import java.util.Set;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.PredicateUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
@@ -110,7 +112,8 @@ public class RecycleBinManager {
|
||||
List<IRepositoryViewObject> deletedObjects = new ArrayList<IRepositoryViewObject>();
|
||||
final EList<TalendItem> deletedItems = projectRecyclebins.get(project.getTechnicalLabel()).getDeletedItems();
|
||||
List<TalendItem> notDeletedItems = new ArrayList<TalendItem>();
|
||||
for (TalendItem deletedItem : deletedItems) {
|
||||
List<TalendItem> dup_deletedItems = new ArrayList<>(deletedItems);
|
||||
for (TalendItem deletedItem : dup_deletedItems) {
|
||||
try {
|
||||
final ERepositoryObjectType type = ERepositoryObjectType.getType(deletedItem.getType());
|
||||
// ignore the generated doc in recycle bin
|
||||
@@ -280,7 +283,40 @@ public class RecycleBinManager {
|
||||
resource = createRecycleBinResource(project);
|
||||
}
|
||||
resource.getContents().clear();
|
||||
recycleBin.setLastUpdate(new Date());
|
||||
EList<String> deletedFolders = recycleBin.getDeletedFolders();
|
||||
if (deletedFolders != null) {
|
||||
List<String> folders = new LinkedList<>(deletedFolders);
|
||||
Collections.sort(folders);
|
||||
deletedFolders.clear();
|
||||
deletedFolders.addAll(folders);
|
||||
}
|
||||
EList<TalendItem> deletedItems = recycleBin.getDeletedItems();
|
||||
if (deletedItems != null) {
|
||||
List<TalendItem> items = new LinkedList<>(deletedItems);
|
||||
items.sort((l, r) -> {
|
||||
if (l == null && r == null) {
|
||||
return 0;
|
||||
} else if (l == null) {
|
||||
return -1;
|
||||
} else if (r == null) {
|
||||
return 1;
|
||||
}
|
||||
int result = StringUtils.compare(l.getType(), r.getType());
|
||||
if (result != 0) {
|
||||
return result;
|
||||
}
|
||||
result = StringUtils.compare(l.getPath(), r.getPath());
|
||||
if (result != 0) {
|
||||
return result;
|
||||
}
|
||||
return StringUtils.compare(l.getId(), r.getId());
|
||||
});
|
||||
deletedItems.clear();
|
||||
deletedItems.addAll(items);
|
||||
}
|
||||
|
||||
// set date to null to avoid timezone conflict
|
||||
recycleBin.setLastUpdate(null);
|
||||
resource.getContents().add(recycleBin);
|
||||
EmfHelper.saveResource(resource);
|
||||
lastSavedRecycleBinMap.put(recycleBin, EcoreUtil.copy(recycleBin));
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -44,6 +45,7 @@ import org.talend.core.model.properties.Project;
|
||||
import org.talend.core.model.properties.StatAndLogsSettings;
|
||||
import org.talend.core.model.properties.Status;
|
||||
import org.talend.core.model.properties.impl.PropertiesFactoryImpl;
|
||||
import org.talend.core.model.relationship.RelationshipItemBuilder;
|
||||
import org.talend.core.repository.constants.FileConstants;
|
||||
import org.talend.core.repository.recyclebin.RecycleBinManager;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
@@ -217,6 +219,68 @@ public class ProjectDataJsonProvider {
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkAndRectifyRelationShipSetting(Project project) throws PersistenceException {
|
||||
File file = getSavingConfigurationFile(project.getTechnicalLabel(), FileConstants.RELATIONSHIP_FILE_NAME);
|
||||
if (file == null || !file.exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<ItemRelationsJson> itemRelationsJsonsList = null;
|
||||
TypeReference<List<ItemRelationsJson>> typeReference = new TypeReference<List<ItemRelationsJson>>() {
|
||||
};
|
||||
FileInputStream input = null;
|
||||
try {
|
||||
input = new FileInputStream(file);
|
||||
itemRelationsJsonsList = new ObjectMapper().readValue(new FileInputStream(file), typeReference);
|
||||
} catch (Exception e) {
|
||||
throw new PersistenceException(e);
|
||||
} finally {
|
||||
closeInputStream(input);
|
||||
}
|
||||
|
||||
if (itemRelationsJsonsList == null || itemRelationsJsonsList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Set<String> idVersionSet = new HashSet<String>();
|
||||
List<ItemRelationsJson> relationJsonList = new ArrayList<ItemRelationsJson>();
|
||||
Map<String, String> currentSystemRoutinesMap = RelationshipItemBuilder.getInstance().getCurrentSystemRoutinesMap();
|
||||
boolean needModify = false;
|
||||
for (ItemRelationsJson relationJson : itemRelationsJsonsList) {
|
||||
ItemRelationJson baseItem = relationJson.getBaseItem();
|
||||
String idversion = baseItem.getId() + ";" + baseItem.getVersion();
|
||||
if (idVersionSet.contains(idversion)) {
|
||||
// in case duplicate
|
||||
needModify = true;
|
||||
continue;
|
||||
}
|
||||
// remove system routines relation
|
||||
int originalSize = relationJson.getRelatedItems().size();
|
||||
relationJson.getRelatedItems()
|
||||
.removeIf(relatedItem -> RelationshipItemBuilder.ROUTINE_RELATION.equals(relatedItem.getType())
|
||||
&& currentSystemRoutinesMap.containsValue(relatedItem.getId()));
|
||||
if (relationJson.getRelatedItems().size() != originalSize) {
|
||||
needModify = true;
|
||||
}
|
||||
if (!relationJson.getRelatedItems().isEmpty()) {
|
||||
relationJsonList.add(relationJson);
|
||||
}
|
||||
idVersionSet.add(idversion);
|
||||
}
|
||||
|
||||
if (needModify) {
|
||||
// re-load to project
|
||||
if (relationJsonList != null && !relationJsonList.isEmpty()) {
|
||||
project.getItemsRelations().clear();
|
||||
for (ItemRelationsJson json : relationJsonList) {
|
||||
project.getItemsRelations().add(json.toEmfObject());
|
||||
}
|
||||
}
|
||||
// re-save relationship setting json file
|
||||
saveRelationShips(project);
|
||||
}
|
||||
}
|
||||
|
||||
private static void loadMigrationTaskSetting(Project project, IPath projectFolderPath) throws PersistenceException {
|
||||
File file = getLoadingConfigurationFile(projectFolderPath, FileConstants.MIGRATION_TASK_FILE_NAME);
|
||||
if (file != null && file.exists()) {
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Priority;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
@@ -37,6 +38,7 @@ import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.common.util.URI;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
@@ -69,6 +71,7 @@ import org.talend.core.model.properties.ValidationRulesConnectionItem;
|
||||
import org.talend.core.model.properties.helper.ByteArrayResource;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.repository.constants.FileConstants;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.utils.ResourceFilenameHelper.FileName;
|
||||
import org.talend.core.ui.ITestContainerProviderService;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
|
||||
@@ -647,6 +650,23 @@ public class XmiResourceManager {
|
||||
}
|
||||
|
||||
public void saveResource(Resource resource) throws PersistenceException {
|
||||
try {
|
||||
if (resource != null) {
|
||||
Object objectByType = EcoreUtil.getObjectByType(resource.getContents(), PropertiesPackage.eINSTANCE.getProject());
|
||||
if (objectByType != null) {
|
||||
Project project = (Project) objectByType;
|
||||
EList migrationTasks = project.getMigrationTask();
|
||||
if (migrationTasks != null && 1 < migrationTasks.size()) {
|
||||
org.talend.commons.exception.ExceptionHandler.process(new Exception("Bad saving logic for Project"),
|
||||
Priority.WARN);
|
||||
ProxyRepositoryFactory.getInstance().saveProject(new org.talend.core.model.general.Project(project));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
org.talend.commons.exception.ExceptionHandler.process(e);
|
||||
}
|
||||
EmfHelper.saveResource(resource);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ Export-Package: org.talend.commons.utils.generation,
|
||||
org.talend.core.model.business,
|
||||
org.talend.core.model.components,
|
||||
org.talend.core.model.context,
|
||||
org.talend.core.model.context.link,
|
||||
org.talend.core.model.general,
|
||||
org.talend.core.model.genhtml,
|
||||
org.talend.core.model.metadata,
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
<?xml version="1.0"?>
|
||||
<mapping>
|
||||
<dbms product="DATABRICKS_DELTA_LAKE" id="databricks_delta_lake_id" label="Mapping Delta Lake" default="true">
|
||||
<dbTypes>
|
||||
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="FLOAT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="DOUBLE" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="BIGINT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="INT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="TINYINT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="STRING" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="DECIMAL" ignoreLen="false" ignorePre="false"/>
|
||||
<dbType type="BOOLEAN" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="STRUCT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="MAP" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="ARRAY" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="DATE" ignoreLen="true" ignorePre="true"/>
|
||||
</dbTypes>
|
||||
|
||||
<language name="java">
|
||||
<talendToDbTypes><!-- Adviced mappings -->
|
||||
<talendType type="id_List"/>
|
||||
<talendType type="id_Boolean">
|
||||
<dbType type="BOOLEAN" default="true"/>
|
||||
</talendType>
|
||||
<talendType type="id_Byte">
|
||||
<dbType type="TINYINT" default="true"/>
|
||||
<dbType type="BIGINT"/>
|
||||
<dbType type="INT"/>
|
||||
<dbType type="SMALLINT"/>
|
||||
</talendType>
|
||||
<talendType type="id_byte[]"/>
|
||||
<talendType type="id_Character">
|
||||
<dbType type="STRING" default="true"/>
|
||||
</talendType>
|
||||
<talendType type="id_Date">
|
||||
<dbType type="TIMESTAMP" default="true"/>
|
||||
<dbType type="DATE"/>
|
||||
</talendType>
|
||||
<talendType type="id_BigDecimal">
|
||||
<dbType type="DECIMAL" default="true"/>
|
||||
<dbType type="BIGINT"/>
|
||||
<dbType type="FLOAT"/>
|
||||
<dbType type="DOUBLE"/>
|
||||
</talendType>
|
||||
<talendType type="id_Double">
|
||||
<dbType type="DOUBLE" default="true" />
|
||||
<dbType type="FLOAT"/>
|
||||
</talendType>
|
||||
<talendType type="id_Float">
|
||||
<dbType type="FLOAT" default="true" />
|
||||
<dbType type="DOUBLE"/>
|
||||
</talendType>
|
||||
<talendType type="id_Integer">
|
||||
<dbType type="INT" default="true" />
|
||||
<dbType type="BIGINT" />
|
||||
</talendType>
|
||||
<talendType type="id_Long">
|
||||
<dbType type="BIGINT" default="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Object">
|
||||
<dbType type="STRUCT" default="true" />
|
||||
<dbType type="MAP" />
|
||||
<dbType type="ARRAY" />
|
||||
</talendType>
|
||||
<talendType type="id_Short">
|
||||
<dbType type="SMALLINT" default="true" />
|
||||
<dbType type="INT" />
|
||||
</talendType>
|
||||
<talendType type="id_String">
|
||||
<dbType type="STRING" default="true"/>
|
||||
</talendType>
|
||||
</talendToDbTypes>
|
||||
<dbToTalendTypes><!-- Adviced mappings -->
|
||||
<dbType type="STRING">
|
||||
<talendType type="id_String" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="BOOLEAN">
|
||||
<talendType type="id_Boolean" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="DOUBLE">
|
||||
<talendType type="id_Double" default="true"/>
|
||||
<talendType type="id_BigDecimal"/>
|
||||
<talendType type="id_Float"/>
|
||||
</dbType>
|
||||
<dbType type="DECIMAL">
|
||||
<talendType type="id_BigDecimal" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="BIGINT">
|
||||
<talendType type="id_Long" default="true"/>
|
||||
<talendType type="id_Integer"/>
|
||||
</dbType>
|
||||
<dbType type="INT">
|
||||
<talendType type="id_Integer" default="true"/>
|
||||
<talendType type="id_Short"/>
|
||||
</dbType>
|
||||
<dbType type="SMALLINT">
|
||||
<talendType type="id_Short" default="true"/>
|
||||
<talendType type="id_Byte"/>
|
||||
</dbType>
|
||||
<dbType type="TINYINT">
|
||||
<talendType type="id_Byte" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="FLOAT">
|
||||
<talendType type="id_Float" default="true"/>
|
||||
<talendType type="id_Double"/>
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="STRUCT">
|
||||
<talendType type="id_Object" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="MAP">
|
||||
<talendType type="id_Object" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="ARRAY">
|
||||
<talendType type="id_Object" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="TIMESTAMP">
|
||||
<talendType type="id_Date" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="DATE">
|
||||
<talendType type="id_Date" default="true"/>
|
||||
</dbType>
|
||||
</dbToTalendTypes>
|
||||
</language>
|
||||
</dbms>
|
||||
</mapping>
|
||||
@@ -40,7 +40,7 @@
|
||||
<dbType type="SET" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="false" />
|
||||
<dbType type="TINYBLOB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TINYINT" ignorePre="true" />
|
||||
<dbType type="TINYINT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
<dbType type="CHAR" defaultLength="50" ignorePre="true"/>
|
||||
<dbType type="CHARACTER" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="CHARACTER VARYING" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DATE" ignoreLen="true" ignorePre="true" defaultPattern="dd-MM-yyyy" />
|
||||
<dbType type="DATETIME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" />
|
||||
<dbType type="DOUBLE PRECISION" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="UNSIGNED INT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="FLOAT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INTEGER" defaultLength="10" ignorePre="false" />
|
||||
<dbType type="NUMERIC" defaultLength="20" defaultPrecision="10"/>
|
||||
<dbType type="REAL" />
|
||||
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true" />
|
||||
@@ -175,6 +176,11 @@
|
||||
<talendType type="id_Short"/>
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<dbType type="INTEGER">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Short" />
|
||||
<talendType type="id_Long" />
|
||||
</dbType>
|
||||
<dbType type="NUMERIC">
|
||||
<talendType type="id_Double"/>
|
||||
<talendType type="id_Float"/>
|
||||
|
||||
@@ -100,6 +100,11 @@
|
||||
<xs:restriction base="xs:short"/>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="defaultPattern">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string"/>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="default" type="xs:boolean"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<extension-point id="hadoopConnectionCreator" name="Hadoop Connection Creator" schema="schema/hadoopConnectionCreator.exsd"/>
|
||||
<extension-point id="artifact_handler" name="Artifact Repository Handler" schema="schema/artifact_handler.exsd"/>
|
||||
<extension-point id="actionFilterDelegate" name="Action Filter delegate" schema="schema/actionFilterDelegate.exsd"/>
|
||||
<extension-point id="saveItemContextLinkService" name="Save Item Context Link Service" schema="schema/saveItemContextLinkService.exsd"/>
|
||||
|
||||
<extension
|
||||
point="org.talend.core.runtime.repositoryComponent_provider">
|
||||
@@ -53,4 +54,28 @@
|
||||
name="Talend">
|
||||
</category>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="org.talend.core.runtime.service">
|
||||
<Service
|
||||
class="org.talend.core.model.update.RepositoryContextUpdateService"
|
||||
serviceId="IRepositoryContextUpdateService">
|
||||
</Service>
|
||||
<Service
|
||||
class="org.talend.core.model.update.GenericDbContextUpdateService"
|
||||
serviceId="IRepositoryContextUpdateService">
|
||||
</Service>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.talend.core.runtime.saveItemContextLinkService">
|
||||
<creator
|
||||
class="org.talend.core.model.context.link.ProcessItemContextLinkService">
|
||||
</creator>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.talend.core.runtime.saveItemContextLinkService">
|
||||
<creator
|
||||
class="org.talend.core.model.context.link.ConnectionItemContextLinkService">
|
||||
</creator>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="org.talend.core.runtime" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.schema plugin="org.talend.core.runtime" id="saveItemContextLinkService" name="Save Item Context Link Service"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
Save the context link data for item which contain ContextType object
|
||||
The extension point must implements interface : org.talend.core.model.context.link.IItemContextLinkService
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.element />
|
||||
</appinfo>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<sequence minOccurs="1" maxOccurs="unbounded">
|
||||
<element ref="creator" minOccurs="1" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="creator">
|
||||
<complexType>
|
||||
<attribute name="class" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn=":org.talend.core.model.context.link.IItemContextLinkService"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="since"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
7.4.1
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="examples"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter extension point usage example here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="apiinfo"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
boolean accept(Item item);
|
||||
|
||||
boolean saveItemLink(Item item);
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
</schema>
|
||||
@@ -254,6 +254,34 @@ public final class ResourceUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Comment method "setFileContent".
|
||||
*
|
||||
* @param stream
|
||||
* @param file
|
||||
* @throws PersistenceException
|
||||
*/
|
||||
public static void setFileContent(InputStream stream, IFile file) throws PersistenceException {
|
||||
try {
|
||||
if (stream == null) {
|
||||
String msg = Messages.getString("resources.file.notCreated", file.getName(), //$NON-NLS-1$
|
||||
Messages.getString("ResourceUtils.streamNull")); //$NON-NLS-1$
|
||||
throw new PersistenceException(msg);
|
||||
}
|
||||
file.setContents(stream, true, false, null);
|
||||
} catch (CoreException e) {
|
||||
String msg = Messages.getString("resources.file.notCreated", file.getName(), e.getMessage()); //$NON-NLS-1$
|
||||
throw new PersistenceException(msg, e);
|
||||
} finally {
|
||||
try {
|
||||
if (stream != null) {
|
||||
stream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Convenience method to delete a file.<br/>
|
||||
*
|
||||
|
||||
@@ -12,35 +12,49 @@
|
||||
// ============================================================================
|
||||
package org.talend.core;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.talend.core.hadoop.repository.HadoopRepositoryUtil;
|
||||
import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
import org.talend.core.runtime.services.IGenericDBService;
|
||||
|
||||
/**
|
||||
* created by ldong on Mar 23, 2015 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class AbstractRepositoryContextUpdateService implements IRepositoryContextUpdateService {
|
||||
|
||||
@Override
|
||||
public void updateRelatedContextVariable(Connection con, String oldValue, String newValue) {
|
||||
|
||||
}
|
||||
|
||||
public abstract class AbstractRepositoryContextUpdateService implements IRepositoryContextUpdateService {
|
||||
protected IGenericDBService service = GlobalServiceRegister.getDefault().getService(IGenericDBService.class);
|
||||
protected String updateHadoopProperties(List<Map<String, Object>> hadoopProperties, String oldValue, String newValue) {
|
||||
String finalProperties = "";
|
||||
String finalProperties = null;
|
||||
boolean isModified = false;
|
||||
if (!hadoopProperties.isEmpty()) {
|
||||
for (Map<String, Object> propertyMap : hadoopProperties) {
|
||||
String propertyValue = (String) propertyMap.get("VALUE");
|
||||
if (propertyValue.equals(oldValue)) {
|
||||
propertyMap.put("VALUE", newValue);
|
||||
isModified = true;
|
||||
}
|
||||
}
|
||||
finalProperties = HadoopRepositoryUtil.getHadoopPropertiesJsonStr(hadoopProperties);
|
||||
if (isModified) {
|
||||
finalProperties = HadoopRepositoryUtil.getHadoopPropertiesJsonStr(hadoopProperties);
|
||||
}
|
||||
}
|
||||
return finalProperties;
|
||||
}
|
||||
|
||||
protected boolean updateCompPropertiesContextParameter(Connection conn, String oldValue, String newValue) {
|
||||
boolean isModified = false;
|
||||
Map<String, String> oldToNewHM = new HashMap<String, String>();
|
||||
oldToNewHM.put(oldValue, newValue);
|
||||
String compProperties = conn.getCompProperties();
|
||||
if (service != null && StringUtils.isNotBlank(compProperties)) {
|
||||
service.updateCompPropertiesForContextMode(conn, oldToNewHM);
|
||||
isModified = true;
|
||||
}
|
||||
return isModified;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
@@ -247,4 +249,29 @@ public class GlobalServiceRegister {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List findAllService(Class klass) {
|
||||
List serviceList = new ArrayList();
|
||||
String key = klass.getName();
|
||||
IConfigurationElement[] configElements = getConfigurationElements();
|
||||
if (configElements != null) {
|
||||
for (IConfigurationElement element : configElements) {
|
||||
if (element.isValid()) {
|
||||
String id = element.getAttribute("serviceId"); //$NON-NLS-1$
|
||||
if (!key.endsWith(id)) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
Object service = element.createExecutableExtension("class"); //$NON-NLS-1$
|
||||
if (klass.isInstance(service)) {
|
||||
serviceList.add(service);
|
||||
};
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return serviceList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,5 +20,7 @@ import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
*/
|
||||
public interface IRepositoryContextUpdateService extends IService {
|
||||
|
||||
public void updateRelatedContextVariable(Connection con, String oldValue, String newValue);
|
||||
public boolean accept(Connection connection);
|
||||
|
||||
public boolean updateContextParameter(Connection conn, String oldValue, String newValue);
|
||||
}
|
||||
|
||||
@@ -20,9 +20,23 @@ import org.talend.core.model.process.INode;
|
||||
public interface ITDQCryptoFileService extends IService {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param node
|
||||
* Get Original value if it is context variable
|
||||
*/
|
||||
public void generateCryptoFile(INode node);
|
||||
public String getOriginalValue(INode node, String input);
|
||||
|
||||
/**
|
||||
* Check whether all the parameter is validation
|
||||
*/
|
||||
public boolean checkParameterValidation(String cryptoFilePath, String passwordM1);
|
||||
|
||||
/**
|
||||
* Get the name of encrypty method
|
||||
*/
|
||||
public String getCryptoMethod();
|
||||
|
||||
/**
|
||||
* Generate Encrypty file
|
||||
*/
|
||||
public void generateCryptoFile(String passwordM1, String cryptoMethod, String cryptoFilePath);
|
||||
|
||||
}
|
||||
|
||||
@@ -214,5 +214,5 @@ public interface ITDQRepositoryService extends IService {
|
||||
/**
|
||||
* @param chooseContext the context name which want to swtich
|
||||
*/
|
||||
void popupSwitchContextFailedMessage(String chooseContext);
|
||||
boolean popupSwitchContextFailedMessage(String chooseContext);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ public enum EDatabaseTypeName {
|
||||
"IBM DB2 ZOS", "IBM DB2 ZOS", Boolean.TRUE, "IBM_DB2", "DB2", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
SYBASEASE(
|
||||
"SybaseASE", "Sybase (ASE and IQ)", Boolean.TRUE, "SYBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
SYBASEASE_SA(
|
||||
"SybaseASE", "SQL Anywhere", Boolean.TRUE, "SYBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
// this Sybase IQ not used.
|
||||
SYBASEIQ(
|
||||
@@ -228,10 +230,10 @@ public enum EDatabaseTypeName {
|
||||
return getTypeFromDispalyNameOriginal(dbType);
|
||||
}
|
||||
for (EDatabaseTypeName typename : EDatabaseTypeName.values()) {
|
||||
if (typename.getXmlName().toUpperCase().equals(dbType.toUpperCase())) {
|
||||
if (typename.getXmlName().equalsIgnoreCase(dbType)) {
|
||||
return typename;
|
||||
}
|
||||
if (typename.getProduct().toUpperCase().equals(dbType.toUpperCase())) {
|
||||
if (typename.getProduct().equalsIgnoreCase(dbType)) {
|
||||
return typename;
|
||||
}
|
||||
}
|
||||
@@ -243,10 +245,10 @@ public enum EDatabaseTypeName {
|
||||
return getTypeFromDisplayNameOriginal(dbType, isDefault);
|
||||
}
|
||||
for (EDatabaseTypeName typename : EDatabaseTypeName.values()) {
|
||||
if (typename.getXmlName().toUpperCase().equals(dbType.toUpperCase())) {
|
||||
if (typename.getXmlName().equalsIgnoreCase(dbType)) {
|
||||
return typename;
|
||||
}
|
||||
if (typename.getProduct().toUpperCase().equals(dbType.toUpperCase())) {
|
||||
if (typename.getProduct().equalsIgnoreCase(dbType)) {
|
||||
return typename;
|
||||
}
|
||||
}
|
||||
@@ -262,7 +264,7 @@ public enum EDatabaseTypeName {
|
||||
return MYSQL;
|
||||
}
|
||||
for (EDatabaseTypeName typename : EDatabaseTypeName.values()) {
|
||||
if (typename.getDisplayName().toLowerCase().equals(displayName.toLowerCase())) {
|
||||
if (typename.getDisplayName().equalsIgnoreCase(displayName)) {
|
||||
return typename;
|
||||
}
|
||||
}
|
||||
@@ -280,7 +282,7 @@ public enum EDatabaseTypeName {
|
||||
return null;
|
||||
}
|
||||
for (EDatabaseTypeName typename : EDatabaseTypeName.values()) {
|
||||
if (typename.getDisplayName().toLowerCase().equals(displayName.toLowerCase())) {
|
||||
if (typename.getDisplayName().equalsIgnoreCase(displayName)) {
|
||||
return typename;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,6 +186,10 @@ public class ConnParameterKeys {
|
||||
|
||||
public static final String CONN_PARA_KEY_HDI_PASSWORD = "CONN_PARA_KEY_HDI_PASSWORD"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_AZURE_HDINSIGHT_STORAGE = "CONN_PARA_KEY_AZURE_HDINSIGHT_STORAGE"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_AZURE_HDINSIGHT_STORAGE_USE_TLS = "CONN_PARA_KEY_AZURE_HDINSIGHT_STORAGE_USE_TLS"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_AZURE_HOSTNAME = "CONN_PARA_KEY_AZURE_HOSTNAME"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_AZURE_CONTAINER = "CONN_PARA_KEY_AZURE_CONTAINER"; //$NON-NLS-1$
|
||||
|
||||