AMashenkov commented on a change in pull request #9246:
URL: https://github.com/apache/ignite/pull/9246#discussion_r667934747
##########
File path: modules/core/src/main/java/org/jsr166/ConcurrentLinkedHashMap.java
##########
@@ -1536,10 +1553,60 @@ public V replacex(K key, V oldVal, V newVal) {
}
/**
- * Removes all of the mappings from this map.
+ * Removes all of the mappings from this map. Performs recursive table
locking.
*/
@Override public void clear() {
- throw new UnsupportedOperationException();
+ int len = segments.length;
+
+ clear(0, len);
+ }
+
+ /**
+ * Recursively locks each segment in consistent order. When all segments
are locked method clears them
+ * all and releases locks in reverse order.
+ * @param segIndex segIndex of a segment to lock
+ * @param len length of segments array
+ */
+ private void clear(int segIndex, int len) {
+
Review comment:
```suggestion
private void clear(int segIndex, int len) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]