kpm1985 closed pull request #1009: This is a documentation patch for 
OracleServer.
URL: https://github.com/apache/fluo/pull/1009
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java 
b/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java
index 0c7ddf07..3c95092d 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java
@@ -60,12 +60,12 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * Oracle server is the responsible for providing incrementing logical 
timestamps to clients. It
- * should never give the same timestamp to two clients and it should always 
provide an incrementing
- * timestamp.
+ * OracleServer is responsible for providing strictly increasing monotonic 
batches of timestamps. It
+ * should never give the same timestamp to two different clients and it should 
always provide an 
+ * incrementing unique timestamp or batch of timestamps.
  * 
  * <p>
- * If multiple oracle servers are run, they will choose a leader and clients 
will automatically
+ * If multiple Oracle Servers are run, they will choose a leader and clients 
will automatically
  * connect to that leader. If the leader goes down, the client will 
automatically fail over to the
  * next leader. In the case where an oracle fails over, the next oracle will 
begin a new block of
  * timestamps.
@@ -307,6 +307,10 @@ public void run() {
     return addr;
   }
 
+  /** 
+   * Use this method to start a new OracleServer
+   * @throws Exception
+   */
   public synchronized void start() throws Exception {
     if (started) {
       throw new IllegalStateException();
@@ -340,7 +344,11 @@ public synchronized void start() throws Exception {
 
     started = true;
   }
-
+  
+  /**
+   * Use this method to shut down the OracleServer 
+   * @throws Exception
+   */
   public synchronized void stop() throws Exception {
     if (started) {
 
@@ -388,6 +396,11 @@ public synchronized void stop() throws Exception {
    * @param curatorFramework Curator framework
    */
   @Override
+  
+  /**
+   * This method is called when this instance is chosen to become the leader 
by the 
+   * curator framework and zookeeper.
+   */
   public void takeLeadership(CuratorFramework curatorFramework) throws 
Exception {
 
     try {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to