Skip to content

/AWS1/IF_EMR=>STARTSESSION()

About StartSession

Creates and starts a new Spark Connect session on the specified cluster. The cluster must be in the RUNNING or WAITING state and have sessions enabled. This operation is supported in Amazon EMR Spark 8.0.0 and later.

Method Signature

METHODS /AWS1/IF_EMR~STARTSESSION
  IMPORTING
    !IV_NAME TYPE /AWS1/EMRXMLSTRINGMAXLEN256 OPTIONAL
    !IV_CLUSTERID TYPE /AWS1/EMRCLUSTERID OPTIONAL
    !IV_EXECUTIONROLEARN TYPE /AWS1/EMRIAMROLEARN OPTIONAL
    !IT_ENGINECONFIGURATIONS TYPE /AWS1/CL_EMRCONFIGURATION=>TT_CONFIGURATIONLIST OPTIONAL
    !IO_MONITORINGCONFIGURATION TYPE REF TO /AWS1/CL_EMRSESSIONMONCONF OPTIONAL
    !IV_SESSIONIDLETIMEOUTINMINS TYPE /AWS1/EMRLONG OPTIONAL
    !IV_CLIENTREQUESTTOKEN TYPE /AWS1/EMRCLIENTREQUESTTOKEN OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_EMRTAG=>TT_TAGLIST OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_emrstartsessionoutput
  RAISING
    /AWS1/CX_EMRINTERNALSERVEREX
    /AWS1/CX_EMRINVALIDREQUESTEX
    /AWS1/CX_EMRCLIENTEXC
    /AWS1/CX_EMRSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_clusterid TYPE /AWS1/EMRCLUSTERID /AWS1/EMRCLUSTERID

The ID of the cluster on which to start the session.

Optional arguments:

iv_name TYPE /AWS1/EMRXMLSTRINGMAXLEN256 /AWS1/EMRXMLSTRINGMAXLEN256

An optional name for the session.

iv_executionrolearn TYPE /AWS1/EMRIAMROLEARN /AWS1/EMRIAMROLEARN

The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.

it_engineconfigurations TYPE /AWS1/CL_EMRCONFIGURATION=>TT_CONFIGURATIONLIST TT_CONFIGURATIONLIST

The configuration overrides for the session. Only runtime configuration overrides are supported.

io_monitoringconfiguration TYPE REF TO /AWS1/CL_EMRSESSIONMONCONF /AWS1/CL_EMRSESSIONMONCONF

The monitoring configuration that controls where session logs are published, such as Amazon S3, CloudWatch, or managed logging.

iv_sessionidletimeoutinmins TYPE /AWS1/EMRLONG /AWS1/EMRLONG

The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR EC2 automatically terminates it.

iv_clientrequesttoken TYPE /AWS1/EMRCLIENTREQUESTTOKEN /AWS1/EMRCLIENTREQUESTTOKEN

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client request token, the service returns the original response without performing the operation again.

it_tags TYPE /AWS1/CL_EMRTAG=>TT_TAGLIST TT_TAGLIST

The tags to assign to the session.

RETURNING

oo_output TYPE REF TO /aws1/cl_emrstartsessionoutput /AWS1/CL_EMRSTARTSESSIONOUTPUT

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->startsession(
  io_monitoringconfiguration = new /aws1/cl_emrsessionmonconf(
    io_cloudwatchloggingconf = new /aws1/cl_emrsesscloudwatchlo00(
      it_logtypes = VALUE /aws1/cl_emrxmlstringlist_w=>tt_logtypesmap(
        (
          VALUE /aws1/cl_emrxmlstringlist_w=>ts_logtypesmap_maprow(
            key = |string|
            value = VALUE /aws1/cl_emrxmlstringlist_w=>tt_xmlstringlist(
              ( new /aws1/cl_emrxmlstringlist_w( |string| ) )
            )
          )
        )
      )
      iv_enabled = ABAP_TRUE
      iv_encryptionkeyarn = |string|
      iv_loggroup = |string|
      iv_logstreamnameprefix = |string|
    )
    io_managedloggingconf = new /aws1/cl_emrsessmngdlogconf(
      iv_enabled = ABAP_TRUE
      iv_encryptionkeyarn = |string|
    )
    io_s3loggingconfiguration = new /aws1/cl_emrsess3loggingconf(
      it_logtypes = VALUE /aws1/cl_emrxmlstringlist_w=>tt_logtypesmap(
        (
          VALUE /aws1/cl_emrxmlstringlist_w=>ts_logtypesmap_maprow(
            key = |string|
            value = VALUE /aws1/cl_emrxmlstringlist_w=>tt_xmlstringlist(
              ( new /aws1/cl_emrxmlstringlist_w( |string| ) )
            )
          )
        )
      )
      iv_enabled = ABAP_TRUE
      iv_encryptionkeyarn = |string|
      iv_loguri = |string|
    )
  )
  it_engineconfigurations = VALUE /aws1/cl_emrconfiguration=>tt_configurationlist(
    (
      new /aws1/cl_emrconfiguration(
        it_configurations = VALUE /aws1/cl_emrconfiguration=>tt_configurationlist(
        )
        it_properties = VALUE /aws1/cl_emrstringmap_w=>tt_stringmap(
          (
            VALUE /aws1/cl_emrstringmap_w=>ts_stringmap_maprow(
              key = |string|
              value = new /aws1/cl_emrstringmap_w( |string| )
            )
          )
        )
        iv_classification = |string|
      )
    )
  )
  it_tags = VALUE /aws1/cl_emrtag=>tt_taglist(
    (
      new /aws1/cl_emrtag(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
  iv_clientrequesttoken = |string|
  iv_clusterid = |string|
  iv_executionrolearn = |string|
  iv_name = |string|
  iv_sessionidletimeoutinmins = 123
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_sessionid = lo_result->get_id( ).
  lv_clusterid = lo_result->get_clusterid( ).
  lv_arntype = lo_result->get_arn( ).
  lv_xmlstringmaxlen256 = lo_result->get_accountid( ).
  lv_sessionstate = lo_result->get_state( ).
ENDIF.