2 # -*- coding: utf-8 -*-
5 sys
.path
.insert(0, "/usr/lib/")
6 sys
.path
.insert(0, "./.libs/")
7 sys
.path
.insert(0, "bindings/python/.libs/")
8 from libelliptics_python
import *
12 def __init__(self
, remotes
=[], groups
=[], log
='/dev/stdout', mask
=8, path
=''):
13 self
.log
= elliptics_log_file(log
, mask
)
14 self
.n
= elliptics_node_python(self
.log
)
16 self
.n
.add_groups(groups
)
19 self
.n
.add_remote(r
[0], r
[1])
22 if len(self
.n
.get_routes()) == 0:
23 raise NameError("Route table for group " + str(group
) + " is empty")
26 for id in b
.iterate(want_removed
=True):
29 eid
= elliptics_id(list(bytearray(id)), g
, -1)
32 print "%s: flags: %x, position: %d, data_size: %d" % \
33 (b
.sid(count
=64), b
.flags
, b
.position
, b
.data_size
)
36 if __name__
== '__main__':
37 # this script runs over index for given blob, finds all removed entries and removes them from the storage
39 # list of tuples of remote addresses to connect and grab route table
40 remotes
= [('elisto19f.dev', 1025)]
45 # Path to blob to get objects from. Index file must be near with .index suffix
46 inpath
='/opt/elliptics/eblob.2/data.0'
49 remover(remotes
=remotes
, groups
=groups
, path
=inpath
)
50 except NameError as e
: