|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lens.rdd.LensRDDClient
public class LensRDDClient
Create RDD from a Lens query. User can poll returned query handle with isReadyForRDD() until the RDD is ready to be used.
Example -LensRDDClient client = new LensRDDClient(javaSparkContext); QueryHandle query = client.createLensRDDAsync("SELECT msr1 from TEST_CUBE WHERE ...", conf); while (!client.isReadyForRDD(query)) { Thread.sleep(1000); } JavaRDDrdd = client.getRDD(query).toJavaRDD(); // Consume RDD here - rdd.map(...);
Alternatively in blocking mode
JavaRDD<ResultRow> rdd = client.createLensRDD("SELECT msr1 from TEST_CUBE WHERE ...", conf);
Nested Class Summary | |
---|---|
static class |
LensRDDClient.LensRDDResult
Container object to store the RDD and corresponding Lens query handle. |
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
The Constant LOG. |
Constructor Summary | |
---|---|
LensRDDClient(org.apache.spark.api.java.JavaSparkContext sparkContext)
Create an RDD client with given spark Context. |
|
LensRDDClient(org.apache.spark.api.java.JavaSparkContext sparkContext,
LensClient lensClient)
Instantiates a new lens rdd client. |
|
LensRDDClient(org.apache.spark.SparkContext sc)
Create an RDD client with given spark Context. |
|
LensRDDClient(org.apache.spark.SparkContext sparkContext,
LensClient lensClient)
Instantiates a new lens rdd client. |
Method Summary | |
---|---|
void |
cancelRDD(QueryHandle queryHandle)
Allow cancelling underlying query in case of non blocking RDD creation. |
LensRDDClient.LensRDDResult |
createLensRDD(String query)
Blocking call to create an RDD from a Lens query. |
QueryHandle |
createLensRDDAsync(String query)
API for non blocking use. |
LensRDDClient.LensRDDResult |
getRDD(QueryHandle queryHandle)
Get the RDD created for the query. |
boolean |
isReadyForRDD(QueryHandle queryHandle)
Check if the RDD is created. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
public LensRDDClient(org.apache.spark.api.java.JavaSparkContext sparkContext)
sparkContext
- the spark contextpublic LensRDDClient(org.apache.spark.SparkContext sc)
sc
- the scpublic LensRDDClient(org.apache.spark.api.java.JavaSparkContext sparkContext, LensClient lensClient)
sparkContext
- the spark contextlensClient
- the lens clientpublic LensRDDClient(org.apache.spark.SparkContext sparkContext, LensClient lensClient)
sparkContext
- the spark contextlensClient
- the lens clientMethod Detail |
---|
public QueryHandle createLensRDDAsync(String query) throws LensException
query
- the query
LensException
- the lens exceptionpublic boolean isReadyForRDD(QueryHandle queryHandle) throws LensException
queryHandle
- the query handle
LensException
- the lens exceptionpublic void cancelRDD(QueryHandle queryHandle) throws LensException
queryHandle
- the query handle
LensException
- the lens exceptionpublic LensRDDClient.LensRDDResult getRDD(QueryHandle queryHandle) throws LensException
queryHandle
- the query handle
LensException
- the lens exceptionpublic LensRDDClient.LensRDDResult createLensRDD(String query) throws LensException
query
- the query
LensException
- the lens exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |