MCPcopy Create free account
hub / github.com/apache/solr / LockImpl

Class LockImpl

solr/core/src/java/org/apache/solr/cloud/LockTree.java:46–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44 public final Map<String, Lock> allLocks = new HashMap<>();
45
46 private class LockImpl implements Lock {
47 final Node node;
48 final String id;
49
50 LockImpl(Node node) {
51 this.node = node;
52 this.id = UUID.randomUUID().toString();
53 }
54
55 @Override
56 public void unlock() {
57 synchronized (LockTree.this) {
58 if (node.unlock(this)) {
59 allLocks.remove(id);
60 }
61 }
62 }
63
64 @Override
65 public String id() {
66 return id;
67 }
68
69 @Override
70 public boolean validateSubpath(int lockLevel, List<String> path) {
71 return node.validateSubpath(lockLevel, path);
72 }
73
74 @Override
75 public String toString() {
76 return StrUtils.join(node.constructPath(new ArrayDeque<>()), '/');
77 }
78 }
79
80 /**
81 * This class is used to mark nodes for which acquiring a lock was attempted but didn't succeed.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…