@Override
  public void run() {
    LOG.info("Name of thread " + Thread.currentThread().getName() + " changed to " + TASK_NAME);
    Thread.currentThread().setName(TASK_NAME);
    try {
      Thread.sleep(10000);
    } catch (InterruptedException ie) {
      LOG.error("Task " + TASK_NAME + " interrupted: " + ie.getMessage(), ie);
    }
  }
An implementation of MetastoreTaskThread for testing metastore leader config.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/RemoteMetastoreTaskThreadTestImpl2.java