Executes region merge as a "transaction". It is similar with SplitTransaction. Call {@link #prepare(RegionServerServices)} to setup thetransaction, {@link #execute(Server,RegionServerServices)} to run thetransaction and {@link #rollback(Server,RegionServerServices)} to cleanup ifexecute fails.
Here is an example of how you would use this class:
RegionMergeTransaction mt = new RegionMergeTransaction(this.conf, parent, midKey) if (!mt.prepare(services)) return; try { mt.execute(server, services); } catch (IOException ioe) { try { mt.rollback(server, services); return; } catch (RuntimeException e) { myAbortable.abort("Failed merge, abort"); } }
This class is not thread safe. Caller needs ensure merge is run by one thread only.