From 1d2810b167276457144ed1bde342ac4c3739c543 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Fri, 6 Mar 2009 06:40:25 +0000 Subject: [PATCH] HBASE-1239 input buffer reading in the REST interface does not correctly clear the character buffer each iteration git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@750782 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 4 +++- src/java/org/apache/hadoop/hbase/rest/Dispatcher.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 2fbd2cc7634..00c1ee63aa6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -31,7 +31,9 @@ Release 0.20.0 - Unreleased HBASE-1211 NPE in retries exhausted exception HBASE-1233 Transactional fixes: Overly conservative scan read-set, potential CME (Clint Morgan via Stack) - HBASE-1185 wrong request/sec in the gui reporting wrong + HBASE-1239 in the REST interface does not correctly clear the character + buffer each iteration-1185 wrong request/sec in the gui + reporting wrong (Brian Beggs via Stack) IMPROVEMENTS HBASE-1089 Add count of regions on filesystem to master UI; add percentage diff --git a/src/java/org/apache/hadoop/hbase/rest/Dispatcher.java b/src/java/org/apache/hadoop/hbase/rest/Dispatcher.java index a9ce7515df9..9f5c14d8b5a 100644 --- a/src/java/org/apache/hadoop/hbase/rest/Dispatcher.java +++ b/src/java/org/apache/hadoop/hbase/rest/Dispatcher.java @@ -363,7 +363,6 @@ public class Dispatcher extends javax.servlet.http.HttpServlet { int maxLength = 5000; // tie to conf int bufferLength = 640; - char[] c = new char[bufferLength]; // 40 characters * sizeof(UTF16) // TODO make s maxLength and c size values in configuration if (!r.ready()) { Thread.sleep(1000); // If r is not ready wait 1 second @@ -372,7 +371,9 @@ public class Dispatcher extends javax.servlet.http.HttpServlet { return new byte[0]; } } + char[] c;// 40 characters * sizeof(UTF16) while (r.ready()) { + c = new char[bufferLength]; int n = r.read(c, 0, bufferLength); resultant += new String(c); if (n != bufferLength) {