private synchronized AffinityLock acquireLockBasedOnLast() {
        final AffinityLock al = this.lastAffinityLock == null ? AffinityLock.acquireLock() : lastAffinityLock
            .acquireLock(this.strategies);
        if (al.cpuId() >= 0) {
            if (!al.isBound()) {
                al.bind();
            }
            this.lastAffinityLock = al;
        }
        return al;
    }
This is a ThreadFactory which assigns threads based the strategies provided.

If no strategies are provided AffinityStrategies.ANY is used.

@author jiachun.fjc
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/util/concurrent/AffinityNamedThreadFactory.java