accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [3/9] git commit: ACCUMULO-2832 fixed object creation in Defaultformatter. Uses single Text object.
Date Fri, 13 Jun 2014 02:36:25 GMT
ACCUMULO-2832 fixed object creation in Defaultformatter. Uses single Text object.

Signed-off-by: Josh Elser <elserj@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/59591273
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/59591273
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/59591273

Branch: refs/heads/master
Commit: 59591273317147600a4299e215114fcf1fc1c341
Parents: a3a8641
Author: meislerj <jacob.meisler@gmail.com>
Authored: Thu Jun 12 19:26:16 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Jun 12 21:34:55 2014 -0400

----------------------------------------------------------------------
 .../accumulo/core/util/format/DefaultFormatter.java     | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/59591273/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
b/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
index 78abed9..2b8a88c 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
@@ -60,22 +60,24 @@ public class DefaultFormatter implements Formatter {
   // this should be replaced with something like Record.toString();
   public static String formatEntry(Entry<Key,Value> entry, boolean showTimestamps)
{
     StringBuilder sb = new StringBuilder();
+    Key key = entry.getKey();
+    Text buffer = new Text();
     
     // append row
-    appendText(sb, entry.getKey().getRow()).append(" ");
+    appendText(sb, key.getRow(buffer)).append(" ");
     
     // append column family
-    appendText(sb, entry.getKey().getColumnFamily()).append(":");
+    appendText(sb, key.getColumnFamily(buffer)).append(":");
     
     // append column qualifier
-    appendText(sb, entry.getKey().getColumnQualifier()).append(" ");
+    appendText(sb, key.getColumnQualifier(buffer)).append(" ");
     
     // append visibility expression
-    sb.append(new ColumnVisibility(entry.getKey().getColumnVisibility()));
+    sb.append(new ColumnVisibility(key.getColumnVisibility(buffer)));
     
     // append timestamp
     if (showTimestamps)
-      sb.append(" ").append(entry.getKey().getTimestamp());
+      sb.append(" ").append(key.getTimestamp());
     
     // append value
     if (entry.getValue() != null && entry.getValue().getSize() > 0) {


Mime
View raw message