public class OverwriteMergeStrategy extends Object implements MergeStrategy
MergeStrategy that completely overwrites the destination database with the content of the source database.| Constructor and Description |
|---|
OverwriteMergeStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
mergeAndCommit(KVTransaction src,
KVTransaction dst,
Date lastActiveTime)
Merge data from the source database being migrated away from into the destination database being migrated to.
|
protected void |
overwrite(KVTransaction src,
KVTransaction dst)
Overwrite one key/value database with another.
|
String |
toString() |
public void mergeAndCommit(KVTransaction src, KVTransaction dst, Date lastActiveTime)
MergeStrategy
This method should commit() both transactions before returning; src
should be committed before dst.
If an exception is thrown, rollback() will be invoked on both transactions
(a rollback() on an already-commit()'ed
transaction does nothing).
mergeAndCommit in interface MergeStrategysrc - read-only view into the database being migrated away fromdst - read-write transaction open on the database being migrated tolastActiveTime - time that dst was last active, or null if neverprotected void overwrite(KVTransaction src, KVTransaction dst)
This method deletes every key/value pair in dst, and then copy every key/value pair
in src into dst.
Does not commit src or dst.
Copyright © 2016. All rights reserved.