@Override
    protected Owner internalTryLock(final byte[] ctx) {
        final byte[] internalKey = getInternalKey();
        final Acquirer acquirer = getAcquirer();
        acquirer.setContext(ctx);
        final CompletableFuture<Owner> future = this.rheaKVStore.tryLockWith(internalKey, false, acquirer);
        final Owner owner = FutureHelper.get(future);
        if (!owner.isSuccess()) {
            updateOwner(owner);
            return owner;
        }

        // if success, update the fencing token in acquirer
        updateOwnerAndAcquirer(owner);

        final ScheduledExecutorService watchdog = getWatchdog();
        if (watchdog == null) {
            return owner;
        }
        // schedule keeping lease
        if (this.watchdogFuture == null) {
            synchronized (this) {
                if (this.watchdogFuture == null) {
                    final long period = (acquirer.getLeaseMillis() / 3) << 1;
                    this.watchdogFuture = scheduleKeepingLease(watchdog, internalKey, acquirer, period);
                }
            }
        }
        return owner;
    }
Default implementation with distributed lock.

@author jiachun.fjc
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/client/DefaultDistributedLock.java