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
7fbd0360
Commit
7fbd0360
authored
Jul 14, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e2b4ee4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+9
-6
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+3
-0
No files found.
wcfs/internal/zdata/δftail.go
View file @
7fbd0360
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
package
zdata
package
zdata
// XXX note about ΔFtail organization: queries results are built on the fly to
// avoid complexity of recomputing vδF on tracking set change.
import
(
import
(
"context"
"context"
"fmt"
"fmt"
...
@@ -78,8 +81,8 @@ type setOid = set.Oid
...
@@ -78,8 +81,8 @@ type setOid = set.Oid
type
ΔFtail
struct
{
type
ΔFtail
struct
{
// ΔFtail merges ΔBtail with history of ZBlk
// ΔFtail merges ΔBtail with history of ZBlk
δBtail
*
xbtree
.
ΔBtail
δBtail
*
xbtree
.
ΔBtail
fileIdx
map
[
zodb
.
Oid
]
setOid
// tree-root -> {} ZBigFile<oid> as of @head
fileIdx
map
[
zodb
.
Oid
]
setOid
// tree-root -> {} ZBigFile<oid>
as of @head
rootIdx
map
[
zodb
.
Oid
]
zodb
.
Oid
// file -> tree-root
rootIdx
map
[
zodb
.
Oid
]
zodb
.
Oid
// file -> tree-root
as of @head
trackSetZFile
setOid
// set of tracked ZBigFiles as of @head
trackSetZFile
setOid
// set of tracked ZBigFiles as of @head
trackSetZBlk
map
[
zodb
.
Oid
]
*
zblkTrack
// zblk -> {} root -> {}blk as of @head
trackSetZBlk
map
[
zodb
.
Oid
]
*
zblkTrack
// zblk -> {} root -> {}blk as of @head
...
@@ -104,10 +107,6 @@ type ΔFile struct {
...
@@ -104,10 +107,6 @@ type ΔFile struct {
Size
bool
// whether file size changed XXX -> ΔSize?
Size
bool
// whether file size changed XXX -> ΔSize?
}
}
// XXX note about ΔFtail organization: queries results are built on the fly to
// avoid complexity of recomputing vδF on tracking set change.
// NewΔFtail creates new ΔFtail object.
// NewΔFtail creates new ΔFtail object.
//
//
// Initial tracked set is empty.
// Initial tracked set is empty.
...
@@ -334,6 +333,10 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
...
@@ -334,6 +333,10 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
_
=
δ
_
=
δ
//fmt.Printf("δZBigFile: %v\n", δ)
//fmt.Printf("δZBigFile: %v\n", δ)
// XXX update .fileIdx
// XXX update .rootIdx
// XXX update .trackSetZBlk ?
}
}
// fmt.Printf("-> δF: %v\n", δF)
// fmt.Printf("-> δF: %v\n", δF)
...
...
wcfs/internal/zdata/δftail_test.go
View file @
7fbd0360
...
@@ -222,6 +222,9 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
...
@@ -222,6 +222,9 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
// δfstr/vδfstr converts δf/vδf to string taking xat into account
// δfstr/vδfstr converts δf/vδf to string taking xat into account
δfstr
:=
func
(
δf
*
ΔFile
)
string
{
δfstr
:=
func
(
δf
*
ΔFile
)
string
{
s
:=
fmt
.
Sprintf
(
"@%s·%s"
,
xat
[
δf
.
Rev
],
δf
.
Blocks
)
s
:=
fmt
.
Sprintf
(
"@%s·%s"
,
xat
[
δf
.
Rev
],
δf
.
Blocks
)
if
δf
.
Epoch
{
s
+=
"E"
}
if
δf
.
Size
{
if
δf
.
Size
{
s
+=
"S"
s
+=
"S"
}
}
...
...
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