Class SparkSessionClient

java.lang.Object
com.azure.analytics.synapse.spark.SparkSessionClient

public final class SparkSessionClient extends Object
Initializes a new instance of the synchronous SparkClient type.
  • Method Details

    • getSparkSessions

      public SparkSessionCollection getSparkSessions(Integer from, Integer size, Boolean detailed)
      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

      public SparkSessionCollection 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

      public SparkSession createSparkSession(SparkSessionOptions sparkSessionOptions, Boolean detailed)
      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

      public SparkSession createSparkSession(SparkSessionOptions sparkSessionOptions)
      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

      public SparkSession getSparkSession(int sessionId, Boolean detailed)
      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

      public SparkSession getSparkSession(int sessionId)
      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

      public Response<Void> cancelSparkSessionWithResponse(int sessionId, Context context)
      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

      public Response<Void> resetSparkSessionTimeoutWithResponse(int sessionId, Context context)
      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

      public SparkStatementCollection getSparkStatements(int sessionId)
      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

      public SparkStatement getSparkStatement(int sessionId, int statementId)
      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

      public SparkStatementCancellationResult cancelSparkStatement(int sessionId, int statementId)
      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.