From 9ef61cd68b4f0a6b9a5c75ac98cabbfca7b62110 Mon Sep 17 00:00:00 2001 From: Peter Murphy Date: Mon, 10 Feb 2025 17:08:48 +0000 Subject: [PATCH] Sort and apply attributes once per table partition --- code/processes/tickerlogreplay.q | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/code/processes/tickerlogreplay.q b/code/processes/tickerlogreplay.q index 9635132f7..b56a0f80f 100644 --- a/code/processes/tickerlogreplay.q +++ b/code/processes/tickerlogreplay.q @@ -165,13 +165,9 @@ checkcount:{[h;p;counter;td] .replay.currentcount:0]} // function used to finish off the replay -// generally this will be to re-sort the table, and set an attribute finishreplay:{[h;p;td] // save down any tables which haven't been saved savetab[td;h;p] each tabsincountorder[.replay.tablestoreplay]; - // sort data and apply the attributes - if[sortafterreplay;applysortandattr[.replay.pathlist]]; - // invoke any user defined post replay function .save.postreplay[h;p]; } @@ -190,7 +186,7 @@ replaylog:{[logfile] [.lg.o[`replay;"skipping first ",(string firstmessage)," messages"]; @[`.;`upd;:;.replay.initialupd]]; @[`.;`upd;:;.replay.realupd]]; - .replay.tablecounts:.replay.errorcounts:.replay.pathlist:()!(); + .replay.tablecounts:.replay.errorcounts:()!(); // If not running in segmented mode, reset replay date and clean HDB directory on each loop .replay.zipped:$[logfile like "*.gz";1b;0b]; @@ -415,7 +411,9 @@ initandrun:{ // Replay all logs and exit .lg.o[`initandrun;"Replaying the following log(s): ",csv sv 1_'string .replay.logstoreplay]; + .replay.pathlist:()!(); .replay.replaylog each .replay.logstoreplay; + if[sortafterreplay;applysortandattr[.replay.pathlist]]; if[partandmerge;postreplaymerge[tempdir;.replay.replaydate;hdbdir]]; .lg.o[`replay;"replay complete"]; if[.replay.exitwhencomplete;exit 0];