Meituan-Dianping / Leaf

Distributed ID Generate Service
Apache License 2.0
6.49k stars 1.84k forks source link

why must set value before set max #201

Open leechliao opened 2 years ago

leechliao commented 2 years ago

` //must set value before set max long value = leafAlloc.getMaxId() - buffer.getStep();

segment.getValue().set(value);

segment.setMax(leafAlloc.getMaxId());

segment.setStep(buffer.getStep());

` why must set value before set max?