@@ -103,12 +103,13 @@ public static void main(String [] args) {
103
103
104
104
long time1 = System .currentTimeMillis ();
105
105
106
- RestructureAvroRecords restr = new RestructureAvroRecords
106
+ RestructureAvroRecords . Builder builder = new RestructureAvroRecords
107
107
.Builder (commandLineArgs .hdfsUri , commandLineArgs .outputDirectory )
108
108
.useGzip ("gzip" .equalsIgnoreCase (commandLineArgs .compression ))
109
109
.doDeduplicate (commandLineArgs .deduplicate ).format (commandLineArgs .format )
110
- .doStage (!commandLineArgs .noStage )
111
- .build ();
110
+ .doStage (!commandLineArgs .noStage );
111
+
112
+ RestructureAvroRecords restr = builder .build ();
112
113
113
114
try {
114
115
for (String input : commandLineArgs .inputPaths ) {
@@ -128,6 +129,10 @@ private RestructureAvroRecords(RestructureAvroRecords.Builder builder) {
128
129
this .setInputWebHdfsURL (builder .hdfsUri );
129
130
this .setOutputPath (builder .outputPath );
130
131
132
+ for (Map .Entry <String , String > hdfsConf : builder .hdfsConf .entrySet ()) {
133
+ conf .set (hdfsConf .getKey (), hdfsConf .getValue ());
134
+ }
135
+
131
136
this .useGzip = builder .useGzip ;
132
137
this .doDeduplicate = builder .doDeduplicate ;
133
138
this .doStage = builder .doStage ;
@@ -386,6 +391,7 @@ public static class Builder {
386
391
private boolean useGzip ;
387
392
private boolean doDeduplicate ;
388
393
private String hdfsUri ;
394
+ private Map <String , String > hdfsConf = new HashMap <>();
389
395
private String outputPath ;
390
396
private String format ;
391
397
private boolean doStage ;
@@ -410,6 +416,10 @@ public Builder format(final String format) {
410
416
return this ;
411
417
}
412
418
419
+ public void putHdfsConfig (String name , String value ) {
420
+ hdfsConf .put (name , value );
421
+ }
422
+
413
423
public RestructureAvroRecords build () {
414
424
return new RestructureAvroRecords (this );
415
425
}
0 commit comments