module PrestoLegacy::Client::Models::DriverStats

Public Class Methods

decode(hash) click to toggle source
# File lib/presto_legacy/client/models.rb, line 396
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["startTime"],
    hash["endTime"],
    hash["queuedTime"],
    hash["elapsedTime"],
    hash["memoryReservation"],
    hash["systemMemoryReservation"],
    hash["totalScheduledTime"],
    hash["totalCpuTime"],
    hash["totalUserTime"],
    hash["totalBlockedTime"],
    hash["fullyBlocked"],
    hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
    hash["rawInputDataSize"],
    hash["rawInputPositions"],
    hash["rawInputReadTime"],
    hash["processedInputDataSize"],
    hash["processedInputPositions"],
    hash["outputDataSize"],
    hash["outputPositions"],
    hash["operatorStats"] && hash["operatorStats"].map {|h| OperatorStats.decode(h) },
  )
  obj
end