Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: LiangliangSui <[email protected]>
  • Loading branch information
LiangliangSui committed May 7, 2024
1 parent 72fdfd5 commit c77c031
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
push:
branches:
- main
- improve_doc
- 'releases/**'
- 'deploy/**'
- 'test*'
Expand Down
7 changes: 4 additions & 3 deletions docs/specification/xlang_serialization_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,17 @@ Fury will write the byte order for that object into the data instead of converti
Fury header consists starts one byte:

```
| 2 bytes | 4 bits | 1 bit | 1 bit | 1 bit | 1 bit | optional 4 bytes |
+--------------+---------------+-------+-------+--------+-------+------------------------------------+
| magic number | reserved bits | oob | xlang | endian | null | unsigned int for meta start offset |
| 2 bytes | 4 bits | 1 bit | 1 bit | 1 bit | 1 bit | 1 byte | optional 4 bytes |
+--------------+---------------+-------+-------+--------+-------+--------------------------+------------------------------------+
| magic number | reserved bits | oob | xlang | endian | null | serialization language | unsigned int for meta start offset |
```

- magic number: used to identify fury serialization protocol, current version use `0x62d4`.
- null flag: 1 when object is null, 0 otherwise. If an object is null, other bits won't be set.
- endian flag: 1 when data is encoded by little endian, 0 for big endian.
- xlang flag: 1 when serialization uses xlang format, 0 when serialization uses Fury java format.
- oob flag: 1 when passed `BufferCallback` is not null, 0 otherwise.
- serialization language: indicates the language used for serialization, such as JAVA, PYTHON, GO, etc.

If meta share mode is enabled, an uncompressed unsigned int is appended to indicate the start offset of metadata.

Expand Down
3 changes: 3 additions & 0 deletions go/fury/fury.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ const (
XLANG Language = iota
JAVA
PYTHON
CPP
GO
JAVASCRIPT
RUST
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ public enum Language {
PYTHON,
CPP,
GO,
JAVASCRIPT,
RUST,
}
2 changes: 1 addition & 1 deletion javascript/packages/fury/lib/fury.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default class {
bitmap |= ConfigFlags.isCrossLanguageFlag;
this.binaryWriter.int16(MAGIC_NUMBER);
this.binaryWriter.uint8(bitmap);
this.binaryWriter.uint8(Language.XLANG);
this.binaryWriter.uint8(Language.JAVASCRIPT);
const cursor = this.binaryWriter.getCursor();
this.binaryWriter.skip(4); // preserve 4-byte for nativeObjects start offsets.
this.binaryWriter.uint32(0); // nativeObjects length.
Expand Down
2 changes: 2 additions & 0 deletions javascript/packages/fury/lib/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ export enum Language {
PYTHON = 2,
CPP = 3,
GO = 4,
JAVASCRIPT = 5,
RUST = 6,
}

export const MAGIC_NUMBER = 0x62D4;
2 changes: 2 additions & 0 deletions python/pyfury/_fury.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,8 @@ class Language(enum.Enum):
PYTHON = 2
CPP = 3
GO = 4
JAVA_SCRIPT = 5
RUST = 6


@dataclass
Expand Down

0 comments on commit c77c031

Please sign in to comment.