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
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
cf3fbe5b
Commit
cf3fbe5b
authored
Feb 28, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cb061733
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
199 additions
and
99 deletions
+199
-99
t/neo/storage/fs1/filestorage.go
t/neo/storage/fs1/filestorage.go
+161
-93
t/neo/storage/fs1/filestorage_test.go
t/neo/storage/fs1/filestorage_test.go
+13
-2
t/neo/storage/fs1/index.go
t/neo/storage/fs1/index.go
+3
-2
t/neo/zodb/zodb.go
t/neo/zodb/zodb.go
+22
-2
No files found.
t/neo/storage/fs1/filestorage.go
View file @
cf3fbe5b
This diff is collapsed.
Click to expand it.
t/neo/storage/fs1/filestorage_test.go
View file @
cf3fbe5b
// XXX license/copyright
// Copyright (C) 2017 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
// it under the terms of the GNU General Public License version 2, or (at your
// option) any later version, as published by the Free Software Foundation.
//
// This program is distributed WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// See COPYING file for full licensing terms.
// FileStorage v1. Tests XXX text
package
fs1
import
(
...
...
t/neo/storage/fs1/index.go
View file @
cf3fbe5b
...
...
@@ -11,6 +11,7 @@
// See COPYING file for full licensing terms.
//
// XXX partly based on code from ZODB ?
// TODO link to format in zodb/py
// FileStorage v1. Index
package
fs1
...
...
@@ -33,8 +34,8 @@ import (
"lab.nexedi.com/kirr/go123/mem"
)
// fsIndex is Oid ->
Tid's position mapping used to associate Oid with latest
//
transaction which changed it.
// fsIndex is Oid ->
Data record position mapping used to associate Oid with
//
Data record in latest transaction which changed it. XXX text
type
fsIndex
struct
{
*
fsb
.
Tree
}
...
...
t/neo/zodb/zodb.go
View file @
cf3fbe5b
...
...
@@ -36,6 +36,15 @@ const (
//Oid0 Oid = 0 // XXX -> simply Oid(0)
)
func
(
tid
Tid
)
Valid
()
bool
{
// XXX if Tid becomes signed also check wrt 0
if
tid
<=
TidMax
{
return
true
}
else
{
return
false
}
}
func
(
tid
Tid
)
String
()
string
{
// XXX also print "tid:" prefix ?
return
fmt
.
Sprintf
(
"%016x"
,
uint64
(
tid
))
...
...
@@ -97,6 +106,17 @@ const (
TxnInprogress
=
'c'
// checkpoint -- a transaction in progress; it's been thru vote() but not finish()
)
// Valid returns true if transaction status value is well-known and valid
func
(
ts
TxnStatus
)
Valid
()
bool
{
switch
ts
{
case
TxnComplete
,
TxnPacked
,
TxnInprogress
:
return
true
default
:
return
false
}
}
// Metadata information about single transaction
type
TxnInfo
struct
{
Tid
Tid
...
...
@@ -154,12 +174,12 @@ type IStorageIterator interface {
// NextTxn yields information about next database transaction:
// 1. transaction metadata, and
// 2. iterator over transaction data records.
// transaction me
ntadata is put into *txnInfo
stays valid until next call to NextTxn().
// transaction me
tadata is put into *txnInfo and
stays valid until next call to NextTxn().
NextTxn
(
txnInfo
*
TxnInfo
)
(
dataIter
IStorageRecordIterator
,
stop
bool
,
err
error
)
// XXX stop -> io.EOF ?
}
type
IStorageRecordIterator
interface
{
// XXX naming -> IRecordIterator
// NextData puts information about next storage data record into *dataInfo.
// data put into *dataInfo stays va
il
d until next call to NextData().
// data put into *dataInfo stays va
li
d until next call to NextData().
NextData
(
dataInfo
*
StorageRecordInformation
)
(
stop
bool
,
err
error
)
// XXX stop -> io.EOF ?
}
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