Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
8ab1fe64
Commit
8ab1fe64
authored
Apr 27, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
704483e5
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
207 additions
and
0 deletions
+207
-0
wcfs/set.go.in
wcfs/set.go.in
+50
-0
wcfs/zset_bigfile.go
wcfs/zset_bigfile.go
+50
-0
wcfs/zset_i64.go
wcfs/zset_i64.go
+50
-0
wcfs/zset_oid.go
wcfs/zset_oid.go
+50
-0
wcfs/δbtail.go
wcfs/δbtail.go
+7
-0
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+0
-0
No files found.
wcfs/set.go.in
View file @
8ab1fe64
...
...
@@ -56,3 +56,53 @@ func (s Set) Elements() []VALUE {
}
return
ev
}
//
Union
returns
s
∪
t
func
(
s
Set
)
Union
(
t
Set
)
Set
{
u
:=
Set
{}
for
v
:=
range
s
{
u
.
Add
(
v
)
}
for
v
:=
range
t
{
u
.
Add
(
v
)
}
return
u
}
//
Intersection
returns
s
∩
t
func
(
s
Set
)
Intersection
(
t
Set
)
Set
{
i
:=
Set
{}
for
v
:=
range
s
{
if
t
.
Has
(
v
)
{
i
.
Add
(
v
)
}
}
return
i
}
//
Difference
returns
s
\
t
.
func
(
s
Set
)
Difference
(
t
Set
)
Set
{
d
:=
Set
{}
for
v
:=
range
s
{
if
!t.Has(v) {
d
.
Add
(
v
)
}
}
return
d
}
//
SymmetricDifference
returns
s
Δ
t
.
func
(
s
Set
)
SymmetricDifference
(
t
Set
)
Set
{
d
:=
Set
{}
for
v
:=
range
s
{
if
!t.Has(v) {
d
.
Add
(
v
)
}
}
for
v
:=
range
t
{
if
!s.Has(v) {
d
.
Add
(
v
)
}
}
return
d
}
wcfs/zset_bigfile.go
View file @
8ab1fe64
...
...
@@ -58,3 +58,53 @@ func (s SetBigFile) Elements() []*BigFile {
}
return
ev
}
// Union returns s ∪ t
func
(
s
SetBigFile
)
Union
(
t
SetBigFile
)
SetBigFile
{
u
:=
SetBigFile
{}
for
v
:=
range
s
{
u
.
Add
(
v
)
}
for
v
:=
range
t
{
u
.
Add
(
v
)
}
return
u
}
// Intersection returns s ∩ t
func
(
s
SetBigFile
)
Intersection
(
t
SetBigFile
)
SetBigFile
{
i
:=
SetBigFile
{}
for
v
:=
range
s
{
if
t
.
Has
(
v
)
{
i
.
Add
(
v
)
}
}
return
i
}
// Difference returns s\t.
func
(
s
SetBigFile
)
Difference
(
t
SetBigFile
)
SetBigFile
{
d
:=
SetBigFile
{}
for
v
:=
range
s
{
if
!
t
.
Has
(
v
)
{
d
.
Add
(
v
)
}
}
return
d
}
// SymmetricDifference returns s Δ t.
func
(
s
SetBigFile
)
SymmetricDifference
(
t
SetBigFile
)
SetBigFile
{
d
:=
SetBigFile
{}
for
v
:=
range
s
{
if
!
t
.
Has
(
v
)
{
d
.
Add
(
v
)
}
}
for
v
:=
range
t
{
if
!
s
.
Has
(
v
)
{
d
.
Add
(
v
)
}
}
return
d
}
wcfs/zset_i64.go
View file @
8ab1fe64
...
...
@@ -58,3 +58,53 @@ func (s SetI64) Elements() []int64 {
}
return
ev
}
// Union returns s ∪ t
func
(
s
SetI64
)
Union
(
t
SetI64
)
SetI64
{
u
:=
SetI64
{}
for
v
:=
range
s
{
u
.
Add
(
v
)
}
for
v
:=
range
t
{
u
.
Add
(
v
)
}
return
u
}
// Intersection returns s ∩ t
func
(
s
SetI64
)
Intersection
(
t
SetI64
)
SetI64
{
i
:=
SetI64
{}
for
v
:=
range
s
{
if
t
.
Has
(
v
)
{
i
.
Add
(
v
)
}
}
return
i
}
// Difference returns s\t.
func
(
s
SetI64
)
Difference
(
t
SetI64
)
SetI64
{
d
:=
SetI64
{}
for
v
:=
range
s
{
if
!
t
.
Has
(
v
)
{
d
.
Add
(
v
)
}
}
return
d
}
// SymmetricDifference returns s Δ t.
func
(
s
SetI64
)
SymmetricDifference
(
t
SetI64
)
SetI64
{
d
:=
SetI64
{}
for
v
:=
range
s
{
if
!
t
.
Has
(
v
)
{
d
.
Add
(
v
)
}
}
for
v
:=
range
t
{
if
!
s
.
Has
(
v
)
{
d
.
Add
(
v
)
}
}
return
d
}
wcfs/zset_oid.go
View file @
8ab1fe64
...
...
@@ -58,3 +58,53 @@ func (s SetOid) Elements() []Oid {
}
return
ev
}
// Union returns s ∪ t
func
(
s
SetOid
)
Union
(
t
SetOid
)
SetOid
{
u
:=
SetOid
{}
for
v
:=
range
s
{
u
.
Add
(
v
)
}
for
v
:=
range
t
{
u
.
Add
(
v
)
}
return
u
}
// Intersection returns s ∩ t
func
(
s
SetOid
)
Intersection
(
t
SetOid
)
SetOid
{
i
:=
SetOid
{}
for
v
:=
range
s
{
if
t
.
Has
(
v
)
{
i
.
Add
(
v
)
}
}
return
i
}
// Difference returns s\t.
func
(
s
SetOid
)
Difference
(
t
SetOid
)
SetOid
{
d
:=
SetOid
{}
for
v
:=
range
s
{
if
!
t
.
Has
(
v
)
{
d
.
Add
(
v
)
}
}
return
d
}
// SymmetricDifference returns s Δ t.
func
(
s
SetOid
)
SymmetricDifference
(
t
SetOid
)
SetOid
{
d
:=
SetOid
{}
for
v
:=
range
s
{
if
!
t
.
Has
(
v
)
{
d
.
Add
(
v
)
}
}
for
v
:=
range
t
{
if
!
s
.
Has
(
v
)
{
d
.
Add
(
v
)
}
}
return
d
}
wcfs/δbtail.go
View file @
8ab1fe64
...
...
@@ -161,6 +161,7 @@ type ΔValue struct {
// XXX -> multiple readers / single writer?
//
// See also zodb.ΔTail
// XXX naming -> ΔBTail ?
type
ΔBtail
struct
{
// raw ZODB changes; Kept to rebuild δBtail/byRoot after new Track.
// includes all changed objects, not only tracked ones.
...
...
@@ -494,6 +495,12 @@ func (tidx trackIndex) AddPath(path []zodb.Oid) {
}
}
// rebuild rebuilds ΔBtree taking trackNew requests into account. XXX
// XXX place
func
(
δBtail
*
ΔBtail
)
rebuild
()
{
panic
(
"TODO"
)
}
// Update updates δB with per-object level ZODB changes.
//
// Only those objects from δZ that belong to tracked set are guaranteed to be
...
...
wcfs/δbtail_test.go
View file @
8ab1fe64
This diff is collapsed.
Click to expand it.
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