[ 
https://issues.apache.org/jira/browse/HADOOP-18957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17787498#comment-17787498
 ] 

ASF GitHub Bot commented on HADOOP-18957:
-----------------------------------------

ayushtkn commented on PR #6231:
URL: https://github.com/apache/hadoop/pull/6231#issuecomment-1817535488

   There is a link with the checkstyle warnings, just click on it
   <img width="825" alt="image" 
src="https://github.com/apache/hadoop/assets/25608848/a3a6a1b3-d616-47ab-8b79-7d5330b2bd2a";>
   
   Some 11 lines
   
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6231/5/artifact/out/results-checkstyle-root.txt
   ```
   
./hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java:299:
          digestAuthData = authPair.getBytes(StandardCharsets.UTF_8);: 'block' 
child has incorrect indentation level 10, expected level should be 8. 
[Indentation]
   
./hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/TestSaslDataTransfer.java:204:
      DFSTestUtil.readFile(fs, PATH).getBytes(StandardCharsets.UTF_8));: 
'DFSTestUtil' has incorrect indentation level 6, expected level should be 8. 
[Indentation]
   
./hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/TaskLog.java:117:
      StandardCharsets.UTF_8));: 'StandardCharsets' has incorrect indentation 
level 6, expected level should be 8. [Indentation]
   
./hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestConcatenatedCompressedInput.java:299:
        new String(uncompressedBuf, 0, numBytesUncompressed, 
StandardCharsets.UTF_8);: 'new' has incorrect indentation level 8, expected 
level should be 10. [Indentation]
   
./hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/dancing/DistributedPentomino.java:144:
                      (fs.create(input), 64*1024), StandardCharsets.UTF_8));: 
'operator new lparen' has incorrect indentation level 22, expected level should 
be 6. [Indentation]
   
./hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/dancing/DistributedPentomino.java:144:
                      (fs.create(input), 64*1024), 
StandardCharsets.UTF_8));:23: '(' should be on the previous line. 
[MethodParamPad]
   
./hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/CompressionEmulationUtil.java:103:
  private static final Charset charsetUTF8 = StandardCharsets.UTF_8;:32: Name 
'charsetUTF8' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'. [ConstantName]
   
./hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/DistributedCacheEmulator.java:117:
  private static final Charset charsetUTF8 = StandardCharsets.UTF_8;:32: Name 
'charsetUTF8' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'. [ConstantName]
   
./hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/GenerateDistCacheData.java:100:
  private static final Charset charsetUTF8 = StandardCharsets.UTF_8;:32: Name 
'charsetUTF8' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'. [ConstantName]
   
./hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamBaseRecordReader.java:107:
      String recordStr = new String(record, start, Math.min(len, 
statusMaxRecordChars_), StandardCharsets.UTF_8);: Line is longer than 100 
characters (found 113). [LineLength]
   
./hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestUnconsumedInput.java:61:
        out.write(input.getBytes(StandardCharsets.UTF_8));: 'for' child has 
incorrect indentation level 8, expected level should be 6. [Indentation]
   ```
   




> Use StandardCharsets.UTF_8 constant
> -----------------------------------
>
>                 Key: HADOOP-18957
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18957
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: PJ Fanning
>            Priority: Major
>              Labels: pull-request-available
>
> * there are some places in the code that have to check for 
> UnsupportedCharsetException when explicitly using the charset name "UTF-8"
> * using StandardCharsets.UTF_8 is more efficient because the Java libs 
> usually have to look up the charsets when you provide it as String param 
> instead
> * also stop using Guava Charsets and use StandardCharsets



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to