Sha256: 235b8bd9633fbbaec7f17d6ad9da68560846f6f8f0903f1881bb9bdf76a7f140

Contents?: true

Size: 993 Bytes

Versions: 63

Compression:

Stored size: 993 Bytes

Contents

require "disk/modules/AzureDiskCommon"
require_relative "../MiqDisk"
require 'ostruct'

module AzureBlobDisk
  include AzureDiskCommon
  # The maximum read length that supports MD5 return.
  MAX_READ_LEN = 1024 * 1024 * 4

  def self.new(svc, blob_uri, dInfo = nil)
    d_info = dInfo || OpenStruct.new
    d_info.storage_acct_svc = svc
    d_info.blob_uri         = blob_uri
    d_info.fileName         = blob_uri

    MiqDisk.new(self, d_info, 0)
  end

  def d_init
    @diskType         = "azure-blob"
    @blockSize        = AzureDiskCommon::SECTOR_LENGTH
    @blob_uri         = @dInfo.blob_uri
    @storage_acct_svc = @dInfo.storage_acct_svc
    d_init_common(@dInfo)
  end

  def d_close
    d_close_common
  end

  def d_read(pos, len)
    $log.debug "AzureBlobDisk#d_read(#{pos}, #{len})"
    d_read_common(pos, len)
  end

  def d_size
    @d_size ||= blob_properties[:content_length].to_i
  end

  def d_write(_pos, _buf, _len)
    raise "Write operation not supported."
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
manageiq-smartstate-0.10.1 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.10.0 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.9.0 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.8.1 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.8.0 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.7.0 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.6.2 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.5.10 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.3.10 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.6.1 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.3.9 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.6.0 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.5.9 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.5.8 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.3.8 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.5.7 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.3.7 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.5.6 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.3.6 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.5.5 lib/disk/modules/AzureBlobDisk.rb