public static PlacementRule getPlacementRule(String ruleStr,
      Configuration conf)
      throws ClassNotFoundException {
    Class<? extends PlacementRule> ruleClass = Class.forName(ruleStr)
        .asSubclass(PlacementRule.class);
    LOG.info("Using PlacementRule implementation - " + ruleClass);
    return ReflectionUtils.newInstance(ruleClass, conf);
  }
@Test(expected = ClassNotFoundException.class)
  public void testGetNonExistRuleText() throws ClassNotFoundException {
    final String nonExist = "my.placement.Rule";
    PlacementFactory.getPlacementRule(nonExist, null);
  }