You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Nemo Chen (JIRA)" <ji...@apache.org> on 2016/08/11 18:13:20 UTC

[jira] [Created] (HDFS-10752) Variable in byte printed directly in hdfs

Nemo Chen created HDFS-10752:
--------------------------------

             Summary: Variable in byte printed directly in hdfs
                 Key: HDFS-10752
                 URL: https://issues.apache.org/jira/browse/HDFS-10752
             Project: Hadoop HDFS
          Issue Type: Bug
    Affects Versions: 2.7.2
            Reporter: Nemo Chen


Similar to the fix for HBASE-623, in file:

hadoop-rel-release-2.7.2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BackupImage.java

In the following method, the log printed variable data (in byte[]). A possible fix is add Bytes.toString(data).
{code}
/**
   * Write the batch of edits to the local copy of the edit logs.
   */
  private void logEditsLocally(long firstTxId, int numTxns, byte[] data) {
    long expectedTxId = editLog.getLastWrittenTxId() + 1;
    Preconditions.checkState(firstTxId == expectedTxId,
        "received txid batch starting at %s but expected txn %s",
        firstTxId, expectedTxId);
    editLog.setNextTxId(firstTxId + numTxns - 1);
    editLog.logEdit(data.length, data);
    editLog.logSync();
  }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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