Commit Graph

115 Commits

Author SHA1 Message Date
Robert Yokota daf38aa825 KAFKA-7476: Fix Date-based types in SchemaProjector
Various converters (AvroConverter and JsonConverter) produce a
SchemaAndValue consisting of a logical schema type and a java.util.Date.
This is a fix for SchemaProjector to properly handle the Date.

Author: Robert Yokota <rayokota@gmail.com>

Reviewers: Konstantine Karantasis <konstantine@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #5736 from rayokota/KAFKA-7476

(cherry picked from commit 3edd8e7333)
Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
2018-10-04 20:36:34 -07:00
Gunnar Morling 0f3affc0f4 KAFKA-7058: Comparing schema default values using Objects#deepEquals()
https://issues.apache.org/jira/browse/KAFKA-7058
* Summary of testing strategy: Added new unit test

Author: Gunnar Morling <gunnar.morling@googlemail.com>

Reviewers: Randall Hauch <rhauch@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #5225 from gunnarmorling/KAFKA-7058

(cherry picked from commit be846d833c)
Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
2018-06-16 23:14:25 -07:00
Randall Hauch 1691a7a256 KAFKA-6661: Ensure sink connectors don’t resume consumer when task is paused
Changed WorkerSinkTaskContext to only resume the consumer topic partitions when the connector/task is not in the paused state.

The context tracks the set of topic partitions that are explicitly paused/resumed by the connector, and when the WorkerSinkTask resumes the tasks it currently resumes all topic partitions *except* those that are still explicitly paused in the context. Therefore, the change above should result in the desired behavior.

Several debug statements were added to record when the context is called by the connector.

This can be backported to older releases, since this bug goes back to 0.10 or 0.9.

Author: Randall Hauch <rhauch@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #4716 from rhauch/kafka-6661

(cherry picked from commit e7ef719a5b)
Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
2018-03-15 16:11:21 -07:00
Arjun Satish 2c620ba1f8 KAFKA-4827: Correctly encode special chars while creating URI objects
Author: Arjun Satish <arjun@confluent.io>

Reviewers: Randall Hauch <rhauch@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #4273 from wicknicks/KAFKA-4827-0.10.2

(cherry picked from commit 6a0b84aa0f)
Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
2017-11-29 10:14:00 -08:00
Hooman Broujerdi 24236d363a MINOR: Added safe deserialization implementation
Author: Hooman Broujerdi <hoomanb@hoomanb.usersys.redhat.com>

Reviewers: Randall Hauch <rhauch@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #3563 from rhauch/deserialization-validation

(cherry picked from commit da42977a00)
Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
2017-07-21 16:10:50 -07:00
Shikhar Bhushan abc47844be KAFKA-4575: ensure topic created before starting sink for ConnectDistributedTest.test_pause_resume_sink
Otherwise in this test the sink task goes through the pause/resume cycle with 0 assigned partitions, since the default metadata refresh interval is quite long

Author: Shikhar Bhushan <shikhar@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2313 from shikhar/kafka-4575
2017-03-27 10:07:45 -07:00
Jason Gustafson a1afb73941 KAFKA-4290: Fix timeout overflow in WorkerCoordinator.poll
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2009 from hachikuji/KAFKA-4290

(cherry picked from commit c1e840050c)
Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
2016-10-10 23:23:06 -07:00
Vahid Hashemian 6956a3819a MINOR: Fix typos in documentation
And improve readability by adding proper punctuations.

Author: Vahid Hashemian <vahidhashemian@us.ibm.com>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #2002 from vahidhashemian/doc/fix_typos

(cherry picked from commit e972d2afd3)
Signed-off-by: Jason Gustafson <jason@confluent.io>
2016-10-10 15:59:00 -07:00
Jason Gustafson d6b3ff142a MINOR: Wakeups propagated from commitOffsets in WorkerSinkTask should be caught
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1907 from hachikuji/catch-wakeup-worker-sink-task

(cherry picked from commit b75245cfbb)
Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
2016-09-26 14:54:32 -07:00
Shikhar Bhushan 431c3b0937 KAFKA-4183; Centralize checking for optional and default values in JsonConverter
Cleaner to just check once for optional & default value from the `convertToConnect()` function.

It also helps address an issue with conversions for logical type schemas that have default values and null as the included value. That test case is _probably_ not an issue in practice, since when using the `JsonConverter` to serialize a missing field with a default value, it will serialize the default value for the field. But in the face of JSON data streaming in from a topic being [generous on input, strict on output](http://tedwise.com/2009/05/27/generous-on-input-strict-on-output) seems best.

Author: Shikhar Bhushan <shikhar@confluent.io>

Reviewers: Randall Hauch <rhauch@gmail.com>, Jason Gustafson <jason@confluent.io>

Closes #1872 from shikhar/kafka-4183
2016-09-19 12:49:38 -07:00
Shikhar Bhushan d7bffebca0 KAFKA-4173; SchemaProjector should successfully project missing Struct field when target field is optional
Author: Shikhar Bhushan <shikhar@confluent.io>

Reviewers: Konstantine Karantasis <konstantine@confluent.io>, Jason Gustafson <jason@confluent.io>

Closes #1865 from shikhar/kafka-4173
2016-09-16 15:54:33 -07:00
Randall Hauch 567cc3d787 KAFKA-4183; Corrected Kafka Connect's JSON Converter to properly convert from null to logical values
The `JsonConverter` class has `LogicalTypeConverter` implementations for Date, Time, Timestamp, and Decimal, but these implementations fail when the input literal value (deserialized from the message) is null.

Test cases were added to check for these cases, and these failed before the `LogicalTypeConverter` implementations were fixed to consider whether the schema has a default value or is optional, similarly to how the `JsonToConnectTypeConverter` implementations do this. Once the fixes were made, the new tests pass.

Author: Randall Hauch <rhauch@gmail.com>

Reviewers: Shikhar Bhushan <shikhar@confluent.io>, Jason Gustafson <jason@confluent.io>

Closes #1867 from rhauch/kafka-4183
2016-09-16 14:55:46 -07:00
David Chen c1bce2d757 KAFKA-4162: Fixed typo "rebalance"
Author: David Chen <mvjome@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1853 from mvj3/KAFKA-4162
2016-09-14 10:38:40 -07:00
Shikhar Bhushan b91eeac943 KAFKA-4100: Ensure 'fields' and 'fieldsByName' are not null for Struct schemas
Author: Shikhar Bhushan <shikhar@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1800 from shikhar/kafka-4100
2016-08-29 19:08:52 -07:00
Shikhar Bhushan 71f7e7c3a2 KAFKA-4042: Contain connector & task start/stop failures within the Worker
Invoke the statusListener.onFailure() callback on start failures so that the statusBackingStore is updated. This involved a fix to the putSafe() functionality which prevented any update that was not preceded by a (non-safe) put() from completing, so here when a connector or task is transitioning directly to FAILED.

Worker start methods can still throw if the same connector name or task ID is already registered with the worker, as this condition should not happen.

Author: Shikhar Bhushan <shikhar@confluent.io>

Reviewers: Jason Gustafson <jason@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1778 from shikhar/distherder-stayup-take4
2016-08-26 14:00:42 -07:00
Shikhar Bhushan 08ad2be0da KAFKA-4070: implement Connect Struct.toString()
Author: Shikhar Bhushan <shikhar@confluent.io>

Reviewers: Gwen Shapira

Closes #1790 from shikhar/add-struct-tostring
2016-08-25 19:25:36 -07:00
Konstantine Karantasis cec2769e22 KAFKA-2894: WorkerSinkTask should rewind offsets on rebalance
Author: Konstantine Karantasis <k.karantasis@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1771 from kkonstantine/KAFKA-2894-rewind-offsets-on-rebalance
2016-08-23 10:19:07 -07:00
Ewen Cheslack-Postava 05ed54bf2b KAFKA-3845: KIP-75: Add per-connector converters
Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Shikhar Bhushan, Gwen Shapira

Closes #1721 from ewencp/kafka-3845-per-connector-converters
2016-08-18 20:56:31 -07:00
Jason Gustafson 40b1dd3f49 KAFKA-3888: send consumer heartbeats from a background thread (KIP-62)
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>, Ismael Juma <ismael@juma.me.uk>, Guozhang Wang <wangguoz@gmail.com>

Closes #1627 from hachikuji/KAFKA-3888
2016-08-17 11:50:04 -07:00
Ewen Cheslack-Postava 208ecae239 KAFKA-3847: Use a separate producer per source task
Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Jason Gustafson, Gwen Shapira

Closes #1727 from ewencp/kafka-3847-per-task-producers and squashes the following commits:

7d39724 [Ewen Cheslack-Postava] Add timeout for closing producers.
98ec7f6 [Ewen Cheslack-Postava] KAFKA-3847: Use a separate producer per source task
2016-08-12 14:06:37 -07:00
Dustin Cote 29f44e75cd KAFKA-2932: Adjust importance level of Kafka Connect configs
ewencp I went down the list of connect configs and it looks like only the internal converter configs are mismarked.  It looks like the `cluster` config that is present in the current docs is already gone.  The only other values I can see arguing to change importance on are the ssl configs (marked high) but they are consistent with the producer/consumer config docs so that's at least consistent.  Everything else marked high looks either mandatory or requires consideration in a production deployment to me.

Author: Dustin Cote <dustin@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1653 from cotedm/KAFKA-2932
2016-08-06 21:59:22 -07:00
Liquan Pei 8d303d0d38 KAFKA-4002: task.open() should be invoked in case that 0 partitions is assigned to task
Author: Liquan Pei <liquanpei@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1686 from Ishiihara/open-partition
2016-08-06 21:11:54 -07:00
Ewen Cheslack-Postava 4059f07216 KAFKA-3500: Handle null keys and values in KafkaOffsetBackingStore.
Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Ismael Juma, Jason Gustafson, Gwen Shapira

Closes #1662 from ewencp/kafka-3500-kafka-offset-backing-store-null
2016-07-26 19:43:32 -07:00
Ewen Cheslack-Postava d1546960de KAFKA-3935; Fix test_restart_failed_task system test for SinkTasks
Fix the test by using a more liberal timeout and forcing more frequent SinkTask.put() calls. Also add some logging to aid future debugging.

Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Jason Gustafson <jason@confluent.io>, Ismael Juma <ismael@juma.me.uk>

Closes #1663 from ewencp/kafka-3935-fix-restart-system-test
2016-07-26 03:02:02 +01:00
Ewen Cheslack-Postava f8a7ace9d4 KAFKA-2941: Clarify docs for key and value Converters
Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Gwen Shapira

Closes #1599 from ewencp/kafka-2941-explain-converter-configs
2016-07-10 21:23:14 -07:00
Liquan Pei 542350d616 KAFKA-3920: Add Schema source connector to Kafka Connect
Author: Liquan Pei <liquanpei@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1574 from Ishiihara/schema-source
2016-07-08 10:56:58 -07:00
Shikhar Bhushan 44ad7b574e KAFKA-3846: KIP-65: include timestamp in Connect record types
https://cwiki.apache.org/confluence/display/KAFKA/KIP-65%3A+Expose+timestamps+to+Connect

Author: Shikhar Bhushan <shikhar@confluent.io>

Reviewers: Jason Gustafson <jason@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1537 from shikhar/kafka-3846
2016-06-30 13:59:31 -07:00
Laurier Mantel 54f9a7012c MINOR: fix grammatical errors in DataException message
Was just reading kafka source code, my favourite Friday afternoon activity, when I found these small grammatical errors in some `DataException` messages.

Could someone please review? ewencp dguy

Author: Laurier Mantel <laurier.mantel@shopify.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1551 from LaurierMantel/maps-typos
2016-06-24 14:16:50 -07:00
Jason Gustafson 36cab7dbdf KAFKA-3863: System tests covering connector/task failure and restart
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1519 from hachikuji/KAFKA-3863
2016-06-22 17:06:49 -07:00
Jason Gustafson 50781b75d8 KAFKA-3865: Fix transient failure in WorkerSourceTaskTest.testSlowTaskStart
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Liquan Pei <liquanpei@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1531 from hachikuji/KAFKA-3865
2016-06-20 20:32:09 -07:00
Rollulus 4544ee4487 KAFKA-3864: make field.get return field's default value when needed
And not the containing struct's default value.

The contribution is my original work and that I license the work to the project under the project's open source license.

ewencp

Author: Rollulus <roelboel@xs4all.nl>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1528 from rollulus/kafka-3864
2016-06-20 12:30:27 -07:00
Jason Gustafson 2c9796114d KAFKA-3850: WorkerSinkTask commit prior to rebalance should be retried on wakeup
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Liquan Pei <liquanpei@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1511 from hachikuji/retry-commit-on-wakeup-in-sinks
2016-06-19 15:31:04 -07:00
Liquan Pei 9ff54cb5dd MINOR: Catch Throwable in commitSourceTask()
Author: Liquan Pei <liquanpei@gmail.com>

Reviewers: Jason Gustafson <jason@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1402 from Ishiihara/source-task-commit-record
2016-06-14 13:21:30 -07:00
Liquan Pei 3fd9be49ac MINOR: Remove synchronized as the tasks are executed sequentially
Author: Liquan Pei <liquanpei@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1441 from Ishiihara/remove-synchronized
2016-05-30 17:11:17 -07:00
Sasaki Toru a4802962c9 KAFKA-3767; Add missing license to connect-test.properties
This address to https://issues.apache.org/jira/browse/KAFKA-3767.

Author: Sasaki Toru <sasakitoa@nttdata.co.jp>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #1443 from sasakitoa/test_failure_no_license
2016-05-28 11:30:19 +01:00
leisore ebed7ce360 MINOR: Delete unused code in FileStreamSourceTask
Author: leisore <leisore@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1433 from leisore/master
2016-05-26 23:21:20 -07:00
Peter Davis 9355427efc KAFKA-3710: MemoryOffsetBackingStore shutdown
ExecutorService needs to be shutdown on close, lest a zombie thread
prevent clean shutdown.

ewencp

Author: Peter Davis <peter.davis@expeditors.com>

Reviewers: Liquan Pei <liquanpei@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1383 from davispw/KAFKA-3710
2016-05-26 21:03:14 -07:00
Christian Posta 3cf2de0694 KAFKA-3723: Cannot change size of schema cache for JSON converter
Author: Christian Posta <christian.posta@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1401 from christian-posta/ceposta-connect-class-cast-error
2016-05-26 14:13:54 -07:00
shikhar e18bbba77f KAFKA-2935: Remove vestigial WorkerConfig.CLUSTER_CONFIG
Author: shikhar <shikhar@schmizz.net>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1404 from shikhar/kafka-2935
2016-05-19 09:25:06 -07:00
Liquan Pei bd8681cdd5 KAFKA-3690: Avoid to pass null to UnmodifiableMap
Author: Liquan Pei <liquanpei@gmail.com>

Reviewers: Jason Gustafson <jason@confluent.io>, Ismael Juma <ismael@juma.me.uk>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1360 from Ishiihara/avoid-to-pass-null
2016-05-11 13:06:20 -07:00
Liquan Pei 9575e93070 KAFKA-3684: SinkConnectorConfig does not return topics in config validation.
Author: Liquan Pei <liquanpei@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1356 from Ishiihara/bug-fix-validate
2016-05-09 17:37:17 -07:00
Jason Gustafson f96da638ee KAFKA-3676: system tests for connector pause/resume
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1345 from hachikuji/KAFKA-3676
2016-05-09 16:56:32 -07:00
Jason Gustafson 8911660e2e KAFKA-3674: Ensure connector target state changes propagated to worker
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1341 from hachikuji/KAFKA-3674
2016-05-09 00:12:30 -07:00
Liquan Pei fc89083f81 MINOR: Move connect.start() to try catch block
Author: Liquan Pei <liquanpei@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1347 from Ishiihara/connect-standalone
2016-05-08 23:52:13 -07:00
Liquan Pei d1bb2b9df1 KAFKA 3671: Move topics to SinkConnectorConfig
Author: Liquan Pei <liquanpei@gmail.com>

Reviewers: Dan Norwood <norwood@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1335 from Ishiihara/sink-connector-config
2016-05-08 22:26:26 -07:00
Jason Gustafson 32bf83e5a7 KAFKA-3659: Handle coordinator disconnects more gracefully in client
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Grant Henke <granthenke@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1322 from hachikuji/KAFKA-3659
2016-05-05 12:03:28 -07:00
Liquan Pei da7095f368 KAFKA 3656: Remove logging outstanding messages when producer flush fails
Author: Liquan Pei <liquanpei@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1319 from Ishiihara/kafka-3656
2016-05-04 16:08:08 -07:00
Liquan Pei 50aacd660d KAFKA-3654: Config validation should validate both common and connector specific configurations
Author: Liquan Pei <liquanpei@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1313 from Ishiihara/config-short-circuit
2016-05-03 18:05:04 -07:00
dan norwood 62253539d8 MINOR: add logfilename to error message when file missing
ewencp

Author: dan norwood <norwood@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1307 from norwood/log-filename-when-missing-file
2016-05-03 10:21:57 -07:00
Liquan Pei d0dedc6314 KAFKA-3459: Returning zero task configurations from a connector does not properly clean up existing tasks
hachikuji ewencp Can you take a look when you have time?

Author: Liquan Pei <liquanpei@gmail.com>

Reviewers: Jason Gustafson <jason@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1248 from Ishiihara/kafka-3459
2016-04-29 14:49:22 -07:00