[Cleanup] Audit and clean up no-op deprecated methods and internal dead code
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
Start by checking the listed methods and classes in wayang-core, wayang-basic, and wayang-api-sql, then search for their call sites and tests before removing anything. The issue proposes phased cleanup but leaves the final removal scope and compatibility decisions open; done means obsolete internal usages are migrated, the affected modules pass their tests, and cleaned call sites no longer emit deprecation warnings.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Issue Description
While auditing the codebase across wayang-core, wayang-basic, wayang-spark, wayang-flink, and wayang-api-sql, several obsolete @Deprecated / @deprecated methods, unused constructor parameters, commented-out stubs, and broken legacy ML classes were identified.
Examples include:
- Methods documented with
@deprecated This method does not do anything, anymore.or@deprecated not needed anymorethat have zero callers (e.g.,Slot.setCardinalityEstimate,Slot.getCardinalityEstimatereturning a hardcoded stubCardinalityEstimate(42, 42, 0.42), andChannelInitializer.unchecked()). - An unused
@Deprecatedconstructor parameter (ExecutionTaskFlow(Collection<ExecutionTask>, Set<Channel>)) whoseinputChannelsargument is completely ignored and whose internal caller passes an always-empty set fromExecutionTaskFlowCompiler. - Internal call sites (
SanityChecker,PlanTransformation, integration/unit tests) still calling deprecatedPlanTraversal,WayangPlan.addSink, andFunctionDescriptor.setLoadEstimatorsAPIs instead of their recommended replacements. - A superseded
@DeprecatedMLModelTransformstack (ModelTransformOperator,SparkModelTransformOperator,ModelTransformMapping) wired toSparkMLModel.transform(...), which unconditionally throwsUnsupportedOperationException. - Missing
@Deprecatedannotations where only Javadoc@deprecatedtags exist, and inconsistent deprecation metadata across modules.
Addressing this in small, focused PRs will:
- Remove Dead Code & Stubs: Eliminate misleading dummy implementations (
42cardinality stubs, ignored parameters, commented-out methods). - Eliminate Internal Deprecation Warnings: Migrate internal and test call sites onto modern Wayang APIs without breaking external users.
- Align Deprecation Metadata: Make future major-version (
2.0) removal candidates explicit and consistent.
Verified Audit Findings
1. Zero-Caller No-Op & Dead Code in wayang-core
org.apache.wayang.core.plan.wayangplan.Slot:setCardinalityEstimate(CardinalityEstimate): Body is entirely commented out; marked@deprecated This method does not do anything, anymore.(0 callers).getCardinalityEstimate(): Returns hardcoded dummynew CardinalityEstimate(42, 42, 0.42); marked@deprecated These method does not do anything, anymore.(0 callers), alongside commented-outmark().
org.apache.wayang.core.plan.executionplan.ChannelInitializer:default ChannelInitializer unchecked(): Marked Javadoc@deprecated not needed anymore(no@Deprecatedannotation, 0 callers).
org.apache.wayang.core.optimizer.enumeration.ExecutionTaskFlow&ExecutionTaskFlowCompiler:@Deprecated ExecutionTaskFlow(Collection<ExecutionTask>, Set<Channel>): Completely ignoresinputChannels; only called internally byExecutionTaskFlow.recreateFrom(...), passingExecutionTaskFlowCompiler.getInputChannels(), whose population is commented out (// this.inputChannels.add(channelCopy)).
2. Internal Callers Still Using Deprecated APIs
org.apache.wayang.core.plan.wayangplan.PlanTraversal:@Deprecated PlanTraversal(boolean, boolean)is still called directly inSanityCheckerandPlanTransformationinstead ofPlanTraversal.fanOut(),PlanTraversal.downstream(), andPlanTraversal.upstream().
org.apache.wayang.core.plan.wayangplan.WayangPlan:@Deprecated addSink(Operator)is still called across unit/integration tests (ReduceByMappingTest,PlanTransformationTest,SubplanPatternTest,WayangPlans) instead ofWayangPlan(Operator...).
org.apache.wayang.core.function.FunctionDescriptor:setLoadEstimators(LoadEstimator, LoadEstimator)(Javadoc@deprecated Use #setLoadProfileEstimator(LoadProfileEstimator) instead., missing@Deprecatedannotation) is still called inWordCountIT.
3. Broken / Superseded Legacy ML Stack (wayang-basic & wayang-spark)
ModelTransformOperator(wayang-basic),SparkModelTransformOperator(wayang-spark),ModelTransformMapping(wayang-spark, registered inspark.mapping.Mappings), andSparkMLModel.transform(JavaRDD):- Superseded by
PredictOperator/PredictOperators/SparkPredictOperator/PredictMapping. SparkMLModel.transform(...)unconditionally throwsUnsupportedOperationException("This method has been deprecated. Please use predict instead."), and no callers or tests remain forModelTransformOperator.
- Superseded by
4. Deprecation Metadata & Scheduled Major-Version Removals
- Methods with Javadoc
@deprecatedbut missing@Deprecatedruntime annotation:ChannelInitializer.unchecked()(if kept),FunctionDescriptor.setLoadEstimators(...),ReduceOperator.createGroupedReduce(...), andorg.apache.wayang.flink.mapping.Mappings.BASIC_MAPPINGS. - Active/scheduled deprecations to preserve until next major version (
2.0) and track clearly:org.apache.wayang.api.sql.calcite.jdbc.JdbcSchema.createDialect(DataSource)(@Deprecated // to be removed before 2.0).ObjectFileSerializationMode.LEGACY_JAVA_SERIALIZATION,ObjectFileSink.useLegacySerialization(), andObjectFileSource.useLegacySerialization().ExecutionOperator.getLoadProfileEstimatorConfigurationKey()andExecutionOperator.getSupportedOutputChannels(int)(still widely overridden/used internally; out of scope for immediate removal).
Proposed Phased Scope & PR Sequence
To keep reviews small and safe, I propose splitting this cleanup into two phases with 2 small, independently testable PRs per phase:
Phase 1: Safe Dead Code Removal & Internal Caller Migration (Non-Breaking)
- PR 1 — Remove zero-caller dead no-ops and commented-out stubs in
wayang-core- Remove
Slot.setCardinalityEstimate(CardinalityEstimate),Slot.getCardinalityEstimate(), and the commented-outmark()block inSlot.java. - Remove
ChannelInitializer.unchecked(). - Remove
@Deprecated ExecutionTaskFlow(Collection<ExecutionTask>, Set<Channel>), switchExecutionTaskFlow.recreateFrom(...)toExecutionTaskFlow(Collection<ExecutionTask>), and remove deadinputChannels/getInputChannels()inExecutionTaskFlowCompiler.
- Remove
- PR 2 — Migrate internal and test callers off deprecated core APIs
- Update
SanityCheckerandPlanTransformationto usePlanTraversal.fanOut(),downstream(), andupstream()instead ofnew PlanTraversal(boolean, boolean). - Migrate test callers (
ReduceByMappingTest,PlanTransformationTest,SubplanPatternTest,WayangPlans) offWayangPlan.addSink(Operator)tonew WayangPlan(Operator...)(keepingaddSinkin place forPlanTransformation.replaceand external compatibility). - Migrate
WordCountIToffFunctionDescriptor.setLoadEstimators(...)tosetLoadProfileEstimator(new NestableLoadProfileEstimator(...)).
- Update
Phase 2: Superseded ModelTransform Removal & Deprecation Metadata Alignment
- PR 3 — Remove broken
@DeprecatedModelTransformML classes (pending maintainer approval)- Remove
ModelTransformOperator,SparkModelTransformOperator,ModelTransformMapping(and its entry inorg.apache.wayang.spark.mapping.Mappings), plusSparkMLModel.transform(JavaRDD)which throwsUnsupportedOperationException. - Verify
PredictOperator/SparkPredictOperatorintegration and unit tests pass cleanly.
- Remove
- PR 4 — Standardize
@Deprecatedannotations and major-version tracking- Add missing
@Deprecatedannotations matching existing Javadoc@deprecatedtags (FunctionDescriptor.setLoadEstimators,ReduceOperator.createGroupedReduce,org.apache.wayang.flink.mapping.Mappings.BASIC_MAPPINGS). - Standardize
since/forRemovalmetadata (e.g., onJdbcSchema.createDialect(DataSource)andModelTransform*if maintainers prefer deferring PR 3 removal until2.0). - Optionally document a follow-up migration path for
ExecutionOperator.getLoadProfileEstimatorConfigurationKey()andgetSupportedOutputChannels(int)if desired.
- Add missing
| PR | Phase | Scope | Breaking? | Depends on |
|---|---|---|---|---|
| PR 1 | Phase 1 | Remove zero-caller stubs in Slot, ChannelInitializer, ExecutionTaskFlow/Compiler |
No (0 callers, no-ops) | - |
| PR 2 | Phase 1 | Migrate internal & test callers (PlanTraversal, WayangPlan.addSink, FunctionDescriptor.setLoadEstimators) |
No (keeps signatures) | - |
| PR 3 | Phase 2 | Remove broken @Deprecated ModelTransform stack & SparkMLModel.transform |
Minimal (0 callers; throws UnsupportedOperationException) |
Maintainer sign-off |
| PR 4 | Phase 2 | Align missing @Deprecated annotations and forRemoval metadata for 2.0 |
No | PR 1–2 |
Verification & Testing
- Run unit and integration tests for
wayang-core,wayang-basic,wayang-spark,wayang-flink,wayang-api-sql, andwayang-tests-integrationafter each PR. - Check compiler deprecation warnings (
-Xlint:deprecation) before and after PR 2 and PR 4. - Run
apache-rat:checkacross all touched modules.
Questions for Maintainers
- Are the zero-caller no-op removals in PR 1 (
Slotdummy42stubs,ChannelInitializer.unchecked(),ExecutionTaskFlowunused parameter) acceptable for1.1.x/1.2.x? - Should PR 3 remove the broken
ModelTransformclasses now, or keep them withforRemoval = trueuntil2.0? - Would you like
@Deprecated(since = ..., forRemoval = true)applied consistently in PR 4 for items slated for2.0removal?
- Lingua principale
- Java
- Stelle
- 284
- Fork
- 143
- Merge medio
- 2g 6h
- PR unite (30g)
- 16
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/wayang
-
JavaReservoirSampleOperator returns the whole input when the dataset size is unknownForse già presa @sasmith-14 l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/wayang#884 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Record.compareTo() throws ClassCastException when comparing recordsForse già presa @harshitsingh070 l’ha presa 64 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
Unused parameter in function ProjectionDescriptor.createPojoJavaImplementation()Forse già presa @AliRana30 l’ha presa 72 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/wayang#732 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Add ClickHouse platform support (wayang-clickhouse)Forse già presa @ekas-7 l’ha presa 6 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
apache/wayang#871 · 8 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[PyWayang] Implement load_collection() and collect()Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/wayang
Issue simili
-
area-templates triage:bot-seen triage:needs-human
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/aspire#22356 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/flink-agents#1395 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
floci-io/floci#8666 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
microsoft/kiota-java#2257 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
openhab/openhab-core#5992 ·
I maintainer di solito rispondono entro 1 giorno