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.5.4 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.3.5 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.5.3 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.5.2 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.5.1 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.5.0 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.3.4 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.4.0 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.2.18.2 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.3.3 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.3.2 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.3.1 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.3.0 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.2.24 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.2.18.1 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.2.23 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.2.22 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.2.21 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.2.20 lib/disk/modules/AzureBlobDisk.rb
manageiq-smartstate-0.2.19 lib/disk/modules/AzureBlobDisk.rb