Rename BestOtherFit -> OkayFit.

The previous order of fitness was

  BestFit > GoodFit > BestOtherFit > ...

which is baffling.  It's now:

  BestFit > GoodFit > OkayFit > ...

which won't break anyone's expectations.
This commit is contained in:
Alex Miller 2018-05-08 23:54:28 -07:00
parent fcfa00928b
commit 6c2cb25c53
2 changed files with 12 additions and 12 deletions

View File

@ -66,9 +66,9 @@ ProcessClass::Fitness ProcessClass::machineClassFitness( ClusterRole role ) cons
case ProcessClass::StatelessClass:
return ProcessClass::GoodFit;
case ProcessClass::ResolutionClass:
return ProcessClass::BestOtherFit;
return ProcessClass::OkayFit;
case ProcessClass::TransactionClass:
return ProcessClass::BestOtherFit;
return ProcessClass::OkayFit;
case ProcessClass::UnsetClass:
return ProcessClass::UnsetFit;
case ProcessClass::TesterClass:
@ -83,9 +83,9 @@ ProcessClass::Fitness ProcessClass::machineClassFitness( ClusterRole role ) cons
case ProcessClass::StatelessClass:
return ProcessClass::GoodFit;
case ProcessClass::ResolutionClass:
return ProcessClass::BestOtherFit;
return ProcessClass::OkayFit;
case ProcessClass::TransactionClass:
return ProcessClass::BestOtherFit;
return ProcessClass::OkayFit;
case ProcessClass::UnsetClass:
return ProcessClass::UnsetFit;
case ProcessClass::TesterClass:
@ -100,7 +100,7 @@ ProcessClass::Fitness ProcessClass::machineClassFitness( ClusterRole role ) cons
case ProcessClass::StatelessClass:
return ProcessClass::GoodFit;
case ProcessClass::TransactionClass:
return ProcessClass::BestOtherFit;
return ProcessClass::OkayFit;
case ProcessClass::UnsetClass:
return ProcessClass::UnsetFit;
case ProcessClass::TesterClass:
@ -115,9 +115,9 @@ ProcessClass::Fitness ProcessClass::machineClassFitness( ClusterRole role ) cons
case ProcessClass::StatelessClass:
return ProcessClass::GoodFit;
case ProcessClass::ResolutionClass:
return ProcessClass::BestOtherFit;
return ProcessClass::OkayFit;
case ProcessClass::TransactionClass:
return ProcessClass::BestOtherFit;
return ProcessClass::OkayFit;
case ProcessClass::UnsetClass:
return ProcessClass::UnsetFit;
case ProcessClass::TesterClass:
@ -128,15 +128,15 @@ ProcessClass::Fitness ProcessClass::machineClassFitness( ClusterRole role ) cons
case ProcessClass::ClusterController:
switch( _class ) {
case ProcessClass::ClusterControllerClass:
return ProcessClass::BestFit;
return ProcessClass::BestFit;
case ProcessClass::StatelessClass:
return ProcessClass::GoodFit;
case ProcessClass::MasterClass:
return ProcessClass::BestOtherFit;
return ProcessClass::OkayFit;
case ProcessClass::ResolutionClass:
return ProcessClass::BestOtherFit;
return ProcessClass::OkayFit;
case ProcessClass::ProxyClass:
return ProcessClass::BestOtherFit;
return ProcessClass::OkayFit;
case ProcessClass::UnsetClass:
return ProcessClass::UnsetFit;
case ProcessClass::TesterClass:

View File

@ -27,7 +27,7 @@
struct ProcessClass {
// This enum is stored in restartInfo.ini for upgrade tests, so be very careful about changing the existing items!
enum ClassType { UnsetClass, StorageClass, TransactionClass, ResolutionClass, TesterClass, ProxyClass, MasterClass, StatelessClass, LogClass, ClusterControllerClass, LogRouterClass, InvalidClass = -1 };
enum Fitness { BestFit, GoodFit, BestOtherFit, UnsetFit, WorstFit, ExcludeFit, NeverAssign }; //cannot be larger than 7 because of leader election mask
enum Fitness { BestFit, GoodFit, OkayFit, UnsetFit, WorstFit, ExcludeFit, NeverAssign }; //cannot be larger than 7 because of leader election mask
enum ClusterRole { Storage, TLog, Proxy, Master, Resolver, LogRouter, ClusterController };
enum ClassSource { CommandLineSource, AutoSource, DBSource, InvalidSource = -1 };
int16_t _class;