You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ne...@apache.org on 2014/09/12 05:59:24 UTC
svn commit: r1624447 - /kafka/site/081/api.html
Author: nehanarkhede
Date: Fri Sep 12 03:59:24 2014
New Revision: 1624447
URL: http://svn.apache.org/r1624447
Log:
KAFKA-1625 Sample Java code contains Scala syntax; reviewed by Neha; patched by David Chen
Modified:
kafka/site/081/api.html
Modified: kafka/site/081/api.html
URL: http://svn.apache.org/viewvc/kafka/site/081/api.html?rev=1624447&r1=1624446&r2=1624447&view=diff
==============================================================================
--- kafka/site/081/api.html (original)
+++ kafka/site/081/api.html Fri Sep 12 03:59:24 2014
@@ -4,8 +4,7 @@
* V: type of the message
* K: type of the optional key associated with the message
*/
-class kafka.javaapi.producer.Producer<K,V>
-{
+class kafka.javaapi.producer.Producer<K,V> {
public Producer(ProducerConfig config);
/**
@@ -28,7 +27,7 @@ class kafka.javaapi.producer.Producer<
}
</pre>
-You can follow
+You can follow
<a href="https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+Producer+Example" title="Kafka 0.8 producer example">this example</a> to learn how to use the producer api.
<h3><a id="highlevelconsumerapi">2.2 High Level Consumer API</a></h3>
@@ -40,7 +39,7 @@ class Consumer {
* @param config at the minimum, need to specify the groupid of the consumer and the zookeeper
* connection string zookeeper.connect.
*/
- public static kafka.javaapi.consumer.ConsumerConnector createJavaConsumerConnector(config: ConsumerConfig);
+ public static kafka.javaapi.consumer.ConsumerConnector createJavaConsumerConnector(ConsumerConfig config);
}
/**
@@ -57,9 +56,9 @@ public interface kafka.javaapi.consumer.
* The number of items in the list is #streams. Each stream supports
* an iterator over message/metadata pairs.
*/
- public <K,V> Map<String, List<KafkaStream<K,V>>>
+ public <K,V> Map<String, List<KafkaStream<K,V>>>
createMessageStreams(Map<String, Integer> topicCountMap, Decoder<K> keyDecoder, Decoder<V> valueDecoder);
-
+
/**
* Create a list of message streams of type T for each topic, using the default decoder.
*/
@@ -76,14 +75,14 @@ public interface kafka.javaapi.consumer.
* @return a list of KafkaStream. Each stream supports an
* iterator over its MessageAndMetadata elements.
*/
- public <K,V> List<KafkaStream<K,V>>
+ public <K,V> List<KafkaStream<K,V>>
createMessageStreamsByFilter(TopicFilter topicFilter, int numStreams, Decoder<K> keyDecoder, Decoder<V> valueDecoder);
-
+
/**
* Create a list of message streams for topics matching a wildcard, using the default decoder.
*/
public List<KafkaStream<byte[], byte[]>> createMessageStreamsByFilter(TopicFilter topicFilter, int numStreams);
-
+
/**
* Create a list of message streams for topics matching a wildcard, using the default decoder, with one stream.
*/
@@ -101,7 +100,7 @@ public interface kafka.javaapi.consumer.
}
</pre>
-You can follow
+You can follow
<a href="https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example" title="Kafka 0.8 consumer example">this example</a> to learn how to use the high level consumer api.
<h3><a id="simpleconsumerapi">2.3 Simple Consumer API</a></h3>
<pre>
@@ -112,15 +111,15 @@ class kafka.javaapi.consumer.SimpleConsu
* @param request specifies the topic name, topic partition, starting byte offset, maximum bytes to be fetched.
* @return a set of fetched messages
*/
- public FetchResponse fetch(request: kafka.javaapi.FetchRequest);
+ public FetchResponse fetch(kafka.javaapi.FetchRequest request);
/**
* Fetch metadata for a sequence of topics.
- *
+ *
* @param request specifies the versionId, clientId, sequence of topics.
* @return metadata for each topic in the request.
*/
- public kafka.javaapi.TopicMetadataResponse send(request: kafka.javaapi.TopicMetadataRequest);
+ public kafka.javaapi.TopicMetadataResponse send(kafka.javaapi.TopicMetadataRequest request);
/**
* Get a list of valid offsets (up to maxSize) before the given time.
@@ -128,7 +127,7 @@ class kafka.javaapi.consumer.SimpleConsu
* @param request a [[kafka.javaapi.OffsetRequest]] object.
* @return a [[kafka.javaapi.OffsetResponse]] object.
*/
- public kafka.javaapi.OffsetResponse getOffsetsBefore(request: OffsetRequest);
+ public kafak.javaapi.OffsetResponse getOffsetsBefore(OffsetRequest request);
/**
* Close the SimpleConsumer.
@@ -146,4 +145,4 @@ Providing a horizontally scalable soluti
<p>
Usage information on the hadoop consumer can be found <a href="https://github.com/linkedin/camus/tree/camus-kafka-0.8/">here</a>.
-</p>
\ No newline at end of file
+</p>