julianhyde/optiq — pull request #189 by jinfengni (2014-03-17 21:48:05+00:00)
Title: Add a way to specify list of TraitDefs that will be used by planner when...

Hi Julian,

This is the code change to support user to explicitly specify the list of RelTraitDef to register with VolcalnoPlanner, when user call Frameworks.getPlanner(). If user provides such list, then, the planner will de-register any existing RelTraitDef, before register the RelTraitDef in the provided list.

This code change has two purposes. 1) User could specify the list of RelTraitDef, 2) User could specify the order of importance of each RelTraitDef. (The order of importance will determine the sequence call of RelTraitDef's in VolcalnoPlanner.changeTraitsUsingConvert() method. )

I also added a unit test case in PlannerTest:testPlanWithExplicitTraitDefs(). This test is almost same as PlannerTest:testPlan(), except the former uses an explicitly specified list of RelTraitDef, when creates the planner.