Commit Graph

279 Commits

Author SHA1 Message Date
Ewen Cheslack-Postava 179d574a39 MINOR: Verify mocks in all WorkerTest tests and don't unnecessarily mockStatic the Plugins class
Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Konstantine Karantasis <konstantine@confluent.io>, Randall Hauch <rhauch@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #3319 from ewencp/minor-worker-test-cleanup
2017-06-14 02:34:18 +01:00
Konstantine Karantasis 004dde9e7a MINOR: Add unit tests for PluginDesc in Connect.
Related to https://github.com/apache/kafka/pull/3321

Author: Konstantine Karantasis <konstantine@confluent.io>

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

Closes #3326 from kkonstantine/MINOR-Add-tests-for-PluginDesc
2017-06-13 16:55:22 -07:00
Konstantine Karantasis 4b4102884c HOTFIX: Handle Connector version returning 'null' during plugin loading.
Author: Konstantine Karantasis <konstantine@confluent.io>

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

Closes #3321 from kkonstantine/HOTFIX-Handle-null-version-returned-from-Connector-interface-during-plugin-loading
2017-06-13 14:40:07 -07:00
Nick Pillitteri d655d806ee KAFKA-4942: Fix commitTimeoutMs being set before the commit actually started
This fixes KAFKA-4942

This supersededs #2730

/cc simplesteph gwenshap ewencp

Author: Nick Pillitteri <nickp@smartertravelmedia.com>
Author: simplesteph <stephane.maarek@gmail.com>

Reviewers: simplesteph <stephane.maarek@gmail.com>, Konstantine Karantasis <konstantine@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2912 from 56quarters/fix-connect-offset-commit
2017-06-06 14:22:39 -07:00
Randall Hauch af85e05b98 KAFKA-5164: Ensure SetSchemaMetadata updates key or value when Schema changes
When the `SetSchemaMetadata` SMT is used to change the name and/or version of the key or value’s schema, any references to the old schema in the key or value must be changed to reference the new schema. Only keys or values that are `Struct` have such references, and so currently only these are adjusted.

This is based on `trunk` since the fix is expected to be targeted to the 0.11.1 release.

Author: Randall Hauch <rhauch@gmail.com>

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

Closes #3198 from rhauch/kafka-5164
2017-06-02 10:02:40 -07:00
Colin P. Mccabe b3036c5861 KAFKA-5293; Do not apply exponential backoff if users have overridden…
… reconnect.backoff.ms

Author: Colin P. Mccabe <cmccabe@confluent.io>

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

Closes #3174 from cmccabe/KAFKA-5293
2017-06-01 21:21:58 +01:00
Konstantine Karantasis e0150a25e8 MINOR: Traverse plugin path recursively in Connect (KIP-146)
Author: Konstantine Karantasis <konstantine@confluent.io>

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

Closes #3173 from kkonstantine/MINOR-Traverse-plugin-path-recursively-in-Connect
2017-06-01 02:07:53 -07:00
Ismael Juma 7311dcbc53 KAFKA-5291; AdminClient should not trigger auto creation of topics
- Added a boolean `allow_auto_topic_creation` to MetadataRequest and
bumped the protocol version to V4.

- When connecting to brokers older than 0.11.0.0, the `allow_auto_topic_creation`
field won't be considered, so we send a metadata request for all topics
to keep the behavior consistent.

- Set `allow_auto_topic_creation` to false in the new AdminClient and
StreamsKafkaClient (which exists for the purpose of creating topics
manually); set it to true everywhere else for now. Other clients will eventually
rely on client-side auto topic creation, but that’s not there yet.

- Add `allowAutoTopicCreation` field to `Metadata`, which is used by
`DefaultMetadataUpdater`. This is not strictly needed for the new
`AdminClient`, but it avoids surprises if it ever adds a topic to `Metadata`
via `setTopics` or `addTopic`.

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

Reviewers: Jun Rao <junrao@gmail.com>

Closes #3098 from ijuma/kafka-5291-admin-client-no-auto-topic-creation
2017-06-01 01:00:11 +01:00
Ewen Cheslack-Postava 61bab2d875 KAFKA-4714; TimestampConverter transformation (KIP-66)
Author: Ewen Cheslack-Postava <me@ewencp.org>

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

Closes #3065 from ewencp/kafka-3209-timestamp-converter
2017-05-19 11:26:59 -07:00
Dana Powers abe699176b KAFKA-3878; Support exponential backoff policy via reconnect.backoff.max (KIP-144)
Summary:
- add `reconnect.backoff.max.ms` common client configuration parameter
- if `reconnect.backoff.max.ms` > `reconnect.backoff.ms`, apply an exponential backoff policy
- apply +/- 20% random jitter to smooth cluster reconnects

Author: Dana Powers <dana.powers@gmail.com>

Reviewers: Ewen Cheslack-Postava <me@ewencp.org>, Roger Hoover <roger.hoover@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #1523 from dpkp/exp_backoff
2017-05-19 14:06:40 +01:00
Randall Hauch 56623efd73 KAFKA-4667: Connect uses AdminClient to create internal topics when needed (KIP-154)
The backing store for offsets, status, and configs now attempts to use the new AdminClient to look up the internal topics and create them if they don’t yet exist. If the necessary APIs are not available in the connected broker, the stores fall back to the old behavior of relying upon auto-created topics. Kafka Connect requires a minimum of Apache Kafka 0.10.0.1-cp1, and the AdminClient can work with all versions since 0.10.0.0.

All three of Connect’s internal topics are created as compacted topics, and new distributed worker configuration properties control the replication factor for all three topics and the number of partitions for the offsets and status topics; the config topic requires a single partition and does not allow it to be set via configuration. All of these new configuration properties have sensible defaults, meaning users can upgrade without having to change any of the existing configurations. In most situations, existing Connect deployments will have already created the storage topics prior to upgrading.

The replication factor defaults to 3, so anyone running Kafka clusters with fewer nodes than 3 will receive an error unless they explicitly set the replication factor for the three internal topics. This is actually desired behavior, since it signals the users that they should be aware they are not using sufficient replication for production use.

The integration tests use a cluster with a single broker, so they were changed to explicitly specify a replication factor of 1 and a single partition.

The `KafkaAdminClientTest` was refactored to extract a utility for setting up a `KafkaAdminClient` with a `MockClient` for unit tests.

Author: Randall Hauch <rhauch@gmail.com>

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

Closes #2984 from rhauch/kafka-4667
2017-05-18 16:02:29 -07:00
Konstantine Karantasis 45f2261763 KAFKA-3487: Support classloading isolation in Connect (KIP-146)
Author: Konstantine Karantasis <konstantine@confluent.io>

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

Closes #3028 from kkonstantine/KAFKA-3487-Support-classloading-isolation-in-Connect
2017-05-18 10:39:15 -07:00
Ewen Cheslack-Postava 1cea4d8f5a KAFKA-4714; Flatten and Cast single message transforms (KIP-66)
Author: Ewen Cheslack-Postava <me@ewencp.org>

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

Closes #2458 from ewencp/kafka-3209-even-more-transforms
2017-05-16 23:05:35 -07:00
Ewen Cheslack-Postava e3892c29c3 MINOR: Handle nulls in NonEmptyListValidator
Author: Ewen Cheslack-Postava <me@ewencp.org>

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

Closes #3045 from ewencp/minor-non-empty-list-validator-nulls
2017-05-14 18:33:05 +01:00
dan norwood b6effcbba5 KAFKA-4343: Expose Connector type in REST API (KIP-151)
https://cwiki.apache.org/confluence/display/KAFKA/KIP-151+Expose+Connector+type+in+REST+API

Author: dan norwood <norwood@confluent.io>

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

Closes #2960 from norwood/KIP-151
2017-05-11 18:16:25 -07:00
Apurva Mehta d0e7c6b930 KAFKA-5043; Rename GroupCoordinator to FindCoordinator (KIP-98)
Also:
1. FindCoordinator is more general and takes a coordinator_type
so that it can be used for the group and transaction coordinators.
2. Include an error message in FindCoordinatorResponse to make the
errors at the client side more informative. We have just added the
field to the protocol in this PR, a subsequent PR will update the
code to use it.
3. Rename `Errors` names for FindCoordinator to be more generic. This
is a compatible change as the ids remain the same.
4. Since the exception classes for the error codes are in a public
package, we introduce new ones and deprecate the old ones.
The classes were not thrown back to the user (KAFKA-5052 aside),
so this is a compatible change.
5. Update InitPidRequest for transactions. Since this protocol API
was introduced recently and is not used by default, we did not bump
its version.

Author: Apurva Mehta <apurva@confluent.io>

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

Closes #2825 from apurvam/exactly-once-rpc-stubs
2017-04-11 09:11:46 +01:00
Ewen Cheslack-Postava d4c4bcf017 MINOR: Make ConfigDef safer by not using empty string for NO_DEFAULT_VALUE.
Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Damian Guy <damian.guy@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #2660 from ewencp/minor-make-configdef-safer
2017-04-05 11:35:04 +01:00
Konstantine Karantasis 9160810072 KAFKA-4837: Fix class name comparison in connector-plugins REST endpoint
Author: Konstantine Karantasis <konstantine@confluent.io>

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

Closes #2798 from kkonstantine/KAFKA-4837-Config-validation-in-Connector-plugins-need-to-compare-against-both-canonical-and-simple-class-names
2017-04-04 15:07:32 -07:00
Vitaly Pushkar 54bf2fb5ff KAFKA-4810: Make Kafka Connect SchemaBuilder more lax about checking that fields are unset
https://issues.apache.org/jira/browse/KAFKA-4810

> Currently SchemaBuilder is strict when checking that certain fields have not been set yet (e.g. version, name, doc). It just checks that the field is null. This is intended to protect the user from buggy code that overwrites a field with different values, but it's a bit too strict currently. In generic code for converting schemas (e.g. Converters) you will sometimes initialize a builder with these values (e.g. because you get a SchemaBuilder for a logical type, which sets name & version), but then have generic code for setting name & version from the source schema.

Changed the validation method to not only check if a field is null but also to check if the new value that is being set is the same as the current value of the field.
ewencp

Author: Vitaly Pushkar <vitaly.pushkar@gmail.com>

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

Closes #2806 from vitaly-pushkar/KAFKA-4810-schema-builder-default-fields-validation
2017-04-04 14:58:45 -07:00
Balint Molnar 75e213e550 KAFKA-4855: Struct SchemaBuilder should not allow duplicate fields
ewencp can you please review.

Author: Balint Molnar <balintmolnar91@gmail.com>

Reviewers: Gwen Shapira <cshapi@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2732 from baluchicken/KAFKA-4855
2017-04-03 20:07:47 -07:00
Colin P. Mccabe f812a8fd93 KAFKA-4977: Fix findbugs issues in connect/runtime
Author: Colin P. Mccabe <cmccabe@confluent.io>

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

Closes #2763 from cmccabe/KAFKA-4977
2017-04-03 17:57:12 -07:00
Armin Braun 040fde8ec1 KAFKA-4878: Improved Invalid Connect Config Error Message
Addresses for https://issues.apache.org/jira/browse/KAFKA-4878

* Adjusted the error message to explicitly state errors and their number
* Dried up the logic for generating the message between standalone and distributed

Example

messed up two config keys in the file source config:
````
namse=local-file-source
connector.class=FileStreamSource
tasks.max=1
fisle=test.txt
topic=connect-test
```

Produces:

```
[2017-03-22 08:57:11,896] ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone:99)
java.util.concurrent.ExecutionException: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector configuration is invalid and contains the following 2 error(s):
Missing required configuration "file" which has no default value.
Missing required configuration "name" which has no default value.
You can also find the above list of errors at the endpoint `/{connectorType}/config/validate`
```

Author: Armin Braun <me@obrown.io>

Reviewers: Gwen Shapira, Konstantine Karantasis, Ewen Cheslack-Postava

Closes #2722 from original-brownbear/KAFKA-4878
2017-04-03 13:09:10 -07:00
Damian Guy 1abed91bd2 KAFKA-4881: add internal leave.group.on.close config to consumer
Author: Damian Guy <damian.guy@gmail.com>

Reviewers: Ismael Juma, Guozhang Wang

Closes #2650 from dguy/consumer-leave-group-config
2017-03-27 10:30:38 -07:00
Jason Gustafson 5bd06f1d54 KAFKA-4816; Message format changes for idempotent/transactional producer (KIP-98)
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Jun Rao <junrao@gmail.com>, Apurva Mehta <apurva@confluent.io>, Guozhang Wang <wangguoz@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #2614 from hachikuji/exactly-once-message-format
2017-03-24 19:38:43 +00:00
Bruce Szalwinski 763ea5aad1 KAFKA-4929: Transformation Key/Value type references should be to class name(), not canonicalName()
Changing getCanonicalName() references to getName() so that docs update with "$" instead of ".".  Also added a connect-plugin-discovery.sh CLI to list all of the transformations available.

Author: Bruce Szalwinski <bruce.szalwinski@cdk.com>

Reviewers: Gwen Shapira

Closes #2720 from bruce-szalwinski/transforms and squashes the following commits:

ec3b5b9 [Bruce Szalwinski] remove connect-plugin-discovery.  will submit in a different PR
eba0af7 [Bruce Szalwinski] Key / Value transformations are static nested classes and so are referenced using OuterClass$Key and OuterClass$Value.
2017-03-22 16:02:09 -05:00
Colin P. Mccabe a7e3679d22 KAFKA-4924: Fix Kafka Connect API findbugs warnings
Author: Colin P. Mccabe <cmccabe@confluent.io>

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

Closes #2715 from cmccabe/KAFKA-4924
2017-03-21 16:48:44 -07:00
Sachin Mittal 197a5d5a6d KAFKA-4848: Fix retryWithBackoff deadlock issue
Fixes related to handling of MAX_POLL_INTERVAL_MS_CONFIG during deadlock and CommitFailedException on partition revoked.

Author: Sachin Mittal <sjmittal@gmail.com>

Reviewers: Matthias J. Sax, Damian Guy, Guozhang Wang

Closes #2642 from sjmittal/trunk
2017-03-20 21:56:15 -07:00
Colin P. Mccabe 5a2fcdd6d4 KAFKA-4894; Fix findbugs "default character set in use" warnings
Author: Colin P. Mccabe <cmccabe@confluent.io>

Reviewers: Jun Rao <junrao@gmail.com>

Closes #2683 from cmccabe/KAFKA-4894
2017-03-20 13:52:35 -07:00
Ismael Juma 962c378cc6 HOTFIX: Fix header in ByteArrayConverter
Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Manikumar reddy O <manikumar.reddy@gmail.com>

Closes #2690 from ijuma/fix-header-in-byte-array-converter
2017-03-15 14:46:32 +00:00
Ewen Cheslack-Postava 52a15d7c0b KAFKA-4783: Add ByteArrayConverter (KIP-128)
Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #2599 from ewencp/kafka-4783-byte-array-converter
2017-03-14 17:20:49 -07:00
Rajini Sivaram a3c45b0c92 KAFKA-4631; Request metadata in consumer if topic/partitions unavailable
If leader node of one more more partitions in a consumer subscription are temporarily unavailable, request metadata refresh so that partitions skipped for assignment dont have to wait for metadata expiry before reassignment. Metadata refresh is also requested if a subscribe topic or assigned partition doesn't exist.

Author: Rajini Sivaram <rajinisivaram@googlemail.com>

Reviewers: Vahid Hashemian <vahidhashemian@us.ibm.com>, Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>

Closes #2622 from rajinisivaram/KAFKA-4631
2017-03-02 17:49:10 -08:00
Matthias J. Sax d0e436c471 MINOR: improve license header check by providing head file instead of (prefix) header regex
Author: Matthias J. Sax <matthias@confluent.io>

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

Closes #2303 from mjsax/licenseHeader
2017-02-28 12:35:04 -08:00
Chris Egerton 8e6fbe8fed MINOR: Make asJsonSchema() and asConnectSchema() methods public
Want to use these methods in an external project.

Author: Chris Egerton <fearthecellos@gmail.com>

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

Closes #2610 from C0urante/public-json-schema-conversion
2017-02-28 11:49:16 -08:00
Armin Braun 43524442dc MINOR: Fixed Non-Final Close Method + its Duplication
Author: Armin Braun <me@obrown.io>

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

Closes #2582 from original-brownbear/cleanup-nonfinal-close
2017-02-24 14:37:31 -08:00
Colin P. Mccabe 916edc3a4e KAFKA-4774; Inner classes which don't need a reference to the outer c…
…lass should be static

Author: Colin P. Mccabe <cmccabe@confluent.io>

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

Closes #2558 from cmccabe/KAFKA-4774
2017-02-18 06:40:35 -08:00
Aegeaner 6c839395b7 KAFKA-4709:Error message from Struct.validate() should include the name of the offending field.
https://issues.apache.org/jira/browse/KAFKA-4709

Author: Aegeaner <xihuke@gmail.com>

Reviewers: Dong Lin, Guozhang Wang

Closes #2521 from Aegeaner/KAFKA-4709
2017-02-16 13:44:08 -08:00
rnpridgeon 5dabca0259 KAFKA-4758; Connect missing checks for NO_TIMESTAMP
Author: rnpridgeon <ryan.n.pridgeon@gmail.com>

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

Closes #2533 from rnpridgeon/no_timestamp
2017-02-12 16:06:33 -08:00
Vahid Hashemian 9898d665d1 MINOR: Use an explicit `Errors` object when possible instead of a numeric error code
Author: Vahid Hashemian <vahidhashemian@us.ibm.com>

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

Closes #2475 from vahidhashemian/minor/use_explicit_Errors_type_when_possible
2017-02-09 21:03:46 -08:00
Maysam Yabandeh cb674e5487 KAFKA-4039; Fix deadlock during shutdown due to log truncation not allowed
Author: Maysam Yabandeh <myabandeh@dropbox.com>
Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Jun Rao <junrao@gmail.com>

Closes #2474 from ijuma/kafka-4039-deadlock-during-shutdown
2017-02-02 22:23:49 +00:00
Balint Molnar 84323eea23 KAFKA-4679: Remove unstable markers from Connect APIs
ewencp ignore this PR if you are already started to work on this ticket.

Author: Balint Molnar <balintmolnar91@gmail.com>

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

Closes #2423 from baluchicken/KAFKA-4679

(cherry picked from commit 1434b61d5d)
Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
2017-01-27 19:58:22 -08:00
Ismael Juma ca0c071c10 KAFKA-4636; Per listener security settings overrides (KIP-103)
Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Jun Rao <junrao@gmail.com>, Rajini Sivaram <rajinisivaram@googlemail.com>

Closes #2406 from ijuma/kafka-4636-per-listener-security-settings
2017-01-27 01:24:56 +00:00
Ismael Juma 254e3b77d6 KAFKA-4699; Invoke producer callbacks before completing the future
This behaviour was changed in 8b3c6c0, but it caused interceptor
test failures (which rely on callbacks) and since we’re so close to
code freeze, it’s better to be conservative.

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

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #2440 from ijuma/kafka-4699-callbacks-invoked-before-future-is-completed
2017-01-26 09:50:25 -08:00
Shikhar Bhushan a8aa756166 KAFKA-3209: KIP-66: more single message transforms
Renames `HoistToStruct` SMT to `HoistField`.

Adds the following SMTs:
`ExtractField`
`MaskField`
`RegexRouter`
`ReplaceField`
`SetSchemaMetadata`
`ValueToKey`

Adds HTML doc generation and updates to `connect.html`.

Author: Shikhar Bhushan <shikhar@confluent.io>

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

Closes #2374 from shikhar/more-smt
2017-01-20 16:15:15 -08:00
Jason Gustafson 6496271a11 MINOR: Remove unneeded client used API lists
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>, Gwen Shapira <cshapi@gmail.com>, Apurva Mehta <apurva.1618@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #2372 from hachikuji/minor-cleanup-used-apis
2017-01-13 19:04:57 +00:00
Shikhar Bhushan ad8ddf737a MINOR: avoid closing over both pre & post-transform record in WorkerSourceTask
Followup to #2299 for KAFKA-3209

Author: Shikhar Bhushan <shikhar@confluent.io>

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

Closes #2365 from shikhar/2299-followup
2017-01-12 17:09:30 -08:00
Shikhar Bhushan 2f90488323 KAFKA-3209: KIP-66: single message transforms
Besides API and runtime changes, this PR also includes 2 data transformations (`InsertField`, `HoistToStruct`) and 1 routing transformation (`TimestampRouter`).

There is some gnarliness in `ConnectorConfig` / `ConfigDef` around creating, parsing and validating a dynamic `ConfigDef`.

Author: Shikhar Bhushan <shikhar@confluent.io>

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

Closes #2299 from shikhar/smt-2017
2017-01-12 16:14:53 -08:00
Colin P. Mccabe 3d60f1e643 KAFKA-4507; Clients should support older brokers (KIP-97)
The client should send older versions of requests to the broker if necessary.

Author: Colin P. Mccabe <cmccabe@confluent.io>

Reviewers: Jason Gustafson <jason@confluent.io>, Jun Rao <junrao@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #2264 from cmccabe/KAFKA-4507
2017-01-11 19:25:58 +00:00
Shikhar Bhushan 2e1bcf661d 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-01-05 15:25:00 -08:00
Ewen Cheslack-Postava a565a77b1f KAFKA-4404; Add javadocs to document core Connect types, especially that integer types are signed
Author: Ewen Cheslack-Postava <me@ewencp.org>

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

Closes #2296 from ewencp/kafka-4404-document-connect-signed-integer-types
2017-01-03 11:02:20 -08:00
Shikhar Bhushan d092146247 KAFKA-4527: task status was being updated before actual pause/resume
h/t ewencp for pointing out the issue

Author: Shikhar Bhushan <shikhar@confluent.io>

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

Closes #2277 from shikhar/kafka-4527
2016-12-24 17:25:01 -05:00
Rekha Joshi a5c15ba037 KAFKA-4500; Code quality improvements
- Removed redundant modifiers, not needed String.format()
- Removed unnecessary semicolon, additional assignment, inlined return
- Using StringBuilder for consistency across codebase
- Using try-with-resources

Author: Rekha Joshi <rekhajoshm@gmail.com>
Author: Joshi <rekhajoshm@gmail.com>

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

Closes #2222 from rekhajoshm/KAFKA-4500
2016-12-20 12:40:07 +00:00
Ewen Cheslack-Postava bc9ef716af KAFKA-4553; Improve round robin assignment in Connect to avoid uneven distributions of connectors and tasks
Author: Ewen Cheslack-Postava <me@ewencp.org>

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

Closes #2272 from ewencp/kafka-4553-better-connect-round-robin
2016-12-19 12:37:58 -08:00
Ashish Singh d6b0b520fc KAFKA-3600; Use ApiVersions to check if broker supports required api versions
Author: Ashish Singh <asingh@cloudera.com>

Reviewers: Jason Gustafson <jason@confluent.io>, Colin P. Mccabe <cmccabe@confluent.io>, Dana Powers <dana.powers@gmail.com>, Gwen Shapira <cshapi@gmail.com>, Grant Henke <granthenke@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #1251 from SinghAsDev/KAFKA-3600
2016-12-17 04:24:15 -08:00
Shikhar Bhushan 8e9e177679 HOTFIX: Fix HerderRequest.compareTo()
With KAFKA-3008 (#1788), the implementation does not respect the contract that 'sgn(x.compareTo(y)) == -sgn(y.compareTo(x))'

This fix addresses the hang with JDK8 in DistributedHerderTest.compareTo()

Author: Shikhar Bhushan <shikhar@confluent.io>

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

Closes #2232 from shikhar/herderreq-compareto
2016-12-10 12:48:51 -08:00
Konstantine Karantasis c9e99f297f KAFKA-4306: Shutdown distributed herder with a timeout.
Resolves

KAFKA-4306: Connect workers won't shut down if brokers are not available
KAFKA-4154: Kafka Connect fails to shutdown if it has not completed startup

Author: Konstantine Karantasis <konstantine@confluent.io>

Reviewers: Shikhar Bhushan <shikhar@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2201 from kkonstantine/KAFKA-4306-Connect-workers-will-not-shut-down-if-brokers-are-not-available
2016-12-06 14:34:52 -08:00
Konstantine Karantasis 34aa538bf3 HOTFIX: Fix bug in readToLogEnd in KafkaBasedLog.
Author: Konstantine Karantasis <konstantine@confluent.io>

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

Closes #2211 from kkonstantine/HOTFIX-Correctly-read-to-end-of-offsets-log-in-Connect-KafkaBasedLog
2016-12-05 14:34:14 -08:00
Ismael Juma 128d0ff91d KAFKA-2247; Merge kafka.utils.Time and kafka.common.utils.Time
Also:
* Make all implementations of `Time` thread-safe as they are accessed from multiple threads in some cases.
* Change default implementation of `MockTime` to use two separate variables for `nanoTime` and `currentTimeMillis` as they have different `origins`.

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

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>, Shikhar Bhushan <shikhar@confluent.io>, Jason Gustafson <jason@confluent.io>, Eno Thereska <eno.thereska@gmail.com>, Damian Guy <damian.guy@gmail.com>

Closes #2095 from ijuma/kafka-2247-consolidate-time-interfaces
2016-12-02 14:00:58 +00:00
Shikhar Bhushan b45a67ede9 KAFKA-4161: KIP-89: Allow sink connectors to decouple flush and offset commit
Author: Shikhar Bhushan <shikhar@confluent.io>

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

Closes #2139 from shikhar/kafka-4161-deux
2016-12-01 15:01:09 -08:00
Konstantine Karantasis b65f9a777d KAFKA-3008: Parallel start and stop of connectors and tasks in Connect
Author: Konstantine Karantasis <konstantine@confluent.io>
Author: Konstantine Karantasis <k.karantasis@gmail.com>

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

Closes #1788 from kkonstantine/KAFKA-3008-Parallel-start-and-stop-of-connectors-and-tasks
2016-12-01 14:42:15 -08:00
Balint Molnar 5819b06faf KAFKA-4403; Update KafkaBasedLog to use new endOffsets consumer API
ewencp plz review

Author: Balint Molnar <balintmolnar91@gmail.com>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #2176 from baluchicken/KAFKA-4403
2016-11-29 19:04:24 -08:00
Konstantine Karantasis d98ca230a1 KAFKA-4397: Refactor Connect backing stores for thread safety
Author: Konstantine Karantasis <konstantine@confluent.io>

Reviewers: Shikhar Bhushan <shikhar@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2123 from kkonstantine/KAFKA-4397-Refactor-connect-backing-stores-for-thread-safety
2016-11-29 15:31:14 -08:00
Ewen Cheslack-Postava 31203efcb2 MINOR: Clarify how to fix conversion issues when plain JSON data is used with schemas.enable=true
Author: Ewen Cheslack-Postava <me@ewencp.org>

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

Closes #2041 from ewencp/clarify-json-converter-failure
2016-11-15 14:23:36 +00:00
Jason Gustafson 3b4c347949 KAFKA-2066; Use client-side FetchRequest/FetchResponse on server
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Jun Rao <junrao@gmail.com>

Closes #2069 from hachikuji/KAFKA-2066
2016-11-14 16:31:04 -08:00
Jason Gustafson b7d36b7261 KAFKA-3829: Ensure valid configuration prior to creating connector
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Shikhar Bhushan <shikhar@schmizz.net>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1911 from hachikuji/KAFKA-3829
2016-11-12 16:11:28 -08:00
rnpridgeon da13b53787 KAFKA-4364: Remove secrets from DEBUG logging
leverage fix from KAFKA-2690 to remove secrets from task logging

Author: rnpridgeon <ryan.n.pridgeon@gmail.com>

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

Closes #2115 from rnpridgeon/KAFKA-4364
2016-11-09 14:58:02 -08:00
Ewen Cheslack-Postava 8f2e0a5ec1 MINOR: Fix regex on connector path param in ConnectorsResource
Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Shikhar Bhushan <shikhar@schmizz.net>, Konstantine Karantasis <konstantine@confluent.io>, Jason Gustafson <jason@confluent.io>

Closes #2108 from ewencp/fix-rest-api-regex
2016-11-07 08:47:28 -08:00
Olivier Girardot 0a659e50f7 KAFKA-4372: Kafka Connect REST API does not handle DELETE of connector with slashes in their names
Kafka Connect REST API does not handle in many places connectors with slashes in their names because it expects PathParams, this PR intends to :
* Reject as bad requests API calls trying to create connectors with slashes in their names
* Add support for connector with slashes in their names in the DELETE part of the API to allow users to cleanup their connectors without dropping everything.

This PR adds as well the Unit Test needed for the creation part and was tested manually for the DELETE part.

Author: Olivier Girardot <o.girardot@lateral-thoughts.com>

Reviewers: Shikhar Bhushan <shikhar@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2096 from ogirardot/fix/connectors-with-slashes-cannot-be-deleted
2016-11-04 10:44:05 -07:00
Mathieu Fenniak 508711d09e MINOR: Fix NPE when Connect offset contains non-primitive type
When storing a non-primitive type in a Connect offset, the following NullPointerException will occur:

```
07:18:23.702 [pool-3-thread-1] ERROR o.a.k.c.storage.OffsetStorageWriter - CRITICAL: Failed to serialize offset data, making it impossible to commit offsets under namespace tenant-db-bootstrap-source. This likely won't recover unless the unserializable partition or offset information is overwritten.
07:18:23.702 [pool-3-thread-1] ERROR o.a.k.c.storage.OffsetStorageWriter - Cause of serialization failure:
java.lang.NullPointerException: null
	at org.apache.kafka.connect.storage.OffsetUtils.validateFormat(OffsetUtils.java:51)
	at org.apache.kafka.connect.storage.OffsetStorageWriter.doFlush(OffsetStorageWriter.java:143)
	at org.apache.kafka.connect.runtime.WorkerSourceTask.commitOffsets(WorkerSourceTask.java:319)
... snip ...
```

The attached patch fixes the specific case where OffsetUtils.validateFormat is attempting to provide a useful error message, but fails to because the schemaType method could return null.

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

Author: Mathieu Fenniak <mathieu.fenniak@replicon.com>

Reviewers: Gwen Shapira

Closes #2087 from mfenniak/fix-npr-with-clearer-error-message
2016-11-02 10:27:19 -07:00
Ismael Juma d092673838 MINOR: A bunch of clean-ups related to usage of unused variables
There should be only one cases where these clean-ups have a functional impact: replaced repeated identical logs with a single log for the stale controller epoch case.

The rest should just make the code easier to read and make it a bit less wasteful. I did this exercise because unused variables sometimes mask bugs.

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

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #1985 from ijuma/remove-unused
2016-10-25 02:55:55 +01:00
Andrew Stevenson ed50769234 MINOR: Check for null timestamp rather than value in hashcode
Author: Andrew Stevenson <andrew@datamountaineer.com>

Reviewers: Shikhar Bhushan <shikhar@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2055 from andrewstevenson/kafka-4334
2016-10-23 22:32:03 -07:00
Jason Gustafson c1e840050c 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
2016-10-10 23:03:06 -07:00
Vahid Hashemian e972d2afd3 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
2016-10-10 15:58:37 -07:00
Jason Gustafson b75245cfbb 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
2016-09-26 14:54:01 -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
Liquan Pei e50327331d KAFKA-3578: Allow cross origin HTTP requests on all HTTP methods
Author: Liquan Pei <liquanpei@gmail.com>

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

Closes #1288 from Ishiihara/kip-56
2016-04-29 10:52:42 -07:00
Liquan Pei 316389d6ad KAFKA-3611: Remove warnings when using reflections
ewencp granders Can you take a look? Thanks!

Author: Liquan Pei <liquanpei@gmail.com>

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

Closes #1259 from Ishiihara/fix-warning
2016-04-28 11:59:02 -07:00
Ewen Cheslack-Postava bc50515651 KAFKA-3605: Return error if connector config includes mismatching connector name.
Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Jason Gustafson

Closes #1253 from ewencp/kafka-3605-connector-name-mismatch
2016-04-22 07:09:14 -07:00
Liquan Pei c7f9bd2a68 KAFKA-3606: Traverse CLASSPATH during herder start
ewencp Can you take a quick look?

Author: Liquan Pei <liquanpei@gmail.com>

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

Closes #1252 from Ishiihara/pre-list-connectors
2016-04-21 17:59:23 -07:00
Rajini Sivaram 9d71489ff0 KAFKA-3548: Use root locale for case transformation of constant strings
For enums and other constant strings, use locale independent case conversions to enable comparisons to work regardless of the default locale.

Author: Rajini Sivaram <rajinisivaram@googlemail.com>

Reviewers: Manikumar Reddy, Ismael Juma, Guozhang Wang, Gwen Shapira

Closes #1220 from rajinisivaram/KAFKA-3548
2016-04-20 18:54:30 -07:00
Liquan Pei f213625fc5 MINOR: Fix comment in DistributedHerder
ewencp

Author: Liquan Pei <liquanpei@gmail.com>

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

Closes #1243 from Ishiihara/docs
2016-04-20 17:50:00 -07:00
Jason Gustafson c9485b78a6 KAFKA-2370: kafka connect pause/resume API
Author: Jason Gustafson <jason@confluent.io>

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

Closes #1087 from hachikuji/KAFKA-2370
2016-04-20 14:09:59 -07:00
Ishita Mandhan 0bf61039c8 MINOR: Fix typos in code comments
This patch fixes all occurances of two consecutive 'the's in the code comments.

Author: Ishita Mandhan (imandhaus.ibm.com)

Author: Ishita Mandhan <imandha@us.ibm.com>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #1240 from imandhan/typofixes
2016-04-19 17:39:04 -07:00
Jason Gustafson 89c67727c2 KAFKA-3506: Kafka Connect restart APIs
Author: Jason Gustafson <jason@confluent.io>

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

Closes #1189 from hachikuji/KAFKA-3506
2016-04-18 10:50:58 -07:00
Liquan Pei 5236bf60de KAFKA-3526: Return string instead of object in ConfigKeyInfo and ConfigValueInfo
Author: Liquan Pei <liquanpei@gmail.com>

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

Closes #1200 from Ishiihara/config-string
2016-04-15 15:51:31 -07:00
Rajini Sivaram 9c34df1511 KAFKA-3488; Avoid failing of unsent requests in consumer where possible
Fail unsent requests only when returning from KafkaConsumer.poll().

Author: Rajini Sivaram <rajinisivaram@googlemail.com>

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

Closes #1183 from rajinisivaram/KAFKA-3488
2016-04-07 15:48:50 -07:00
Liquan Pei 83cf38545b MINOR: Clean up of SourceTaskOffsetCommiter
Author: Liquan Pei <liquanpei@gmail.com>

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

Closes #1170 from Ishiihara/minor-cleanup
2016-04-03 19:04:48 -07:00
Liquan Pei 78fa20eb58 KAFKA-3316: Add REST API for listing connector plugins
Author: Liquan Pei <liquanpei@gmail.com>

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

Closes #1090 from Ishiihara/kafka-3316
2016-03-25 16:46:53 -07:00
Ryan P 419e268d6f KAFKA-3445: Validate TASKS_MAX_CONFIG's lower bound
Currently the property TASKS_MAX_CONFIG is not validated against nonsensical values such as 0. This patch leverages the Range.atLeast() method to ensure value is at least 1.

Author: Ryan P <Ryan.N.Pridgeon@Gmail.com>

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

Closes #1132 from rnpridgeon/KAFKA-3445
2016-03-24 10:12:19 -07:00
Ewen Cheslack-Postava eb823281a5 KAFKA-3424: Add CORS support to Connect REST API
Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Gwen Shapira

Closes #1099 from ewencp/cors-rest-support
2016-03-19 18:39:52 -07:00
Pierre-Yves Ritschard 4332175c11 KAFKA-3006: standardize KafkaConsumer API to use Collection
Author: Pierre-Yves Ritschard <pyr@spootnik.org>

Reviewers: Jason Gustafson, Gwen Shapira

Closes #1098 from hachikuji/KAFKA-3006
2016-03-18 16:07:20 -07:00
Liquan Pei c07d017227 KAFKA-3315: Add REST and Connector API to expose connector configuration
Author: Liquan Pei <liquanpei@gmail.com>

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

Closes #964 from Ishiihara/expose-connector-config
2016-03-17 13:26:02 -07:00
Ewen Cheslack-Postava 6834b91e34 MINOR: KAFKA-3260 follow up, fix commitRecord calls in tests
Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #1080 from ewencp/minor-kafka-3260-followup-tests
2016-03-16 08:24:18 -07:00
Jeremy Custenborder 6eacc0de30 KAFKA-3260 - Added SourceTask.commitRecord
Added commitRecord(SourceRecord record) to SourceTask. This method is called during the callback from producer.send() when the message has been sent successfully. Added commitTaskRecord(SourceRecord record) to WorkerSourceTask to handle calling commitRecord on the SourceTask. Updated tests for calls to commitRecord.

Author: Jeremy Custenborder <jcustenborder@gmail.com>

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

Closes #950 from jcustenborder/KAFKA-3260
2016-03-15 14:32:22 -07:00
Ismael Juma 241c3ebb28 KAFKA-3375; Suppress deprecated warnings where reasonable and tweak compiler settings
* Fix and suppress number of unchecked warnings (except for Kafka Streams)
* Add `SafeVarargs` annotation to fix warnings
* Suppress unfixable deprecation warnings
* Replace deprecated by non-deprecated usage where possible
* Avoid reflective calls via structural types in Scala
* Tweak compiler settings for scalac and javac

Once we drop Java 7 and Scala 2.10, we can tweak the compiler settings further so that they warn us about more things.

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

Reviewers: Grant Henke, Gwen Shapira, Guozhang Wang

Closes #1042 from ijuma/kafka-3375-suppress-depreccated-tweak-compiler
2016-03-14 19:14:36 -07:00
Gwen Shapira b7d6fae59e KAFKA-3299: Ensure that reading config log on rebalance doesn't hang the herder
Author: Gwen Shapira <cshapi@gmail.com>

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

Closes #981 from gwenshap/KAFKA-3299
2016-03-04 14:21:22 -08:00
Jason Gustafson 7079f57f70 KAFKA-3290: fix race condition with worker task shutdown and mock validation
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Gwen Shapira

Closes #1008 from hachikuji/KAFKA-3290-REVISITED
2016-03-03 14:58:43 -08:00
jinxing 079c88178d KAFKA-2934; Offset storage file configuration in Connect standalone mode is not included in StandaloneConfig
Added offsetBackingStore config to StandaloneConfig and DistributedConfig;
Added config for offset.storage.topic and config.storage.topic into DistributedConfig;

Author: jinxing <jinxing@fenbi.com>

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

Closes #734 from ZoneMayor/trunk-KAFKA-2934
2016-03-03 08:54:37 -08:00
Gwen Shapira 00a58f8e1e KAFKA-2944: Replaced the NPE with a nicer error and clean exit and added debug message to assist with figuring this out.
…ssage to assist with figuring this out.

Author: Gwen Shapira <cshapi@gmail.com>

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

Closes #993 from gwenshap/KAFKA-2944
2016-03-02 18:50:59 -08:00
Jason Gustafson cfc324333f KAFKA-3290: fix transient test failures in WorkerSourceTaskTest
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Gwen Shapira

Closes #998 from hachikuji/KAFKA-3290
2016-03-02 17:22:14 -08:00
Anna Povzner 002b377dad KAFKA-3196; Added checksum and size to RecordMetadata and ConsumerRecord
This is the second (remaining) part of KIP-42. See https://cwiki.apache.org/confluence/display/KAFKA/KIP-42%3A+Add+Producer+and+Consumer+Interceptors

Author: Anna Povzner <anna@confluent.io>

Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>, Jun Rao <junrao@gmail.com>

Closes #951 from apovzner/kafka-3196
2016-03-02 09:40:34 -08:00
Jason Gustafson b3b533171c MINOR: Connect status tracking API followup
Fixes from Ishiihara's review.

Author: Jason Gustafson <jason@confluent.io>

Reviewers: Liquan Pei, Gwen Shapira

Closes #974 from hachikuji/status-tracking-followup
2016-02-25 13:59:17 -08:00
Gwen Shapira 1bfaddae9c MINOR: add useful debug log messages to KConnect source task execution
Author: Gwen Shapira <cshapi@gmail.com>

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

Closes #957 from gwenshap/source_worker_debug
2016-02-24 11:07:34 -08:00
Jason Gustafson f7d019ed40 KAFKA-3093: Add Connect status tracking API
Author: Jason Gustafson <jason@confluent.io>

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

Closes #920 from hachikuji/KAFKA-3093
2016-02-23 22:47:31 -08:00
Jiangjie Qin 45c8195fa1 KAFKA-3025; Added timetamp to Message and use relative offset.
See KIP-31 and KIP-32 for details.

A few notes on the patch:
1. This patch implements KIP-31 and KIP-32. The patch includes features in both KAFKA-3025,  KAFKA-3026 and KAFKA-3036
2. All unit tests passed.
3. The unit tests were run with new and old message format.
4. When message format conversion occurs during consumption, the consumer will not be able to detect the message size too large situation. I did not try to fix this because the situation seems rare and only happen during migration phase.

Author: Jiangjie Qin <becket.qin@gmail.com>
Author: Ismael Juma <ismael@juma.me.uk>
Author: Jiangjie (Becket) Qin <becket.qin@gmail.com>

Reviewers: Jason Gustafson <jason@confluent.io>, Anna Povzner <anna@confluent.io>, Ismael Juma <ismael@juma.me.uk>, Guozhang Wang <wangguoz@gmail.com>, Jun Rao <junrao@gmail.com>

Closes #764 from becketqin/KAFKA-3025
2016-02-19 07:56:40 -08:00
Jeremy Custenborder 8c90b1a98a KAFKA-3225: Method commit() of class SourceTask never invoked
1. Added a test case to prove commit() on SourceTask was not being called.
2. Added commitSourceTask() which logs potential exceptions.
3. Added after call to finishSuccessfulFlush().

Author: Jeremy Custenborder <jeremy@scarcemedia.com>

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

Closes #909 from jcustenborder/KAFKA-3225
2016-02-17 11:12:41 -05:00
Jason Gustafson 5092e7f834 MINOR: Connect hangs on startup failure
Author: Jason Gustafson <jason@confluent.io>

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

Closes #902 from hachikuji/hotfix-connect-startup
2016-02-10 17:08:23 -08:00
Jason Gustafson dc662776cd KAFKA-3211: Handle WorkerTask stop before start correctly
Author: Jason Gustafson <jason@confluent.io>

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

Closes #874 from hachikuji/KAFKA-3211
2016-02-04 18:00:45 -08:00
Gwen Shapira 9b47f9a7f6 MINOR: log connect reconfiguration error only if there was an error
Author: Gwen Shapira <cshapi@gmail.com>

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

Closes #871 from gwenshap/fix-cc-log
2016-02-04 14:34:29 -08:00
Jason Gustafson f8598f96df HOTFIX: fix broken WorkerSourceTask test
Author: Jason Gustafson <jason@confluent.io>

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

Closes #859 from hachikuji/hotfix-worker-source-test
2016-02-04 11:11:41 -08:00
Jason Gustafson 1d80f563bc KAFKA-3092: Replace SinkTask onPartitionsAssigned/onPartitionsRevoked with open/close
Author: Jason Gustafson <jason@confluent.io>

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

Closes #815 from hachikuji/KAFKA-3092
2016-02-03 11:28:58 -08:00