Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-4444

Add space between total transaction time and number of transactions in FSEditLog#printStatistics

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-alpha, 3.0.0
    • Fix Version/s: 1.2.0, 2.0.3-alpha, 0.23.7
    • Component/s: None
    • Labels:
      None

      Description

      Currently, when we log statistics, we see something like

      13/01/25 23:16:59 INFO namenode.FSNamesystem: Number of transactions: 0 Total time for transactions(ms): 0Number of transactions batched in Syncs: 0 Number of syncs: 0 SyncTimes(ms): 0
      

      Notice how the value for total transactions time and "Number of transactions batched in Syncs" needs a space to separate them.

      FSEditLog#printStatistics:

        private void printStatistics(boolean force) {
          long now = now();
          if (lastPrintTime + 60000 > now && !force) {
            return;
          }
          lastPrintTime = now;
          StringBuilder buf = new StringBuilder();
          buf.append("Number of transactions: ");
          buf.append(numTransactions);
          buf.append(" Total time for transactions(ms): ");
          buf.append(totalTimeTransactions);
          buf.append("Number of transactions batched in Syncs: ");
          buf.append(numTransactionsBatchedInSync);
          buf.append(" Number of syncs: ");
          buf.append(editLogStream.getNumSync());
          buf.append(" SyncTimes(ms): ");
          buf.append(journalSet.getSyncTimes());
          LOG.info(buf);
        }
      
      1. HDFS-4444.patch.branch-1
        0.7 kB
        Stephen Chu
      2. HDFS-4444.patch.001
        0.9 kB
        Stephen Chu

        Issue Links

          Activity

          Chris Nauroth made changes -
          Link This issue is related to HDFS-4782 [ HDFS-4782 ]
          Arun C Murthy made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Thomas Graves made changes -
          Fix Version/s 0.23.7 [ 12323955 ]
          Thomas Graves made changes -
          Fix Version/s 0.23.7 [ 12323955 ]
          Thomas Graves made changes -
          Fix Version/s 0.23.7 [ 12323955 ]
          Suresh Srinivas made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Hadoop Flags Reviewed [ 10343 ]
          Fix Version/s 1.2.0 [ 12321657 ]
          Fix Version/s 2.0.3-alpha [ 12323274 ]
          Resolution Fixed [ 1 ]
          Stephen Chu made changes -
          Attachment HDFS-4444.patch.branch-1 [ 12566702 ]
          Chris Nauroth made changes -
          Affects Version/s 3.0.0 [ 12320356 ]
          Target Version/s 2.0.0-alpha, 3.0.0 [ 12320353, 12320356 ]
          Stephen Chu made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Stephen Chu made changes -
          Attachment HDFS-4444.patch.001 [ 12566620 ]
          Stephen Chu made changes -
          Description Currently, when we log statistics, we see something like
          {code}
          13/01/25 23:16:59 INFO namenode.FSNamesystem: Number of transactions: 0 Total time for transactions(ms): 0Number of transactions batched in Syncs: 0 Number of syncs: 0 SyncTimes(ms): 0
          {code}

          Notice how the value for total transactions time and "Number of transactions batched in Syncs" needs a space to separate them.

          FSEditLog#printStatistics:
          {code}
            private void printStatistics(boolean force) {
              long now = now();
              if (lastPrintTime + 60000 > now && !force) {
                return;
              }
              lastPrintTime = now;
              StringBuilder buf = new StringBuilder();
              buf.append("Number of transactions: ");
              buf.append(numTransactions);
              buf.append(" Total time for transactions(ms): ");
              buf.append(totalTimeTransactions);
              buf.append(" Number of transactions batched in Syncs: ");
              buf.append(numTransactionsBatchedInSync);
              buf.append(" Number of syncs: ");
              buf.append(editLogStream.getNumSync());
              buf.append(" SyncTimes(ms): ");
              buf.append(journalSet.getSyncTimes());
              LOG.info(buf);
            }
          {code}
          Currently, when we log statistics, we see something like
          {code}
          13/01/25 23:16:59 INFO namenode.FSNamesystem: Number of transactions: 0 Total time for transactions(ms): 0Number of transactions batched in Syncs: 0 Number of syncs: 0 SyncTimes(ms): 0
          {code}

          Notice how the value for total transactions time and "Number of transactions batched in Syncs" needs a space to separate them.

          FSEditLog#printStatistics:
          {code}
            private void printStatistics(boolean force) {
              long now = now();
              if (lastPrintTime + 60000 > now && !force) {
                return;
              }
              lastPrintTime = now;
              StringBuilder buf = new StringBuilder();
              buf.append("Number of transactions: ");
              buf.append(numTransactions);
              buf.append(" Total time for transactions(ms): ");
              buf.append(totalTimeTransactions);
              buf.append("Number of transactions batched in Syncs: ");
              buf.append(numTransactionsBatchedInSync);
              buf.append(" Number of syncs: ");
              buf.append(editLogStream.getNumSync());
              buf.append(" SyncTimes(ms): ");
              buf.append(journalSet.getSyncTimes());
              LOG.info(buf);
            }
          {code}
          Stephen Chu made changes -
          Field Original Value New Value
          Description Currently, when we log statistics, we see something like
          {code}
          13/01/25 23:16:59 INFO namenode.FSNamesystem: Number of transactions: 0 Total time for transactions(ms): 0Number of transactions batched in Syncs: 0 Number of syncs: 0 SyncTimes(ms): 0
          {code}

          Notice how the value for total transactions time and "Number of transactions batched in Syncs" needs a space to separate them.

          FSEditLog#printStatistics:
          {code}
            private void printStatistics(boolean force) {
              long now = now();
              if (lastPrintTime + 60000 > now && !force) {
                return;
              }
              lastPrintTime = now;
              StringBuilder buf = new StringBuilder();
              buf.append("Number of transactions: ");
              buf.append(numTransactions);
              buf.append(" Total time for transactions(ms): ");
              buf.append(totalTimeTransactions);
              buf.append(" Number of transactions batched in Syncs: ");
              buf.append(numTransactionsBatchedInSync);
              buf.append(" Number of syncs: ");
              buf.append(editLogStream.getNumSync());
              buf.append(" SyncTimes(ms): ");
              buf.append(journalSet.getSyncTimes());
              LOG.info(buf);
            }
          {code}
          Stephen Chu created issue -

            People

            • Assignee:
              Stephen Chu
              Reporter:
              Stephen Chu
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development