Mercurial > hg > Database > Christie
view src/main/java/christie/test/ring/FlipCodeGear.java @ 272:b592fe1d4a4e default tip
create example Attendance
author | matac42 <matac@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 01 Jul 2021 20:41:07 +0900 |
parents | 6660ebba441e |
children |
line wrap: on
line source
package christie.test.ring; import christie.annotation.Peek; import christie.annotation.Take; import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; public class FlipCodeGear extends CodeGear{ @Take int count; @Take long timestamp; @Peek String hostname; @Take boolean start; @Override protected void run(CodeGearManager cgm) { System.out.println(hostname + " : count " + count); if (count == 5) { System.out.println(System.currentTimeMillis() - timestamp); } else { getDGM("remote").put("data", timestamp); if (hostname.equals("node0")) { getDGM("remote").put("count", ++count); } else { getDGM("remote").put("count", count); } } cgm.setup(new FlipCodeGear()); getLocalDGM().put("start", start); } }