Skip to content

Commit

Permalink
Added beginning of template for standard_storage_manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhosk committed Oct 24, 2024
1 parent c3e22e7 commit 5f950d2
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 37 deletions.
69 changes: 32 additions & 37 deletions src/tablestream/templates/lock.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,12 @@ doc: |
There are some issues with this, I need to ffigure them out but it is at least partly correct...
seq:
- id: fcntl
type: u1
doc: |
Acquire/release of lock can be shared (read) or exclusive (write)
- id: proc
type: u1
doc: |
Tells other processes that table is open. Creates a shared lock.
- id: lock_type
type: u1
doc: |
Permanent or shared lock.
- id: special
type: u1
repeat: expr
repeat-expr: 3
doc: |
Special internal lock usage.
- id: n_processes
type: u4
- id: lock_info
type: u2
type: list
repeat: expr
repeat-expr: 127
doc: |
There is structure in here but I'm not filling it in yet. This should
describe the list of processes trying to access the data.
repeat-expr: 32
- id: stream_length
type: u4
- id: apsio_header
Expand All @@ -53,10 +34,9 @@ seq:
type: u4
doc: |
Counter incremented if the table.dat has changed.
- id: block
- id: data_block
type: data_block


types:
header:
seq:
Expand All @@ -71,19 +51,34 @@ types:
- id: version
type: u1

data_block:
list:
seq:
- id: number_rows
type: u4
- id: filler
type: u2
- id: idk
- id: fcntl
type: u1
doc: |
Acquire/release of lock can be shared (read) or exclusive (write)
- id: proc
type: u1
doc: |
Tells other processes that table is open. Creates a shared lock.
- id: lock_type
type: u1
doc: |
Permanent or shared lock.
- id: special
type: u1
- id: name
type: dtype::string
- id: size
type: u4
repeat: expr
repeat-expr: 25
repeat-expr: 3
doc: |
I just did this to figure out how much data there was.
Special internal lock usage.
- id: host_id
type: u1
- id: process_id
type: u1


data_block:
seq:
- id: block
type: u4
repeat: eos
70 changes: 70 additions & 0 deletions src/tablestream/templates/standard_storage_manager.ksy
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
meta:
id: standard_storage_manager
endian: le
file-extension: standard_storage_manager
imports: dtype

doc: |
User defined version of base numerical data types. This will allow for the
compilation of languages like c++ and rust
seq:
- id: header
type: header
- id: header_remains
size: 512 - _io.pos

types:
header:
seq:
- id: magic
contents: [ 0xbe, 0xbe, 0xbe, 0xbe ]
doc: |
casa magic unsigned int 3200171710 190 190 190 190
- id: size
type: u4
- id: name
type: string
- id: version
type: u4
- id: is_endian
type: u1
enum: is_endian
if: version > 2
- id: bucket_size
type: u4
- id: n_buckets
type: u4
- id: cache_size
type: u4
doc: |
Cache size in buckets
- id: first_free_bucket
type: s4
- id: n_index_buckets
type: u4
- id: first_index_bucket
type: s4
- id: offset_index
type: u4
if: version > 1
- id: last_string_heap_bucket
type: s4
- id: index_length
type: u4
- id: n_indicies
type: u4

string:
seq:
- id: length
type: u4
- id: value
type: str
encoding: ASCII
size: length

enums:
is_endian:
0: false
1: true

0 comments on commit 5f950d2

Please sign in to comment.