Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message writer for record batches #163

Merged
merged 26 commits into from
Jan 28, 2019
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
55ba9d6
Add branching for record batch writer
VictorDenisov Dec 2, 2018
1c90763
Make key and value from headers public
VictorDenisov Dec 2, 2018
a8cd851
Add writeVarInt function
VictorDenisov Dec 3, 2018
d18779b
Implement writeRecord method
VictorDenisov Dec 4, 2018
582f1d1
Write record batch method
VictorDenisov Dec 9, 2018
29674e8
Use zigzag encoding for varint
VictorDenisov Dec 10, 2018
0784aa5
Drop logging
VictorDenisov Dec 18, 2018
faddbdc
Add unit test for v2 record batch
VictorDenisov Dec 19, 2018
a57d973
Remove commented out code
VictorDenisov Jan 6, 2019
57693cf
Use int constants from math package
VictorDenisov Jan 6, 2019
a96cefa
Use exact record size instead of extra buffer
VictorDenisov Jan 12, 2019
60e7246
Give a simpler name to calcVarIntLen
VictorDenisov Jan 15, 2019
8128763
Move error check out of if else block
VictorDenisov Jan 15, 2019
fc101c3
Extract message set size in a function
VictorDenisov Jan 15, 2019
eca66e2
Give calcRecordSize a shorter name
VictorDenisov Jan 15, 2019
f4bc280
Protect recordSize from confusing order of params
VictorDenisov Jan 15, 2019
3da360b
Use recordSize intead of estimatedRecordSize
VictorDenisov Jan 15, 2019
d4b332e
Extract record batch size
VictorDenisov Jan 15, 2019
8c48777
Use record size from calculation
VictorDenisov Jan 18, 2019
36e6a36
Assign offsets to messages in record batch
VictorDenisov Jan 21, 2019
8798908
Write message set straight to output writer
VictorDenisov Jan 21, 2019
6464be6
Write record batch straight to output writer
VictorDenisov Jan 21, 2019
60de28c
Get rid of remainder buffer
VictorDenisov Jan 21, 2019
e22b69b
Remove commented out code
VictorDenisov Jan 23, 2019
d2cd545
Use bytes.Equal for comparing slices of bytes
VictorDenisov Jan 23, 2019
93017f4
Compress messages before calculating size
VictorDenisov Jan 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use int constants from math package
  • Loading branch information
VictorDenisov committed Jan 14, 2019
commit 57693cf23f28bcf5f6fcb56a75a50ac610a2549c
7 changes: 1 addition & 6 deletions write.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,8 @@ func baseTime(msgs ...Message) (baseTime time.Time) {
return
}

const MaxUint = ^uint64(0)
const MinUint = 0
const MaxInt = int64(MaxUint >> 1)
const MinInt = -MaxInt - 1

func baseOffset(msgs ...Message) (baseOffset int64) {
baseOffset = MaxInt
baseOffset = math.MaxInt64
for _, msg := range msgs {
if msg.Offset < baseOffset {
baseOffset = msg.Offset
Expand Down