ComposantsComponents › DiversMisc
Ajoute les lignes d'un flux au tampon du job : une liste en mémoire, propre à chaque exécution du job. Elle sert à renvoyer des lignes au job parent, qui les reçoit par la sortie de son tRunJob, ou à les relire plus loin dans le même job avec un tBufferInput. Un job n'a qu'un tampon : tous ses tBufferOutput y ajoutent leurs lignes, et rien ne le vide avant la fin du job. Adds the rows of a flow to the job buffer: an in-memory list that belongs to each run of the job. It is used to return rows to the parent job, which receives them through the output of its tRunJob, or to read them again later in the same job with a tBufferInput. A job has only one buffer: all its tBufferOutput components add their rows to it, and nothing empties it before the end of the job.
EntréeInput
Main un flux, obligatoireone flow, required
SortieOutput
Main facultatif : les lignes repartent telles quellesoptional: the rows go on unchanged
Déclencheurs en sortieOutput triggers
On Component Ok On Component Error Run if
ChildJob
MyJob
Le job enfant remplit son tampon. Quand il a fini, le tRunJob du job parent envoie chaque ligne du tampon dans son lien de sortie, convertie selon son propre schéma. The child job fills its buffer. When it has finished, the tRunJob of the parent job sends each row of the buffer into its output link, converted according to its own schema.
Le tBufferInput relit tout le tampon, dans un sous-job lancé après celui du tBufferOutput. The tBufferInput reads the whole buffer, in a subjob run after the one of the tBufferOutput.
Le libellé est celui de l'onglet Composant ; le nom technique, en gris, est celui du paramètre dans le fichier du job. Le composant n'a pas d'autre paramètre, ni de paramètres avancés propres. The label is the one of the Component tab; the technical name, in grey, is the parameter name in the job file. The component has no other setting, and no advanced settings of its own.
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| SchémaSchemaSCHEMA | — | ToujoursAlways | Les colonnes gardées, dans leur ordre. Elles viennent du lien entrant. Pour la suite, seul l'ordre compte : le tBufferInput ou le tRunJob qui relit les lignes prend les valeurs par position, pas par nom (voir l'exemple). The kept columns, in their order. They come from the incoming link. Afterwards, only the order matters: the tBufferInput or the tRunJob that reads the rows takes the values by position, not by name (see the example). |
Chaque ligne est rangée comme un tableau de textes (String[]), une case par colonne du schéma, dans l'ordre. Celui qui relit le tampon reconvertit chaque case dans le type de sa propre colonne (voir l'exemple).
Each row is stored as an array of texts (String[]), one cell per schema column, in order. Whoever reads the buffer converts each cell back to the type of its own column (see the example).
1234.5 ou true. Un BigDecimal est d'abord arrondi à la précision de la colonne, si elle est renseignée : avec 2, 3.14159 est gardé 3.14.Numbers and booleans: their Java writing, such as 1234.5 or true. A BigDecimal is first rounded to the precision of the column, if it is set: with 2, 3.14159 is kept as 3.14."dd-MM-yyyy" donne 11-11-2026).Dates: written with the date pattern of the column ("dd-MM-yyyy" gives 11-11-2026).byte[] : décodé en texte avec l'encodage par défaut de la machine Java (voir l'Encodage du tBufferInput).byte[]: decoded into text with the default encoding of the Java machine (see the Encoding of the tBufferInput).null reste null.null stays null.
Aucune : le composant ne fournit pas de NB_LINE. Le nombre de lignes relues est le NB_LINE du tBufferInput.
None: the component gives no NB_LINE. The number of rows read is the NB_LINE of the tBufferInput.
Le tampon lui-même est un champ du job, globalBuffer, une List<String[]> qu'un tJava peut lire :
The buffer itself is a field of the job, globalBuffer, a List<String[]> that a tJava can read:
System.out.println(globalBuffer.size());
Les sorties sont celles de la console, copiées depuis une exécution du job. Les tLogRow sont en mode Simple ; certains affichent leur nom unique. Le job parent s'appelle ici MyJob, le job enfant ChildJob.
The outputs are the console ones, copied from a run of the job. The tLogRow components are in Basic mode; some print their unique name. The parent job is called MyJob here, the child job ChildJob.
ChildJob
MyJob
| idInteger | nameString |
|---|---|
| 1 | Ada |
| 2 | Grace |
Le job enfant met ces deux lignes dans son tampon. Dans le parent, le tRunJob_1 a le même schéma que le tBufferOutput_1, et le tBufferInput_1 aussi. Code du tJava_1 : The child job puts these two rows in its buffer. In the parent, tRunJob_1 has the same schema as tBufferOutput_1, and so does tBufferInput_1. tJava_1 code:
System.out.println("tBufferInput_1_NB_LINE: " + globalMap.get("tBufferInput_1_NB_LINE"));
[tLogRow_1] 1|Ada [tLogRow_1] 2|Grace tBufferInput_1_NB_LINE: 0
Les lignes du job enfant arrivent par la sortie du tRunJob_1. Elles ne vont pas dans le tampon du parent : son tBufferInput_1 ne lit rien. À l'inverse, un tBufferInput du job enfant ne voit pas le tampon du parent (exemple). The rows of the child job arrive through the output of tRunJob_1. They do not go into the buffer of the parent: its tBufferInput_1 reads nothing. Conversely, a tBufferInput of the child job does not see the buffer of the parent (example).
tLoop de 1 à 2 ; le tRunJob_1 lance le même ChildJob.
tLoop from 1 to 2; tRunJob_1 runs the same ChildJob.
1|Ada 2|Grace 1|Ada 2|Grace
Chaque lancement repart d'un tampon vide : le parent reçoit les deux lignes de chaque lancement, sans celles des lancements précédents. Each run starts with an empty buffer: the parent receives the two rows of each run, without those of the previous runs.
Les deux lignes du premier exemple, dans un seul job. The two rows of the first example, in a single job.
[tLogRow_1] 1|Ada [tLogRow_1] 2|Grace [tLogRow_2] 1|Ada [tLogRow_2] 2|Grace
Le tBufferOutput garde les lignes et les passe aussi, inchangées, au composant suivant. The tBufferOutput keeps the rows and also passes them, unchanged, to the next component.
tFixedFlowInput_1 : colonnes id (Integer), name (1 Ada, 2 Grace). tFixedFlowInput_2 : colonnes code (Integer), label, city (10 Alan Manchester, 11 Margaret Boston). tBufferInput_1 : colonnes id (Integer), name, city.
tFixedFlowInput_1: columns id (Integer), name (1 Ada, 2 Grace). tFixedFlowInput_2: columns code (Integer), label, city (10 Alan Manchester, 11 Margaret Boston). tBufferInput_1: columns id (Integer), name, city.
1|Ada| 2|Grace| 10|Alan|Manchester 11|Margaret|Boston
Un seul tampon : les lignes s'y suivent dans l'ordre d'exécution, chacune avec son nombre de valeurs. code et label sont lus par position dans id et name ; les lignes du tBufferOutput_1 n'ont que deux valeurs, city y reste vide (null).
A single buffer: the rows follow one another in run order, each with its number of values. code and label are read by position into id and name; the rows of tBufferOutput_1 only have two values, city stays empty there (null).
Colonnes id (Integer), price (Double), day (Date, modèle "dd-MM-yyyy"), active (Boolean). Deux lignes : 1, 1234.5, TalendDate.parseDate("yyyy-MM-dd", "2026-11-11"), true ; puis 2, null, null, false. Le tBufferInput_1 a les mêmes colonnes, toutes en String ; le tBufferInput_2 a le schéma du tBufferOutput_1. Code du tJava_1 :
Columns id (Integer), price (Double), day (Date, pattern "dd-MM-yyyy"), active (Boolean). Two rows: 1, 1234.5, TalendDate.parseDate("yyyy-MM-dd", "2026-11-11"), true; then 2, null, null, false. tBufferInput_1 has the same columns, all String; tBufferInput_2 has the schema of tBufferOutput_1. tJava_1 code:
String[] first = globalBuffer.get(0);
System.out.println("Values: " + first.length + " " + first[0].getClass().getSimpleName());
[tLogRow_1] 1|1234.5|11-11-2026|true [tLogRow_1] 2|||false [tLogRow_2] 1|1234.5|11-11-2026|true [tLogRow_2] 2|||false Values: 4 String
Le tBufferInput_1 montre le texte rangé : la date est écrite avec le modèle de la colonne, les null restent null. Le tBufferInput_2 reconvertit ce texte dans les types de son schéma.
tBufferInput_1 shows the stored text: the date is written with the pattern of the column, the null values stay null. tBufferInput_2 converts this text back to the types of its schema.
Le job parent du premier exemple, réduit au tRunJob_1 relié au tLogRow_1 (sans nom unique). Les noms des jobs sont remplacés par MyJob et ChildJob, les traces sont abrégées.
The parent job of the first example, reduced to tRunJob_1 connected to tLogRow_1 (without unique name). The job names are replaced with MyJob and ChildJob, the traces are shortened.
Le tRunJob_1 a les colonnes name (String), puis id (Integer).
tRunJob_1 has the columns name (String), then id (Integer).
Exception in component tRunJob_1 (MyJob) java.lang.NumberFormatException: For input string: "Ada" at …
Les valeurs sont prises par position : la 2e, Ada, arrive dans id, un Integer. Le parent s'arrête avec le code 1.
The values are taken by position: the 2nd one, Ada, goes into id, an Integer. The parent stops with code 1.
Le job enfant n'a qu'un tJava : System.out.println("Child job: no tBufferOutput");. Le tRunJob_1 garde ses colonnes id, name.
The child job only has a tJava: System.out.println("Child job: no tBufferOutput");. tRunJob_1 keeps its columns id, name.
Child job: no tBufferOutput 0|
Le tRunJob envoie quand même une ligne : le code de retour du job enfant (0) dans la 1re colonne, rien dans les autres.
The tRunJob still sends one row: the exit code of the child job (0) in the 1st column, nothing in the others.
Utiliser un processus indépendant pour exécuter le sous-Job coché sur le tRunJob_1. Use an independent process to run subjob checked on tRunJob_1.
when tRunJob runs in an independent process, it can't extract datas from tBufferOutput of child job. |
Le tRunJob écrit ce message sur la sortie d'erreur, puis envoie une seule ligne, vide : les lignes du tampon ne reviennent pas. Le job se termine avec le code 0. The tRunJob writes this message on the error output, then sends a single row, empty: the rows of the buffer do not come back. The job ends with code 0.
Exécuté seul, et non par un tRunJob, le job enfant garde ses lignes dans le tampon puis s'arrête : elles sont perdues, la console reste vide. Pour le tester seul, ajoutez un tLogRow après le tBufferOutput : les lignes le traversent (exemple). Run alone, and not by a tRunJob, the child job keeps its rows in the buffer and then stops: they are lost, the console stays empty. To test it alone, add a tLogRow after the tBufferOutput: the rows go through it (example).
Copier le schéma du Job enfant, sur le tRunJob, reprend le schéma d'un seul tBufferOutput du job enfant, le premier trouvé. Avec plusieurs tBufferOutput, gardez le même ordre de colonnes et les mêmes types dans tous. Copy Child Job Schema, on the tRunJob, takes the schema of a single tBufferOutput of the child job, the first one found. With several tBufferOutput components, keep the same column order and the same types in all of them.
Le tampon appartient à une exécution du job : le parent et l'enfant ont chacun le leur, et chaque lancement par un tRunJob part d'un tampon vide. Pendant l'exécution, rien ne le vide : relu, il reste plein, et un tBufferOutput dans une boucle y ajoute ses lignes à chaque itération. The buffer belongs to one run of the job: the parent and the child each have their own, and each run by a tRunJob starts with an empty buffer. During the run, nothing empties it: once read, it stays full, and a tBufferOutput in a loop adds its rows at each iteration.
Toutes les lignes, sous forme de texte, occupent la mémoire de la JVM jusqu'à la fin du job. Pour un gros volume, prévoyez la mémoire (-Xmx) ou passez par un fichier.
All the rows, as text, use the memory of the JVM until the end of the job. For a large volume, plan the memory (-Xmx) or go through a file.
La classe Java du job renvoie le tampon, en String[][], par sa méthode runJob(String[] args) : c'est elle qu'appelle le tRunJob. Sans tBufferOutput dans le job, elle renvoie une seule ligne, le code de retour (voir les pièges).
The Java class of the job returns the buffer, as String[][], through its runJob(String[] args) method: this is what the tRunJob calls. Without tBufferOutput in the job, it returns a single row, the exit code (see the pitfalls).
Pour garder dans un même job plusieurs ensembles de lignes séparés, avec leurs types, prenez tHashOutput et tHashInput : chaque tHashOutput a son propre cache. To keep several separate sets of rows in one job, with their types, use tHashOutput and tHashInput: each tHashOutput has its own cache.
tBufferInput · relit le tampon du jobreads the job buffertRunJob · lance un job enfant et reçoit ses lignesruns a child job and receives its rowstHashOutput · garde les lignes d'un flux dans un cache en mémoirekeeps the rows of a flow in an in-memory cachetHashInput · relit le cache d'un tHashOutputreads the cache of a tHashOutputtLoop · exécute un sous-job en boucleruns a subjob in a looptLogRow · afficher les lignes d'un fluxdisplay the rows of a flow