2121import static org .apache .parquet .column .ParquetProperties .DEFAULT_ADAPTIVE_BLOOM_FILTER_ENABLED ;
2222import static org .apache .parquet .column .ParquetProperties .DEFAULT_BLOOM_FILTER_ENABLED ;
2323import static org .apache .parquet .hadoop .ParquetWriter .DEFAULT_BLOCK_SIZE ;
24- import static org .apache .parquet .hadoop .util .ContextUtil .getConfiguration ;
2524
2625import java .io .IOException ;
2726import java .util .Objects ;
@@ -190,7 +189,7 @@ public static JobSummaryLevel getJobSummaryLevel(Configuration conf) {
190189 }
191190
192191 public static void setWriteSupportClass (Job job , Class <?> writeSupportClass ) {
193- getConfiguration (job ).set (WRITE_SUPPORT_CLASS , writeSupportClass .getName ());
192+ job . getConfiguration ().set (WRITE_SUPPORT_CLASS , writeSupportClass .getName ());
194193 }
195194
196195 public static void setWriteSupportClass (JobConf job , Class <?> writeSupportClass ) {
@@ -208,35 +207,35 @@ public static Class<?> getWriteSupportClass(Configuration configuration) {
208207 }
209208
210209 public static void setBlockSize (Job job , int blockSize ) {
211- getConfiguration (job ).setInt (BLOCK_SIZE , blockSize );
210+ job . getConfiguration ().setInt (BLOCK_SIZE , blockSize );
212211 }
213212
214213 public static void setPageSize (Job job , int pageSize ) {
215- getConfiguration (job ).setInt (PAGE_SIZE , pageSize );
214+ job . getConfiguration ().setInt (PAGE_SIZE , pageSize );
216215 }
217216
218217 public static void setDictionaryPageSize (Job job , int pageSize ) {
219- getConfiguration (job ).setInt (DICTIONARY_PAGE_SIZE , pageSize );
218+ job . getConfiguration ().setInt (DICTIONARY_PAGE_SIZE , pageSize );
220219 }
221220
222221 public static void setCompression (Job job , CompressionCodecName compression ) {
223- getConfiguration (job ).set (COMPRESSION , compression .name ());
222+ job . getConfiguration ().set (COMPRESSION , compression .name ());
224223 }
225224
226225 public static void setColumnCompression (Job job , String columnPath , CompressionCodecName codec ) {
227- getConfiguration (job ).set (COMPRESSION + '#' + columnPath , codec .name ());
226+ job . getConfiguration ().set (COMPRESSION + '#' + columnPath , codec .name ());
228227 }
229228
230229 public static void setColumnCompressionLevel (Job job , String columnPath , int level ) {
231- getConfiguration (job ).setInt (COLUMN_COMPRESSION_LEVEL_PREFIX + '#' + columnPath , level );
230+ job . getConfiguration ().setInt (COLUMN_COMPRESSION_LEVEL_PREFIX + '#' + columnPath , level );
232231 }
233232
234233 public static void setEnableDictionary (Job job , boolean enableDictionary ) {
235- getConfiguration (job ).setBoolean (ENABLE_DICTIONARY , enableDictionary );
234+ job . getConfiguration ().setBoolean (ENABLE_DICTIONARY , enableDictionary );
236235 }
237236
238237 public static boolean getEnableDictionary (JobContext jobContext ) {
239- return getEnableDictionary (getConfiguration (jobContext ));
238+ return getEnableDictionary (jobContext . getConfiguration ());
240239 }
241240
242241 public static int getBloomFilterMaxBytes (Configuration conf ) {
@@ -252,31 +251,31 @@ public static boolean getAdaptiveBloomFilterEnabled(Configuration conf) {
252251 }
253252
254253 public static int getBlockSize (JobContext jobContext ) {
255- return getBlockSize (getConfiguration (jobContext ));
254+ return getBlockSize (jobContext . getConfiguration ());
256255 }
257256
258257 public static int getPageSize (JobContext jobContext ) {
259- return getPageSize (getConfiguration (jobContext ));
258+ return getPageSize (jobContext . getConfiguration ());
260259 }
261260
262261 public static int getDictionaryPageSize (JobContext jobContext ) {
263- return getDictionaryPageSize (getConfiguration (jobContext ));
262+ return getDictionaryPageSize (jobContext . getConfiguration ());
264263 }
265264
266265 public static CompressionCodecName getCompression (JobContext jobContext ) {
267- return getCompression (getConfiguration (jobContext ));
266+ return getCompression (jobContext . getConfiguration ());
268267 }
269268
270269 public static boolean isCompressionSet (JobContext jobContext ) {
271- return isCompressionSet (getConfiguration (jobContext ));
270+ return isCompressionSet (jobContext . getConfiguration ());
272271 }
273272
274273 public static void setValidation (JobContext jobContext , boolean validating ) {
275- setValidation (getConfiguration (jobContext ), validating );
274+ setValidation (jobContext . getConfiguration (), validating );
276275 }
277276
278277 public static boolean getValidation (JobContext jobContext ) {
279- return getValidation (getConfiguration (jobContext ));
278+ return getValidation (jobContext . getConfiguration ());
280279 }
281280
282281 public static boolean getEnableDictionary (Configuration configuration ) {
@@ -350,7 +349,7 @@ private CompressionCodecName getCodec(TaskAttemptContext taskAttemptContext) {
350349 }
351350
352351 public static void setMaxPaddingSize (JobContext jobContext , int maxPaddingSize ) {
353- setMaxPaddingSize (getConfiguration (jobContext ), maxPaddingSize );
352+ setMaxPaddingSize (jobContext . getConfiguration (), maxPaddingSize );
354353 }
355354
356355 public static void setMaxPaddingSize (Configuration conf , int maxPaddingSize ) {
@@ -362,7 +361,7 @@ private static int getMaxPaddingSize(Configuration conf) {
362361 }
363362
364363 public static void setColumnIndexTruncateLength (JobContext jobContext , int length ) {
365- setColumnIndexTruncateLength (getConfiguration (jobContext ), length );
364+ setColumnIndexTruncateLength (jobContext . getConfiguration (), length );
366365 }
367366
368367 public static void setColumnIndexTruncateLength (Configuration conf , int length ) {
@@ -374,7 +373,7 @@ private static int getColumnIndexTruncateLength(Configuration conf) {
374373 }
375374
376375 public static void setStatisticsTruncateLength (JobContext jobContext , int length ) {
377- setStatisticsTruncateLength (getConfiguration (jobContext ), length );
376+ setStatisticsTruncateLength (jobContext . getConfiguration (), length );
378377 }
379378
380379 private static void setStatisticsTruncateLength (Configuration conf , int length ) {
@@ -386,7 +385,7 @@ private static int getStatisticsTruncateLength(Configuration conf) {
386385 }
387386
388387 public static void setBlockRowCountLimit (JobContext jobContext , int rowCount ) {
389- setBlockRowCountLimit (getConfiguration (jobContext ), rowCount );
388+ setBlockRowCountLimit (jobContext . getConfiguration (), rowCount );
390389 }
391390
392391 public static void setBlockRowCountLimit (Configuration conf , int rowCount ) {
@@ -398,7 +397,7 @@ static int getBlockRowCountLimit(Configuration conf) {
398397 }
399398
400399 public static void setPageRowCountLimit (JobContext jobContext , int rowCount ) {
401- setPageRowCountLimit (getConfiguration (jobContext ), rowCount );
400+ setPageRowCountLimit (jobContext . getConfiguration (), rowCount );
402401 }
403402
404403 public static void setPageRowCountLimit (Configuration conf , int rowCount ) {
@@ -410,7 +409,7 @@ private static int getPageRowCountLimit(Configuration conf) {
410409 }
411410
412411 public static void setPageWriteChecksumEnabled (JobContext jobContext , boolean val ) {
413- setPageWriteChecksumEnabled (getConfiguration (jobContext ), val );
412+ setPageWriteChecksumEnabled (jobContext . getConfiguration (), val );
414413 }
415414
416415 public static void setPageWriteChecksumEnabled (Configuration conf , boolean val ) {
@@ -422,15 +421,15 @@ public static boolean getPageWriteChecksumEnabled(Configuration conf) {
422421 }
423422
424423 public static void setStatisticsEnabled (JobContext jobContext , boolean enabled ) {
425- getConfiguration (jobContext ).setBoolean (STATISTICS_ENABLED , enabled );
424+ jobContext . getConfiguration ().setBoolean (STATISTICS_ENABLED , enabled );
426425 }
427426
428427 public static boolean getStatisticsEnabled (Configuration conf ) {
429428 return conf .getBoolean (STATISTICS_ENABLED , ParquetProperties .DEFAULT_STATISTICS_ENABLED );
430429 }
431430
432431 public static void setStatisticsEnabled (JobContext jobContext , String columnPath , boolean enabled ) {
433- getConfiguration (jobContext ).set (STATISTICS_ENABLED + "#" + columnPath , String .valueOf (enabled ));
432+ jobContext . getConfiguration ().set (STATISTICS_ENABLED + "#" + columnPath , String .valueOf (enabled ));
434433 }
435434
436435 public static boolean getStatisticsEnabled (Configuration conf , String columnPath ) {
@@ -490,7 +489,7 @@ public RecordWriter<Void, T> getRecordWriter(TaskAttemptContext taskAttemptConte
490489 public RecordWriter <Void , T > getRecordWriter (TaskAttemptContext taskAttemptContext , Mode mode )
491490 throws IOException , InterruptedException {
492491
493- final Configuration conf = getConfiguration (taskAttemptContext );
492+ final Configuration conf = taskAttemptContext . getConfiguration ();
494493
495494 CompressionCodecName codec = getCodec (taskAttemptContext );
496495 String extension = codec .getExtension () + ".parquet" ;
@@ -505,7 +504,7 @@ public RecordWriter<Void, T> getRecordWriter(TaskAttemptContext taskAttemptConte
505504
506505 public RecordWriter <Void , T > getRecordWriter (TaskAttemptContext taskAttemptContext , Path file , Mode mode )
507506 throws IOException , InterruptedException {
508- return getRecordWriter (getConfiguration (taskAttemptContext ), file , getCodec (taskAttemptContext ), mode );
507+ return getRecordWriter (taskAttemptContext . getConfiguration (), file , getCodec (taskAttemptContext ), mode );
509508 }
510509
511510 public RecordWriter <Void , T > getRecordWriter (Configuration conf , Path file , CompressionCodecName codec )
0 commit comments