Constructor
new StreamingQueryManager()
- Since:
- EclairJS 0.7 Spark 2.0.0
- Source:
Methods
active() → {Array.<StreamingQuery>}
Returns a list of active queries associated with this SQLContext
- Since:
- EclairJS 0.7 Spark 2.0.0
- Source:
Returns:
- Type
- Array.<StreamingQuery>
addListener(queryEventCallback) → {Promise.<Void>}
Register to receive callbacks for life cycle events of module:eclairjs/sql/streaming.StreamingQuery.
Example:
var listener = queryManger.addListener(
function(event){
console.log("queryEvent " + JSON.stringify(event));
if (event.type == 'start') {
// event started
} else if (event.type == 'process') {
queryManger.get(event.streamingQueryInfo.id).stop().then(function(){
//sparkSession.stop();
});
} else if (event.type == 'terminated') {
sparkSession.stop();
}
}
);
Parameters:
Name | Type | Description |
---|---|---|
queryEventCallback |
module:eclairjs/sql/streaming.StreamingQueryManager~queryEventCallback |
- Since:
- EclairJS 0.7 Spark 2.0.0
- Source:
Returns:
A Promise that resolves to nothing.
- Type
- Promise.<Void>
addListenerx(listener) → {Promise.<Void>}
Register a StreamingQueryListener to receive up-calls for life cycle events of
StreamingQuery.
Parameters:
Name | Type | Description |
---|---|---|
listener |
module:eclairjs/sql/streaming.StreamingQueryListener |
- Since:
- EclairJS 0.7 Spark 2.0.0
- Source:
Returns:
A Promise that resolves to nothing.
- Type
- Promise.<Void>
get(id) → {StreamingQuery}
Returns the query if there is an active query with the given id, or null.
Parameters:
Name | Type | Description |
---|---|---|
id |
number |
- Since:
- EclairJS 0.7 Spark 2.0.0
- Source:
Returns:
- Type
- StreamingQuery
removeListener(listener) → {Promise.<Void>}
Deregister a StreamingQueryListener.
Parameters:
Name | Type | Description |
---|---|---|
listener |
module:eclairjs/sql/streaming.StreamingQueryListener |
- Since:
- EclairJS 0.7 Spark 2.0.0
- Source:
Returns:
A Promise that resolves to nothing.
- Type
- Promise.<Void>
resetTerminated() → {Promise.<Void>}
Forget about past terminated queries so that `awaitAnyTermination()` can be used again to
wait for new terminations.
- Since:
- EclairJS 0.7 Spark 2.0.0
- Source:
Returns:
A Promise that resolves to nothing.
- Type
- Promise.<Void>
Type Definitions
queryEventCallback(event)
This callback called for query starts, process or termination events.
Parameters:
Name | Type | Description |
---|---|---|
event |
module:eclairjs/sql/streaming.StreamingQueryInfo |