[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hadoop-dev
Subject:    [jira] [Created] (HADOOP-17607) TFileDumper creates malformed hex sample output
From:       "Marcono1234 (Jira)" <jira () apache ! org>
Date:       2021-03-27 17:39:00
Message-ID: JIRA.13368121.1616866681000.153624.1616866740036 () Atlassian ! JIRA
[Download RAW message or body]

Marcono1234 created HADOOP-17607:
------------------------------------

             Summary: TFileDumper creates malformed hex sample output
                 Key: HADOOP-17607
                 URL: https://issues.apache.org/jira/browse/HADOOP-17607
             Project: Hadoop Common
          Issue Type: Bug
    Affects Versions: 3.2.2
            Reporter: Marcono1234


{{org.apache.hadoop.io.file.tfile.TFileDumper}} creates malformed hex output:
{code}
out.print("0X");
for (int j = 0; j < sampleLen; ++j) {
  byte b = key[i];
  out.printf("%X", b);
}
{code}
It should use {{"%02X"}} (zero-pad and use width 2) as formatting pattern; otherwise \
bytes < 16 will only have on hex char and for example both {{1, 0}} and {{16}} would \
have the result {{"10"}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-dev-help@hadoop.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic