google app engine - HRD with no unapplied jobs on GAE Java Dev Server -


for testing purposes need run local app engine java development server high-replication datastore (hrd), no unapplied jobs. have same effect can in standalone unit tests following:

localdatastoreservicetestconfig cfg     = new localdatastoreservicetestconfig(); cfg.setapplyallhighrepjobpolicy() localservicetesthelper helper = new localservicetesthelper(cfg); helper.setup(); 

on dev server classes not available, there way have hrd no unapplied jobs on dev server?

(hrd enabled dev app server jvm flag -ddatastore.default_high_rep_job_policy_unapplied_job_pct. if set zero, disable hrd , use master-slave datastore instead)

i cannot use master-slave datastore, @ least objectify (4.0b) creates trouble cross-group transactions. fail following message: cross-group transaction need explicitly specified.

you can set own job policy. use:

public class alwaysapplyjobpolicy implements highrepjobpolicy {     @override     public boolean shouldapplynewjob(key arg0) {         return true;     }      @override     public boolean shouldrollforwardexistingjob(key arg0) {         // should irrelevant because jobs apply         return true;     } }  private final localservicetesthelper helper =         new localservicetesthelper(                 // our tests assume strong consistency                 new localdatastoreservicetestconfig().setalternatehighrepjobpolicyclass(alwaysapplyjobpolicy.class),                 new localmemcacheservicetestconfig(),                 new localtaskqueuetestconfig()); 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -