if (fromState.toString().equalsIgnoreCase("SLAVE")
&& toState.toString().equalsIgnoreCase("MASTER")) {
// add a stat and report to ZK
// perhaps should keep reporter per instance...
ParticipantHealthReportCollectorImpl reporter =
new ParticipantHealthReportCollectorImpl(manager, instance);
MockEspressoHealthReportProvider provider = new MockEspressoHealthReportProvider();
reporter.addHealthReportProvider(provider);
String statName = "latency";
// using constant as timestamp so that when each partition does this transition,
// they do not advance timestamp, and no stats double-counted
String timestamp = "12345";
provider.setStat(_dbName, statName, "15", timestamp);
// sleep for random time and see about errors.
/*
* Random r = new Random();
* int x = r.nextInt(30000);
* try {
* Thread.sleep(x);
* } catch (InterruptedException e) {
* // TODO Auto-generated catch block
* e.printStackTrace();
* }
*/
reporter.transmitHealthReports();
/*
* for (int i = 0; i < 5; i++)
* {
* accessor.setProperty(PropertyType.HEALTHREPORT,