pkuwm commented on a change in pull request #1332:
URL: https://github.com/apache/helix/pull/1332#discussion_r480384049



##########
File path: 
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/annotation/PreFetchChangedData.java
##########
@@ -22,8 +22,25 @@
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 
-
+/**
+ * An annotation used to prefetch changed data for
+ * {@link org.apache.helix.zookeeper.zkclient.IZkDataListener} in ZkClient.
+ * By default, prefetch is enabled: when ZkClient handles a data change event,
+ * ZkClient will read data and pass data object to
+ * {@link 
org.apache.helix.zookeeper.zkclient.IZkDataListener#handleDataChange(String, 
Object)}.
+ * If disabled({@code false}): ZkClient will not read data, so data object is 
passed as null.
+ * <p>
+ * Example:
+ * <pre>
+ * {@code @PreFetch(enabled = false)}
+ *  public class MyCallback implements IZkDataListener
+ * </pre>
+ *
+ * {@code @PreFetch(enabled = false)} means data will not be prefetched in 
ZkClient before
+ * handling data change: data is null in
+ * {@link 
org.apache.helix.zookeeper.zkclient.IZkDataListener#handleDataChange(String, 
Object)}
+ */
 @Retention(RetentionPolicy.RUNTIME)

Review comment:
       @kaisun2000  It tells the Java compiler and JVM that the annotation 
should be available via reflection at runtime/class/source code. More details 
you could check jdk javadoc.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to