Vesta發(fā)號器源碼解析——PropertyMachineIdsProvider
屬性配置文件持有Id的模式,沒啥東西,比單個的多了一個獲取下一個的方法封裝
實現(xiàn)上略有一點點區(qū)別
private long[] machineIds;
private int currentIndex;
public long getNextMachineId() {
return getMachineId();
}
public long getMachineId() {
return machineIds[currentIndex++%machineIds.length];
}
public void setMachineIds(long[] machineIds) {
this.machineIds = machineIds;
}