mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 05:55:51 +00:00
Implement Shadow Writes
Adds code for shadow writes.
This commit is contained in:
parent
ed62231e88
commit
24f731083c
1 changed files with 12 additions and 0 deletions
|
@ -37,4 +37,16 @@ public class NewOwnerStore {
|
||||||
public Map<Integer, StaticOwner> getNewOwnerStore() {
|
public Map<Integer, StaticOwner> getNewOwnerStore() {
|
||||||
return this.ownerStore;
|
return this.ownerStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void save(Owner owner){
|
||||||
|
//actual write to datastore
|
||||||
|
owners.save(owner);
|
||||||
|
//shadow write to new datastore
|
||||||
|
ownerStore.put(owner.getId(), convertToStaticOwner(owner));
|
||||||
|
}
|
||||||
|
|
||||||
|
//this is for testing to introduce inconsistencies
|
||||||
|
public void testPutInOldDatastoreOnly(Owner owner){
|
||||||
|
owners.save(owner);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue