Class SparkSessionClient
java.lang.Object
com.azure.analytics.synapse.spark.SparkSessionClient
Initializes a new instance of the synchronous SparkClient type.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancelSparkSession
(int sessionId) Cancels a running spark session.cancelSparkSessionWithResponse
(int sessionId, Context context) Cancels a running spark session.cancelSparkStatement
(int sessionId, int statementId) Kill a statement within a session.cancelSparkStatementWithResponse
(int sessionId, int statementId, Context context) Kill a statement within a session.createSparkSession
(SparkSessionOptions sparkSessionOptions) Create new spark session.createSparkSession
(SparkSessionOptions sparkSessionOptions, Boolean detailed) Create new spark session.createSparkSessionWithResponse
(SparkSessionOptions sparkSessionOptions, Boolean detailed, Context context) Create new spark session.createSparkStatement
(int sessionId, SparkStatementOptions sparkStatementOptions) Create statement within a spark session.createSparkStatementWithResponse
(int sessionId, SparkStatementOptions sparkStatementOptions, Context context) Create statement within a spark session.getSparkSession
(int sessionId) Gets a single spark session.getSparkSession
(int sessionId, Boolean detailed) Gets a single spark session.List all spark sessions which are running under a particular spark pool.getSparkSessions
(Integer from, Integer size, Boolean detailed) List all spark sessions which are running under a particular spark pool.getSparkSessionsWithResponse
(Integer from, Integer size, Boolean detailed, Context context) List all spark sessions which are running under a particular spark pool.getSparkSessionWithResponse
(int sessionId, Boolean detailed, Context context) Gets a single spark session.getSparkStatement
(int sessionId, int statementId) Gets a single statement within a spark session.getSparkStatements
(int sessionId) Gets a list of statements within a spark session.getSparkStatementsWithResponse
(int sessionId, Context context) Gets a list of statements within a spark session.getSparkStatementWithResponse
(int sessionId, int statementId, Context context) Gets a single statement within a spark session.void
resetSparkSessionTimeout
(int sessionId) Sends a keep alive call to the current session to reset the session timeout.resetSparkSessionTimeoutWithResponse
(int sessionId, Context context) Sends a keep alive call to the current session to reset the session timeout.
-
Method Details
-
getSparkSessions
List all spark sessions which are running under a particular spark pool.- Parameters:
from
- Optional param specifying which index the list should begin from.size
- Optional param specifying the size of the returned list. By default it is 20 and that is the maximum.detailed
- Optional query param specifying whether detailed response is returned beyond plain livy.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getSparkSessions
List all spark sessions which are running under a particular spark pool.- Returns:
- the response.
- Throws:
HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getSparkSessionsWithResponse
public Response<SparkSessionCollection> getSparkSessionsWithResponse(Integer from, Integer size, Boolean detailed, Context context) List all spark sessions which are running under a particular spark pool.- Parameters:
from
- Optional param specifying which index the list should begin from.size
- Optional param specifying the size of the returned list. By default it is 20 and that is the maximum.detailed
- Optional query param specifying whether detailed response is returned beyond plain livy.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
createSparkSession
Create new spark session.- Parameters:
sparkSessionOptions
- Livy compatible batch job request payload.detailed
- Optional query param specifying whether detailed response is returned beyond plain livy.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
createSparkSession
Create new spark session.- Parameters:
sparkSessionOptions
- Livy compatible batch job request payload.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
createSparkSessionWithResponse
public Response<SparkSession> createSparkSessionWithResponse(SparkSessionOptions sparkSessionOptions, Boolean detailed, Context context) Create new spark session.- Parameters:
sparkSessionOptions
- Livy compatible batch job request payload.detailed
- Optional query param specifying whether detailed response is returned beyond plain livy.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getSparkSession
Gets a single spark session.- Parameters:
sessionId
- Identifier for the session.detailed
- Optional query param specifying whether detailed response is returned beyond plain livy.- Returns:
- a single spark session.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getSparkSession
Gets a single spark session.- Parameters:
sessionId
- Identifier for the session.- Returns:
- a single spark session.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getSparkSessionWithResponse
public Response<SparkSession> getSparkSessionWithResponse(int sessionId, Boolean detailed, Context context) Gets a single spark session.- Parameters:
sessionId
- Identifier for the session.detailed
- Optional query param specifying whether detailed response is returned beyond plain livy.context
- The context to associate with this operation.- Returns:
- a single spark session.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
cancelSparkSession
public void cancelSparkSession(int sessionId) Cancels a running spark session.- Parameters:
sessionId
- Identifier for the session.- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
cancelSparkSessionWithResponse
Cancels a running spark session.- Parameters:
sessionId
- Identifier for the session.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
resetSparkSessionTimeout
public void resetSparkSessionTimeout(int sessionId) Sends a keep alive call to the current session to reset the session timeout.- Parameters:
sessionId
- Identifier for the session.- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
resetSparkSessionTimeoutWithResponse
Sends a keep alive call to the current session to reset the session timeout.- Parameters:
sessionId
- Identifier for the session.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getSparkStatements
Gets a list of statements within a spark session.- Parameters:
sessionId
- Identifier for the session.- Returns:
- a list of statements within a spark session.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getSparkStatementsWithResponse
public Response<SparkStatementCollection> getSparkStatementsWithResponse(int sessionId, Context context) Gets a list of statements within a spark session.- Parameters:
sessionId
- Identifier for the session.context
- The context to associate with this operation.- Returns:
- a list of statements within a spark session.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
createSparkStatement
public SparkStatement createSparkStatement(int sessionId, SparkStatementOptions sparkStatementOptions) Create statement within a spark session.- Parameters:
sessionId
- Identifier for the session.sparkStatementOptions
- Livy compatible batch job request payload.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
createSparkStatementWithResponse
public Response<SparkStatement> createSparkStatementWithResponse(int sessionId, SparkStatementOptions sparkStatementOptions, Context context) Create statement within a spark session.- Parameters:
sessionId
- Identifier for the session.sparkStatementOptions
- Livy compatible batch job request payload.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getSparkStatement
Gets a single statement within a spark session.- Parameters:
sessionId
- Identifier for the session.statementId
- Identifier for the statement.- Returns:
- a single statement within a spark session.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getSparkStatementWithResponse
public Response<SparkStatement> getSparkStatementWithResponse(int sessionId, int statementId, Context context) Gets a single statement within a spark session.- Parameters:
sessionId
- Identifier for the session.statementId
- Identifier for the statement.context
- The context to associate with this operation.- Returns:
- a single statement within a spark session.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
cancelSparkStatement
Kill a statement within a session.- Parameters:
sessionId
- Identifier for the session.statementId
- Identifier for the statement.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
cancelSparkStatementWithResponse
public Response<SparkStatementCancellationResult> cancelSparkStatementWithResponse(int sessionId, int statementId, Context context) Kill a statement within a session.- Parameters:
sessionId
- Identifier for the session.statementId
- Identifier for the statement.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.HttpResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-