From d60d72b4485bd2b1215d48af6524a3adc9ed7453 Mon Sep 17 00:00:00 2001 From: tommyvicananza Date: Tue, 25 Aug 2015 16:07:18 +0200 Subject: [PATCH 1/8] added nil parameter for pack.Recycle --- bq_output.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bq_output.go b/bq_output.go index a97237b..4d1e3f2 100644 --- a/bq_output.go +++ b/bq_output.go @@ -127,12 +127,12 @@ func (bqo *BqOutput) Run(or OutputRunner, h PluginHelper) (err error) { payload, err = or.Encode(pack) if err != nil { or.LogError(err) - pack.Recycle() + pack.Recycle(nil) continue } } else { payload = []byte(pack.Message.GetPayload()) - pack.Recycle() + pack.Recycle(nil) } // Write to both file and buffer From 932076a511f624ed8ae2a5b67061cba0a471c16a Mon Sep 17 00:00:00 2001 From: tommyvicananza Date: Tue, 25 Aug 2015 16:14:41 +0200 Subject: [PATCH 2/8] changed import --- bq_output.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bq_output.go b/bq_output.go index 4d1e3f2..0ef9c54 100644 --- a/bq_output.go +++ b/bq_output.go @@ -12,9 +12,7 @@ import ( "os" "time" - "google.golang.org/api/bigquery/v2" - - "github.com/aranair/heka-bigquery/bq" + "github.com/tommyvicananza/heka-bigquery/bq" . "github.com/mozilla-services/heka/pipeline" ) From bcdf9a310a2c57005f0bb5b1bba22c2c9bfe5dd5 Mon Sep 17 00:00:00 2001 From: tommyvicananza Date: Tue, 25 Aug 2015 16:56:13 +0200 Subject: [PATCH 3/8] bigquery definition --- bq_output.go | 1 + 1 file changed, 1 insertion(+) diff --git a/bq_output.go b/bq_output.go index 0ef9c54..592520f 100644 --- a/bq_output.go +++ b/bq_output.go @@ -13,6 +13,7 @@ import ( "time" "github.com/tommyvicananza/heka-bigquery/bq" + bigquery "google.golang.org/api/bigquery/v2" . "github.com/mozilla-services/heka/pipeline" ) From 479017efa9a78fc99c8b6ca8eb204a607f11ee53 Mon Sep 17 00:00:00 2001 From: tommyvicananza Date: Wed, 2 Sep 2015 14:25:12 +0200 Subject: [PATCH 4/8] trying to fix recycle --- bq_output.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bq_output.go b/bq_output.go index 592520f..5ea4347 100644 --- a/bq_output.go +++ b/bq_output.go @@ -126,7 +126,7 @@ func (bqo *BqOutput) Run(or OutputRunner, h PluginHelper) (err error) { payload, err = or.Encode(pack) if err != nil { or.LogError(err) - pack.Recycle(nil) + pack.Recycle(err) continue } } else { From 7211bbd7879282b96b12fb13c6bc4b159e2c6726 Mon Sep 17 00:00:00 2001 From: tommyvicananza Date: Wed, 2 Sep 2015 14:46:10 +0200 Subject: [PATCH 5/8] prueba con logs --- bq_output.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bq_output.go b/bq_output.go index 5ea4347..0d7f23d 100644 --- a/bq_output.go +++ b/bq_output.go @@ -127,11 +127,13 @@ func (bqo *BqOutput) Run(or OutputRunner, h PluginHelper) (err error) { if err != nil { or.LogError(err) pack.Recycle(err) + logUpdate(or, "Primer bucle") continue } } else { payload = []byte(pack.Message.GetPayload()) pack.Recycle(nil) + logUpdate(or, "Segundo bloque") } // Write to both file and buffer From c0bbd43a7405021741289c251df39d409c9f3ca3 Mon Sep 17 00:00:00 2001 From: tommyvicananza Date: Wed, 2 Sep 2015 15:17:30 +0200 Subject: [PATCH 6/8] else for error igual a nil --- bq_output.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bq_output.go b/bq_output.go index 0d7f23d..14ff587 100644 --- a/bq_output.go +++ b/bq_output.go @@ -127,9 +127,12 @@ func (bqo *BqOutput) Run(or OutputRunner, h PluginHelper) (err error) { if err != nil { or.LogError(err) pack.Recycle(err) - logUpdate(or, "Primer bucle") + logUpdate(or, "Primer bloque error distinto nil") continue } + else { + logUpdate(or, "Primer bloque error es nil") + } } else { payload = []byte(pack.Message.GetPayload()) pack.Recycle(nil) From e151f597d8149da214a9225dff638fc924c2091e Mon Sep 17 00:00:00 2001 From: tommyvicananza Date: Wed, 2 Sep 2015 15:21:18 +0200 Subject: [PATCH 7/8] fixed else --- bq_output.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bq_output.go b/bq_output.go index 14ff587..f5173f4 100644 --- a/bq_output.go +++ b/bq_output.go @@ -129,8 +129,7 @@ func (bqo *BqOutput) Run(or OutputRunner, h PluginHelper) (err error) { pack.Recycle(err) logUpdate(or, "Primer bloque error distinto nil") continue - } - else { + } else { logUpdate(or, "Primer bloque error es nil") } } else { From 96cee60a7d27357a280d0273c989eec725b1c629 Mon Sep 17 00:00:00 2001 From: tommyvicananza Date: Wed, 2 Sep 2015 15:31:02 +0200 Subject: [PATCH 8/8] else with recycle pack --- bq_output.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bq_output.go b/bq_output.go index f5173f4..e0a22ef 100644 --- a/bq_output.go +++ b/bq_output.go @@ -127,15 +127,13 @@ func (bqo *BqOutput) Run(or OutputRunner, h PluginHelper) (err error) { if err != nil { or.LogError(err) pack.Recycle(err) - logUpdate(or, "Primer bloque error distinto nil") continue } else { - logUpdate(or, "Primer bloque error es nil") + pack.Recycle(nil) } } else { payload = []byte(pack.Message.GetPayload()) pack.Recycle(nil) - logUpdate(or, "Segundo bloque") } // Write to both file and buffer