@@ -129,14 +129,14 @@ public class BulkLoadHFilesTool extends Configured implements BulkLoadHFiles, To
129129 // above. It is invalid family name.
130130 static final String TMP_DIR = ".tmp" ;
131131
132- private final int maxFilesPerRegionPerFamily ;
133- private final boolean assignSeqIds ;
132+ private int maxFilesPerRegionPerFamily ;
133+ private boolean assignSeqIds ;
134134 private boolean bulkLoadByFamily ;
135135
136136 // Source delegation token
137- private final FsDelegationToken fsDelegationToken ;
138- private final UserProvider userProvider ;
139- private final int nrThreads ;
137+ private FsDelegationToken fsDelegationToken ;
138+ private UserProvider userProvider ;
139+ private int nrThreads ;
140140 private final AtomicInteger numRetries = new AtomicInteger (0 );
141141 private String bulkToken ;
142142
@@ -146,6 +146,11 @@ public class BulkLoadHFilesTool extends Configured implements BulkLoadHFiles, To
146146 public BulkLoadHFilesTool (Configuration conf ) {
147147 // make a copy, just to be sure we're not overriding someone else's config
148148 super (new Configuration (conf ));
149+ initialize ();
150+ }
151+
152+ public void initialize () {
153+ Configuration conf = getConf ();
149154 // disable blockcache for tool invocation, see HBASE-10500
150155 conf .setFloat (HConstants .HFILE_BLOCK_CACHE_SIZE_KEY , 0 );
151156 userProvider = UserProvider .instantiate (conf );
@@ -1073,6 +1078,8 @@ public int run(String[] args) throws Exception {
10731078 usage ();
10741079 return -1 ;
10751080 }
1081+ // Re-initialize to apply -D options from the command line parameters
1082+ initialize ();
10761083 Path dirPath = new Path (args [0 ]);
10771084 TableName tableName = TableName .valueOf (args [1 ]);
10781085 if (args .length == 2 ) {
0 commit comments