Hello header for HBase 0.92 to 0.94.
()
| 2139 | |
| 2140 | /** Hello header for HBase 0.92 to 0.94. */ |
| 2141 | private ChannelBuffer header092() { |
| 2142 | final byte[] buf = new byte[4 + 1 + 4 + 1 + 44]; |
| 2143 | final ChannelBuffer header = commonHeader(buf, HRPC3); |
| 2144 | |
| 2145 | // Serialized ipc.ConnectionHeader |
| 2146 | // We skip 4 bytes now and will set it to the actual size at the end. |
| 2147 | header.writerIndex(header.writerIndex() + 4); // 4 |
| 2148 | final String klass = "org.apache.hadoop.hbase.ipc.HRegionInterface"; |
| 2149 | header.writeByte(klass.length()); // 1 |
| 2150 | header.writeBytes(Bytes.ISO88591(klass)); // 44 |
| 2151 | |
| 2152 | // Now set the length of the whole damn thing. |
| 2153 | // -4 because the length itself isn't part of the payload. |
| 2154 | // -5 because the "hrpc" + version isn't part of the payload. |
| 2155 | header.setInt(5, header.writerIndex() - 4 - 5); |
| 2156 | return header; |
| 2157 | } |
| 2158 | |
| 2159 | /** Hello header for HBase 0.90 and earlier. */ |
| 2160 | private ChannelBuffer header090() { |
no test coverage detected