Skip to content

Commit

Permalink
Remove batching of inconsistent records.
Browse files Browse the repository at this point in the history
Printing all discovered inconsistent records to stdout as a batch contradicts
with various things, such as pyDKB's file mode and the possibility of
controlling the workflow with Apache Kafka.

Create an output message with _id and _type for each inconsistent record.
Still exit with code 1 if at least one inconsistent record was found,
0 otherwise.
  • Loading branch information
Evildoor committed Apr 18, 2019
1 parent 72d85a9 commit cacba11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Utils/Dataflow/071_esConsistency/consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def log(msg, prefix='DEBUG'):


INDEX = None
FOUND_DIFF = []
FOUND_DIFF = False


def load_config(fname):
Expand Down Expand Up @@ -166,8 +166,10 @@ def process(stage, message):
if data != es_data:
log('Document (%s, %d) differs between Oracle and ES: Oracle:%s ES:%s'
% (_type, _id, data, es_data), 'WARN')
out_message = JSONMessage({'_type': _type, '_id': _id})
stage.output(out_message)
global FOUND_DIFF
FOUND_DIFF.append((_type, _id))
FOUND_DIFF = True
else:
log('Document (%s, %d) is up to date in ES' % (_type, _id), 'INFO')

Expand Down Expand Up @@ -218,8 +220,6 @@ def main(args):
if exit_code == 0 and FOUND_DIFF:
exit_code = 1

print FOUND_DIFF

exit(exit_code)


Expand Down

0 comments on commit cacba11

Please sign in to comment.