Ethan Buchman
9e940b95ad
libs/autofile: bring back loops ( #2261 )
* libs/autofile: bring back loops
* changelog, version
6 years ago
Dev Ojha
2756be5a59
libs: Remove usage of custom Fmt, in favor of fmt.Sprintf ( #2199 )
* libs: Remove usage of custom Fmt, in favor of fmt.Sprintf
Closes #2193
* Fix bug that was masked by custom Fmt!
6 years ago
Anton Kaliaev
b1cff0f9bf
[libs/autofile] create a Group ticker on Start
1) no need to stop the ticker in createTestGroup() method
2) now there is a symmetry - we start the ticker in OnStart(), we stop it
in OnStop()
Refs #2072
6 years ago
Anton Kaliaev
b33f73eaf1
stop autofile and autogroup properly
NOTE: from the ticker#Stop documentation:
```
Stop does not close the channel, to prevent a read from the channel
succeeding incorrectly.
https://golang.org/src/time/tick.go?s=1318:1341#L35
```
Refs #2072
6 years ago
Zach Ramsay
44dad6d70b
Revert "detele everything"
This reverts commit d02c5d1e30
.
7 years ago
Zach Ramsay
d02c5d1e30
detele everything
7 years ago
Ethan Buchman
d55243f0e6
fix import paths
7 years ago
Ethan Buchman
ae3bf81833
mv tmlibs files to libs dir
7 years ago
Anton Kaliaev
e0985bf566
flush on stop & function to close group
as opposite to OpenGroup
7 years ago
Thomas Corbière
ee67e34519
Fix lint errors ( #190 )
* use increment and decrement operators.
* remove unnecessary else branches.
* fix receiver names.
* remove omittable code.
* fix dot imports.
7 years ago
Anton Kaliaev
668698584d
[autofile] test GroupReader more extensively (Refs #69 )
7 years ago
Anton Kaliaev
81591e288e
fix metalinter warnings
7 years ago
Anton Kaliaev
21b2c26fb1
GroupReader#Read: return io.EOF if file is empty
7 years ago
Anton Kaliaev
c75ddd0fa3
return err if empty slice given
7 years ago
Anton Kaliaev
35e81018e9
add MinIndex method to Group
7 years ago
Anton Kaliaev
aace56018a
add Read method to GroupReader
7 years ago
Anton Kaliaev
45095e83e7
add Write method to autofile/Group
7 years ago
Anton Kaliaev
498fb1134a
write docs for autofile/group
7 years ago
Zach Ramsay
3c57c24921
linting: next round of fixes
7 years ago
Zach Ramsay
d6e03d2368
linting: add to Makefile & do some fixes
7 years ago
Anton Kaliaev
d71d1394ec
call fsync after flush (Refs #573 )
short: flushing the bufio buffer is not enough to ensure data
consistency.
long:
Saving an entry to the WAL calls writeLine to append data to the
autofile group backing the WAL, then calls group.Flush() to flush that
data to persistent storage. group.Flush() in turn proxies to
headBuf.flush(), flushing the active bufio.BufferedWriter. However,
BufferedWriter wraps a Writer, not another BufferedWriter, and the way
it flushes is by calling io.Writer.Write() to clear the BufferedWriter's
buffer. The io.Writer we're wrapping here is AutoFile, whose Write
method calls os.File.Write(), performing an unbuffered write to the
operating system, where, I assume, it sits in the OS buffers awaiting
sync. This means that Wal.Save does not, in fact, ensure the saved
operation is synced to disk before returning.
7 years ago
Anton Kaliaev
74a7f8c92b
[autofile] close file before renaming it
this might fix our windows bug https://github.com/tendermint/tendermint/issues/444
0980f8e197
8 years ago
Ethan Buchman
2f8551d3b6
go-common -> tmlibs
8 years ago
Ethan Buchman
900be74e8f
update import paths
8 years ago
Ethan Buchman
a893bb119b
merge go-autofile
8 years ago
Jae Kwon
0416e0aa9c
Close opened files
8 years ago
Jae Kwon
2a306419c8
Remove spurious fmt
8 years ago
Jae Kwon
dd12bd8f1b
Fix checkTotalSizeLimit bug; remove more than 1 file at a time
8 years ago
Jae Kwon
a528af55d3
Group is a BaseService; TotalSizeLimit enforced; tests fixed
8 years ago
Jae Kwon
d1848762cf
Fix issue where buffered writes may split a line to two files
8 years ago
Jae Kwon
dc8fa06e64
Add MakeSimpleSearchFunc
8 years ago
Jae Kwon
1261fca160
FindLast
8 years ago
Jae Kwon
5e9c5dc413
Add Group.WriteLine
8 years ago
Jae Kwon
0311042336
Add CHALLENGE
8 years ago
Jae Kwon
d741b81ab5
Add better docs for Group
8 years ago
Jae Kwon
c26b857900
Fix Search and add test
8 years ago
Jae Kwon
1859c4d5fe
First commit
8 years ago