[HUDI-3515] Making rdd unpersist optional at the end of writes (#4898)
Co-authored-by: 苏承祥 <sucx@tuya.com>
This commit is contained in:
@@ -531,7 +531,11 @@ public class SparkRDDWriteClient<T extends HoodieRecordPayload> extends
|
||||
|
||||
@Override
|
||||
protected void releaseResources() {
|
||||
((HoodieSparkEngineContext) context).getJavaSparkContext().getPersistentRDDs().values()
|
||||
.forEach(rdd -> rdd.unpersist());
|
||||
// If we do not explicitly release the resource, spark will automatically manage the resource and clean it up automatically
|
||||
// see: https://spark.apache.org/docs/latest/rdd-programming-guide.html#removing-data
|
||||
if (config.areReleaseResourceEnabled()) {
|
||||
((HoodieSparkEngineContext) context).getJavaSparkContext().getPersistentRDDs().values()
|
||||
.forEach(JavaRDD::unpersist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user