Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
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
...
@@ -150,7 +150,7 @@ EOF
mysql_install_db
--defaults-file
=
$mycnf
mysql_install_db
--defaults-file
=
$mycnf
fi
fi
mysqld
--defaults-file
=
$mycnf
&
mysqld
--defaults-file
=
$mycnf
--log-error
=
$log
/mdb.log
&
}
}
xmysql
()
{
xmysql
()
{
...
@@ -208,8 +208,8 @@ gensqlite() {
...
@@ -208,8 +208,8 @@ gensqlite() {
#neopylite
#neopylite
neopysql
neopysql
#time demo-zbigarray read neo://$cluster@$Mbind
#time demo-zbigarray read neo://$cluster@$Mbind
./zsha1.py neo://
$cluster
@
$Mbind
#./zsha1.py neo://$cluster@$Mbind 2>py.log
go run zsha1.go neo://
$cluster
@
$Mbind
go run zsha1.go neo://
$cluster
@
$Mbind
2>go.log
xneoctl
set
cluster stopping
xneoctl
set
cluster stopping
xmysql
-e
"SHUTDOWN"
xmysql
-e
"SHUTDOWN"
...
...
go/neo/t/zsha1.go
View file @
5ef342b1
// zsha1 - compute sha1 of whole latest objects stream in a ZODB database
// zsha1 - compute sha1 of whole latest objects stream in a ZODB database
package
main
package
main
// +build ignore
import
(
import
(
"context"
"context"
"crypto/sha1"
"crypto/sha1"
...
@@ -32,7 +34,9 @@ func main() {
...
@@ -32,7 +34,9 @@ func main() {
}
}
before
:=
lastTid
+
1
// XXX overflow ?
before
:=
lastTid
+
1
// XXX overflow ?
if
false
{
defer
profile
.
Start
()
.
Stop
()
defer
profile
.
Start
()
.
Stop
()
}
tstart
:=
time
.
Now
()
tstart
:=
time
.
Now
()
m
:=
sha1
.
New
()
m
:=
sha1
.
New
()
...
@@ -42,7 +46,7 @@ func main() {
...
@@ -42,7 +46,7 @@ func main() {
loop
:
loop
:
for
{
for
{
xid
:=
zodb
.
Xid
{
Oid
:
oid
,
XTid
:
zodb
.
XTid
{
Tid
:
before
,
TidBefore
:
true
}}
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
)
{
switch
err
.
(
type
)
{
case
nil
:
case
nil
:
// ok
// ok
...
@@ -54,6 +58,8 @@ loop:
...
@@ -54,6 +58,8 @@ loop:
m
.
Write
(
data
)
m
.
Write
(
data
)
fmt
.
Fprintf
(
os
.
Stderr
,
"%d @%s
\t
sha1: %x
\n
"
,
uint
(
oid
),
serial
,
m
.
Sum
(
nil
))
nread
+=
len
(
data
)
nread
+=
len
(
data
)
oid
+=
1
oid
+=
1
}
}
...
...
go/neo/t/zsha1.py
View file @
5ef342b1
#!/usr/bin/env python
#!/usr/bin/env python
"""zsha1 - compute sha1 of whole latest objects stream in a ZODB database"""
"""zsha1 - compute sha1 of whole latest objects stream in a ZODB database"""
from
__future__
import
print_function
import
zodbtools.util
import
zodbtools.util
from
ZODB.POSException
import
POSKeyError
from
ZODB.POSException
import
POSKeyError
from
ZODB.utils
import
p64
,
u64
from
ZODB.utils
import
p64
,
u64
...
@@ -27,9 +29,10 @@ def main():
...
@@ -27,9 +29,10 @@ def main():
except
POSKeyError
:
except
POSKeyError
:
break
break
#print('%s @%s' % (oid, u64(serial)))
m
.
update
(
data
)
m
.
update
(
data
)
print
(
'%s @%s
\
t
sha1: %s'
%
(
oid
,
u64
(
serial
),
m
.
hexdigest
()),
file
=
sys
.
stderr
)
nread
+=
len
(
data
)
nread
+=
len
(
data
)
oid
+=
1
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