storazzo 0.5.7 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +7 -5
- data/Makefile +8 -6
- data/Rakefile +15 -13
- data/VERSION +1 -1
- data/bin/hello-storazzo +1 -0
- data/bin/ricdisk-magic +33 -30
- data/bin/stats-with-md5 +182 -157
- data/bin/storazzo +112 -114
- data/bin/storazzo-symlink.rb +1 -0
- data/lib/storazzo/colors.rb +77 -36
- data/lib/storazzo/common.rb +72 -68
- data/lib/storazzo/debug.rb +2 -0
- data/lib/storazzo/hashify.rb +7 -5
- data/lib/storazzo/main.rb +59 -49
- data/lib/storazzo/media/abstract_ric_disk.rb +188 -179
- data/lib/storazzo/media/gcs_bucket.rb +76 -58
- data/lib/storazzo/media/local_folder.rb +56 -42
- data/lib/storazzo/media/mount_point.rb +20 -12
- data/lib/storazzo/ric_disk.rb +386 -383
- data/lib/storazzo/ric_disk_config.rb +227 -209
- data/lib/storazzo/ric_disk_sample_config.rb +26 -24
- data/lib/storazzo/ric_disk_statsfile.rb +19 -17
- data/lib/storazzo/ric_disk_ugly.rb +1 -0
- data/lib/storazzo/version.rb +3 -3
- data/lib/storazzo.rb +6 -7
- data/storazzo.gemspec +24 -16
- data/test/benchmark/for_future_use.rb +4 -2
- data/test/benchmark/test_hashing_functions-speed.rb +17 -0
- data/test/bin/new-idea.rb +17 -0
- data/test/bin/storazzo.rb +22 -25
- data/test/media/test_abstract_ric_disk.rb +5 -3
- data/test/media/test_gcs_bucket.rb +24 -23
- data/test/media/test_local_folder.rb +24 -23
- data/test/media/test_mount_point.rb +6 -5
- data/test/test_ric_disk.rb +6 -4
- data/test/test_ric_disk_config.rb +12 -11
- data/test/test_ric_disk_stats_file.rb +5 -3
- data/test/test_storazzo.rb +6 -4
- data/var/test/disks/disk02-full/Rakefile +7 -5
- data/var/test/disks/ricdisk_stats_v11.rds +11 -0
- metadata +13 -21
@@ -1,48 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# require "storazzo/ric_disk/abstract_ric_disk"
|
2
4
|
# require "abstract_ric_disk"
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
6
|
+
require 'English'
|
7
|
+
module Storazzo
|
8
|
+
module Media
|
9
|
+
module Storazzo
|
10
|
+
module Media
|
11
|
+
class LocalFolder < Storazzo::Media::AbstractRicDisk
|
12
|
+
# extend Storazzo::Common
|
13
|
+
include Storazzo::Common
|
14
|
+
|
15
|
+
attr_accessor :local_mountpoint, :wr
|
16
|
+
|
17
|
+
def initialize(local_mount)
|
18
|
+
deb '[Storazzo::Media::LocalFolder] initialize'
|
19
|
+
|
20
|
+
@local_mountpoint = File.expand_path(local_mount)
|
21
|
+
@description = "Local Folder originally in '#{local_mount}'"
|
22
|
+
raise 'Sorry local mount doesnt exist!' unless File.exist?(@local_mountpoint)
|
23
|
+
|
24
|
+
@wr = writeable? # File.writable?(stats_filename_default_fullpath) # .writeable? stats_file_smart_fullpath
|
25
|
+
# super.initialize(local_mount) rescue "SUPER_ERROR: #{$!}"
|
26
|
+
begin
|
27
|
+
super(local_mount)
|
28
|
+
rescue StandardError
|
29
|
+
"SUPER_ERROR(#{local_mount}): #{$ERROR_INFO}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# WRONG: config = nil
|
34
|
+
def self.list_all
|
35
|
+
# get lists from Config singleton
|
36
|
+
config = Storazzo::RicDiskConfig.instance # # ).get_config
|
37
|
+
config.load
|
38
|
+
config.get_local_folders
|
39
|
+
end
|
40
|
+
|
41
|
+
def parse(opts = {})
|
42
|
+
puts "LF.parse(#{opts}): TODO Sbrodola inside the dir: #{local_mountpoint}"
|
43
|
+
parse_block_storage_folder
|
44
|
+
end
|
45
|
+
|
46
|
+
def path
|
47
|
+
@local_mountpoint
|
48
|
+
end
|
49
|
+
|
50
|
+
def writeable?
|
51
|
+
File.writable?(@local_mountpoint)
|
52
|
+
end
|
53
|
+
|
54
|
+
def default_stats_filename
|
55
|
+
# '42'
|
56
|
+
Storazzo::RicDiskStatsFile.default_name
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
46
60
|
end
|
47
61
|
end
|
48
62
|
end
|
@@ -1,19 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# TODO
|
2
|
-
module Storazzo
|
3
|
-
|
4
|
-
|
4
|
+
module Storazzo
|
5
|
+
module Media
|
6
|
+
module Storazzo
|
7
|
+
module Media
|
8
|
+
class MountPoint < Storazzo::Media::AbstractRicDisk
|
9
|
+
# puts "[REMOVEME] Storazzo::Media::MountPoint being read. REMOVEME when you see this :)"
|
5
10
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
11
|
+
def self.list_local_mount_points
|
12
|
+
deb 'Maybe its abuot time you refactor that method here :)'
|
13
|
+
RicDisk.interesting_mount_points
|
14
|
+
end
|
10
15
|
|
11
|
-
|
12
|
-
|
13
|
-
|
16
|
+
def self.list_all
|
17
|
+
RicDisk.interesting_mount_points
|
18
|
+
end
|
14
19
|
|
15
|
-
|
16
|
-
|
20
|
+
def self.list_all_with_type
|
21
|
+
list_all.map { |x| [:mount_point_todo_less_generic, x] }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
17
25
|
end
|
18
26
|
end
|
19
27
|
end
|