You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/06/27 15:50:53 UTC

[GitHub] [spark] LantaoJin commented on a change in pull request #24982: [SPARK-28181][CORE] Add a filter interface to KVStore to speed up the entities retrieve

LantaoJin commented on a change in pull request #24982: [SPARK-28181][CORE] Add a filter interface to KVStore to speed up the entities retrieve
URL: https://github.com/apache/spark/pull/24982#discussion_r298248246
 
 

 ##########
 File path: common/kvstore/src/main/java/org/apache/spark/util/kvstore/InMemoryStore.java
 ##########
 @@ -106,6 +106,12 @@ public void delete(Class<?> type, Object naturalKey) {
     return list != null ? list.view() : emptyView();
   }
 
+  @Override
+  public <T> KVStoreView<T> viewWithCondition(Class<T> type, Predicate<T> condition) {
+    InstanceList<T> list = inMemoryLists.get(type);
 
 Review comment:
   I’ve tried like `view(Class<T> type, Optional<Predicate<T>> condition)`, but how can I add a default parameter value in Java like `condition: Option[Predicate[T]] = None` in Scala? Otherwise, it needs to change many places so I choose to add a new function called `viewWithCondition`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org