@Test public void testPrepareWithClosedRegion() throws IOException { this.parent.close(); SplitTransaction st = new SplitTransaction(this.parent, GOOD_SPLIT_ROW); assertFalse(st.prepare()); }
public boolean prepare() { if (this.parent.isClosed() || this.parent.isClosing()) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !this.parent.getRegionInfo().containsRow(splitrow)) { LOG.info("Split row is not inside region key range or is equal to " + "startkey: " + Bytes.toString(this.splitrow)); return false; } long rid = getDaughterRegionIdTimestamp(hri); this.hri_a = new HRegionInfo(hri.getTableDesc(), startKey, this.splitrow, false, rid); this.hri_b = new HRegionInfo(hri.getTableDesc(), this.splitrow, endKey, false, rid); return true; }
SplitTransaction { public boolean prepare() { if (this.parent.isClosed() || this.parent.isClosing()) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !this.parent.getRegionInfo().containsRow(splitrow)) { LOG.info("Split row is not inside region key range or is equal to " + "startkey: " + Bytes.toString(this.splitrow)); return false; } long rid = getDaughterRegionIdTimestamp(hri); this.hri_a = new HRegionInfo(hri.getTableDesc(), startKey, this.splitrow, false, rid); this.hri_b = new HRegionInfo(hri.getTableDesc(), this.splitrow, endKey, false, rid); return true; } }
SplitTransaction { public boolean prepare() { if (this.parent.isClosed() || this.parent.isClosing()) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !this.parent.getRegionInfo().containsRow(splitrow)) { LOG.info("Split row is not inside region key range or is equal to " + "startkey: " + Bytes.toString(this.splitrow)); return false; } long rid = getDaughterRegionIdTimestamp(hri); this.hri_a = new HRegionInfo(hri.getTableDesc(), startKey, this.splitrow, false, rid); this.hri_b = new HRegionInfo(hri.getTableDesc(), this.splitrow, endKey, false, rid); return true; } SplitTransaction(final HRegion r, final byte [] splitrow); }
SplitTransaction { public boolean prepare() { if (this.parent.isClosed() || this.parent.isClosing()) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !this.parent.getRegionInfo().containsRow(splitrow)) { LOG.info("Split row is not inside region key range or is equal to " + "startkey: " + Bytes.toString(this.splitrow)); return false; } long rid = getDaughterRegionIdTimestamp(hri); this.hri_a = new HRegionInfo(hri.getTableDesc(), startKey, this.splitrow, false, rid); this.hri_b = new HRegionInfo(hri.getTableDesc(), this.splitrow, endKey, false, rid); return true; } SplitTransaction(final HRegion r, final byte [] splitrow); boolean prepare(); void rollback(final OnlineRegions or); }
SplitTransaction { public boolean prepare() { if (this.parent.isClosed() || this.parent.isClosing()) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !this.parent.getRegionInfo().containsRow(splitrow)) { LOG.info("Split row is not inside region key range or is equal to " + "startkey: " + Bytes.toString(this.splitrow)); return false; } long rid = getDaughterRegionIdTimestamp(hri); this.hri_a = new HRegionInfo(hri.getTableDesc(), startKey, this.splitrow, false, rid); this.hri_b = new HRegionInfo(hri.getTableDesc(), this.splitrow, endKey, false, rid); return true; } SplitTransaction(final HRegion r, final byte [] splitrow); boolean prepare(); void rollback(final OnlineRegions or);  }