Skip to content

Commit

Permalink
fixed all error of javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
adyliu committed Mar 15, 2016
1 parent 270ec8e commit 6a787de
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 53 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/sohu/jafka/api/CreaterRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* Create Operation
* <p>
* This operation creates topic in a broker or enlarge the partition number of topic.
* </p>
*
* @author adyliu ([email protected])
* @since 1.2
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/sohu/jafka/api/MultiFetchResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ public class MultiFetchResponse implements Iterable<ByteBufferMessageSet> {
* create a multi-response
* <p>
* buffer format: <b> size+errorCode(short)+payload+size+errorCode(short)+payload+... </b>
* <br/>
* <p>
* size = 2(short)+length(payload)
* </p>
*
* @param buffer the whole data buffer
* @param numSets response count
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/sohu/jafka/api/OffsetRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
* Jafka will returns all offsets earlier than given time with max number
* limit. The fist offset of result is the biggest and the the last is the
* smallest.
* </p>
*
* @author adyliu ([email protected])
* @since 1.0
Expand Down Expand Up @@ -74,7 +73,6 @@ public class OffsetRequest implements Request {
* <li>time&gt;0: the log file offset which lastmodified time earlier
* than the time</li>
* </ul>
* </p>
*/
public long time;

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/sohu/jafka/api/ProducerRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
* message: bytes
* </pre>
*
* </p>
*
* @author adyliu ([email protected])
* @since 1.0
*/
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/sohu/jafka/cluster/Broker.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public Broker(int id, String creatorId, String host, int port,boolean autocreate
* the broker info saved in zookeeper
* <p>
* format: <b>creatorId:host:port</b>
* </p>
*
* @return broker info saved in zookeeper
*/
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/sohu/jafka/consumer/ConsumerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
* <li>groupid: the consumer group name</li>
* <li>zk.connect: the zookeeper connection string</li>
* </ul>
* </p>
*
* @author adyliu ([email protected])
* @since 1.0
Expand Down Expand Up @@ -79,7 +78,6 @@ public class ConsumerConfig extends ZKConfig {
* <li>groupid: the consumer group name</li>
* <li>zk.connect: the zookeeper connection string</li>
* </ul>
* </p>
*
* @param props config properties
*/
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/sohu/jafka/consumer/TopicCount.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public class TopicCount {

/**
* @param consumerIdString groupid-consumerid
* @param topicCountMap map: topic->threadCount
* @param topicCountMap map: topic-&gt;threadCount
*/
public TopicCount(String consumerIdString, Map<String, Integer> topicCountMap) {
this.consumerIdString = consumerIdString;
this.topicCountMap = topicCountMap;
}
/**
*
* @return topic->(consumerIdString-0,consumerIdString-1..)
* @return topic-&gt;(consumerIdString-0,consumerIdString-1..)
*/
public Map<String, Set<String>> getConsumerThreadIdsPerTopic() {
Map<String, Set<String>> consumerThreadIdsPerTopicMap = new HashMap<String, Set<String>>();
Expand Down Expand Up @@ -89,7 +89,7 @@ public boolean equals(Object obj) {
return true;
}
/**
* topic->count map
* topic-&gt;count map
* @return json map
*/
public String toJsonString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,72 +67,68 @@

/**
* This class handles the consumers interaction with zookeeper
* <p/>
*
* Directories:
* <p>
* <b>1. Consumer id registry:</b>
* <p/>
*
* <pre>
* /consumers/[group_id]/ids[consumer_id] -> topic1,...topicN
* /consumers/[group_id]/ids[consumer_id] -- topic1,...topicN
* </pre>
* <p/>
*
* A consumer has a unique consumer id within a consumer group. A consumer registers its id as
* an ephemeral znode and puts all topics that it subscribes to as the value of the znode. The
* znode is deleted when the client is gone. A consumer subscribes to event changes of the
* consumer id registry within its group.
* </p>
* <p>
* The consumer id is picked up from configuration, instead of the sequential id assigned by
* ZK. Generated sequential ids are hard to recover during temporary connection loss to ZK,
* since it's difficult for the client to figure out whether the creation of a sequential znode
* has succeeded or not. More details can be found at
* (http://wiki.apache.org/hadoop/ZooKeeper/ErrorHandling)
* </p>
* <p>
* <b>2. Broker node registry:</b>
* <p/>
* <pre>
* /brokers/[0...N] --> { "host" : "host:port",
* /brokers/[0...N] -- { "host" : "host:port",
* "topics" : {"topic1": ["partition1" ... "partitionN"], ...,
* "topicN": ["partition1" ... "partitionN"] } }
* </pre>
* <p/>
* This is a list of all present broker brokers. A unique logical node id is configured on each
* broker node. A broker node registers itself on start-up and creates a znode with the logical
* node id under /brokers.
* <p/>
*
* The value of the znode is a JSON String that contains
* <p/>
*
* <pre>
* (1) the host name and the port the broker is listening to,
* (2) a list of topics that the broker serves,
* (3) a list of logical partitions assigned to each topic on the broker.
* </pre>
* <p/>
*
* A consumer subscribes to event changes of the broker node registry.
* </p>
* <p/>
*
*
* <p>
* <b>3. Partition owner registry:</b>
* <p/>
*
* <pre>
* /consumers/[group_id]/owner/[topic]/[broker_id-partition_id] --> consumer_node_id
* /consumers/[group_id]/owner/[topic]/[broker_id-partition_id] -- consumer_node_id
* </pre>
* <p/>
*
* This stores the mapping before broker partitions and consumers. Each partition is owned by a
* unique consumer within a consumer group. The mapping is reestablished after each
* rebalancing.
* </p>
* <p/>
*
*
* <p>
* <b>4. Consumer offset tracking:</b>
* <p/>
*
* <pre>
* /consumers/[group_id]/offsets/[topic]/[broker_id-partition_id] --> offset_counter_value
* /consumers/[group_id]/offsets/[topic]/[broker_id-partition_id] -- offset_counter_value
* </pre>
* <p/>
*
* Each consumer tracks the offset of the latest message consumed for each partition.
* </p>
*
*
* @author adyliu ([email protected])
* @since 1.0
Expand Down Expand Up @@ -816,9 +812,8 @@ public void handleStateChanged(KeeperState state) throws Exception {
/**
* register consumer data in zookeeper
* <p>
* register path: /consumers/groupid/ids/groupid-consumerid <br/>
* register path: /consumers/groupid/ids/groupid-consumerid <br>
* data: {topic:count,topic:count}
* </p>
*
* @param zkGroupDirs zookeeper group path
* @param consumerIdString groupid-consumerid
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/sohu/jafka/log/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ public int getNumberOfSegments() {
return segments.getView().size();
}
/**
* delete all log segments in this topic-partition <br/>
* delete all log segments in this topic-partition
* <p>
* The log directory will be removed also.
* @return segment counts deleted
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/sohu/jafka/message/FileMessageSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected MessageAndOffset makeNext() {
}

/**
* the max offset(next message id).<br/>
* the max offset(next message id).<br>
* The <code> #getSizeInBytes()</code> maybe is larger than {@link #highWaterMark()}
* while some messages were cached in memory(not flush to disk).
*/
Expand Down Expand Up @@ -279,7 +279,7 @@ void checkMutable() {
}

/**
* The max offset(next message id) persisted in the log file.<br/>
* The max offset(next message id) persisted in the log file.<br>
* Messages with smaller offsets have persisted in file.
*
* @return max offset
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/sohu/jafka/message/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
* 3. 4 byte CRC32 of the payload
* 4. N - 6 byte payload
* </pre>
*
* </p>
*
*
* @author adyliu ([email protected])
* @since 1.0
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/sohu/jafka/mx/LogStatsMBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* For the last writeable file:
* <ul>
* <li>size</li>
* </p>
* </ul>
*
* @author adyliu ([email protected])
* @since 1.0
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/sohu/jafka/producer/ProducerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public int getZkReadRetries() {
* a VIP. If the zk.connect option is used instead, this will not have any effect because
* with the zk-based producer, brokers are not re-selected upon retry. So retries would go
* to the same (potentially still down) broker. (KAFKA-253 will help address this.)
* <br/><br/>
* <br>
* see https://github.com/apache/kafka/commit/d6b1de35f6b9cd5370c7812790fea8e61618f461
*/
public int getNumRetries() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* producer
*
* @author adyliu ([email protected])
* @see {@link AbstractCallbackHandler}
* @see AbstractCallbackHandler
* @since 1.0
*/
public interface CallbackHandler<T> {
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/com/sohu/jafka/server/ServerRegister.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
/**
* Handles the server's interaction with zookeeper. The server needs to register the following
* paths:
* <p/>
* <p>
* <pre>
* /topics/[topic]/[node_id-partition_num]
* /brokers/[0...N] --> host:port
* /brokers/[0...N] -- host:port
* </pre>
*
* @author adyliu ([email protected])
Expand Down Expand Up @@ -113,9 +113,8 @@ private int getPartitions(String topic) {
/**
* register broker in the zookeeper
* <p>
* path: /brokers/ids/<id> <br/>
* path: /brokers/ids/&lt;id&gt; <br>
* data: creator:host:port
* </p>
*/
public void registerBrokerInZk() {
logger.info("Registering broker " + brokerIdPath);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/sohu/jafka/utils/Mx4jLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
* <p>
* see https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/utils/
* Mx4jTool.java
* </p>
*
* @author adyliu ([email protected])
* @since 1.0
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/sohu/jafka/utils/zookeeper/ZkUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static TopicCount getTopicCount(ZkClient zkClient, String group, String c
*
* @param zkClient the zookeeper client
* @param topics topic names
* @return topic->(brokerid-0,brokerid-1...brokerid2-0,brokerid2-1...)
* @return topic-&gt;(brokerid-0,brokerid-1...brokerid2-0,brokerid2-1...)
*/
public static Map<String, List<String>> getPartitionsForTopics(ZkClient zkClient, Collection<String> topics) {
Map<String, List<String>> ret = new HashMap<String, List<String>>();
Expand All @@ -146,7 +146,7 @@ public static Map<String, List<String>> getPartitionsForTopics(ZkClient zkClient
*
* @param zkClient the zookeeper client
* @param group the group name
* @return topic->(consumerIdStringA-0,consumerIdStringA-1...consumerIdStringB-0,consumerIdStringB-1)
* @return topic-&gt;(consumerIdStringA-0,consumerIdStringA-1...consumerIdStringB-0,consumerIdStringB-1)
*/
public static Map<String, List<String>> getConsumersPerTopic(ZkClient zkClient, String group) {
ZkGroupDirs dirs = new ZkGroupDirs(group);
Expand Down

0 comments on commit 6a787de

Please sign in to comment.