alephant-sequencer 1.2.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4570103faf053dd8afeabdb9178b0778df846d3b
|
4
|
+
data.tar.gz: 659abaf0cbd4076ff51f243ef9a29196d2353463
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edddb7427b92d890e8b60c062e3bbf6571257a7b18c9b33c41432f972e31a533e110f38ddcffdb49b6f9a58bf7f2c84f3d61149738a65579d88e6a018cee1ead
|
7
|
+
data.tar.gz: 8182c93059341e7c63be14c35c9577b8bd1f540b12a5fb5caa5e4275622ecf67e2ae3126025cc08cd8f20762a079454453cea25f9ac62215d8bca0b086b6f6b6
|
@@ -66,10 +66,24 @@ module Alephant
|
|
66
66
|
})
|
67
67
|
end
|
68
68
|
|
69
|
-
logger.info(
|
69
|
+
logger.info(
|
70
|
+
"event" => "SequenceIdUpdated",
|
71
|
+
"id" => ident,
|
72
|
+
"value" => value,
|
73
|
+
"method" => "#{self.class}#update_sequence_id"
|
74
|
+
)
|
70
75
|
rescue AWS::DynamoDB::Errors::ConditionalCheckFailedException
|
71
76
|
logger.metric "SequencerFailedConditionalChecks"
|
72
|
-
logger.
|
77
|
+
logger.error(
|
78
|
+
"event" => "DynamoDBConditionalCheckFailed",
|
79
|
+
"newSequenceValue" => value,
|
80
|
+
"currentSequenceValue" => current_sequence,
|
81
|
+
"id" => ident,
|
82
|
+
"class" => e.class,
|
83
|
+
"message" => e.message,
|
84
|
+
"backtrace" => e.backtrace.join("\n"),
|
85
|
+
"method" => "#{self.class}#update_sequence_id"
|
86
|
+
)
|
73
87
|
end
|
74
88
|
end
|
75
89
|
|
@@ -14,7 +14,13 @@ module Alephant
|
|
14
14
|
@exists = exists?
|
15
15
|
@jsonpath = sequence_path
|
16
16
|
@ident = id
|
17
|
-
logger.info(
|
17
|
+
logger.info(
|
18
|
+
"event" => "SequencerInitialized",
|
19
|
+
"sequenceTable" => sequence_table,
|
20
|
+
"jsonPath" => sequence_path,
|
21
|
+
"id" => id,
|
22
|
+
"method" => "#{self.class}#initialize"
|
23
|
+
)
|
18
24
|
end
|
19
25
|
|
20
26
|
def sequential?(msg)
|
@@ -35,14 +41,24 @@ module Alephant
|
|
35
41
|
set_last_seen(msg, last_seen_id)
|
36
42
|
else
|
37
43
|
logger.metric "SequencerNonSequentialMessageCount"
|
38
|
-
logger.info(
|
44
|
+
logger.info(
|
45
|
+
"event" => "NonSequentialMessageReceived",
|
46
|
+
"id" => ident,
|
47
|
+
"lastSeenId" => last_seen_id,
|
48
|
+
"method" => "#{self.class}#validate"
|
49
|
+
)
|
39
50
|
end
|
40
51
|
end
|
41
52
|
|
42
53
|
def delete!
|
43
|
-
logger.info("Sequencer#delete!: #{ident}")
|
44
54
|
@exists = false
|
45
|
-
@sequence_table.delete_item!(ident)
|
55
|
+
@sequence_table.delete_item!(ident).tap do
|
56
|
+
logger.info(
|
57
|
+
"event" => "SequenceIdDeleted",
|
58
|
+
"id" => ident,
|
59
|
+
"method" => "#{self.class}#delete!"
|
60
|
+
)
|
61
|
+
end
|
46
62
|
end
|
47
63
|
|
48
64
|
def truncate!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alephant-sequencer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BBC News
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|