Skip to content

Commit

Permalink
Merge pull request elastic#256 from andrewkroh/bugfix/rename-bulk-size
Browse files Browse the repository at this point in the history
Rename bulk_size to bulk_max_size
  • Loading branch information
monicasarbu committed Nov 3, 2015
2 parents 64784fe + 2ba88bf commit ad1a93e
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions outputs/elasticsearch/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ func (out *elasticsearchOutput) init(
}

// configure bulk size in config in case it is not set
if config.Bulk_size == nil {
if config.BulkMaxSize == nil {
bulkSize := defaultBulkSize
config.Bulk_size = &bulkSize
config.BulkMaxSize = &bulkSize
}

clients, err := mode.MakeClients(config, makeClientFactory(beat, tlsConfig, config))
Expand Down
2 changes: 1 addition & 1 deletion outputs/elasticsearch/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func createElasticsearchConnection(flushInterval int, bulkSize int) elasticsearc
Index: index,
Protocol: "http",
Flush_interval: &flushInterval,
Bulk_size: &bulkSize,
BulkMaxSize: &bulkSize,
}, 10)

return output
Expand Down
2 changes: 1 addition & 1 deletion outputs/fileout/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (out *fileOutput) init(beat string, config *outputs.MothershipConfig, topol
// disable bulk support
configDisableInt := -1
config.Flush_interval = &configDisableInt
config.Bulk_size = &configDisableInt
config.BulkMaxSize = &configDisableInt

rotateeverybytes := uint64(config.Rotate_every_kb) * 1024
if rotateeverybytes == 0 {
Expand Down
2 changes: 1 addition & 1 deletion outputs/logstash/logstash_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func newTestElasticsearchOutput(t *testing.T, test string) *testOutputer {
Hosts: []string{getElasticsearchHost()},
Index: index,
Flush_interval: &flushInterval,
Bulk_size: &bulkSize,
BulkMaxSize: &bulkSize,
}

output, err := plugin.NewOutput("test", &config, 10)
Expand Down
2 changes: 1 addition & 1 deletion outputs/outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type MothershipConfig struct {
Number_of_files int
DataType string
Flush_interval *int
Bulk_size *int
BulkMaxSize *int `yaml:"bulk_max_size"`
Max_retries *int
Pretty *bool
TLS *TLSConfig
Expand Down
4 changes: 2 additions & 2 deletions publisher/async.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ func asyncOutputer(ws *workerSignal, worker *outputWorker) worker {
}

maxBulkSize := defaultBulkSize
if config.Bulk_size != nil {
maxBulkSize = *config.Bulk_size
if config.BulkMaxSize != nil {
maxBulkSize = *config.BulkMaxSize
}

// batching disabled
Expand Down
2 changes: 1 addition & 1 deletion publisher/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func newTestPublisher(bulkSize int, response OutputResponse) *testPublisher {
}

ow := &outputWorker{}
ow.config.Bulk_size = &bulkSize
ow.config.BulkMaxSize = &bulkSize
ow.handler = mh
ws := workerSignal{}
ow.messageWorker.init(&ws, 1000, mh)
Expand Down
4 changes: 2 additions & 2 deletions publisher/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func newOutputWorker(
hwm int,
) *outputWorker {
maxBulkSize := defaultBulkSize
if config.Bulk_size != nil {
maxBulkSize = *config.Bulk_size
if config.BulkMaxSize != nil {
maxBulkSize = *config.BulkMaxSize
}

o := &outputWorker{
Expand Down
2 changes: 1 addition & 1 deletion publisher/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (publisher *PublisherType) Init(
output := plugin.Output
config := plugin.Config

debug("create output worker: %p, %p", config.Flush_interval, config.Bulk_size)
debug("create output worker: %p, %p", config.Flush_interval, config.BulkMaxSize)

outputers = append(outputers,
newOutputWorker(config, output, &publisher.wsOutput, 1000))
Expand Down

0 comments on commit ad1a93e

Please sign in to comment.