Class: StructuredDataToSql::MysqlDumpXml::TableDiscovery::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/structured_data_to_sql/mysql_dump_xml/table_discovery.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bytes_scannedObject

Returns the value of attribute bytes_scanned

Returns:

  • (Object)

    the current value of bytes_scanned



25
26
27
# File 'lib/structured_data_to_sql/mysql_dump_xml/table_discovery.rb', line 25

def bytes_scanned
  @bytes_scanned
end

#filesObject

Returns the value of attribute files

Returns:

  • (Object)

    the current value of files



25
26
27
# File 'lib/structured_data_to_sql/mysql_dump_xml/table_discovery.rb', line 25

def files
  @files
end

#files_foundObject

Returns the value of attribute files_found

Returns:

  • (Object)

    the current value of files_found



25
26
27
# File 'lib/structured_data_to_sql/mysql_dump_xml/table_discovery.rb', line 25

def files_found
  @files_found
end

#files_skippedObject

Returns the value of attribute files_skipped

Returns:

  • (Object)

    the current value of files_skipped



25
26
27
# File 'lib/structured_data_to_sql/mysql_dump_xml/table_discovery.rb', line 25

def files_skipped
  @files_skipped
end

#skippedObject

Returns the value of attribute skipped

Returns:

  • (Object)

    the current value of skipped



25
26
27
# File 'lib/structured_data_to_sql/mysql_dump_xml/table_discovery.rb', line 25

def skipped
  @skipped
end

#table_metadataObject

Returns the value of attribute table_metadata

Returns:

  • (Object)

    the current value of table_metadata



25
26
27
# File 'lib/structured_data_to_sql/mysql_dump_xml/table_discovery.rb', line 25

def 
  @table_metadata
end

#tablesObject

Returns the value of attribute tables

Returns:

  • (Object)

    the current value of tables



25
26
27
# File 'lib/structured_data_to_sql/mysql_dump_xml/table_discovery.rb', line 25

def tables
  @tables
end

#truncatedObject

Returns the value of attribute truncated

Returns:

  • (Object)

    the current value of truncated



25
26
27
# File 'lib/structured_data_to_sql/mysql_dump_xml/table_discovery.rb', line 25

def truncated
  @truncated
end

Instance Method Details

#sorted_tablesObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/structured_data_to_sql/mysql_dump_xml/table_discovery.rb', line 37

def sorted_tables
  sized, unsized =
    tables.partition do |table|
      TableDiscovery.size_metadata?([table])
    end
  sized.sort_by do |table|
     = [table] || {}
    [
      -TableDiscovery.total_size(),
      -[:rows].to_i,
      table
    ]
  end + unsized.sort
end