ComposantsComponents › TechniqueTechnical
Relit les lignes gardées en mémoire par un tHashOutput du même job et les envoie dans un flux. Le même cache se relit autant de fois que nécessaire, par un ou plusieurs tHashInput, tant qu'il n'est pas vidé. Reads the rows kept in memory by a tHashOutput of the same job and sends them into a flow. The same cache can be read as many times as needed, by one or several tHashInput components, as long as it is not cleared.
EntréeInput
Aucune : il commence son sous-job. Sinon un lien Iterate. None: it starts its subjob. Otherwise one Iterate link.
SortieOutput
Main un flux : les lignes du cacheone flow: the rows of the cache
Déclencheurs en sortieOutput triggers
On Subjob Ok On Subjob Error On Component Ok On Component Error Run if
Le tHashInput commence un sous-job qui s'exécute une fois le cache rempli : la source n'est lue qu'une fois, ses lignes servent ensuite où il faut. The tHashInput starts a subjob that runs once the cache is filled: the source is read only once, its rows are then used where needed.
Deux tHashInput lisent le même tHashOutput, l'un après l'autre. Cochez Vider le cache après lecture sur le dernier seulement. Two tHashInput components read the same tHashOutput, one after the other. Check Clear cache after reading on the last one only.
Le tHashInput est masqué par défaut : il n'est pas dans la palette tant qu'il n'est pas affiché dans les paramètres du projet. Le réglage est enregistré dans le projet : il vaut pour tous ses jobs et pour tous ceux qui ouvrent le projet. Faites-le en même temps pour le tHashOutput, masqué lui aussi. The tHashInput is hidden by default: it is not in the palette until it is shown in the project settings. The setting is saved in the project: it applies to all its jobs and to everyone who opens the project. Do it at the same time for the tHashOutput, which is hidden too.
Les libellés Hide, Show, PaletteFilter et Apply and Close sont en anglais, même dans le Studio en français. Un composant déjà utilisé dans un job du projet ne peut pas être masqué de nouveau : le Studio le laisse visible et le signale. The Hide, Show, PaletteFilter and Apply and Close labels are in English, even in the French Studio. A component already used in a job of the project cannot be hidden again: the Studio leaves it visible and says so.
Les libellés sont ceux de l'onglet Composant ; le nom technique, en gris, est celui du paramètre dans le fichier du job. Le composant n'a pas de paramètres avancés propres. Labels are those of the Component tab; the technical name, in grey, is the parameter name in the job file. The component has no advanced settings of its own.
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| SchémaSchemaSCHEMA | — | ToujoursAlways | Les colonnes envoyées dans le flux. Les valeurs du cache y sont copiées par position, pas par nom : la 1re colonne du tHashOutput dans la 1re colonne, et ainsi de suite. The columns sent into the flow. The cache values are copied into them by position, not by name: the 1st column of the tHashOutput into the 1st column, and so on. |
| Relier à un tHashOutputLink with a tHashOutputLINK_WITH | OuiYes | ToujoursAlways | Coché et grisé : le tHashInput lit toujours le cache d'un tHashOutput. Checked and greyed out: the tHashInput always reads the cache of a tHashOutput. |
| Liste des composantsComponent listLIST | — | ToujoursAlways | Le tHashOutput du job dont le cache est lu. S'il est relié à un autre tHashOutput, c'est le cache commun qui est lu, avec toutes ses lignes (voir l'exemple). The tHashOutput of the job whose cache is read. If it is linked with another tHashOutput, the common cache is read, with all its rows (see the example). |
| Vider le cache après lectureClear cache after readingRELEASE_CACHE | NonNo | ToujoursAlways | Une fois toutes les lignes lues, efface le cache, avec celui des tHashOutput qui lui sont reliés : la mémoire est libérée, mais une lecture suivante du même cache échoue. À cocher sur la dernière lecture (voir l'exemple). Once all the rows are read, clears the cache, along with that of the tHashOutput components linked to it: the memory is freed, but a later read of the same cache fails. To check on the last read (see the example). |
Un tFixedFlowInput envoie trois lignes à un tHashOutput_1. Les sorties sont celles de la console, copiées depuis une exécution du job ; les tLogRow affichent leur nom unique devant chaque ligne. Dans les erreurs, le nom du job est remplacé par MyJob et les traces sont abrégées.
A tFixedFlowInput sends three rows to a tHashOutput_1. The outputs are the console ones, copied from a run of the job; the tLogRow components print their unique name in front of each row. In the errors, the job name is replaced with MyJob and the traces are shortened.
| idInteger | nameString | cityString |
|---|---|---|
| 1 | Ada | London |
| 2 | Grace | New York |
| 3 | Alan | Manchester |
Les deux tHashInput lisent le tHashOutput_1, Vider le cache après lecture décoché : chacun reçoit les trois lignes. Both tHashInput components read tHashOutput_1, Clear cache after reading unchecked: each one receives the three rows.
[tLogRow_1] 1|Ada|London [tLogRow_1] 2|Grace|New York [tLogRow_1] 3|Alan|Manchester [tLogRow_2] 1|Ada|London [tLogRow_2] 2|Grace|New York [tLogRow_2] 3|Alan|Manchester
Même job, Vider le cache après lecture coché sur le tHashInput_1 : le tHashInput_2 ne trouve plus rien à lire. Same job, Clear cache after reading checked on tHashInput_1: tHashInput_2 finds nothing left to read.
[tLogRow_1] 1|Ada|London [tLogRow_1] 2|Grace|New York [tLogRow_1] 3|Alan|Manchester Exception in component tHashInput_2 (MyJob) java.lang.RuntimeException: The hash is not initialized : The hash must exist before you read from it at demo.myjob_0_1.MyJob.tHashInput_2Process(MyJob.java:2729) …
Le job s'arrête avec le code de sortie 1. The job stops with exit code 1.
Le job de l'exemple Relier à un tHashOutput : tHashOutput_1 reçoit id, name (1 Ada, 2 Grace) ; tHashOutput_2, relié au premier, reçoit code, label (10 Alan, 11 Margaret). Le tHashInput_2 lit le tHashOutput_2 avec le schéma code (Integer), label (String). Extrait : les lignes de son tLogRow_2.
The job of the Link with a tHashOutput example: tHashOutput_1 receives id, name (1 Ada, 2 Grace); tHashOutput_2, linked with the first one, receives code, label (10 Alan, 11 Margaret). tHashInput_2 reads tHashOutput_2 with the schema code (Integer), label (String). Excerpt: the rows of its tLogRow_2.
[tLogRow_2] 1|Ada [tLogRow_2] 2|Grace [tLogRow_2] 10|Alan [tLogRow_2] 11|Margaret
Le cache commun est lu en entier, et les valeurs de id et name arrivent dans code et label : seule la position compte.
The common cache is read in full, and the values of id and name arrive in code and label: only the position matters.
Un seul tHashInput, suivi par On Subjob Ok d'un tJava : A single tHashInput, followed through On Subjob Ok by a tJava:
System.out.println("tHashOutput_1_NB_LINE: " + globalMap.get("tHashOutput_1_NB_LINE"));
System.out.println("tHashInput_1_NB_LINE: " + globalMap.get("tHashInput_1_NB_LINE"));
1|Ada|London 2|Grace|New York 3|Alan|Manchester tHashOutput_1_NB_LINE: 3 tHashInput_1_NB_LINE: 3
Ici le tLogRow est réglé par défaut, sans nom unique. Avec Garder le premier sur le tHashOutput, les deux nombres peuvent différer : voir la gestion des clés. Here the tLogRow has its default settings, without the unique name. With Keep first on the tHashOutput, the two numbers can differ: see keys management.
Deux sous-jobs sans lien entre eux, celui du tHashInput placé en premier : il s'exécute d'abord. Two subjobs without a link between them, the tHashInput one placed first: it runs first.
Exception in component tHashInput_1 (MyJob) java.lang.RuntimeException: The hash is not initialized : The hash must exist before you read from it at demo.myjob_0_1.MyJob.tHashInput_1Process(MyJob.java:902) …
Le même message apparaît quand le cache a été vidé par un tHashInput précédent (voir plus haut). Reliez le sous-job du tHashOutput à celui du tHashInput par On Subjob Ok. The same message appears when the cache was cleared by an earlier tHashInput (see above). Connect the subjob of the tHashOutput to the one of the tHashInput with On Subjob Ok.
NB_LINE (Integer, disponible après l'exécution du composant) : nombre de lignes lues dans le cache. NB_LINE (Integer, available after the component has run): number of rows read from the cache.
((Integer) globalMap.get("tHashInput_1_NB_LINE"))
Les noms des colonnes ne sont pas comparés, seule leur position compte : deux colonnes de même type inversées dans un des schémas échangent leurs valeurs, sans message. Après un changement du schéma du tHashOutput, reportez-le dans le tHashInput. Column names are not compared, only their position matters: two columns of the same type swapped in one of the schemas exchange their values, without a message. After a change to the schema of the tHashOutput, apply it to the tHashInput too.
Le cache reste en mémoire jusqu'à la fin du job. Sur un gros volume, cochez Vider le cache après lecture sur le dernier tHashInput qui le lit. The cache stays in memory until the end of the job. On a large volume, check Clear cache after reading on the last tHashInput that reads it.
Les lignes sortent dans leur ordre d'arrivée avec Garder tout sur le tHashOutput. Avec Garder le premier ou Garder le dernier, l'ordre n'est pas garanti : triez ensuite si besoin. The rows come out in their arrival order with Keep all on the tHashOutput. With Keep first or Keep last, the order is not guaranteed: sort afterwards if needed.
Quand un même flux traverse au moins deux composants de fusion (tUnite), le code généré range les lignes dans un tHashOutput puis les relit par un tHashInput qui vide le cache après lecture. Leurs noms, comme tHashInput_tUnite_1, peuvent apparaître dans les messages d'erreur.
When a same flow goes through at least two merge components (tUnite), the generated code stores the rows in a tHashOutput then reads them back with a tHashInput that clears the cache after reading. Their names, such as tHashInput_tUnite_1, can appear in error messages.
tHashOutput · garde les lignes d'un flux en mémoirekeeps the rows of a flow in memorytArray · range les lignes dans une liste Java de globalMapstores the rows in a Java list in globalMaptArrayIn · partie interne de tIterateToFlow et tDenormalizeinternal part of tIterateToFlow and tDenormalizetLogRow · afficher les lignes d'un fluxdisplay the rows of a flow