Class SparkSessionAsyncClient

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

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

    • getSparkSessionsWithResponse

      public Mono<Response<SparkSessionCollection>> getSparkSessionsWithResponse(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 Mono<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 Mono<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.
    • createSparkSessionWithResponse

      public Mono<Response<SparkSession>> createSparkSessionWithResponse(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 Mono<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 Mono<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.
    • getSparkSessionWithResponse

      public Mono<Response<SparkSession>> getSparkSessionWithResponse(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 Mono<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 Mono<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.
    • cancelSparkSessionWithResponse

      public Mono<Response<Void>> cancelSparkSessionWithResponse(int sessionId)
      Cancels a running spark session.
      Parameters:
      sessionId - Identifier for the session.
      Returns:
      the completion.
      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 Mono<Void> cancelSparkSession(int sessionId)
      Cancels a running spark session.
      Parameters:
      sessionId - Identifier for the session.
      Returns:
      the completion.
      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 Mono<Response<Void>> resetSparkSessionTimeoutWithResponse(int sessionId)
      Sends a keep alive call to the current session to reset the session timeout.
      Parameters:
      sessionId - Identifier for the session.
      Returns:
      the completion.
      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 Mono<Void> resetSparkSessionTimeout(int sessionId)
      Sends a keep alive call to the current session to reset the session timeout.
      Parameters:
      sessionId - Identifier for the session.
      Returns:
      the completion.
      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 Mono<Response<SparkStatementCollection>> getSparkStatementsWithResponse(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.
    • getSparkStatements

      public Mono<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.
    • createSparkStatementWithResponse

      public Mono<Response<SparkStatement>> createSparkStatementWithResponse(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.
    • createSparkStatement

      public Mono<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.
    • getSparkStatementWithResponse

      public Mono<Response<SparkStatement>> getSparkStatementWithResponse(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.
    • getSparkStatement

      public Mono<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.
    • cancelSparkStatementWithResponse

      public Mono<Response<SparkStatementCancellationResult>> cancelSparkStatementWithResponse(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.
    • cancelSparkStatement

      public Mono<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.