refactor: simplify batch processing by removing partition dependency and introducing batch accumulator
This commit is contained in:
@@ -27,7 +27,6 @@ func sendBatch(ctx context.Context, chBatchesOut chan<- models.Batch, batch mode
|
||||
|
||||
func flush(
|
||||
ctx context.Context,
|
||||
partition *models.Partition,
|
||||
batchSize int,
|
||||
batchRows []models.UnknownRowValues,
|
||||
chBatchesOut chan<- models.Batch,
|
||||
@@ -36,7 +35,7 @@ func flush(
|
||||
return nil
|
||||
}
|
||||
|
||||
batch := models.Batch{Id: uuid.New(), PartitionId: partition.Id, Rows: batchRows}
|
||||
batch := models.Batch{Id: uuid.New(), Rows: batchRows}
|
||||
batchRows = make([]models.UnknownRowValues, 0, batchSize)
|
||||
return sendBatch(ctx, chBatchesOut, batch)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user