Skip to content

Commit

Permalink
[FLINK-2386] [kafka connector] Add comments to all backported kafka s…
Browse files Browse the repository at this point in the history
…ources and move them to 'org.apache.flink.kafka_backport'
  • Loading branch information
StephanEwen committed Aug 27, 2015
1 parent fb5aac2 commit 33f4c81
Show file tree
Hide file tree
Showing 174 changed files with 2,169 additions and 702 deletions.
Expand Up @@ -10,9 +10,18 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients;
package org.apache.flink.kafka_backport.clients;

import org.apache.kafka.copied.common.requests.RequestSend;
import org.apache.flink.kafka_backport.common.requests.RequestSend;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* A request being sent to the server. This holds both the network send as well as the client-level metadata.
Expand Down
Expand Up @@ -10,9 +10,18 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients;
package org.apache.flink.kafka_backport.clients;

import org.apache.kafka.copied.common.protocol.types.Struct;
import org.apache.flink.kafka_backport.common.protocol.types.Struct;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* A response from the server. Contains both the body of the response as well as the correlated request that was
Expand Down
Expand Up @@ -10,9 +10,10 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients;
package org.apache.flink.kafka_backport.clients;

import org.apache.kafka.copied.common.config.ConfigException;
import org.apache.flink.kafka_backport.common.config.ConfigException;
import org.apache.flink.kafka_backport.common.utils.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -22,8 +23,14 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;

import static org.apache.kafka.copied.common.utils.Utils.getHost;
import static org.apache.kafka.copied.common.utils.Utils.getPort;
// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

public class ClientUtils {
private static final Logger log = LoggerFactory.getLogger(ClientUtils.class);
Expand All @@ -32,8 +39,8 @@ public static List<InetSocketAddress> parseAndValidateAddresses(List<String> url
List<InetSocketAddress> addresses = new ArrayList<InetSocketAddress>();
for (String url : urls) {
if (url != null && url.length() > 0) {
String host = getHost(url);
Integer port = getPort(url);
String host = Utils.getHost(url);
Integer port = Utils.getPort(url);
if (host == null || port == null)
throw new ConfigException("Invalid url in " + CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG + ": " + url);
try {
Expand Down
Expand Up @@ -10,11 +10,20 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients;
package org.apache.flink.kafka_backport.clients;

import java.util.HashMap;
import java.util.Map;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* The state of our connection to each node in the cluster.
*
Expand Down
Expand Up @@ -11,7 +11,16 @@
* specific language governing permissions and limitations under the License.
*/

package org.apache.kafka.copied.clients;
package org.apache.flink.kafka_backport.clients;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* Some configurations shared by both producer and consumer
Expand Down
Expand Up @@ -10,7 +10,16 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients;
package org.apache.flink.kafka_backport.clients;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* The states of a node connection
Expand Down
Expand Up @@ -10,14 +10,23 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients;
package org.apache.flink.kafka_backport.clients;

import java.util.ArrayDeque;
import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.Map;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* The set of requests which have been sent or are being sent but haven't yet received a response
*/
Expand Down
Expand Up @@ -10,15 +10,24 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients;
package org.apache.flink.kafka_backport.clients;

import org.apache.kafka.copied.common.Node;
import org.apache.kafka.copied.common.protocol.ApiKeys;
import org.apache.kafka.copied.common.requests.RequestHeader;
import org.apache.flink.kafka_backport.common.Node;
import org.apache.flink.kafka_backport.common.requests.RequestHeader;
import org.apache.flink.kafka_backport.common.protocol.ApiKeys;

import java.io.Closeable;
import java.util.List;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* The interface for {@link NetworkClient}
*/
Expand Down
Expand Up @@ -10,16 +10,25 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients;
package org.apache.flink.kafka_backport.clients;

import org.apache.kafka.copied.common.Cluster;
import org.apache.kafka.copied.common.errors.TimeoutException;
import org.apache.flink.kafka_backport.common.Cluster;
import org.apache.flink.kafka_backport.common.errors.TimeoutException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashSet;
import java.util.Set;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* A class encapsulating some of the logic around metadata.
* <p>
Expand Down
Expand Up @@ -10,22 +10,22 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients;

import org.apache.kafka.copied.common.Cluster;
import org.apache.kafka.copied.common.Node;
import org.apache.kafka.copied.common.network.NetworkReceive;
import org.apache.kafka.copied.common.network.Selectable;
import org.apache.kafka.copied.common.network.Send;
import org.apache.kafka.copied.common.protocol.ApiKeys;
import org.apache.kafka.copied.common.protocol.ProtoUtils;
import org.apache.kafka.copied.common.protocol.types.Struct;
import org.apache.kafka.copied.common.requests.MetadataRequest;
import org.apache.kafka.copied.common.requests.MetadataResponse;
import org.apache.kafka.copied.common.requests.RequestHeader;
import org.apache.kafka.copied.common.requests.RequestSend;
import org.apache.kafka.copied.common.requests.ResponseHeader;
import org.apache.kafka.copied.common.utils.Utils;
package org.apache.flink.kafka_backport.clients;

import org.apache.flink.kafka_backport.common.Node;
import org.apache.flink.kafka_backport.common.network.NetworkReceive;
import org.apache.flink.kafka_backport.common.network.Send;
import org.apache.flink.kafka_backport.common.protocol.ApiKeys;
import org.apache.flink.kafka_backport.common.protocol.ProtoUtils;
import org.apache.flink.kafka_backport.common.protocol.types.Struct;
import org.apache.flink.kafka_backport.common.requests.MetadataRequest;
import org.apache.flink.kafka_backport.common.requests.MetadataResponse;
import org.apache.flink.kafka_backport.common.requests.RequestHeader;
import org.apache.flink.kafka_backport.common.requests.RequestSend;
import org.apache.flink.kafka_backport.common.utils.Utils;
import org.apache.flink.kafka_backport.common.Cluster;
import org.apache.flink.kafka_backport.common.network.Selectable;
import org.apache.flink.kafka_backport.common.requests.ResponseHeader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -36,6 +36,15 @@
import java.util.Random;
import java.util.Set;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* A network client for asynchronous request/response network i/o. This is an internal class used to implement the
* user-facing producer and consumer clients.
Expand Down
Expand Up @@ -10,7 +10,16 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients;
package org.apache.flink.kafka_backport.clients;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* A callback interface for attaching an action to be executed when a request is complete and the corresponding response
Expand Down
Expand Up @@ -10,7 +10,16 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients.consumer;
package org.apache.flink.kafka_backport.clients.consumer;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

public enum CommitType {
SYNC, ASYNC
Expand Down
Expand Up @@ -10,18 +10,27 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients.consumer;
package org.apache.flink.kafka_backport.clients.consumer;

import org.apache.kafka.copied.common.Metric;
import org.apache.kafka.copied.common.MetricName;
import org.apache.kafka.copied.common.PartitionInfo;
import org.apache.kafka.copied.common.TopicPartition;
import org.apache.flink.kafka_backport.common.Metric;
import org.apache.flink.kafka_backport.common.MetricName;
import org.apache.flink.kafka_backport.common.PartitionInfo;
import org.apache.flink.kafka_backport.common.TopicPartition;

import java.io.Closeable;
import java.util.List;
import java.util.Map;
import java.util.Set;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* @see KafkaConsumer
* @see MockConsumer
Expand Down
Expand Up @@ -10,12 +10,21 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.copied.clients.consumer;
package org.apache.flink.kafka_backport.clients.consumer;

import org.apache.kafka.copied.common.TopicPartition;
import org.apache.flink.kafka_backport.common.TopicPartition;

import java.util.Map;

// ----------------------------------------------------------------------------
// This class is copied from the Apache Kafka project.
//
// The class is part of a "backport" of the new consumer API, in order to
// give Flink access to its functionality until the API is properly released.
//
// This is a temporary workaround!
// ----------------------------------------------------------------------------

/**
* A callback interface that the user can implement to trigger custom actions when a commit request completes. The callback
* may be executed in any thread calling {@link Consumer#poll(long) poll()}.
Expand Down

0 comments on commit 33f4c81

Please sign in to comment.