module Trino::Client::ModelVersions::V303::TaskStats

Public Class Methods

decode(hash) click to toggle source
# File lib/trino/client/model_versions/303.rb, line 2311
def decode(hash)
  unless hash.is_a?(Hash)
    raise TypeError, "Can't convert #{hash.class} to Hash"
  end
  obj = allocate
  obj.send(:initialize_struct,
    hash["createTime"],
    hash["firstStartTime"],
    hash["lastStartTime"],
    hash["lastEndTime"],
    hash["endTime"],
    hash["elapsedTime"],
    hash["queuedTime"],
    hash["totalDrivers"],
    hash["queuedDrivers"],
    hash["queuedPartitionedDrivers"],
    hash["runningDrivers"],
    hash["runningPartitionedDrivers"],
    hash["blockedDrivers"],
    hash["completedDrivers"],
    hash["cumulativeUserMemory"],
    hash["userMemoryReservation"],
    hash["revocableMemoryReservation"],
    hash["systemMemoryReservation"],
    hash["totalScheduledTime"],
    hash["totalCpuTime"],
    hash["totalBlockedTime"],
    hash["fullyBlocked"],
    hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
    hash["physicalInputDataSize"],
    hash["physicalInputPositions"],
    hash["internalNetworkInputDataSize"],
    hash["internalNetworkInputPositions"],
    hash["rawInputDataSize"],
    hash["rawInputPositions"],
    hash["processedInputDataSize"],
    hash["processedInputPositions"],
    hash["outputDataSize"],
    hash["outputPositions"],
    hash["physicalWrittenDataSize"],
    hash["fullGcCount"],
    hash["fullGcTime"],
    hash["pipelines"] && hash["pipelines"].map {|h| PipelineStats.decode(h) },
  )
  obj
end