@Override
  void execute() {
    String[] loc = getCl().getUpddateLocationParams();

    Path newPath = new Path(loc[0]);
    Path oldPath = new Path(loc[1]);

    URI oldURI = oldPath.toUri();
    URI newURI = newPath.toUri();

    /*
     * validate input - Both new and old URI should contain valid host names and valid schemes.
     * port is optional in both the URIs since HDFS HA NN URI doesn't have a port.
     */
    if (oldURI.getHost() == null || newURI.getHost() == null) {
      throw new IllegalStateException("HiveMetaTool:A valid host is required in both old-loc and new-loc");
    } else if (oldURI.getScheme() == null || newURI.getScheme() == null) {
      throw new IllegalStateException("HiveMetaTool:A valid scheme is required in both old-loc and new-loc");
    }

    updateFSRootLocation(oldURI, newURI, getCl().getSerdePropKey(), getCl().getTablePropKey(), getCl().isDryRun());
  }
@Test
  public void testNoScheme() throws Exception {
    exception.expect(IllegalStateException.class);
    exception.expectMessage("HiveMetaTool:A valid scheme is required in both old-loc and new-loc");

    MetaToolTaskUpdateLocation t = new MetaToolTaskUpdateLocation();
    t.setCommandLine(new HiveMetaToolCommandLine(new String[] {"-updateLocation", "//old.host", "//new.host"}));
    t.execute();
  }