Implement Shadow Writes

Adds code for shadow writes.
This commit is contained in:
Zackkogan 2018-04-02 22:49:53 -04:00
parent ed62231e88
commit 24f731083c

View file

@ -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);
}
} }