Represents a Spark application submitted with fabric_livy_batch_submit()
Use $wait() to wait for completion, $result() or $logs() to inspect the
outcome, and $cancel() to request cancellation. Most users do not need to
call this 'R6' class directly. These lifecycle methods do not have separate
free-function wrappers
Format
An R6::R6Class generator
Public fields
idFabric batch ID
urlBatch lifecycle URL
stateLatest batch state
responseLatest raw service response
cancel_requestedWhether
$cancel()was called successfullysubmitted_localLocal submission timestamp
completed_localLocal completion timestamp
verboseWhether lifecycle messages are enabled
Methods
FabricLivyBatch$new()
Internal constructor used by
fabric_livy_batch_submit()
Usage
FabricLivyBatch$new(response, url, credential, verbose = TRUE)FabricLivyBatch$status()
Retrieve current batch metadata
FabricLivyBatch$wait()
Wait for the batch to reach a terminal state
Usage
FabricLivyBatch$wait(
timeout = 1200,
poll_interval = 5,
error_on_failure = TRUE,
cancel_on_timeout = FALSE
)FabricLivyBatch$result()
Return structured batch metadata and logs
Examples
if (FALSE) { # \dontrun{
# fabric_livy_batch_submit() returns this class for a submitted Spark job
workspace <- fabric_workspaces()[[1L]]
lakehouse <- fabric_lakehouses(workspace)[[1L]]
scripts <- fabric_onelake_list(workspace, lakehouse, "Files/jobs")
script <- scripts[grepl("[.]py$", scripts$path), ][1L, ]
script_uri <- paste0(
"abfss://", workspace$id, "@onelake.dfs.fabric.microsoft.com/",
lakehouse$id, "/", script$path[[1L]]
)
batch <- fabric_livy_batch_submit(
lakehouse,
file = script_uri
)
inherits(batch, "FabricLivyBatch")
# Wait for completion, then inspect the application result and logs
batch$wait()
batch$result()
batch$logs()
} # }