[ 
https://issues.apache.org/jira/browse/BEAM-6053?focusedWorklogId=165903&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-165903
 ]

ASF GitHub Bot logged work on BEAM-6053:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Nov/18 14:42
            Start Date: 14/Nov/18 14:42
    Worklog Time Spent: 10m 
      Work Description: jbonofre commented on a change in pull request #7018: 
[BEAM-6053] added sparkOptions cacheDisabled
URL: https://github.com/apache/beam/pull/7018#discussion_r233474408
 
 

 ##########
 File path: 
runners/spark/src/main/java/org/apache/beam/runners/spark/translation/EvaluationContext.java
 ##########
 @@ -139,11 +139,24 @@ public void setCurrentTransform(AppliedPTransform<?, ?, 
?> transform) {
         .collect(Collectors.toMap(e -> e.getKey(), e -> ((PCollection) 
e.getValue()).getCoder()));
   }
 
-  private boolean shouldCache(PValue pvalue) {
-    if ((pvalue instanceof PCollection)
-        && cacheCandidates.containsKey(pvalue)
-        && cacheCandidates.get(pvalue) > 1) {
-      return true;
+  /**
+   * Cache PCollection if {@link #isCacheDisabled()} flag is false and 
PCollection is used more then
+   * once in Pipeline or forceCache flag is true.
+   *
+   * @param pvalue
+   * @param forceCache if PCollection is not used more than once
+   * @return if PCollection will be cached
+   */
+  public boolean shouldCache(PValue pvalue, boolean forceCache) {
 
 Review comment:
   I don't remember exactly the rational, but AFAIR, users wanted to "force" 
the caching of RDD (disk storage) even if it's only read once.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 165903)
    Time Spent: 1h 10m  (was: 1h)

> Add option to disable caching in Spark
> --------------------------------------
>
>                 Key: BEAM-6053
>                 URL: https://issues.apache.org/jira/browse/BEAM-6053
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-spark
>    Affects Versions: 2.9.0
>            Reporter: Marek Simunek
>            Assignee: Marek Simunek
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Add possibility to SparkOptions to turn off spark RDD caching. There are use 
> cases when its faster to recompute whole RDD rather then serialize, store, 
> deserialize, read from store.
> We probably don't want to have some list of `PCollections` which we don't 
> want to cache, because that would be tailored to specific runner and would be 
> against Beam's concepts. So I propose to turn off caching for the whole 
> pipeline.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to