-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tentative: use string enum instead of string union to avoid two copie…
…s of constant string
- Loading branch information
Lin Jian
committed
May 21, 2020
1 parent
6487153
commit 18e8c2b
Showing
3 changed files
with
53 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,4 @@ | ||
export const AvroConstants = { | ||
SYNC_MARKER_SIZE: 16, | ||
|
||
// 'O', 'b', 'j', 1 | ||
INIT_BYTES: new Uint8Array([79, 98, 106, 1]), | ||
|
||
CODEC_KEY: "avro.codec", | ||
|
||
SCHEMA_KEY: "avro.schema", | ||
|
||
NULL: "null", | ||
|
||
BOOLEAN: "boolean", | ||
|
||
INT: "int", | ||
|
||
LONG: "long", | ||
|
||
FLOAT: "float", | ||
|
||
DOUBLE: "double", | ||
|
||
BYTES: "bytes", | ||
|
||
STRING: "string", | ||
|
||
RECORD: "record", | ||
|
||
ENUM: "enum", | ||
|
||
MAP: "map", | ||
|
||
ARRAY: "array", | ||
|
||
UNION: "union", | ||
|
||
FIXED: "fixed", | ||
|
||
ALIASES: "aliases", | ||
|
||
NAME: "name", | ||
|
||
FIELDS: "fields", | ||
|
||
TYPE: "type", | ||
|
||
SYMBOLS: "symbols", | ||
|
||
VALUES: "values" | ||
}; | ||
export const AVRO_SYNC_MARKER_SIZE: number = 16; | ||
export const AVRO_INIT_BYTES: Uint8Array = new Uint8Array([79, 98, 106, 1]); | ||
export const AVRO_CODEC_KEY: string = "avro.codec"; | ||
export const AVRO_SCHEMA_KEY: string = "avro.schema"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters