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
fe823e9c
Commit
fe823e9c
authored
Nov 18, 2016
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
399f16c9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
162 additions
and
15 deletions
+162
-15
t/neo/NOTES
t/neo/NOTES
+0
-0
t/neo/filestorage.go
t/neo/filestorage.go
+74
-0
t/neo/pkt.go
t/neo/pkt.go
+0
-15
t/neo/pktgen.go
t/neo/pktgen.go
+0
-0
t/neo/zodb.go
t/neo/zodb.go
+88
-0
No files found.
t/NOTES
→
t/
neo/
NOTES
View file @
fe823e9c
File moved
t/neo/filestorage.go
0 → 100644
View file @
fe823e9c
// XXX license
// filestorage support XXX text
package
neo
type
FileStorage
struct
{
fd
int
}
// IStorage
var
_
IStorage
=
(
*
FileStorage
)(
nil
)
type
TxnRecHead
struct
{
Tid
Tid
RecLenm8
uint64
Status
TxnStatus
//UserLen uint16
//DescriptionLen uint16
//ExtensionLen uint16
User
[]
byte
// TODO Encode ^^^
Description
[]
byte
Extension
[]
byte
Datav
[]
DataRec
}
type
DataRec
struct
{
Oid
Oid
Tid
Tid
PrevDataRecPos
uint64
// previous-record file-position
TxnPos
uint64
// beginning of transaction record file position
// 2-bytes with zero values. (Was version length.)
//DataLen uint64
Data
[]
byte
DataRecPos
uint64
// if Data == nil -> byte position of data record containing data
}
func
(
TxnRecHead
*
rh
)
MarshalFS
()
[]
byte
{
panic
(
"TODO"
)
}
func
(
TxnRecHead
*
rh
)
UnmarshalFS
(
data
[]
byte
)
{
TODO
}
func
NewFileStorage
(
path
string
)
(
*
FileStorage
,
error
)
{
fd
,
err
:=
...
Open
(
path
,
O_RDONLY
)
if
err
!=
nil
{
return
nil
,
err
}
// TODO read file header
Read
(
fd
,
4
)
!=
"FS21"
->
invalid
header
return
&
FileStorage
{
fd
:
fd
}
}
func
(
f
*
FileStorage
)
Close
()
error
{
err
:=
Os
.
Close
(
f
.
fd
)
if
err
!=
nil
{
return
err
}
f
.
fd
=
-
1
return
nil
}
func
(
f
*
FileStorage
)
Iterate
(
start
,
stop
Tid
)
IStorageIterator
{
if
start
!=
TID0
||
stop
!=
TIDMAX
{
panic
(
"TODO start/stop support"
)
}
}
t/pkt.go
→
t/
neo/
pkt.go
View file @
fe823e9c
...
...
@@ -74,21 +74,6 @@ const (
GRANTED_TO_OTHER
)
// XXX move out of here ?
type
TID
uint64
// XXX or [8]byte ?
type
OID
uint64
// XXX or [8]byte ?
const
(
INVALID_UUID
UUID
=
0
INVALID_TID
TID
=
0xffffffffffffffff
// 1<<64 - 1
INVALID_OID
OID
=
0xffffffffffffffff
// 1<<64 - 1
ZERO_TID
TID
=
0
// XXX or simply TID{} ?
ZERO_OID
OID
=
0
// XXX or simply OID{} ?
// OID_LEN = 8
// TID_LEN = 8
MAX_TID
TID
=
0x7fffffffffffffff
// SQLite does not accept numbers above 2^63-1
)
// An UUID (node identifier, 4-bytes signed integer)
type
UUID
int32
...
...
t/pktgen.go
→
t/
neo/
pktgen.go
View file @
fe823e9c
File moved
t/neo/zodb.go
0 → 100644
View file @
fe823e9c
// XXX license
// ZODB types
package
neo
// XXX -> zodb ?
// XXX naming -> TID, OID ?
type
Tid
uint64
// XXX or [8]byte ?
type
Oid
uint64
// XXX or [8]byte ?
// XXX "extended" oid - oid + serial, completely specifying object revision
type
Xid
struct
{
Tid
Oid
}
const
(
INVALID_UUID
UUID
=
0
INVALID_TID
TID
=
0xffffffffffffffff
// 1<<64 - 1
INVALID_OID
OID
=
0xffffffffffffffff
// 1<<64 - 1
ZERO_TID
TID
=
0
// XXX or simply TID{} ? // XXX -> TID0 ?
ZERO_OID
OID
=
0
// XXX or simply OID{} ? // XXX -> OID0
// OID_LEN = 8
// TID_LEN = 8
MAX_TID
TID
=
0x7fffffffffffffff
// SQLite does not accept numbers above 2^63-1 // XXX -> TIDMAX ?
)
type
TxnStatus
byte
// TODO Tid.String(), Oid.String() +verbose, scanning (?)
// Information about single storage transaction
// XXX -> storage.ITransactionInformation
//type IStorageTransactionInformation interface {
type
IStorageTransactionInformation
struct
{
Tid
Tid
Status
TxnStatus
User
[]
byte
Description
[]
byte
Extension
[]
byte
// TODO iter -> IStorageRecordInformation
Iter
()
IStorageRecordIterator
}
// Information about single storage record
type
StorageRecordInformation
struct
{
Oid
Oid
Tid
Tid
Data
[]
byte
// XXX .version ?
// XXX .data_txn (The previous transaction id)
}
type
IStorage
interface
{
Close
()
error
// TODO:
// Name()
// History(oid, size=1)
// LastTid()
// LoadBefore(oid Oid, beforeTid Tid) (data []bytes, tid Tid, err error)
// LoadSerial(oid Oid, serial Tid) (data []bytes, err error)
// PrefetchBefore(oidv []Oid, beforeTid Tid) error (?)
// Store(oid Oid, serial Tid, data []byte, txn ITransaction) error
// XXX Restore ?
// CheckCurrentSerialInTransaction(oid Oid, serial Tid, txn ITransaction) // XXX naming
// tpc_begin(txn)
// tpc_vote(txn)
// tpc_finish(txn, callback) XXX clarify about callback
// tpc_abort(txn)
Iterate
(
start
,
stop
Tid
)
IStorageIterator
// XXX -> Iter() ?
}
type
IStorageIterator
interface
{
Next
()
(
*
StorageTransactionInformation
,
error
)
// XXX -> NextTxn() ?
}
type
IStorageRecordIterator
interface
{
// XXX naming -> IRecordIterator
Next
()
(
*
StorageRecordInformation
,
error
)
// XXX vs ptr & nil ?
// XXX -> NextTxnObject() ?
}
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