@Override
 public void registered(
     final SchedulerDriver driver, Protos.FrameworkID frameworkId, Protos.MasterInfo masterInfo) {
   Runtime.getRuntime()
       .addShutdownHook(
           new Thread(
               new Runnable() {
                 @Override
                 public void run() {
                   driver.stop();
                 }
               }));
   LOG.info(
       "Registered framework {} with master {}:{}",
       frameworkId.getValue(),
       masterInfo.getHostname(),
       masterInfo.getPort());
 }
 @Override
 public void reregistered(SchedulerDriver driver, Protos.MasterInfo masterInfo) {
   LOG.info(
       "Registered framework with master {}:{}", masterInfo.getHostname(), masterInfo.getPort());
 }