dschneider-pivotal commented on a change in pull request #7431:
URL: https://github.com/apache/geode/pull/7431#discussion_r828338887
##########
File path:
geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisList.java
##########
@@ -48,6 +49,33 @@ public RedisList() {
this.elementList = new SizeableByteArrayList();
}
+ /**
+ * @param count number of elements to remove.
+ * A count that is 0 removes all matching elements in the list.
+ * Positive count starts from the head and moves to the tail.
+ * Negative count starts from the tail and moves to the head.
+ * @param element element to remove
+ * @param region the region this instance is stored in
+ * @param key the name of the set to add
+ * @return amount of elements that were actually removed
+ */
+ public int lrem(int count, byte[] element, Region<RedisKey, RedisData>
region, RedisKey key) {
+ List<Integer> removedIndexes;
+ if (0 <= count) {
+ removedIndexes = elementList.removeObjectsStartingAtHead(element, count);
Review comment:
I think this command needs to be versioned and hold sync around
removeObjectsStartingAtHead
--
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]