code: private IMetaStoreClient createRetryingMetaStoreClient(final HiveConf hiveConf)
        throws MetaException {
      // Custom hook-loader to return a HiveMetaHook if the table is configured with a custom storage handler
      final HiveMetaHookLoader hookLoader = new HiveMetaHookLoader() {
        @Override
        public HiveMetaHook getHook(final Table tbl) throws MetaException {
          if (tbl == null) {
            return null;
          }
  
          try {
            final HiveStorageHandler storageHandler =
                HiveUtils.getStorageHandler(hiveConf, tbl.getParameters().get(META_TABLE_STORAGE));
            return storageHandler == null ? null : storageHandler.getMetaHook();
          } catch (final HiveException e) {
            HadoopSecurityManager_H_2_0.logger.error(e.toString());
            throw new MetaException("Failed to get storage handler: " + e);
          }
        }
      };
  
      return RetryingMetaStoreClient
          .getProxy(hiveConf, hookLoader, HiveMetaStoreClient.class.getName());
    }
docs: Method to create a metastore client that retries on failures