Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
5ef342b1
Commit
5ef342b1
authored
Sep 05, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0ef5e1ba
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
go/neo/t/t.sh
go/neo/t/t.sh
+3
-3
go/neo/t/zsha1.go
go/neo/t/zsha1.go
+8
-2
go/neo/t/zsha1.py
go/neo/t/zsha1.py
+4
-1
No files found.
go/neo/t/t.sh
View file @
5ef342b1
...
...
@@ -150,7 +150,7 @@ EOF
mysql_install_db
--defaults-file
=
$mycnf
fi
mysqld
--defaults-file
=
$mycnf
&
mysqld
--defaults-file
=
$mycnf
--log-error
=
$log
/mdb.log
&
}
xmysql
()
{
...
...
@@ -208,8 +208,8 @@ gensqlite() {
#neopylite
neopysql
#time demo-zbigarray read neo://$cluster@$Mbind
./zsha1.py neo://
$cluster
@
$Mbind
go run zsha1.go neo://
$cluster
@
$Mbind
#./zsha1.py neo://$cluster@$Mbind 2>py.log
go run zsha1.go neo://
$cluster
@
$Mbind
2>go.log
xneoctl
set
cluster stopping
xmysql
-e
"SHUTDOWN"
...
...
go/neo/t/zsha1.go
View file @
5ef342b1
// zsha1 - compute sha1 of whole latest objects stream in a ZODB database
package
main
// +build ignore
import
(
"context"
"crypto/sha1"
...
...
@@ -32,7 +34,9 @@ func main() {
}
before
:=
lastTid
+
1
// XXX overflow ?
if
false
{
defer
profile
.
Start
()
.
Stop
()
}
tstart
:=
time
.
Now
()
m
:=
sha1
.
New
()
...
...
@@ -42,7 +46,7 @@ func main() {
loop
:
for
{
xid
:=
zodb
.
Xid
{
Oid
:
oid
,
XTid
:
zodb
.
XTid
{
Tid
:
before
,
TidBefore
:
true
}}
data
,
_
,
err
:=
stor
.
Load
(
bg
,
xid
)
data
,
serial
,
err
:=
stor
.
Load
(
bg
,
xid
)
switch
err
.
(
type
)
{
case
nil
:
// ok
...
...
@@ -54,6 +58,8 @@ loop:
m
.
Write
(
data
)
fmt
.
Fprintf
(
os
.
Stderr
,
"%d @%s
\t
sha1: %x
\n
"
,
uint
(
oid
),
serial
,
m
.
Sum
(
nil
))
nread
+=
len
(
data
)
oid
+=
1
}
...
...
go/neo/t/zsha1.py
View file @
5ef342b1
#!/usr/bin/env python
"""zsha1 - compute sha1 of whole latest objects stream in a ZODB database"""
from
__future__
import
print_function
import
zodbtools.util
from
ZODB.POSException
import
POSKeyError
from
ZODB.utils
import
p64
,
u64
...
...
@@ -27,9 +29,10 @@ def main():
except
POSKeyError
:
break
#print('%s @%s' % (oid, u64(serial)))
m
.
update
(
data
)
print
(
'%s @%s
\
t
sha1: %s'
%
(
oid
,
u64
(
serial
),
m
.
hexdigest
()),
file
=
sys
.
stderr
)
nread
+=
len
(
data
)
oid
+=
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment