@@ -260,7 +260,7 @@ public GetSubClusterPolicyConfigurationResponse getPolicyConfiguration(
260260    try  {
261261      return  stateStoreClient .getPolicyConfiguration (request );
262262    } catch  (YarnException  e ) {
263-       LOG .error ("getPolicyConfiguration error" , e );
263+       LOG .error ("getPolicyConfiguration error. " , e );
264264      this .metrics .incrFailedGetCurrentVersionCount ();
265265      throw  e ;
266266    }
@@ -269,106 +269,208 @@ public GetSubClusterPolicyConfigurationResponse getPolicyConfiguration(
269269  @ Override 
270270  public  SetSubClusterPolicyConfigurationResponse  setPolicyConfiguration (
271271      SetSubClusterPolicyConfigurationRequest  request ) throws  YarnException  {
272-     return  stateStoreClient .setPolicyConfiguration (request );
272+     try  {
273+       return  stateStoreClient .setPolicyConfiguration (request );
274+     } catch  (YarnException  e ) {
275+       LOG .error ("setPolicyConfiguration error." , e );
276+       this .metrics .incrFailedSetPolicyConfigurationCount ();
277+       throw  e ;
278+     }
273279  }
274280
275281  @ Override 
276282  public  GetSubClusterPoliciesConfigurationsResponse  getPoliciesConfigurations (
277283      GetSubClusterPoliciesConfigurationsRequest  request ) throws  YarnException  {
278-     return  stateStoreClient .getPoliciesConfigurations (request );
284+     try  {
285+       return  stateStoreClient .getPoliciesConfigurations (request );
286+     } catch  (YarnException  e ) {
287+       LOG .error ("getPoliciesConfigurations error." , e );
288+       this .metrics .incrFailedGetPoliciesConfigurationsCount ();
289+       throw  e ;
290+     }
279291  }
280292
281293  @ Override 
282294  public  SubClusterRegisterResponse  registerSubCluster (
283295      SubClusterRegisterRequest  registerSubClusterRequest )
284296      throws  YarnException  {
285-     return  stateStoreClient .registerSubCluster (registerSubClusterRequest );
297+     try  {
298+       return  stateStoreClient .registerSubCluster (registerSubClusterRequest );
299+     } catch  (YarnException  e ) {
300+       LOG .error ("registerSubCluster error." , e );
301+       this .metrics .incrFailedRegisterSubClusterCount ();
302+       throw  e ;
303+     }
286304  }
287305
288306  @ Override 
289307  public  SubClusterDeregisterResponse  deregisterSubCluster (
290308      SubClusterDeregisterRequest  subClusterDeregisterRequest )
291309      throws  YarnException  {
292-     return  stateStoreClient .deregisterSubCluster (subClusterDeregisterRequest );
310+     try  {
311+       return  stateStoreClient .deregisterSubCluster (subClusterDeregisterRequest );
312+     } catch  (YarnException  e ) {
313+       LOG .error ("deregisterSubCluster error." , e );
314+       this .metrics .incrFailedDeregisterSubClusterCount ();
315+       throw  e ;
316+     }
293317  }
294318
295319  @ Override 
296320  public  SubClusterHeartbeatResponse  subClusterHeartbeat (
297321      SubClusterHeartbeatRequest  subClusterHeartbeatRequest )
298322      throws  YarnException  {
299-     return  stateStoreClient .subClusterHeartbeat (subClusterHeartbeatRequest );
323+     try  {
324+       return  stateStoreClient .subClusterHeartbeat (subClusterHeartbeatRequest );
325+     } catch  (YarnException  e ) {
326+       LOG .error ("subClusterHeartbeat error." , e );
327+       this .metrics .incrFailedSubClusterHeartbeatCount ();
328+       throw  e ;
329+     }
300330  }
301331
302332  @ Override 
303333  public  GetSubClusterInfoResponse  getSubCluster (
304334      GetSubClusterInfoRequest  subClusterRequest ) throws  YarnException  {
305-     return  stateStoreClient .getSubCluster (subClusterRequest );
335+     try  {
336+       return  stateStoreClient .getSubCluster (subClusterRequest );
337+     } catch  (YarnException  e ) {
338+       LOG .error ("getSubCluster error." , e );
339+       this .metrics .incrFailedGetSubClusterCount ();
340+       throw  e ;
341+     }
306342  }
307343
308344  @ Override 
309345  public  GetSubClustersInfoResponse  getSubClusters (
310346      GetSubClustersInfoRequest  subClustersRequest ) throws  YarnException  {
311-     return  stateStoreClient .getSubClusters (subClustersRequest );
347+     try  {
348+       return  stateStoreClient .getSubClusters (subClustersRequest );
349+     } catch  (YarnException  e ) {
350+       LOG .error ("getSubClusters error." , e );
351+       this .metrics .incrFailedGetSubClustersCount ();
352+       throw  e ;
353+     }
312354  }
313355
314356  @ Override 
315357  public  AddApplicationHomeSubClusterResponse  addApplicationHomeSubCluster (
316358      AddApplicationHomeSubClusterRequest  request ) throws  YarnException  {
317-     return  stateStoreClient .addApplicationHomeSubCluster (request );
359+     try  {
360+       return  stateStoreClient .addApplicationHomeSubCluster (request );
361+     } catch  (YarnException  e ) {
362+       LOG .error ("addApplicationHomeSubCluster error." , e );
363+       this .metrics .incrFailedAddApplicationHomeSubClusterCount ();
364+       throw  e ;
365+     }
318366  }
319367
320368  @ Override 
321369  public  UpdateApplicationHomeSubClusterResponse  updateApplicationHomeSubCluster (
322370      UpdateApplicationHomeSubClusterRequest  request ) throws  YarnException  {
323-     return  stateStoreClient .updateApplicationHomeSubCluster (request );
371+     try  {
372+       return  stateStoreClient .updateApplicationHomeSubCluster (request );
373+     } catch  (YarnException  e ) {
374+       LOG .error ("updateApplicationHomeSubCluster error." , e );
375+       this .metrics .incrFailedUpdateApplicationHomeSubClusterCount ();
376+       throw  e ;
377+     }
324378  }
325379
326380  @ Override 
327381  public  GetApplicationHomeSubClusterResponse  getApplicationHomeSubCluster (
328382      GetApplicationHomeSubClusterRequest  request ) throws  YarnException  {
329-     return  stateStoreClient .getApplicationHomeSubCluster (request );
383+     try  {
384+       return  stateStoreClient .getApplicationHomeSubCluster (request );
385+     } catch  (YarnException  e ) {
386+       LOG .error ("getApplicationHomeSubCluster error." , e );
387+       this .metrics .incrFailedGetApplicationHomeSubClusterCount ();
388+       throw  e ;
389+     }
330390  }
331391
332392  @ Override 
333393  public  GetApplicationsHomeSubClusterResponse  getApplicationsHomeSubCluster (
334394      GetApplicationsHomeSubClusterRequest  request ) throws  YarnException  {
335-     return  stateStoreClient .getApplicationsHomeSubCluster (request );
395+     try  {
396+       return  stateStoreClient .getApplicationsHomeSubCluster (request );
397+     } catch  (YarnException  e ) {
398+       LOG .error ("getApplicationsHomeSubCluster error." , e );
399+       this .metrics .incrFailedGetApplicationsHomeSubClusterCount ();
400+       throw  e ;
401+     }
336402  }
337403
338404  @ Override 
339405  public  DeleteApplicationHomeSubClusterResponse  deleteApplicationHomeSubCluster (
340406      DeleteApplicationHomeSubClusterRequest  request ) throws  YarnException  {
341-     return  stateStoreClient .deleteApplicationHomeSubCluster (request );
407+     try  {
408+       return  stateStoreClient .deleteApplicationHomeSubCluster (request );
409+     } catch  (YarnException  e ) {
410+       LOG .error ("deleteApplicationHomeSubCluster error." , e );
411+       this .metrics .incrFailedDeleteApplicationHomeSubClusterCount ();
412+       throw  e ;
413+     }
342414  }
343415
344416  @ Override 
345417  public  AddReservationHomeSubClusterResponse  addReservationHomeSubCluster (
346418      AddReservationHomeSubClusterRequest  request ) throws  YarnException  {
347-     return  stateStoreClient .addReservationHomeSubCluster (request );
419+     try  {
420+       return  stateStoreClient .addReservationHomeSubCluster (request );
421+     } catch  (YarnException  e ) {
422+       LOG .error ("addReservationHomeSubCluster error." , e );
423+       this .metrics .incrFailedAddReservationHomeSubClusterCount ();
424+       throw  e ;
425+     }
348426  }
349427
350428  @ Override 
351429  public  GetReservationHomeSubClusterResponse  getReservationHomeSubCluster (
352430      GetReservationHomeSubClusterRequest  request ) throws  YarnException  {
353-     return  stateStoreClient .getReservationHomeSubCluster (request );
431+     try  {
432+       return  stateStoreClient .getReservationHomeSubCluster (request );
433+     } catch  (YarnException  e ) {
434+       LOG .error ("getReservationHomeSubCluster error." , e );
435+       this .metrics .incrFailedGetReservationHomeSubClusterCount ();
436+       throw  e ;
437+     }
354438  }
355439
356440  @ Override 
357441  public  GetReservationsHomeSubClusterResponse  getReservationsHomeSubCluster (
358442      GetReservationsHomeSubClusterRequest  request ) throws  YarnException  {
359-     return  stateStoreClient .getReservationsHomeSubCluster (request );
443+     try  {
444+       return  stateStoreClient .getReservationsHomeSubCluster (request );
445+     } catch  (YarnException  e ) {
446+       LOG .error ("getReservationsHomeSubCluster error." , e );
447+       this .metrics .incrFailedGetReservationsHomeSubClusterCount ();
448+       throw  e ;
449+     }
360450  }
361451
362452  @ Override 
363453  public  UpdateReservationHomeSubClusterResponse  updateReservationHomeSubCluster (
364454      UpdateReservationHomeSubClusterRequest  request ) throws  YarnException  {
365-     return  stateStoreClient .updateReservationHomeSubCluster (request );
455+     try  {
456+       return  stateStoreClient .updateReservationHomeSubCluster (request );
457+     } catch  (YarnException  e ) {
458+       LOG .error ("updateReservationHomeSubCluster error." , e );
459+       this .metrics .incrFailedUpdateReservationHomeSubClusterCount ();
460+       throw  e ;
461+     }
366462  }
367463
368464  @ Override 
369465  public  DeleteReservationHomeSubClusterResponse  deleteReservationHomeSubCluster (
370466      DeleteReservationHomeSubClusterRequest  request ) throws  YarnException  {
371-     return  stateStoreClient .deleteReservationHomeSubCluster (request );
467+     try  {
468+       return  stateStoreClient .deleteReservationHomeSubCluster (request );
469+     } catch  (YarnException  e ) {
470+       LOG .error ("deleteReservationHomeSubCluster error." , e );
471+       this .metrics .incrFailedDeleteReservationHomeSubClusterCount ();
472+       throw  e ;
473+     }
372474  }
373475
374476  @ Override 
0 commit comments