void start() { lifeCycle.transition(STARTING); state.start(); RaftConfiguration conf = getRaftConf(); if (conf != null && conf.contains(getId())) { LOG.debug("{} starts as a follower, conf={}", getId(), conf); startAsFollower(); } else { LOG.debug("{} starts with initializing state, conf={}", getId(), conf); startInitializing(); } registerMBean(getId(), getGroupId(), jmxAdapter, jmxAdapter); }
boolean start() { if (!lifeCycle.compareAndTransition(NEW, STARTING)) { return false; } LOG.info("{}: start {}", getId(), groupId); RaftConfiguration conf = getRaftConf(); if (conf != null && conf.contains(getId())) { LOG.debug("{} starts as a follower, conf={}", getId(), conf); startAsFollower(); } else { LOG.debug("{} starts with initializing state, conf={}", getId(), conf); startInitializing(); } registerMBean(getId(), getGroupId(), jmxAdapter, jmxAdapter); state.start(); return true; }