Skip to content

Commit 1ee63fa

Browse files
authored
Sort and apply attributes once per table partition (#694)
1 parent d844917 commit 1ee63fa

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

code/processes/tickerlogreplay.q

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,9 @@ checkcount:{[h;p;counter;td]
165165
.replay.currentcount:0]}
166166

167167
// function used to finish off the replay
168-
// generally this will be to re-sort the table, and set an attribute
169168
finishreplay:{[h;p;td]
170169
// save down any tables which haven't been saved
171170
savetab[td;h;p] each tabsincountorder[.replay.tablestoreplay];
172-
// sort data and apply the attributes
173-
if[sortafterreplay;applysortandattr[.replay.pathlist]];
174-
175171
// invoke any user defined post replay function
176172
.save.postreplay[h;p];
177173
}
@@ -190,7 +186,7 @@ replaylog:{[logfile]
190186
[.lg.o[`replay;"skipping first ",(string firstmessage)," messages"];
191187
@[`.;`upd;:;.replay.initialupd]];
192188
@[`.;`upd;:;.replay.realupd]];
193-
.replay.tablecounts:.replay.errorcounts:.replay.pathlist:()!();
189+
.replay.tablecounts:.replay.errorcounts:()!();
194190

195191
// If not running in segmented mode, reset replay date and clean HDB directory on each loop
196192
.replay.zipped:$[logfile like "*.gz";1b;0b];
@@ -415,7 +411,9 @@ initandrun:{
415411

416412
// Replay all logs and exit
417413
.lg.o[`initandrun;"Replaying the following log(s): ",csv sv 1_'string .replay.logstoreplay];
414+
.replay.pathlist:()!();
418415
.replay.replaylog each .replay.logstoreplay;
416+
if[sortafterreplay;applysortandattr[.replay.pathlist]];
419417
if[partandmerge;postreplaymerge[tempdir;.replay.replaydate;hdbdir]];
420418
.lg.o[`replay;"replay complete"];
421419
if[.replay.exitwhencomplete;exit 0];

0 commit comments

Comments
 (0)