MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / metaRegionInfo

Method metaRegionInfo

test/BaseTestHBaseClient.java:243–265  ·  view source on GitHub ↗
( final byte[] start_key, 
      final byte[] stop_key, final boolean offline, final boolean splitting, 
      final byte[] table)

Source from the content-addressed store, hash-verified

241 }
242
243 protected static KeyValue metaRegionInfo( final byte[] start_key,
244 final byte[] stop_key, final boolean offline, final boolean splitting,
245 final byte[] table) {
246 final byte[] name = concat(table, COMMA, start_key, COMMA, TIMESTAMP);
247 final byte is_splitting = (byte) (splitting ? 1 : 0);
248 final byte[] regioninfo = concat(
249 new byte[] {
250 0, // version
251 (byte) stop_key.length, // vint: stop key length
252 },
253 stop_key,
254 offline ? new byte[] { 1 } : new byte[] { 0 }, // boolean: offline
255 Bytes.fromLong(name.hashCode()), // long: region ID (make it random)
256 new byte[] { (byte) name.length }, // vint: region name length
257 name, // region name
258 new byte[] {
259 is_splitting, // boolean: splitting
260 (byte) start_key.length, // vint: start key length
261 },
262 start_key
263 );
264 return new KeyValue(region.name(), INFO, REGIONINFO, regioninfo);
265 }
266
267 protected static RegionInfo mkregion(final String table, final String name) {
268 return new RegionInfo(table.getBytes(), name.getBytes(),

Calls 4

concatMethod · 0.95
fromLongMethod · 0.95
hashCodeMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected