5858 */
5959public class MountTableConverter extends Configured {
6060 private static final Logger LOG = LoggerFactory .getLogger (MountTableConverter .class );
61- static final String ROUTER_ADMIN_ADDRESS_FORMATTER = "%s-linkfs.grid.linkedin.com :%s" ;
61+ static final String ROUTER_ADMIN_ADDRESS_FORMATTER = "%s:%s" ;
6262 static final String RBF_NS_INDICATOR = "/THIS_IS_LINKFS" ;
6363 private final String rbfNsSuffix ;
6464 private final String keytabPrincipal ;
6565 private final String keytabPath ;
66- private final String clusterName ;
66+ private final String routerAddr ;
6767 private final Path mountConfigPath ;
6868 private final boolean dryRun ;
6969 private final boolean removeOld ;
@@ -84,15 +84,16 @@ public class MountTableConverter extends Configured {
8484
8585 public static final Option RBF_NAMESPACE_SUFFIX = new Option ("rbfNsSuffix" , true , "RBF namespace suffix" );
8686
87- public static final Option CLUSTER_NAME = new Option ("cluster" , true , "Cluster name used to construct router admin address" );
87+ public static final Option ROUTER_ADDRESS =
88+ new Option ("routerAddr" , true , "Router RPC address used to construct router admin address" );
8889
8990 private static final Options OPTIONS = new Options ().addOption (MOUNT_CONFIG_PATH )
9091 .addOption (KEYTAB_PRINCIPAL )
9192 .addOption (KEYTAB_PATH )
9293 .addOption (DRY_RUN )
9394 .addOption (REMOVE_OLD )
9495 .addOption (RBF_NAMESPACE_SUFFIX )
95- .addOption (CLUSTER_NAME );
96+ .addOption (ROUTER_ADDRESS );
9697
9798 public static void main (String [] args ) throws Exception {
9899 Configuration conf = new HdfsConfiguration ();
@@ -105,12 +106,13 @@ public static void main(String[] args) throws Exception {
105106 String keytabPath = commandLine .getOptionValue (KEYTAB_PATH .getOpt ());
106107 String rbfNsSuffix = commandLine .getOptionValue (RBF_NAMESPACE_SUFFIX .getOpt ());
107108 Path mountConfigPath = new Path (commandLine .getOptionValue (MOUNT_CONFIG_PATH .getOpt ()));
108- String clusterName = commandLine .getOptionValue (CLUSTER_NAME .getOpt ());
109+ String routerAddr = commandLine .getOptionValue (ROUTER_ADDRESS .getOpt ());
109110 boolean dryRun = commandLine .hasOption (DRY_RUN .getOpt ());
110111 boolean removeOld = commandLine .hasOption (REMOVE_OLD .getOpt ());
111112
112113 MountTableConverter adminTool =
113- new MountTableConverter (conf , keytabPrincipal , keytabPath , mountConfigPath , dryRun , removeOld , rbfNsSuffix , clusterName );
114+ new MountTableConverter (conf , keytabPrincipal , keytabPath , mountConfigPath , dryRun , removeOld , rbfNsSuffix ,
115+ routerAddr );
114116 adminTool .initClient ();
115117 adminTool .convert ();
116118 } catch (ParseException ex ) {
@@ -120,30 +122,29 @@ public static void main(String[] args) throws Exception {
120122 }
121123
122124 public MountTableConverter (Configuration conf , String keytabPrincipal , String keytabPath , Path mountConfigPath ,
123- boolean dryRun , boolean removeOld , String rbfNsSuffix , String clusterName ) {
125+ boolean dryRun , boolean removeOld , String rbfNsSuffix , String routerAddr ) {
124126 super (conf );
125127 this .keytabPrincipal = keytabPrincipal ;
126128 this .keytabPath = keytabPath ;
127129 this .mountConfigPath = mountConfigPath ;
128130 this .dryRun = dryRun ;
129131 this .removeOld = removeOld ;
130132 this .rbfNsSuffix = rbfNsSuffix ;
131- this .clusterName = clusterName ;
133+ this .routerAddr = routerAddr ;
132134 }
133135
134136 public void initClient () throws IOException {
135137 // Load client's minimum set of configurations to use kerberos
136138 Configuration .addDefaultResource ("router-client-security.xml" );
137139
138- if (this .clusterName != null ) {
139- // If clusterName is null, will fall back to use local configuration DFS_ROUTER_ADMIN_ADDRESS_KEY, if
140+ if (this .routerAddr != null ) {
141+ // If routerAddr is null, will fall back to use local configuration DFS_ROUTER_ADMIN_ADDRESS_KEY, if
140142 // DFS_ROUTER_ADMIN_ADDRESS_KEY is not set, will use DFS_ROUTER_ADMIN_ADDRESS_DEFAULT as router.admin-address.
141143 final String routerAdminAddr =
142- String .format (ROUTER_ADMIN_ADDRESS_FORMATTER , this .clusterName , RBFConfigKeys .DFS_ROUTER_ADMIN_PORT_DEFAULT );
144+ String .format (ROUTER_ADMIN_ADDRESS_FORMATTER , this .routerAddr , RBFConfigKeys .DFS_ROUTER_ADMIN_PORT_DEFAULT );
143145 getConf ().set (RBFConfigKeys .DFS_ROUTER_ADMIN_ADDRESS_KEY , routerAdminAddr );
144146 }
145147
146-
147148 UserGroupInformation .loginUserFromKeytab (keytabPrincipal , new File (keytabPath ).getAbsolutePath ());
148149 try {
149150 String address = getConf ().getTrimmed (RBFConfigKeys .DFS_ROUTER_ADMIN_ADDRESS_KEY ,
0 commit comments