| 726 | } |
| 727 | |
| 728 | public String toString() { |
| 729 | // Try to rightsize the buffer. |
| 730 | final String method = new String(this.method((byte) 0)); |
| 731 | final StringBuilder buf = new StringBuilder(16 + method.length() + 2 |
| 732 | + 8 + (table == null ? 4 : table.length + 2) // Assumption: ASCII => +2 |
| 733 | + 6 + (key == null ? 4 : key.length * 2) // Assumption: binary => *2 |
| 734 | + 9 + (region == null ? 4 : region.stringSizeHint()) |
| 735 | + 10 + 1 + 1); |
| 736 | buf.append("HBaseRpc(method="); |
| 737 | buf.append(method); |
| 738 | buf.append(", table="); |
| 739 | Bytes.pretty(buf, table); |
| 740 | buf.append(", key="); |
| 741 | Bytes.pretty(buf, key); |
| 742 | buf.append(", region="); |
| 743 | if (region == null) { |
| 744 | buf.append("null"); |
| 745 | } else { |
| 746 | region.toStringbuf(buf); |
| 747 | } |
| 748 | buf.append(", attempt=").append(attempt) |
| 749 | .append(", timeout=").append(timeout) |
| 750 | .append(", hasTimedout=").append(has_timedout); |
| 751 | buf.append(')'); |
| 752 | return buf.toString(); |
| 753 | } |
| 754 | |
| 755 | /** |
| 756 | * Helper for subclass's {@link #toString} implementations. |