refactor(asapedgeprocessor): split god-object files into warm/cold/ingest/flush units - #448
Merged
Merged
Conversation
…gest/flush units Pure file-level reorganization within package asapedgeprocessor. No behavior change: the set of 106 top-level declarations is identical to main, and build/vet/test are green (go test ok in ~1.8s, same as before). Source splits: - processor.go (667L) -> processor.go (struct+ctor+lifecycle+forward) + ingest.go (ConsumeMetrics/consumeMetric/attr decode/shard key) + flush.go (flushLoop/flushAll/flushShardWarmCold/flushSum/appendSum) + shard.go (shard struct) + cold_encoder.go (encoder create/drain + cold-part ship/seal helpers) - config.go -> config.go (schema: types/consts/structs) + config_validate.go (normalized/valid/eligibility/Validate/familyFor) - coldpart_path.go -> cold_intchunk_shipper.go + cold_intchunk_accum.go Renames to warm_*/cold_* convention (git mv, blame preserved): - shipper.go -> cold_fragment_shipper.go, spool.go -> cold_spool.go, sum.go -> warm_sum.go, sketch.go -> warm_sketch.go Test files realigned where the mapping is 1:1 (sum_path->warm_sum, sketch_path->warm_sketch, cold_path->cold_fragment, coldpart_path->cold_intchunk, spool->cold_spool, stagger_path->flush_stagger). Scenario tests with no clean 1:1 target (all_families, sample_p_path, tier_path, smooth_flush, cold_density) are left as-is rather than lossily merged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Pure file-level reorganization of the
asapedgeprocessorpackage: break up the 667-line god-objectprocessor.goand rename the rest to a consistentwarm_*/cold_*/flush_*/ingestconvention. No behavior change.Why
processor.gohad grown to own OTel lifecycle, ingest traversal, shard locking, warm sum/sketch flush, cold fragment + intchunk cold-part shipping, accumulation, and shutdown sealing all at once. This splits those concerns into navigable files without changing any logic, as a low-risk first step before any deeper package extraction.Source changes
processor.go(667L)processor.go(struct + ctor + lifecycle + forward),ingest.go,flush.go,shard.go,cold_encoder.goconfig.goconfig.go(schema: types/consts/structs),config_validate.go(normalized/valid/eligibility/Validate/familyFor)coldpart_path.gocold_intchunk_shipper.go,cold_intchunk_accum.goshipper.gocold_fragment_shipper.gospool.gocold_spool.gosum.go/sketch.gowarm_sum.go/warm_sketch.goRenames use
git mvto preserve blame; thecoldpart_path.gosplit keeps blame on the accumulator half.Test files
Renamed the 6 that map 1:1 (
sum_path→warm_sum,sketch_path→warm_sketch,cold_path→cold_fragment,coldpart_path→cold_intchunk,spool→cold_spool,stagger_path→flush_stagger). The cross-cutting scenario tests (all_families,sample_p_path,tier_path,smooth_flush,cold_density) are left as-is rather than lossily merged.Verification
main(diff empty).go build ./...,go vet ./...,go test ./...all green —okin ~1.8s, same as the pre-change baseline.gofmt -lclean across the package.🤖 Generated with Claude Code