-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added page length Signed-off-by: Joe Elliott <number101010@gmail.com> * Added len to NextPage Signed-off-by: Joe Elliott <number101010@gmail.com> * Added appendblockfromfile Signed-off-by: Joe Elliott <number101010@gmail.com> * Ditched replay block. Long live AppendBlock Signed-off-by: Joe Elliott <number101010@gmail.com> * Fixed bench Signed-off-by: Joe Elliott <number101010@gmail.com> * Use new replay code in ingester/instance Signed-off-by: Joe Elliott <number101010@gmail.com> * removed PushBytes Signed-off-by: Joe Elliott <number101010@gmail.com> * Added test for bad blocks Signed-off-by: Joe Elliott <number101010@gmail.com> * commment Signed-off-by: Joe Elliott <number101010@gmail.com> * Rename AllBlocks. Pass in logger Signed-off-by: Joe Elliott <number101010@gmail.com> * Added test for empty wal file Signed-off-by: Joe Elliott <number101010@gmail.com> * Added partial replay support and tests Signed-off-by: Joe Elliott <number101010@gmail.com> * lint Signed-off-by: Joe Elliott <number101010@gmail.com> * Added flush queue test Signed-off-by: Joe Elliott <number101010@gmail.com> * removed jitter on tests...horribly Signed-off-by: Joe Elliott <number101010@gmail.com>
- Loading branch information
1 parent
bde2845
commit 0b72812
Showing
23 changed files
with
473 additions
and
444 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package encoding | ||
|
||
import ( | ||
"github.com/grafana/tempo/tempodb/encoding/common" | ||
) | ||
|
||
type recordAppender struct { | ||
records []*common.Record | ||
} | ||
|
||
// NewRecordAppender returns an appender that stores records only. | ||
func NewRecordAppender(records []*common.Record) Appender { | ||
return &recordAppender{ | ||
records: records, | ||
} | ||
} | ||
|
||
// Append appends the id/object to the writer. Note that the caller is giving up ownership of the two byte arrays backing the slices. | ||
// Copies should be made and passed in if this is a problem | ||
func (a *recordAppender) Append(id common.ID, b []byte) error { | ||
return common.ErrUnsupported | ||
} | ||
|
||
func (a *recordAppender) Records() []*common.Record { | ||
return a.records | ||
} | ||
|
||
func (a *recordAppender) Length() int { | ||
return len(a.records) | ||
} | ||
|
||
func (a *recordAppender) DataLength() uint64 { | ||
return 0 | ||
} | ||
|
||
func (a *recordAppender) Complete() error { | ||
return nil | ||
} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package common | ||
|
||
import ( | ||
"bytes" | ||
"sort" | ||
) | ||
|
||
type recordSorter struct { | ||
records []*Record | ||
} | ||
|
||
// SortRecords sorts a slice of record pointers | ||
func SortRecords(records []*Record) { | ||
sort.Sort(&recordSorter{ | ||
records: records, | ||
}) | ||
} | ||
|
||
func (t *recordSorter) Len() int { | ||
return len(t.records) | ||
} | ||
|
||
func (t *recordSorter) Less(i, j int) bool { | ||
a := t.records[i] | ||
b := t.records[j] | ||
|
||
return bytes.Compare(a.ID, b.ID) == -1 | ||
} | ||
|
||
func (t *recordSorter) Swap(i, j int) { | ||
t.records[i], t.records[j] = t.records[j], t.records[i] | ||
} |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.