You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@distributedlog.apache.org by si...@apache.org on 2017/01/08 22:01:34 UTC

incubator-distributedlog git commit: DL-83: Add javadoc to website

Repository: incubator-distributedlog
Updated Branches:
  refs/heads/master 1bb44e776 -> 042032a3a


DL-83: Add javadoc to website

- update the javadoc plugin to aggregate api by 'core library' and 'proxy service'. (turn some java class to package private and delete unused files. so they won't appear in java doc)
- improve the website build script to include javadoc
- update some readme files to include user mail list and slack channel

Author: Sijie Guo <si...@twitter.com>
Author: Sijie Guo <si...@apache.org>

Reviewers: Leigh Stewart <ls...@apache.org>

Closes #96 from sijie/sijie/merge_website_script


Project: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/commit/042032a3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/tree/042032a3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/diff/042032a3

Branch: refs/heads/master
Commit: 042032a3a79ed922bcb1c61c79b11cceacef8632
Parents: 1bb44e7
Author: Sijie Guo <si...@twitter.com>
Authored: Sun Jan 8 14:01:35 2017 -0800
Committer: Sijie Guo <si...@apache.org>
Committed: Sun Jan 8 14:01:35 2017 -0800

----------------------------------------------------------------------
 README.md                                       |   6 +-
 .../subscription/package-info.java              |  21 +++
 .../apache/distributedlog/BKAsyncLogWriter.java |   2 +-
 .../org/apache/distributedlog/BKLogHandler.java |   2 +-
 .../distributedlog/DistributedLogConstants.java |   3 +
 .../org/apache/distributedlog/EntryBuffer.java  |   2 +-
 .../apache/distributedlog/EnvelopedEntry.java   |   2 +-
 .../distributedlog/LedgerReadPosition.java      | 171 -------------------
 .../org/apache/distributedlog/LogReader.java    |   8 +-
 .../distributedlog/ReadAheadEntryReader.java    |   2 +-
 .../org/apache/distributedlog/WriteLimiter.java |   2 +-
 .../org/apache/distributedlog/RecordStream.java |   2 +-
 .../service/stream/HeartbeatOp.java             |   5 +-
 docs/_config-local.yml                          |   2 +-
 docs/_includes/header.html                      |   7 +
 docs/user_guide/api/main.rst                    |   4 +
 pom.xml                                         |  13 +-
 scripts/dev/build-website.sh                    |  97 +++++++++++
 website/Gemfile                                 |   2 +-
 website/Gemfile.lock                            |   2 +-
 website/_config-local.yml                       |   2 +-
 website/_config-production.yml                  |   2 +-
 website/_config.yml                             |   4 +
 website/_includes/header.html                   |   8 +-
 website/build.sh                                |  79 ++++++++-
 website/community/community.md                  |   8 +
 website/faq.md                                  |   2 +-
 website/index.md                                |  16 +-
 28 files changed, 265 insertions(+), 211 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 3c68ba9..6f8f7df 100644
--- a/README.md
+++ b/README.md
@@ -85,7 +85,11 @@ For filing bugs, suggesting improvements, or requesting new features, help us ou
 
 ### Need Help?
 
-[Subscribe](mailto:dev-subscribe@distributedlog.incubator.apache.org) or [mail](mailto:dev@distributedlog.incubator.apache.org) the [dev@distributedlog.incubator.apache.org](mailto:dev@distributedlog.incubator.apache.org) list - Ask questions, find answers, join developement discussions and also help other users.
+[Subscribe](mailto:user-subscribe@distributedlog.incubator.apache.org) or [mail](mailto:user@distributedlog.incubator.apache.org) the [user@distributedlog.incubator.apache.org](mailto:user@distributedlog.incubator.apache.org) list - Ask questions, find answers, and also help other users.
+
+[Subscribe](mailto:dev-subscribe@distributedlog.incubator.apache.org) or [mail](mailto:dev@distributedlog.incubator.apache.org) the [dev@distributedlog.incubator.apache.org](mailto:dev@distributedlog.incubator.apache.org) list - Join developement discussions, propose new ideas and connect with contributors.
+
+[Join us on Slack](https://getdl-slack.herokuapp.com/) - This is the most immediate way to connect with DistributedLog committers and contributors.
 
 ## Contributing
 

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-core/src/main/java/com/twitter/distributedlog/subscription/package-info.java
----------------------------------------------------------------------
diff --git a/distributedlog-core/src/main/java/com/twitter/distributedlog/subscription/package-info.java b/distributedlog-core/src/main/java/com/twitter/distributedlog/subscription/package-info.java
new file mode 100644
index 0000000..7135755
--- /dev/null
+++ b/distributedlog-core/src/main/java/com/twitter/distributedlog/subscription/package-info.java
@@ -0,0 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on 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.
+ */
+/**
+ * Subscription utils for tracking offsets.
+ */
+package com.twitter.distributedlog.subscription;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-core/src/main/java/org/apache/distributedlog/BKAsyncLogWriter.java
----------------------------------------------------------------------
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/BKAsyncLogWriter.java b/distributedlog-core/src/main/java/org/apache/distributedlog/BKAsyncLogWriter.java
index 1102ff5..a1b1d5c 100644
--- a/distributedlog-core/src/main/java/org/apache/distributedlog/BKAsyncLogWriter.java
+++ b/distributedlog-core/src/main/java/org/apache/distributedlog/BKAsyncLogWriter.java
@@ -66,7 +66,7 @@ import java.util.List;
  * </ul>
  * See {@link BKLogSegmentWriter} for segment writer stats.
  */
-public class BKAsyncLogWriter extends BKAbstractLogWriter implements AsyncLogWriter {
+class BKAsyncLogWriter extends BKAbstractLogWriter implements AsyncLogWriter {
 
     static final Logger LOG = LoggerFactory.getLogger(BKAsyncLogWriter.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-core/src/main/java/org/apache/distributedlog/BKLogHandler.java
----------------------------------------------------------------------
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/BKLogHandler.java b/distributedlog-core/src/main/java/org/apache/distributedlog/BKLogHandler.java
index 07ae0ff..3919e92 100644
--- a/distributedlog-core/src/main/java/org/apache/distributedlog/BKLogHandler.java
+++ b/distributedlog-core/src/main/java/org/apache/distributedlog/BKLogHandler.java
@@ -82,7 +82,7 @@ import java.util.concurrent.atomic.AtomicReference;
  * @see BKLogWriteHandler
  * @see BKLogReadHandler
  */
-public abstract class BKLogHandler implements AsyncCloseable, AsyncAbortable {
+abstract class BKLogHandler implements AsyncCloseable, AsyncAbortable {
     static final Logger LOG = LoggerFactory.getLogger(BKLogHandler.class);
 
     protected final LogMetadata logMetadata;

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-core/src/main/java/org/apache/distributedlog/DistributedLogConstants.java
----------------------------------------------------------------------
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/DistributedLogConstants.java b/distributedlog-core/src/main/java/org/apache/distributedlog/DistributedLogConstants.java
index f951991..4688f40 100644
--- a/distributedlog-core/src/main/java/org/apache/distributedlog/DistributedLogConstants.java
+++ b/distributedlog-core/src/main/java/org/apache/distributedlog/DistributedLogConstants.java
@@ -26,6 +26,9 @@ import org.apache.zookeeper.data.ACL;
 
 import static com.google.common.base.Charsets.UTF_8;
 
+/**
+ * Constants used in DistributedLog.
+ */
 public class DistributedLogConstants {
     public static final byte[] EMPTY_BYTES = new byte[0];
     public static final String SCHEME_PREFIX = "distributedlog";

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-core/src/main/java/org/apache/distributedlog/EntryBuffer.java
----------------------------------------------------------------------
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/EntryBuffer.java b/distributedlog-core/src/main/java/org/apache/distributedlog/EntryBuffer.java
index c695420..c08fbeb 100644
--- a/distributedlog-core/src/main/java/org/apache/distributedlog/EntryBuffer.java
+++ b/distributedlog-core/src/main/java/org/apache/distributedlog/EntryBuffer.java
@@ -27,7 +27,7 @@ import java.io.IOException;
  * Write representation of a {@link Entry}.
  * It is a buffer of log record set, used for transmission.
  */
-public interface EntryBuffer extends TransmitListener {
+interface EntryBuffer extends TransmitListener {
 
     /**
      * Return if this record set contains user records.

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-core/src/main/java/org/apache/distributedlog/EnvelopedEntry.java
----------------------------------------------------------------------
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/EnvelopedEntry.java b/distributedlog-core/src/main/java/org/apache/distributedlog/EnvelopedEntry.java
index eb1e9af..aed47fc 100644
--- a/distributedlog-core/src/main/java/org/apache/distributedlog/EnvelopedEntry.java
+++ b/distributedlog-core/src/main/java/org/apache/distributedlog/EnvelopedEntry.java
@@ -67,7 +67,7 @@ import org.apache.distributedlog.util.BitMaskUtils;
  *      10      : Unused
  *      11      : Unused
  */
-public class EnvelopedEntry {
+class EnvelopedEntry {
 
     public static final int VERSION_LENGTH = 1; // One byte long
     public static final byte VERSION_ONE = 1;

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-core/src/main/java/org/apache/distributedlog/LedgerReadPosition.java
----------------------------------------------------------------------
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/LedgerReadPosition.java b/distributedlog-core/src/main/java/org/apache/distributedlog/LedgerReadPosition.java
deleted file mode 100644
index f94495f..0000000
--- a/distributedlog-core/src/main/java/org/apache/distributedlog/LedgerReadPosition.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on 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.distributedlog;
-
-import java.io.Serializable;
-import java.util.Comparator;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class LedgerReadPosition {
-    static final Logger LOG = LoggerFactory.getLogger(LedgerReadPosition.class);
-
-    private static enum PartialOrderingComparisonResult {
-        NotComparable,
-        GreaterThan,
-        LessThan,
-        EqualTo
-    }
-
-    long ledgerId = DistributedLogConstants.UNRESOLVED_LEDGER_ID;
-    long logSegmentSequenceNo;
-    long entryId;
-
-    public LedgerReadPosition(long ledgerId, long logSegmentSequenceNo, long entryId) {
-        this.ledgerId = ledgerId;
-        this.logSegmentSequenceNo = logSegmentSequenceNo;
-        this.entryId = entryId;
-    }
-
-    public LedgerReadPosition(LedgerReadPosition that) {
-        this.ledgerId = that.ledgerId;
-        this.logSegmentSequenceNo = that.logSegmentSequenceNo;
-        this.entryId = that.entryId;
-    }
-
-
-    public LedgerReadPosition(final DLSN dlsn) {
-        this(dlsn.getLogSegmentSequenceNo(), dlsn.getEntryId());
-    }
-
-    public LedgerReadPosition(long logSegmentSequenceNo, long entryId) {
-        this.logSegmentSequenceNo = logSegmentSequenceNo;
-        this.entryId = entryId;
-    }
-
-    public long getLedgerId() {
-        if (DistributedLogConstants.UNRESOLVED_LEDGER_ID == ledgerId) {
-            LOG.trace("Ledger Id is not initialized");
-            throw new IllegalStateException("Ledger Id is not initialized");
-        }
-        return ledgerId;
-    }
-
-    public long getLogSegmentSequenceNumber() {
-        return logSegmentSequenceNo;
-    }
-
-    public long getEntryId() {
-        return entryId;
-    }
-
-    public void advance() {
-        entryId++;
-    }
-
-    public void positionOnNewLogSegment(long ledgerId, long logSegmentSequenceNo) {
-        this.ledgerId = ledgerId;
-        this.logSegmentSequenceNo = logSegmentSequenceNo;
-        this.entryId = 0L;
-    }
-
-    @Override
-    public String toString() {
-        return String.format("(lid=%d, lseqNo=%d, eid=%d)", ledgerId, logSegmentSequenceNo, entryId);
-    }
-
-    public boolean definitelyLessThanOrEqualTo(LedgerReadPosition threshold) {
-        PartialOrderingComparisonResult result = comparePartiallyOrdered(threshold);
-        return ((result == PartialOrderingComparisonResult.LessThan) ||
-            (result == PartialOrderingComparisonResult.EqualTo));
-    }
-
-    public boolean definitelyLessThan(LedgerReadPosition threshold) {
-        PartialOrderingComparisonResult result = comparePartiallyOrdered(threshold);
-        return result == PartialOrderingComparisonResult.LessThan;
-    }
-
-    private PartialOrderingComparisonResult comparePartiallyOrdered(LedgerReadPosition threshold) {
-        // If no threshold is passed we cannot make a definitive comparison
-        if (null == threshold) {
-            return PartialOrderingComparisonResult.NotComparable;
-        }
-
-        if (this.logSegmentSequenceNo != threshold.logSegmentSequenceNo) {
-            if (this.logSegmentSequenceNo < threshold.logSegmentSequenceNo) {
-                return PartialOrderingComparisonResult.LessThan;
-            } else {
-                return PartialOrderingComparisonResult.GreaterThan;
-            }
-        } else if (this.ledgerId != threshold.ledgerId) {
-            // When logSegmentSequenceNo is equal we cannot definitely say that this
-            // position is less than the threshold unless ledgerIds are equal
-            // since LogSegmentSequenceNumber maybe inferred from transactionIds in older
-            // versions of the metadata.
-            return PartialOrderingComparisonResult.NotComparable;
-        } else if (this.getEntryId() < threshold.getEntryId()) {
-            return PartialOrderingComparisonResult.LessThan;
-        } else if (this.getEntryId() > threshold.getEntryId()) {
-            return PartialOrderingComparisonResult.GreaterThan;
-        } else {
-            return PartialOrderingComparisonResult.EqualTo;
-        }
-    }
-
-    /**
-     * Comparator for the key portion
-     */
-    public static final ReadAheadCacheKeyComparator COMPARATOR = new ReadAheadCacheKeyComparator();
-
-    // Only compares the key portion
-    @Override
-    public boolean equals(Object other) {
-        if (!(other instanceof LedgerReadPosition)) {
-            return false;
-        }
-        LedgerReadPosition key = (LedgerReadPosition) other;
-        return ledgerId == key.ledgerId &&
-            entryId == key.entryId;
-    }
-
-    @Override
-    public int hashCode() {
-        return (int) (ledgerId * 13 ^ entryId * 17);
-    }
-
-    /**
-     * Compare EntryKey.
-     */
-    protected static class ReadAheadCacheKeyComparator implements Comparator<LedgerReadPosition>, Serializable {
-
-        private static final long serialVersionUID = 0L;
-
-        @Override
-        public int compare(LedgerReadPosition left, LedgerReadPosition right) {
-            long ret = left.ledgerId - right.ledgerId;
-            if (ret == 0) {
-                ret = left.entryId - right.entryId;
-            }
-            return (ret < 0) ? -1 : ((ret > 0) ? 1 : 0);
-        }
-    }
-
-}
-
-

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-core/src/main/java/org/apache/distributedlog/LogReader.java
----------------------------------------------------------------------
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/LogReader.java b/distributedlog-core/src/main/java/org/apache/distributedlog/LogReader.java
index 75a32ef..baf3182 100644
--- a/distributedlog-core/src/main/java/org/apache/distributedlog/LogReader.java
+++ b/distributedlog-core/src/main/java/org/apache/distributedlog/LogReader.java
@@ -154,11 +154,11 @@ import java.util.List;
  *
  * </pre>
  *
- * @see AsyncLogReader
+ * <p>
+ * NOTE: Extending {@link AsyncCloseable}: BKSyncLogReader is implemented based on BKAsyncLogReader, exposing
+ * the {@link AsyncCloseable} interface so the reader could be closed asynchronously
  *
- * NOTE:
- * 1. Extending {@link AsyncCloseable}: BKSyncLogReader is implemented based on BKAsyncLogReader, exposing
- *    the {@link AsyncCloseable} interface so the reader could be closed asynchronously
+ * @see AsyncLogReader
  */
 public interface LogReader extends Closeable, AsyncCloseable {
 

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-core/src/main/java/org/apache/distributedlog/ReadAheadEntryReader.java
----------------------------------------------------------------------
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/ReadAheadEntryReader.java b/distributedlog-core/src/main/java/org/apache/distributedlog/ReadAheadEntryReader.java
index 0b8c55a..f94a6e0 100644
--- a/distributedlog-core/src/main/java/org/apache/distributedlog/ReadAheadEntryReader.java
+++ b/distributedlog-core/src/main/java/org/apache/distributedlog/ReadAheadEntryReader.java
@@ -63,7 +63,7 @@ import java.util.concurrent.atomic.AtomicReference;
  * NOTE: all the state changes happen in the same thread. All *unsafe* methods should be submitted to the order
  * scheduler using stream name as the key.
  */
-public class ReadAheadEntryReader implements
+class ReadAheadEntryReader implements
         AsyncCloseable,
         LogSegmentListener,
         LogSegmentEntryReader.StateChangeListener,

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-core/src/main/java/org/apache/distributedlog/WriteLimiter.java
----------------------------------------------------------------------
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/WriteLimiter.java b/distributedlog-core/src/main/java/org/apache/distributedlog/WriteLimiter.java
index d25d056..a2109f4 100644
--- a/distributedlog-core/src/main/java/org/apache/distributedlog/WriteLimiter.java
+++ b/distributedlog-core/src/main/java/org/apache/distributedlog/WriteLimiter.java
@@ -20,7 +20,7 @@ package org.apache.distributedlog;
 import org.apache.distributedlog.exceptions.OverCapacityException;
 import org.apache.distributedlog.util.PermitLimiter;
 
-public class WriteLimiter {
+class WriteLimiter {
 
     String streamName;
     final PermitLimiter streamLimiter;

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-protocol/src/main/java/org/apache/distributedlog/RecordStream.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/org/apache/distributedlog/RecordStream.java b/distributedlog-protocol/src/main/java/org/apache/distributedlog/RecordStream.java
index a2614c0..253f1f2 100644
--- a/distributedlog-protocol/src/main/java/org/apache/distributedlog/RecordStream.java
+++ b/distributedlog-protocol/src/main/java/org/apache/distributedlog/RecordStream.java
@@ -20,7 +20,7 @@ package org.apache.distributedlog;
 /**
  * A iterator to iterate records in the stream.
  */
-public interface RecordStream {
+interface RecordStream {
     /**
      * advance <i>numRecords</i> records.
      */

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/distributedlog-service/src/main/java/org/apache/distributedlog/service/stream/HeartbeatOp.java
----------------------------------------------------------------------
diff --git a/distributedlog-service/src/main/java/org/apache/distributedlog/service/stream/HeartbeatOp.java b/distributedlog-service/src/main/java/org/apache/distributedlog/service/stream/HeartbeatOp.java
index 5cda0ca..0ffa619 100644
--- a/distributedlog-service/src/main/java/org/apache/distributedlog/service/stream/HeartbeatOp.java
+++ b/distributedlog-service/src/main/java/org/apache/distributedlog/service/stream/HeartbeatOp.java
@@ -20,7 +20,6 @@ package org.apache.distributedlog.service.stream;
 import static com.google.common.base.Charsets.UTF_8;
 
 import org.apache.distributedlog.AsyncLogWriter;
-import org.apache.distributedlog.BKAsyncLogWriter;
 import org.apache.distributedlog.DLSN;
 import org.apache.distributedlog.LogRecord;
 import org.apache.distributedlog.acl.AccessControlManager;
@@ -77,7 +76,9 @@ public class HeartbeatOp extends AbstractWriteOp {
             Future<DLSN> writeResult;
             synchronized (txnLock) {
                 txnId = sequencer.nextId();
-                writeResult = ((BKAsyncLogWriter) writer).writeControlRecord(new LogRecord(txnId, HEARTBEAT_DATA));
+                LogRecord hbRecord = new LogRecord(txnId, HEARTBEAT_DATA);
+                hbRecord.setControl();
+                writeResult = writer.write(hbRecord);
             }
             return writeResult.map(new AbstractFunction1<DLSN, WriteResponse>() {
                 @Override

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/docs/_config-local.yml
----------------------------------------------------------------------
diff --git a/docs/_config-local.yml b/docs/_config-local.yml
index 5832f1d..d5c50d4 100644
--- a/docs/_config-local.yml
+++ b/docs/_config-local.yml
@@ -1 +1 @@
-baseurl: "https://sijie.github.io/incubator-distributedlog/docs/latest"
+baseurl: "/docs/latest"

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/docs/_includes/header.html
----------------------------------------------------------------------
diff --git a/docs/_includes/header.html b/docs/_includes/header.html
index 2d547c5..14dc063 100644
--- a/docs/_includes/header.html
+++ b/docs/_includes/header.html
@@ -52,6 +52,13 @@
             {% endfor %}
           </ul>
         </li>
+        <!-- API -->
+        <li>
+          <a href="{{ start }}" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">API<span class="caret"></span></a>
+          <ul class="dropdown-menu" role="menu">
+            <li><a href="{{ site.baseurl }}/api/java">Java</a></li>
+          </ul>
+        </li>
         <!-- User Guide -->
         <li class="dropdown">
 		      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">User Guide<span class="caret"></span></a>

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/docs/user_guide/api/main.rst
----------------------------------------------------------------------
diff --git a/docs/user_guide/api/main.rst b/docs/user_guide/api/main.rst
index ac4a5b3..d344d4f 100644
--- a/docs/user_guide/api/main.rst
+++ b/docs/user_guide/api/main.rst
@@ -31,3 +31,7 @@ This page covers the API usage of `DistributedLog`.
 - `Best Practise`_
 
 .. _Best Practise: ./practice
+
+See the `Java API Reference`_ for more information on individual APIs.
+
+.. _Java API Reference: ../../api/java

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 977026b..ecb3c12 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,12 +109,21 @@
         <artifactId>maven-javadoc-plugin</artifactId>
         <version>2.8</version>
         <configuration>
+          <!-- Avoid for missing javadoc comments to be marked as errors -->
+          <additionalparam>-Xdoclint:none</additionalparam>
           <groups>
             <group>
-              <title>DistributedLog</title>
-              <packages>org.apache.distributedlog.*</packages>
+              <title>Core Library</title>
+              <packages>com.twitter.distributedlog:com.twitter.distributedlog.annotations:com.twitter.distributedlog.callback:com.twitter.distributedlog.exceptions:com.twitter.distributedlog.feature:com.twitter.distributedlog.io:com.twitter.distributedlog.lock:com.twitter.distributedlog.logsegment:com.twitter.distributedlog.metadata:com.twitter.distributedlog.namespace:com.twitter.distributedlog.net:com.twitter.distributedlog.stats:com.twitter.distributedlog.subscription</packages>
+            </group>
+            <group>
+              <title>Proxy Client</title>
+              <packages>com.twitter.distributedlog.client*:com.twitter.distributedlog.service*</packages>
             </group>
           </groups>
+          <excludePackageNames>
+            com.twitter.distributedlog.acl:com.twitter.distributedlog.admin:com.twitter.distributedlog.auditor:com.twitter.distributedlog.basic:com.twitter.distributedlog.benchmark*:com.twitter.distributedlog.bk:com.twitter.distributedlog.ownership:com.twitter.distributedlog.proxy:com.twitter.distributedlog.resolver:com.twitter.distributedlog.service.*:com.twitter.distributedlog.config:com.twitter.distributedlog.function:com.twitter.distributedlog.impl*:com.twitter.distributedlog.injector:com.twitter.distributedlog.kafka:com.twitter.distributedlog.limiter:com.twitter.distributedlog.mapreduce:com.twitter.distributedlog.messaging:com.twitter.distributedlog.rate:com.twitter.distributedlog.readahead:com.twitter.distributedlog.selector:com.twitter.distributedlog.stats:com.twitter.distributedlog.thrift*:com.twitter.distributedlog.tools:com.twitter.distributedlog.util:com.twitter.distributedlog.zk:org.apache.bookkeeper.client:org.apache.bookkeeper.stats 
+          </excludePackageNames>
         </configuration>
         <executions>
           <execution>

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/scripts/dev/build-website.sh
----------------------------------------------------------------------
diff --git a/scripts/dev/build-website.sh b/scripts/dev/build-website.sh
new file mode 100755
index 0000000..4fef9a6
--- /dev/null
+++ b/scripts/dev/build-website.sh
@@ -0,0 +1,97 @@
+#!/usr/bin/env bash
+#
+#/**
+# * Copyright 2007 The Apache Software Foundation
+# *
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on 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.
+# */
+
+DLOG_ENV=$1
+
+set -e
+
+PROJECT_NAME="incubator-distributedlog"
+CAPITALIZED_PROJECT_NAME="DL"
+
+BASEDIR=$(dirname "$0")
+DLOG_ROOT="${BASEDIR}/../.."
+DLOG_ROOT=`cd $DLOG_ROOT > /dev/null;pwd`
+# Location of the local git repository
+REPO_HOME=${DL_HOME:-"$DLOG_ROOT"}
+SITE_REMOTE="https://git-wip-us.apache.org/repos/asf/${PROJECT_NAME}.git"
+BUILT_DIR=${DLOG_ROOT}/build/website
+
+# remove the built content first
+rm -rf ${BUILT_DIR}
+
+# BRANCHES
+SRC_REMOTE_NAME="apache"
+SRC_BRANCH="master"
+SITE_REMOTE_NAME="apache"
+SITE_BRANCH="asf-site"
+
+# Temp Branch to merge
+TEMP_SITE_BRANCH="SITE_MERGE_BRANCH_${RANDOM}"
+
+# Origin Branch
+ORIGIN_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+
+# fetch apache/master
+git fetch ${SRC_REMOTE_NAME}
+git fetch ${SITE_REMOTE_NAME}
+
+# checkout apache/master
+git checkout ${SRC_REMOTE_NAME}/${SRC_BRANCH}
+
+SRC_GITSHA=`git rev-parse HEAD`
+
+# build the websiste
+echo "Building the website to ${BUILT_DIR} ..."
+
+echo ${DLOG_ROOT}/website/build.sh ${DLOG_ENV} ${BUILT_DIR}
+${DLOG_ROOT}/website/build.sh ${DLOG_ENV} ${BUILT_DIR}
+
+echo "Built the website into ${BUILT_DIR}."
+
+# checkout asf-site
+git checkout ${SITE_REMOTE_NAME}/${SITE_BRANCH}
+
+# checkout the temp branch
+git checkout -b ${TEMP_SITE_BRANCH}
+
+# cp the built content
+cp -r ${BUILT_DIR}/content/* ${DLOG_ROOT}/content/
+
+# add the content
+git add ${DLOG_ROOT}/content
+
+# commit the add
+git commit -m "Built website from gitsha '${SRC_GITSHA}'."
+
+# push the branch
+git push ${SITE_REMOTE_NAME} ${TEMP_SITE_BRANCH}:${SITE_BRANCH}
+
+echo "Push the new website to ${SITE_REMOTE_NAME}/${SITE_BRANCH}."
+
+# clean up
+echo "Restoring head pointer to ${ORIGIN_BRANCH}."
+
+git checkout ${ORIGIN_BRANCH}
+
+echo "Deleting site merge branch ${TEMP_SITE_BRANCH}..."
+
+git branch -D ${TEMP_SITE_BRANCH}

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/website/Gemfile
----------------------------------------------------------------------
diff --git a/website/Gemfile b/website/Gemfile
index 8bc5038..da77425 100644
--- a/website/Gemfile
+++ b/website/Gemfile
@@ -1,4 +1,4 @@
-source 'https://rubygems.org'
+source 'http://rubygems.org'
 gem 'jekyll'
 gem 'jekyll-redirect-from'
 gem 'html-proofer'

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/website/Gemfile.lock
----------------------------------------------------------------------
diff --git a/website/Gemfile.lock b/website/Gemfile.lock
index 136ae6f..1ab11b5 100644
--- a/website/Gemfile.lock
+++ b/website/Gemfile.lock
@@ -1,5 +1,5 @@
 GEM
-  remote: https://rubygems.org/
+  remote: http://rubygems.org/
   specs:
     RbST (0.5.1)
     activesupport (4.2.7)

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/website/_config-local.yml
----------------------------------------------------------------------
diff --git a/website/_config-local.yml b/website/_config-local.yml
index ca29cd2..2b9cde5 100644
--- a/website/_config-local.yml
+++ b/website/_config-local.yml
@@ -1 +1 @@
-baseurl: "https://sijie.github.io/incubator-distributedlog/"
+baseurl: ""

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/website/_config-production.yml
----------------------------------------------------------------------
diff --git a/website/_config-production.yml b/website/_config-production.yml
index 2f8879a..2b9cde5 100644
--- a/website/_config-production.yml
+++ b/website/_config-production.yml
@@ -1 +1 @@
-baseurl: "/"
+baseurl: ""

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/website/_config.yml
----------------------------------------------------------------------
diff --git a/website/_config.yml b/website/_config.yml
index d3e460c..049a804 100644
--- a/website/_config.yml
+++ b/website/_config.yml
@@ -12,6 +12,8 @@ description: > # this means to ignore newlines until "baseurl:"
 
 # versions
 DL_VERSION_STABLE: 0.3.51-RC1
+DL_VERSION_LATEST: 0.4.0-incubating-SNAPSHOT
+stable_doc_version: latest
 
 # the subpath of your site, e.g. /blog
 baseurl: ""
@@ -22,6 +24,8 @@ url: "http://distributedlog.incubator.apache.org"
 twitter_username: distributedlog
 twitter_url: https://twitter.com/distributedlog
 github_url: https://github.com/apache/incubator-distributedlog
+getslack_url: https://getdl-slack.herokuapp.com
+slack_url: https://apachedistributedlog.slack.com
 wiki_url: https://cwiki.apache.org/confluence/display/DL/Apache+DistributedLog+Home
 jira_url: https://issues.apache.org/jira/browse/DL
 developer_setup_url: https://cwiki.apache.org/confluence/display/DL/Developer+Setup

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/website/_includes/header.html
----------------------------------------------------------------------
diff --git a/website/_includes/header.html b/website/_includes/header.html
index 05d1922..4a5ce5f 100644
--- a/website/_includes/header.html
+++ b/website/_includes/header.html
@@ -49,7 +49,7 @@
 		      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Documentation<span class="caret"></span></a>
           <ul class="dropdown-menu">
             <li class="dropdown-header">Snapshot (Developement)</li>
-            <li><a href="{{ site.baseurl }}/docs/latest">Latest</a></li>
+            <li><a href="{{ site.baseurl }}/docs/latest">{{ site.DL_VERSION_LATEST }}</a></li>
             <li role="separator" class="divider"></li>
             <li>
               <a href="https://cwiki.apache.org/confluence/display/DL/Project+Ideas">
@@ -101,6 +101,12 @@
               </a>
             </li>
             <li>
+              <a href="{{ site.getslack_url }}">
+                <small><span class="glyphicon glyphicon-new-window"></span></small>
+                Slack
+              </a>
+            </li>
+            <li>
               <a href="{{ site.wiki_url }}">
                 <small><span class="glyphicon glyphicon-new-window"></span></small>
                 Wiki

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/website/build.sh
----------------------------------------------------------------------
diff --git a/website/build.sh b/website/build.sh
index 8f45a09..819471c 100755
--- a/website/build.sh
+++ b/website/build.sh
@@ -17,6 +17,15 @@
 # limitations under the License.
 ################################################################################
 
+usage() {
+  echo "Usage: build <env> [dest] [serve]."
+}
+
+if [ $# -lt 1 ]; then
+  usage
+  exit 1
+fi
+
 DLOG_ENV=$1
 
 OVERRIDED_CONFIG=_config-${DLOG_ENV}.yml
@@ -24,26 +33,78 @@ OVERRIDED_CONFIG=_config-${DLOG_ENV}.yml
 BINDIR=`dirname "$0"`
 DLOG_HOME=`cd $BINDIR/.. > /dev/null;pwd`
 
+if [ $# -gt 1 ]; then
+  DEST_DIR=$2
+else 
+  DEST_DIR=${DLOG_HOME}
+fi
+
+SERVE="FALSE"
+if [ $# -gt 2 ]; then
+  SERVE="TRUE"
+fi
+
+rm -rf ${DEST_DIR}/content
+
 if [ ! -d "${DLOG_HOME}/website/docs" ]; then
   mkdir ${DLOG_HOME}/website/docs
 fi
 
-if [ ! -d "${DLOG_HOME}/website/docs/latest" ]; then
-  ln -s ../../docs ${DLOG_HOME}/website/docs/latest
-fi
+# Get the project version
+PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version 2> /dev/null | grep -Ev '(^\[|Download\w+:)')
 
-mkdir -p ${DLOG_HOME}/content/docs/latest
+echo "Building the website to ${DEST_DIR}/content ..."
 
 # build the website
-
 cd ${DLOG_HOME}/website
 
-bundle exec jekyll build --destination ${DLOG_HOME}/content --config _config.yml,${OVERRIDED_CONFIG}
+bundle exec jekyll build --destination ${DEST_DIR}/content --config _config.yml,${OVERRIDED_CONFIG}
+
+echo "Built the website @ ${DEST_DIR}/content."
+
+echo "Building the documentation for version ${PROJECT_VERSION} ..."
 
 # build the documents
 
-DOC_HOME="${DLOG_HOME}/website/docs/latest"
+if [[ ${PROJECT_VERSION} == *"SNAPSHOT"* ]]; then
+  # it is a snapshot version, built the docs into latest
+  DOC_SRC_HOME="${DLOG_HOME}/website/docs/latest"
+  DOC_DEST_HOME="${DEST_DIR}/content/docs/latest"
+else
+  # it is a release version, built the docs to release-version directory.
+  DOC_SRC_HOME="${DLOG_HOME}/website/docs/${PROJECT_VERSION}"
+  DOC_DEST_HOME="${DEST_DIR}/content/docs/${PROJECT_VERSION}"
+fi
+
+# link the doc source directory if necessary
+if [ ! -d "${DOC_SRC_HOME}" ]; then
+  ln -s ../../docs ${DOC_SRC_HOME} 
+fi
+
+# create the doc dest directory
+mkdir -p ${DOC_DEST_HOME}
+
+cd ${DOC_SRC_HOME}
 
-cd ${DOC_HOME}
+bundle exec jekyll build --destination ${DOC_DEST_HOME} --config _config.yml,${OVERRIDED_CONFIG}
+
+# build the javadoc API
+
+cd ${DLOG_HOME}
+# create the api directory
+mkdir -p ${DEST_DIR}/content/docs/latest/api/java
+# build the javadoc
+mvn -DskipTests clean package javadoc:aggregate \
+    -Ddoctitle="Apache DistributedLog for Java, version ${PROJECT_VERSION}" \
+    -Dwindowtitle="Apache DistributedLog for Java, version ${PROJECT_VERSION}" \
+    -Dmaven.javadoc.failOnError=false
+# copy the built javadoc
+cp -r ${DLOG_HOME}/target/site/apidocs/* ${DOC_DEST_HOME}/api/java
+
+echo "Built the documentation for version ${PROJECT_VERSION}."
+
+if [[ "${SERVE}" == "TRUE" ]]; then
+  cd ${DLOG_HOME}/website
+  bundle exec jekyll serve --destination ${DEST_DIR}/content --config _config.yml,${OVERRIDED_CONFIG} --incremental
+fi
 
-bundle exec jekyll build --destination ${DLOG_HOME}/content/docs/latest --config _config.yml,${OVERRIDED_CONFIG}

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/website/community/community.md
----------------------------------------------------------------------
diff --git a/website/community/community.md b/website/community/community.md
index cf63407..d7995c2 100644
--- a/website/community/community.md
+++ b/website/community/community.md
@@ -62,6 +62,14 @@ There are many ways to get help from the Apache DistributedLog community. The [m
   </tr>
 </table>
 
+## Slack Channel
+
+There is a Slack channel dedicated to Apache DistributedLog at [https://apachedistributedlog.slack.com/](https://apachedistributedlog.slack.com/). The slack channel can be used for online discussions about Apache DistributedLog as community. Users can get help using DistributedLog, follow developement discussions and connect with the community.
+
+But developers should be careful to move or duplicate all the official or useful discussions to the issue tracking system or dev mailing list.
+
+If you are interested in connecting with the community using Slack channel, you can get invite from [here](https://getdl-slack.herokuapp.com/).
+
 ## Issue Tracker
 
 We use JIRA to track all code related issues: [{{ site.jira_url }}]({{ site.jira_url }}).

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/website/faq.md
----------------------------------------------------------------------
diff --git a/website/faq.md b/website/faq.md
index 04a593e..84f4638 100644
--- a/website/faq.md
+++ b/website/faq.md
@@ -13,7 +13,7 @@ The Apache DistributedLog FAQ page is in the process of bootstrapping. So please
 
 # Frequently Asked Questions
 
-The following questions are frequently asked with regard to the DistributedLog project in general. If you have further questions, make sure to consult the [documentation]({{ site.baseurl }}/docs/latest) or [ask the community]({{ site.baseurl }}/community).
+The following questions are frequently asked with regard to the DistributedLog project in general. If you have further questions, make sure to consult the [documentation]({{ site.baseurl }}/docs/{{ site.stable_doc_version }}) or [ask the community]({{ site.baseurl }}/community).
 
 * TOC
 {:toc}

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/042032a3/website/index.md
----------------------------------------------------------------------
diff --git a/website/index.md b/website/index.md
index 18f6010..d2847b6 100644
--- a/website/index.md
+++ b/website/index.md
@@ -16,8 +16,8 @@ The Apache DistributedLog project is in the process of bootstrapping. This inclu
     </p>
     <div class="row">
         <div class="text-center">
-            <a href="{{ site.baseurl }}/docs/latest/start/download" class="btn btn-primary btn-lg">Download</a>
-            <a href="{{ site.baseurl }}/docs/latest/start/quickstart" class="btn btn-primary btn-lg">Quick Start</a>
+            <a href="{{ site.baseurl }}/docs/{{ site.stable_doc_version }}/start/download" class="btn btn-primary btn-lg">Download</a>
+            <a href="{{ site.baseurl }}/docs/{{ site.stable_doc_version }}/start/quickstart" class="btn btn-primary btn-lg">Quick Start</a>
         </div>
     </div>
 </div>
@@ -26,7 +26,7 @@ The Apache DistributedLog project is in the process of bootstrapping. This inclu
     <div class="col-lg-4">
         <h3>
             <span class="glyphicon glyphicon-flash"></span>
-            <a href="{{ site.baseurl }}/docs/latest/user_guide/architecture/main.html">
+            <a href="{{ site.baseurl }}/docs/{{ site.stable_doc_version }}/user_guide/architecture/main.html">
             High Performance
             </a>
         </h3>
@@ -39,7 +39,7 @@ thousands of clients.
     <div class="col-lg-4">
         <h3>
             <span class="glyphicon glyphicon-menu-hamburger"></span>
-            <a href="{{ site.baseurl }}/docs/latest/user_guide/architecture/main.html">
+            <a href="{{ site.baseurl }}/docs/{{ site.stable_doc_version }}/user_guide/architecture/main.html">
             Durable and Consistent 
             </a>
         </h3>
@@ -52,7 +52,7 @@ readers in terms of <strong>strict ordering</strong>.
     <div class="col-lg-4">
         <h3>
             <span class="glyphicon glyphicon-random"></span>
-            <a href="{{ site.baseurl }}/docs/latest/user_guide/architecture/main.html">
+            <a href="{{ site.baseurl }}/docs/{{ site.stable_doc_version }}/user_guide/architecture/main.html">
             Efficient Fan-in and Fan-out
             </a>
         </h3>
@@ -65,7 +65,7 @@ to support large scale writes (fan-in) and reads (fan-out).
     <div class="col-lg-4">
         <h3>
             <span class="glyphicon glyphicon-fire"></span>
-            <a href="{{ site.baseurl }}/docs/latest/user_guide/architecture/main.html">
+            <a href="{{ site.baseurl }}/docs/{{ site.stable_doc_version }}/user_guide/architecture/main.html">
             Various Workloads
             </a>
         </h3>
@@ -79,7 +79,7 @@ analytical processing.
     <div class="col-lg-4">
         <h3>
             <span class="glyphicon glyphicon-user"></span>
-            <a href="{{ site.baseurl }}/docs/latest/user_guide/architecture/main.html">
+            <a href="{{ site.baseurl }}/docs/{{ site.stable_doc_version }}/user_guide/architecture/main.html">
             Multi Tenant
             </a>
         </h3>
@@ -91,7 +91,7 @@ isolation in real-world workloads.
     <div class="col-lg-4">
         <h3>
             <span class="glyphicon glyphicon-send"></span>
-            <a href="{{ site.baseurl }}/docs/latest/user_guide/architecture/main.html">
+            <a href="{{ site.baseurl }}/docs/{{ site.stable_doc_version }}/user_guide/architecture/main.html">
             Layered Architecture
             </a>
         </h3>