Java Code Examples for org.apache.spark.storage.RDDInfo#id()

The following examples show how to use org.apache.spark.storage.RDDInfo#id() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SparkExecutionContext.java    From systemds with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("resource")
public boolean isRDDCached( int rddID ) {
	//check that rdd is marked for caching
	JavaSparkContext jsc = getSparkContext();
	if( !jsc.sc().getPersistentRDDs().contains(rddID) ) {
		return false;
	}

	//check that rdd is actually already cached
	for( RDDInfo info : jsc.sc().getRDDStorageInfo() ) {
		if( info.id() == rddID )
			return info.isCached();
	}
	return false;
}
 
Example 2
Source File: SparkExecutionContext.java    From systemds with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("resource")
public boolean isRDDCached( int rddID ) {
	//check that rdd is marked for caching
	JavaSparkContext jsc = getSparkContext();
	if( !jsc.sc().getPersistentRDDs().contains(rddID) ) {
		return false;
	}

	//check that rdd is actually already cached
	for( RDDInfo info : jsc.sc().getRDDStorageInfo() ) {
		if( info.id() == rddID )
			return info.isCached();
	}
	return false;
}