public ConsistentHash getReadConsistentHash() {
      switch (phase) {
         case CONFLICT_RESOLUTION:
         case NO_REBALANCE:
            assert pendingCH == null;
            assert unionCH == null;
            return currentCH;
         case TRANSITORY:
            return pendingCH;
         case READ_OLD_WRITE_ALL:
            assert pendingCH != null;
            assert unionCH != null;
            return currentCH;
         case READ_ALL_WRITE_ALL:
            assert pendingCH != null;
            return unionCH;
         case READ_NEW_WRITE_ALL:
            assert unionCH != null;
            return pendingCH;
         default:
            throw new IllegalStateException();
      }
   }
public ConsistentHash getReadConsistentHash ( ) { switch ( phase ) { case CONFLICT_RESOLUTION : case NO_REBALANCE : assert pendingCH == null ; assert unionCH == null ; return currentCH ; case TRANSITORY : return pendingCH ; case READ_OLD_WRITE_ALL : assert pendingCH != null ; assert unionCH != null ; return currentCH ; case READ_ALL_WRITE_ALL : assert pendingCH != null ; return unionCH ; case READ_NEW_WRITE_ALL : assert unionCH != null ; return pendingCH ; default : throw new IllegalStateException ( ) ; } }
Read operations should always go to the "current" owners.