Skip to content
Snippets Groups Projects

Initial implementation of an elasticsearch indexer in Go

Merged Nick Thomas requested to merge 1-initial-implementation into master
All threads resolved!
2 files
+ 15
2
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 9
1
@@ -13,12 +13,15 @@ import (
)
var (
timeoutError = fmt.Errorf("Timeout")
)
const (
// TODO: make this configurable / detectable.
// Limiting to 10MiB lets us work on small AWS clusters, but unnecessarily
// increases round trips in larger or non-AWS clusters
MaxBulkSize = 10 * 1024 * 1024
BulkWorkers = 2
timeoutError = fmt.Errorf("Timeout")
)
type Client struct {
@@ -101,6 +104,11 @@ func (c *Client) ParentID() string {
return c.ProjectID
}
// FIXME(nick): this should reserve some space for encoding
func (c *Client) SubmissionLimit() int64 {
return MaxBulkSize
}
func (c *Client) Flush() error {
return c.bulk.Flush()
}
Loading