@@ -536,76 +536,76 @@ protected Configuration getNewConf() {
536536 public String reconfigurePropertyImpl (String property , String newVal )
537537 throws ReconfigurationException {
538538 switch (property ) {
539- case DFS_DATANODE_DATA_DIR_KEY : {
540- IOException rootException = null ;
539+ case DFS_DATANODE_DATA_DIR_KEY : {
540+ IOException rootException = null ;
541+ try {
542+ LOG .info ("Reconfiguring {} to {}" , property , newVal );
543+ this .refreshVolumes (newVal );
544+ return getConf ().get (DFS_DATANODE_DATA_DIR_KEY );
545+ } catch (IOException e ) {
546+ rootException = e ;
547+ } finally {
548+ // Send a full block report to let NN acknowledge the volume changes.
541549 try {
542- LOG .info ("Reconfiguring {} to {}" , property , newVal );
543- this .refreshVolumes (newVal );
544- return getConf ().get (DFS_DATANODE_DATA_DIR_KEY );
550+ triggerBlockReport (
551+ new BlockReportOptions .Factory ().setIncremental (false ).build ());
545552 } catch (IOException e ) {
546- rootException = e ;
553+ LOG .warn ("Exception while sending the block report after refreshing"
554+ + " volumes {} to {}" , property , newVal , e );
555+ if (rootException == null ) {
556+ rootException = e ;
557+ }
547558 } finally {
548- // Send a full block report to let NN acknowledge the volume changes.
549- try {
550- triggerBlockReport (
551- new BlockReportOptions .Factory ().setIncremental (false ).build ());
552- } catch (IOException e ) {
553- LOG .warn ("Exception while sending the block report after refreshing"
554- + " volumes {} to {}" , property , newVal , e );
555- if (rootException == null ) {
556- rootException = e ;
557- }
558- } finally {
559- if (rootException != null ) {
560- throw new ReconfigurationException (property , newVal ,
561- getConf ().get (property ), rootException );
562- }
559+ if (rootException != null ) {
560+ throw new ReconfigurationException (property , newVal ,
561+ getConf ().get (property ), rootException );
563562 }
564563 }
565- break ;
566564 }
567- case DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY : {
568- ReconfigurationException rootException = null ;
569- try {
570- LOG .info ("Reconfiguring {} to {}" , property , newVal );
571- int movers ;
572- if (newVal == null ) {
573- // set to default
574- movers = DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_DEFAULT ;
575- } else {
576- movers = Integer .parseInt (newVal );
577- if (movers <= 0 ) {
578- rootException = new ReconfigurationException (
579- property ,
580- newVal ,
581- getConf ().get (property ),
582- new IllegalArgumentException (
583- "balancer max concurrent movers must be larger than 0" ));
584- }
585- }
586- boolean success = xserver .updateBalancerMaxConcurrentMovers (movers );
587- if (!success ) {
565+ break ;
566+ }
567+ case DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY : {
568+ ReconfigurationException rootException = null ;
569+ try {
570+ LOG .info ("Reconfiguring {} to {}" , property , newVal );
571+ int movers ;
572+ if (newVal == null ) {
573+ // set to default
574+ movers = DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_DEFAULT ;
575+ } else {
576+ movers = Integer .parseInt (newVal );
577+ if (movers <= 0 ) {
588578 rootException = new ReconfigurationException (
589579 property ,
590580 newVal ,
591581 getConf ().get (property ),
592582 new IllegalArgumentException (
593- "Could not modify concurrent moves thread count " ));
583+ "balancer max concurrent movers must be larger than 0 " ));
594584 }
595- return Integer .toString (movers );
596- } catch (NumberFormatException nfe ) {
585+ }
586+ boolean success = xserver .updateBalancerMaxConcurrentMovers (movers );
587+ if (!success ) {
597588 rootException = new ReconfigurationException (
598- property , newVal , getConf ().get (property ), nfe );
599- } finally {
600- if (rootException != null ) {
601- LOG .warn (String .format (
602- "Exception in updating balancer max concurrent movers %s to %s" ,
603- property , newVal ), rootException );
604- throw rootException ;
605- }
589+ property ,
590+ newVal ,
591+ getConf ().get (property ),
592+ new IllegalArgumentException (
593+ "Could not modify concurrent moves thread count" ));
594+ }
595+ return Integer .toString (movers );
596+ } catch (NumberFormatException nfe ) {
597+ rootException = new ReconfigurationException (
598+ property , newVal , getConf ().get (property ), nfe );
599+ } finally {
600+ if (rootException != null ) {
601+ LOG .warn (String .format (
602+ "Exception in updating balancer max concurrent movers %s to %s" ,
603+ property , newVal ), rootException );
604+ throw rootException ;
606605 }
607- break ;
608606 }
607+ break ;
608+ }
609609 case DFS_BLOCKREPORT_INTERVAL_MSEC_KEY : {
610610 ReconfigurationException rootException = null ;
611611 try {
0 commit comments