shameless 0.6.1 → 0.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2526346314c5a0cfa3bf8b5213b703701c7aa195
4
- data.tar.gz: 0a480b7a99749fc5cdc8ed6942abc954e4311541
2
+ SHA256:
3
+ metadata.gz: 62705914e1b3d5a6e300d9038b669340ce5bca3cd9ae6fa5f42f22aee5933c94
4
+ data.tar.gz: 235c7b59732597c09afe2c90d9860e9ed35f59005b305460b7810e7394cc047a
5
5
  SHA512:
6
- metadata.gz: eb55ac5e9d0cfe640e51a15d5721364094759ff4bb0f1b62a3e017b252b7f65ef62b71549b5be244124ebc54579978dab1575701224858cb4191f87c2cb24192
7
- data.tar.gz: b499a86c1f3ad9081484798c89998a183844a1c92e3aa1735f7a607926c86e414e2912ef910581fd2fb8ac081f15d3dcf73a63826d4449d26874d65d2fa5f895
6
+ metadata.gz: 1791591147dfb26da4c28ffdc83fad51c6ef4cf03697950697d396b41a085f24434edc120bae3c0b30d2260d0dc3fa32b68cda96c247e33d241bfeaf43550510
7
+ data.tar.gz: '08b5c198fbb14bceb004b422032615370f6b1d17db538067dce98ea3fe7b5548e94356c6ed3b5826d41ba746ff930ed51870895e09dc436b80707a7224dec5ed'
@@ -1,5 +1,9 @@
1
1
  ### Unreleased
2
2
 
3
+ ### 0.7.0 (2019-04-23)
4
+
5
+ * Add `Model.max_id_on_shard`
6
+
3
7
  ### 0.6.1 (2017-07-31)
4
8
 
5
9
  * Fix Sequel deprecation warning
@@ -74,6 +74,10 @@ module Shameless
74
74
  end
75
75
  end
76
76
 
77
+ def max_id_on_shard(shard)
78
+ @store.find_table(table_name, shard).max(:id)
79
+ end
80
+
77
81
  def table_name
78
82
  [@store.name, @name].compact.join('_')
79
83
  end
@@ -64,6 +64,13 @@ module Shameless
64
64
  shardable_value % @configuration.shards_count
65
65
  end
66
66
 
67
+ def find_table(table_name, shardable_value)
68
+ shard = find_shard(shardable_value)
69
+ partition = find_partition_for_shard(shard)
70
+ table_name = table_name_with_shard(table_name, shard)
71
+ partition.from(table_name)
72
+ end
73
+
67
74
  private
68
75
 
69
76
  def models_hash
@@ -103,13 +110,6 @@ module Shameless
103
110
  shard.to_s.rjust(6, '0')
104
111
  end
105
112
 
106
- def find_table(table_name, shardable_value)
107
- shard = find_shard(shardable_value)
108
- partition = find_partition_for_shard(shard)
109
- table_name = table_name_with_shard(table_name, shard)
110
- partition.from(table_name)
111
- end
112
-
113
113
  def find_partition_for_shard(shard)
114
114
  partition_index = shard / @configuration.shards_per_partition_count
115
115
  partitions[partition_index]
@@ -1,3 +1,3 @@
1
1
  module Shameless
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -5,8 +5,8 @@ require 'shameless/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "shameless"
7
7
  spec.version = Shameless::VERSION
8
- spec.authors = ["Olek Janiszewski"]
9
- spec.email = ["olek@hoteltonight.com"]
8
+ spec.authors = ["Olek Janiszewski", "Chas Lemley", "Marek Rosa"]
9
+ spec.email = ["olek@hoteltonight.com", "chas@hoteltonight.com", "marek@hoteltonight.com"]
10
10
 
11
11
  spec.summary = %q{Scalable distributed append-only data store}
12
12
  spec.homepage = "https://github.com/hoteltonight/shameless"
metadata CHANGED
@@ -1,14 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shameless
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olek Janiszewski
8
+ - Chas Lemley
9
+ - Marek Rosa
8
10
  autorequire:
9
11
  bindir: exe
10
12
  cert_chain: []
11
- date: 2017-07-31 00:00:00.000000000 Z
13
+ date: 2019-04-24 00:00:00.000000000 Z
12
14
  dependencies:
13
15
  - !ruby/object:Gem::Dependency
14
16
  name: msgpack
@@ -97,6 +99,8 @@ dependencies:
97
99
  description:
98
100
  email:
99
101
  - olek@hoteltonight.com
102
+ - chas@hoteltonight.com
103
+ - marek@hoteltonight.com
100
104
  executables: []
101
105
  extensions: []
102
106
  extra_rdoc_files: []
@@ -139,8 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
143
  - !ruby/object:Gem::Version
140
144
  version: '0'
141
145
  requirements: []
142
- rubyforge_project:
143
- rubygems_version: 2.6.10
146
+ rubygems_version: 3.0.3
144
147
  signing_key:
145
148
  specification_version: 4
146
149
  summary: Scalable distributed append-only data store