use of com.tencent.angel.ps.backup.ha.push.SyncEventPusher in project angel by Tencent.
the class ParameterServer method initialize.
/**
* Initialize.
*
* @throws IOException
* @throws InstantiationException
* @throws IllegalAccessException
*/
public void initialize() throws IOException, InstantiationException, IllegalAccessException {
LOG.info("Initialize a parameter server");
locationManager = new PSLocationManager(context);
locationManager.setMasterLocation(masterLocation);
workerPool = new WorkerPool(context);
workerPool.init();
ioExecutors = new IOExecutors(context);
ioExecutors.init();
matrixStorageManager = new MatrixStorageManager(context);
int taskNum = conf.getInt(AngelConf.ANGEL_TASK_ACTUAL_NUM, 1);
clockVectorManager = new ClockVectorManager(taskNum, context);
clockVectorManager.init();
matrixMetaManager = new PSMatrixMetaManager(context);
master = new MasterClient(context);
master.init();
psServerService = new ParameterServerService(context);
psServerService.start();
matrixTransportServer = new MatrixTransportServer(getPort() + 1, context);
int replicNum = conf.getInt(AngelConf.ANGEL_PS_HA_REPLICATION_NUMBER, AngelConf.DEFAULT_ANGEL_PS_HA_REPLICATION_NUMBER);
if (replicNum > 1) {
// conf.getBoolean(AngelConf.ANGEL_PS_HA_USE_EVENT_PUSH, AngelConf.DEFAULT_ANGEL_PS_HA_USE_EVENT_PUSH);
boolean useEventPush = false;
if (useEventPush) {
boolean sync = conf.getBoolean(AngelConf.ANGEL_PS_HA_PUSH_SYNC, AngelConf.DEFAULT_ANGEL_PS_HA_PUSH_SYNC);
if (sync) {
ps2PSPusher = new SyncEventPusher(context);
} else {
ps2PSPusher = new AsyncEventPusher(context);
}
} else {
ps2PSPusher = new PeriodPusher(context);
}
ps2PSPusher.init();
} else {
snapshotDumper = new SnapshotDumper(context);
}
}
Aggregations