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 2016/12/21 01:00:46 UTC
[1/3] incubator-distributedlog git commit: DL-129: Enable checkstyle
plugin for distributedlog-protocol module
Repository: incubator-distributedlog
Updated Branches:
refs/heads/master 26942a91a -> 3bd162027
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogRecordTooLongException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogRecordTooLongException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogRecordTooLongException.java
index 0521133..76a1aa2 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogRecordTooLongException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogRecordTooLongException.java
@@ -19,6 +19,11 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception is thrown when attempting to write a record whose size is too larger.
+ *
+ * <p>The size limit of a log record is {@link com.twitter.distributedlog.LogRecord#MAX_LOGRECORD_SIZE}.
+ */
public class LogRecordTooLongException extends DLException {
private static final long serialVersionUID = 2788274084603111386L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/MetadataException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/MetadataException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/MetadataException.java
index 76ab573..cb62e7c 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/MetadataException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/MetadataException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception is thrown when encountering metadata errors.
+ */
public class MetadataException extends DLException {
private static final long serialVersionUID = 6683578078046016125L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/NotYetImplementedException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/NotYetImplementedException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/NotYetImplementedException.java
index 7c703e4..04edb01 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/NotYetImplementedException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/NotYetImplementedException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception is thrown when a method is not implemented yet.
+ */
public class NotYetImplementedException extends DLException {
private static final long serialVersionUID = -6002036746792556106L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/OverCapacityException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/OverCapacityException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/OverCapacityException.java
index ab46f64..d564758 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/OverCapacityException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/OverCapacityException.java
@@ -19,6 +19,12 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception is thrown when the system is over capacity.
+ *
+ * <p>When this exception is received, the client (either writer or reader) should take actions to not
+ * overwhelm the system. For example, backoff sending any requests.
+ */
public class OverCapacityException extends DLException {
private static final long serialVersionUID = -6398949404860680263L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/OwnershipAcquireFailedException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/OwnershipAcquireFailedException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/OwnershipAcquireFailedException.java
index 9bdef0e..7816333 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/OwnershipAcquireFailedException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/OwnershipAcquireFailedException.java
@@ -19,6 +19,11 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception is thrown when a log writer attempt to acquire a lock.
+ *
+ * <p>It is typically thrown when the lock is already acquired by another writer.
+ */
public class OwnershipAcquireFailedException extends LockingException {
private static final long serialVersionUID = 8176056926552748001L;
private final String currentOwner;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ReadCancelledException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ReadCancelledException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ReadCancelledException.java
index 2876d3f..84d9271 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ReadCancelledException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ReadCancelledException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Signals that a read request has been cancelled.
+ */
public class ReadCancelledException extends DLException {
private static final long serialVersionUID = -6273430297547510262L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RegionUnavailableException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RegionUnavailableException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RegionUnavailableException.java
index 4158c97..440d86e 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RegionUnavailableException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RegionUnavailableException.java
@@ -19,6 +19,11 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception indicates that the service is not available in one region.
+ *
+ * <p>The client should retry the other regions when encountering this exception.
+ */
public class RegionUnavailableException extends DLException {
private static final long serialVersionUID = 5727337162533143957L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RequestDeniedException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RequestDeniedException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RequestDeniedException.java
index e4b61c4..0a1e1c5 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RequestDeniedException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RequestDeniedException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Signals that a request has been denied at the server.
+ */
public class RequestDeniedException extends DLException {
private static final long serialVersionUID = 7338220414584728216L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RetryableReadException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RetryableReadException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RetryableReadException.java
index d35988c..5224564 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RetryableReadException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/RetryableReadException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Signals that a read request can be retried..
+ */
public class RetryableReadException extends DLException {
private static final long serialVersionUID = 2803207702150642330L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ServiceUnavailableException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ServiceUnavailableException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ServiceUnavailableException.java
index 7851c0b..29e20d8 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ServiceUnavailableException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ServiceUnavailableException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception indicates that the service is unavailable at the server side.
+ */
public class ServiceUnavailableException extends DLException {
private static final long serialVersionUID = 6317900286881665746L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/StreamNotReadyException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/StreamNotReadyException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/StreamNotReadyException.java
index e44706a..6cac468 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/StreamNotReadyException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/StreamNotReadyException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception is thrown when a log stream is not ready on server side for serving the write requests.
+ */
public class StreamNotReadyException extends DLException {
private static final long serialVersionUID = 684211282036293028L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/StreamUnavailableException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/StreamUnavailableException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/StreamUnavailableException.java
index 1e23da0..9872fdc 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/StreamUnavailableException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/StreamUnavailableException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception thrown when a stream is not available for serving traffic.
+ */
public class StreamUnavailableException extends DLException {
private static final long serialVersionUID = 684211282036993028L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/TooManyStreamsException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/TooManyStreamsException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/TooManyStreamsException.java
index bbee4e4..6ee405d 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/TooManyStreamsException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/TooManyStreamsException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Signals that a server has been serving too many streams.
+ */
public class TooManyStreamsException extends OverCapacityException {
private static final long serialVersionUID = -6391941401860180163L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/TransactionIdOutOfOrderException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/TransactionIdOutOfOrderException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/TransactionIdOutOfOrderException.java
index 370b83e..915525c 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/TransactionIdOutOfOrderException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/TransactionIdOutOfOrderException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * An exception is thrown when a log writer attempts to write a record with out-of-order transaction id.
+ */
public class TransactionIdOutOfOrderException extends DLException {
private static final long serialVersionUID = -6239322552103630036L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/UnexpectedException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/UnexpectedException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/UnexpectedException.java
index ec26ad2..4454cd0 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/UnexpectedException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/UnexpectedException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * An {@code UnexpectedException} is thrown when encountering unexpected conditions.
+ */
public class UnexpectedException extends DLException {
private static final long serialVersionUID = 903763128422774055L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/UnsupportedMetadataVersionException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/UnsupportedMetadataVersionException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/UnsupportedMetadataVersionException.java
index 042c7db..47c361a 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/UnsupportedMetadataVersionException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/UnsupportedMetadataVersionException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception is thrown when found unsupported metadata version.
+ */
public class UnsupportedMetadataVersionException extends DLException {
private static final long serialVersionUID = 4980892659955478446L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/WriteCancelledException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/WriteCancelledException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/WriteCancelledException.java
index 33f11d4..f3adac2 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/WriteCancelledException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/WriteCancelledException.java
@@ -19,14 +19,17 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Signals when a write request is cancelled.
+ */
public class WriteCancelledException extends DLException {
private static final long serialVersionUID = -1836146493496072122L;
public WriteCancelledException(String stream, Throwable t) {
super(StatusCode.WRITE_CANCELLED_EXCEPTION,
- "Write cancelled on stream " +
- stream + " due to an earlier error", t);
+ "Write cancelled on stream "
+ + stream + " due to an earlier error", t);
}
public WriteCancelledException(String stream, String reason) {
@@ -36,7 +39,7 @@ public class WriteCancelledException extends DLException {
public WriteCancelledException(String stream) {
super(StatusCode.WRITE_CANCELLED_EXCEPTION,
- "Write cancelled on stream " +
- stream + " due to an earlier error");
+ "Write cancelled on stream "
+ + stream + " due to an earlier error");
}
}
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/WriteException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/WriteException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/WriteException.java
index 64714d7..77c18d4 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/WriteException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/WriteException.java
@@ -19,13 +19,15 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * An exception on writing log records.
+ */
public class WriteException extends DLException {
private static final long serialVersionUID = -1836146493446072122L;
public WriteException(String stream, String transmitError) {
super(StatusCode.WRITE_EXCEPTION,
- "Write rejected because stream " + stream + " has encountered an error : " +
- transmitError);
+ "Write rejected because stream " + stream + " has encountered an error : " + transmitError);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/package-info.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/package-info.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/package-info.java
new file mode 100644
index 0000000..ad027d8
--- /dev/null
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/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.
+ */
+/**
+ * Defines exceptions used across distributedlog project.
+ */
+package com.twitter.distributedlog.exceptions;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/CompressionCodec.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/CompressionCodec.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/CompressionCodec.java
index 2637f87..0f1753a 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/CompressionCodec.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/CompressionCodec.java
@@ -20,14 +20,13 @@ package com.twitter.distributedlog.io;
import org.apache.bookkeeper.stats.OpStatsLogger;
/**
- * Common interface for compression/decompression operations using different
- * compression codecs.
+ * Common interface for compression/decompression operations using different compression codecs.
*/
public interface CompressionCodec {
/**
* Enum specifying the currently supported compression types.
*/
- public static enum Type {
+ enum Type {
NONE, LZ4, UNKNOWN
}
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/CompressionUtils.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/CompressionUtils.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/CompressionUtils.java
index 3acef62..2552786 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/CompressionUtils.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/CompressionUtils.java
@@ -17,13 +17,16 @@
*/
package com.twitter.distributedlog.io;
+/**
+ * Utils for compression related operations.
+ */
public class CompressionUtils {
- public final static String LZ4 = "lz4";
- public final static String NONE = "none";
+ public static final String LZ4 = "lz4";
+ public static final String NONE = "none";
- private static CompressionCodec identityCodec = new IdentityCompressionCodec();
- private static CompressionCodec lz4Codec = new LZ4CompressionCodec();
+ private static final CompressionCodec IDENTITY_CODEC = new IdentityCompressionCodec();
+ private static final CompressionCodec LZ4_CODEC = new LZ4CompressionCodec();
/**
* Get a cached compression codec instance for the specified type.
@@ -32,10 +35,10 @@ public class CompressionUtils {
*/
public static CompressionCodec getCompressionCodec(CompressionCodec.Type type) {
if (type == CompressionCodec.Type.LZ4) {
- return lz4Codec;
+ return LZ4_CODEC;
}
// No Compression
- return identityCodec;
+ return IDENTITY_CODEC;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/IdentityCompressionCodec.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/IdentityCompressionCodec.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/IdentityCompressionCodec.java
index 4cc7762..39952c3 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/IdentityCompressionCodec.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/IdentityCompressionCodec.java
@@ -17,23 +17,26 @@
*/
package com.twitter.distributedlog.io;
-import java.util.Arrays;
-
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+import java.util.Arrays;
import org.apache.bookkeeper.stats.OpStatsLogger;
+/**
+ * An identity compression codec implementation for {@link CompressionCodec}.
+ */
public class IdentityCompressionCodec implements CompressionCodec {
@Override
public byte[] compress(byte[] data, int offset, int length, OpStatsLogger compressionStat) {
- Preconditions.checkNotNull(data);
- Preconditions.checkArgument(length >= 0);
+ checkNotNull(data);
+ checkArgument(length >= 0);
return Arrays.copyOfRange(data, offset, offset + length);
}
@Override
public byte[] decompress(byte[] data, int offset, int length, OpStatsLogger decompressionStat) {
- Preconditions.checkNotNull(data);
+ checkNotNull(data);
return Arrays.copyOfRange(data, offset, offset + length);
}
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/LZ4CompressionCodec.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/LZ4CompressionCodec.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/LZ4CompressionCodec.java
index 2137452..12d6ac4 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/LZ4CompressionCodec.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/LZ4CompressionCodec.java
@@ -17,21 +17,22 @@
*/
package com.twitter.distributedlog.io;
-import java.util.concurrent.TimeUnit;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
-import com.google.common.base.Preconditions;
import com.google.common.base.Stopwatch;
-
+import java.util.concurrent.TimeUnit;
import net.jpountz.lz4.LZ4Compressor;
import net.jpountz.lz4.LZ4Exception;
import net.jpountz.lz4.LZ4Factory;
import net.jpountz.lz4.LZ4FastDecompressor;
import net.jpountz.lz4.LZ4SafeDecompressor;
-
import org.apache.bookkeeper.stats.OpStatsLogger;
/**
- * All functions are thread safe.
+ * An {@code lz4} based {@link CompressionCodec} implementation.
+ *
+ * <p>All functions are thread safe.
*/
public class LZ4CompressionCodec implements CompressionCodec {
@@ -50,10 +51,10 @@ public class LZ4CompressionCodec implements CompressionCodec {
@Override
public byte[] compress(byte[] data, int offset, int length, OpStatsLogger compressionStat) {
- Preconditions.checkNotNull(data);
- Preconditions.checkArgument(offset >= 0 && offset < data.length);
- Preconditions.checkArgument(length >= 0);
- Preconditions.checkNotNull(compressionStat);
+ checkNotNull(data);
+ checkArgument(offset >= 0 && offset < data.length);
+ checkArgument(length >= 0);
+ checkNotNull(compressionStat);
Stopwatch watch = Stopwatch.createStarted();
byte[] compressed = compressor.compress(data, offset, length);
@@ -63,10 +64,10 @@ public class LZ4CompressionCodec implements CompressionCodec {
@Override
public byte[] decompress(byte[] data, int offset, int length, OpStatsLogger decompressionStat) {
- Preconditions.checkNotNull(data);
- Preconditions.checkArgument(offset >= 0 && offset < data.length);
- Preconditions.checkArgument(length >= 0);
- Preconditions.checkNotNull(decompressionStat);
+ checkNotNull(data);
+ checkArgument(offset >= 0 && offset < data.length);
+ checkArgument(length >= 0);
+ checkNotNull(decompressionStat);
Stopwatch watch = Stopwatch.createStarted();
// Assume that we have a compression ratio of 1/3.
@@ -86,11 +87,11 @@ public class LZ4CompressionCodec implements CompressionCodec {
// length parameter is ignored here because of the way the fastDecompressor works.
public byte[] decompress(byte[] data, int offset, int length, int decompressedSize,
OpStatsLogger decompressionStat) {
- Preconditions.checkNotNull(data);
- Preconditions.checkArgument(offset >= 0 && offset < data.length);
- Preconditions.checkArgument(length >= 0);
- Preconditions.checkArgument(decompressedSize >= 0);
- Preconditions.checkNotNull(decompressionStat);
+ checkNotNull(data);
+ checkArgument(offset >= 0 && offset < data.length);
+ checkArgument(length >= 0);
+ checkArgument(decompressedSize >= 0);
+ checkNotNull(decompressionStat);
Stopwatch watch = Stopwatch.createStarted();
byte[] decompressed = fastDecompressor.decompress(data, offset, decompressedSize);
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/package-info.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/package-info.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/package-info.java
new file mode 100644
index 0000000..bbd9528
--- /dev/null
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/io/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.
+ */
+/**
+ * I/O related utilities used across the project.
+ */
+package com.twitter.distributedlog.io;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/package-info.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/package-info.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/package-info.java
new file mode 100644
index 0000000..8fc526d
--- /dev/null
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/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.
+ */
+/**
+ * Provides the core data structures used across multiple modules.
+ */
+package com.twitter.distributedlog;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/BitMaskUtils.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/BitMaskUtils.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/BitMaskUtils.java
index adee084..07d9d26 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/BitMaskUtils.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/BitMaskUtils.java
@@ -17,15 +17,18 @@
*/
package com.twitter.distributedlog.util;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+/**
+ * Utils for bit mask operations.
+ */
public class BitMaskUtils {
/**
* 1) Unset all bits where value in mask is set.
* 2) Set these bits to value specified by newValue.
*
- * e.g.
+ * <p>e.g.
* if oldValue = 1010, mask = 0011, newValue = 0001
* 1) 1010 -> 1000
* 2) 1000 -> 1001
@@ -36,19 +39,19 @@ public class BitMaskUtils {
* @return updated value
*/
public static long set(long oldValue, long mask, long newValue) {
- Preconditions.checkArgument(oldValue >= 0L && mask >= 0L && newValue >= 0L);
+ checkArgument(oldValue >= 0L && mask >= 0L && newValue >= 0L);
return ((oldValue & (~mask)) | (newValue & mask));
}
/**
- * Get the bits where mask is 1
+ * Get the bits where mask is 1.
*
* @param value value
* @param mask mask of the value
* @return the bit of the mask
*/
public static long get(long value, long mask) {
- Preconditions.checkArgument(value >= 0L && mask >= 0L);
+ checkArgument(value >= 0L && mask >= 0L);
return (value & mask);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/ProtocolUtils.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/ProtocolUtils.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/ProtocolUtils.java
index 0b08471..bac5cdd 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/ProtocolUtils.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/ProtocolUtils.java
@@ -17,11 +17,10 @@
*/
package com.twitter.distributedlog.util;
-import java.util.zip.CRC32;
+import static com.google.common.base.Charsets.UTF_8;
import com.twitter.distributedlog.DLSN;
-
-import static com.google.common.base.Charsets.UTF_8;
+import java.util.zip.CRC32;
/**
* With CRC embedded in the application, we have to keep track of per api crc. Ideally this
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/package-info.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/package-info.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/package-info.java
new file mode 100644
index 0000000..f95e666
--- /dev/null
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/util/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.
+ */
+/**
+ * defines the utilities used across the project.
+ */
+package com.twitter.distributedlog.util;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/test/java/com/twitter/distributedlog/TestDLSN.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/test/java/com/twitter/distributedlog/TestDLSN.java b/distributedlog-protocol/src/test/java/com/twitter/distributedlog/TestDLSN.java
index 373994b..551d0ca 100644
--- a/distributedlog-protocol/src/test/java/com/twitter/distributedlog/TestDLSN.java
+++ b/distributedlog-protocol/src/test/java/com/twitter/distributedlog/TestDLSN.java
@@ -17,9 +17,14 @@
*/
package com.twitter.distributedlog;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
import org.junit.Test;
-import static org.junit.Assert.*;
+/**
+ * Test Case for {@link DLSN}.
+ */
public class TestDLSN {
@Test(timeout = 60000)
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/test/java/com/twitter/distributedlog/TestLogRecordSet.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/test/java/com/twitter/distributedlog/TestLogRecordSet.java b/distributedlog-protocol/src/test/java/com/twitter/distributedlog/TestLogRecordSet.java
index bc1e627..4a5fdac 100644
--- a/distributedlog-protocol/src/test/java/com/twitter/distributedlog/TestLogRecordSet.java
+++ b/distributedlog-protocol/src/test/java/com/twitter/distributedlog/TestLogRecordSet.java
@@ -17,6 +17,13 @@
*/
package com.twitter.distributedlog;
+import static com.google.common.base.Charsets.UTF_8;
+import static com.twitter.distributedlog.LogRecord.MAX_LOGRECORD_SIZE;
+import static com.twitter.distributedlog.LogRecordSet.HEADER_LEN;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
import com.google.common.collect.Lists;
import com.twitter.distributedlog.LogRecordSet.Reader;
import com.twitter.distributedlog.LogRecordSet.Writer;
@@ -25,18 +32,12 @@ import com.twitter.distributedlog.io.CompressionCodec.Type;
import com.twitter.util.Await;
import com.twitter.util.Future;
import com.twitter.util.Promise;
-import org.junit.Test;
-
import java.nio.ByteBuffer;
import java.util.List;
-
-import static com.google.common.base.Charsets.UTF_8;
-import static com.twitter.distributedlog.LogRecord.*;
-import static com.twitter.distributedlog.LogRecordSet.*;
-import static org.junit.Assert.*;
+import org.junit.Test;
/**
- * Test Case for {@link LogRecordSet}
+ * Test Case for {@link LogRecordSet}.
*/
public class TestLogRecordSet {
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6cca9ce..a7f60b1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,6 +83,7 @@
</developer>
</developers>
<modules>
+ <module>distributedlog-build-tools</module>
<module>distributedlog-protocol</module>
<module>distributedlog-core</module>
<module>distributedlog-client</module>
[2/3] incubator-distributedlog git commit: DL-129: Enable checkstyle
plugin for distributedlog-protocol module
Posted by si...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-build-tools/src/main/resources/ide/eclipse/DL_formatter.xml
----------------------------------------------------------------------
diff --git a/distributedlog-build-tools/src/main/resources/ide/eclipse/DL_formatter.xml b/distributedlog-build-tools/src/main/resources/ide/eclipse/DL_formatter.xml
new file mode 100644
index 0000000..a73e7c4
--- /dev/null
+++ b/distributedlog-build-tools/src/main/resources/ide/eclipse/DL_formatter.xml
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+ <!--
+/**
+ * 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.
+ */
+-->
+<profiles version="1">
+<profile kind="CodeFormatterProfile" name="'DL'" version="1">
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="20"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.source" value="1.7"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="100"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.7"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="true"/>
+</profile>
+</profiles>
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/pom.xml
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/pom.xml b/distributedlog-protocol/pom.xml
index 4417d14..3adae05 100644
--- a/distributedlog-protocol/pom.xml
+++ b/distributedlog-protocol/pom.xml
@@ -113,6 +113,39 @@
<excludeFilterFile>${basedir}/src/main/resources/findbugsExclude.xml</excludeFilterFile>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.17</version>
+ <dependencies>
+ <dependency>
+ <groupId>com.puppycrawl.tools</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>6.19</version>
+ </dependency>
+ <dependency>
+ <groupId>com.twitter</groupId>
+ <artifactId>distributedlog-build-tools</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <configLocation>distributedlog/checkstyle.xml</configLocation>
+ <suppressionsLocation>distributedlog/suppressions.xml</suppressionsLocation>
+ <consoleOutput>true</consoleOutput>
+ <failOnViolation>true</failOnViolation>
+ <includeResources>false</includeResources>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/DLSN.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/DLSN.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/DLSN.java
index 9e3b76c..57cc0ef 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/DLSN.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/DLSN.java
@@ -17,12 +17,13 @@
*/
package com.twitter.distributedlog;
+import static com.google.common.base.Preconditions.checkArgument;
+
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
+import java.nio.ByteBuffer;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.Hex;
-import java.nio.ByteBuffer;
/**
* DistributedLog Sequence Number (DLSN) is the system generated sequence number for log record.
@@ -46,7 +47,7 @@ public class DLSN implements Comparable<DLSN> {
// The non-inclusive lower bound DLSN
public static final DLSN NonInclusiveLowerBound = new DLSN(1, 0 , -1);
// Invalid DLSN
- public static final DLSN InvalidDLSN = new DLSN(0,-1,-1);
+ public static final DLSN InvalidDLSN = new DLSN(0, -1, -1);
static final byte CUR_VERSION = VERSION1;
static final int VERSION0_LEN = Long.SIZE * 3 + Byte.SIZE;
@@ -72,14 +73,6 @@ public class DLSN implements Comparable<DLSN> {
}
/**
- * use {@link #getLogSegmentSequenceNo()} instead
- */
- @Deprecated
- long getLedgerSequenceNo() {
- return logSegmentSequenceNo;
- }
-
- /**
* Return the entry id of the batch that the record is written to.
*
* @return entry id of the batch that the record is written to.
@@ -100,11 +93,11 @@ public class DLSN implements Comparable<DLSN> {
@Override
public int compareTo(DLSN that) {
if (this.logSegmentSequenceNo != that.logSegmentSequenceNo) {
- return (this.logSegmentSequenceNo < that.logSegmentSequenceNo)? -1 : 1;
+ return (this.logSegmentSequenceNo < that.logSegmentSequenceNo) ? -1 : 1;
} else if (this.entryId != that.entryId) {
- return (this.entryId < that.entryId)? -1 : 1;
+ return (this.entryId < that.entryId) ? -1 : 1;
} else {
- return (this.slotId < that.slotId)? -1 : (this.slotId == that.slotId)? 0 : 1;
+ return (this.slotId < that.slotId) ? -1 : (this.slotId == that.slotId) ? 0 : 1;
}
}
@@ -125,7 +118,7 @@ public class DLSN implements Comparable<DLSN> {
* @return the serialized bytes
*/
public byte[] serializeBytes(byte version) {
- Preconditions.checkArgument(version <= CUR_VERSION && version >= VERSION0);
+ checkArgument(version <= CUR_VERSION && version >= VERSION0);
byte[] data = new byte[CUR_VERSION == version ? VERSION1_LEN : VERSION0_LEN];
ByteBuffer bb = ByteBuffer.wrap(data);
bb.put(version);
@@ -208,23 +201,33 @@ public class DLSN implements Comparable<DLSN> {
@Override
public String toString() {
- return "DLSN{" +
- "logSegmentSequenceNo=" + logSegmentSequenceNo +
- ", entryId=" + entryId +
- ", slotId=" + slotId +
- '}';
+ return "DLSN{"
+ + "logSegmentSequenceNo=" + logSegmentSequenceNo
+ + ", entryId=" + entryId
+ + ", slotId=" + slotId
+ + '}';
}
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof DLSN)) return false;
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof DLSN)) {
+ return false;
+ }
DLSN dlsn = (DLSN) o;
- if (entryId != dlsn.entryId) return false;
- if (logSegmentSequenceNo != dlsn.logSegmentSequenceNo) return false;
- if (slotId != dlsn.slotId) return false;
+ if (entryId != dlsn.entryId) {
+ return false;
+ }
+ if (logSegmentSequenceNo != dlsn.logSegmentSequenceNo) {
+ return false;
+ }
+ if (slotId != dlsn.slotId) {
+ return false;
+ }
return true;
}
@@ -238,9 +241,10 @@ public class DLSN implements Comparable<DLSN> {
}
/**
- * Positions to a DLSN greater than the current value - this may not
- * correspond to an actual LogRecord, its just used by the positioning logic
- * to position the reader
+ * Positions to a DLSN greater than the current value.
+ *
+ * <p>This may not correspond to an actual LogRecord, its just used by the positioning logic
+ * to position the reader.
*
* @return the next DLSN
*/
@@ -249,9 +253,10 @@ public class DLSN implements Comparable<DLSN> {
}
/**
- * Positions to a DLSN greater than the current value - this may not
- * correspond to an actual LogRecord, its just used by the positioning logic
- * to position the reader
+ * Positions to next log segment than the current value.
+ *
+ * <p>this may not correspond to an actual LogRecord, its just used by the positioning logic
+ * to position the reader.
*
* @return the next DLSN
*/
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/EnvelopedRecordSetReader.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/EnvelopedRecordSetReader.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/EnvelopedRecordSetReader.java
index d3f7a99..dae8403 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/EnvelopedRecordSetReader.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/EnvelopedRecordSetReader.java
@@ -17,15 +17,19 @@
*/
package com.twitter.distributedlog;
+import static com.twitter.distributedlog.LogRecordSet.COMPRESSION_CODEC_LZ4;
+import static com.twitter.distributedlog.LogRecordSet.METADATA_COMPRESSION_MASK;
+import static com.twitter.distributedlog.LogRecordSet.METADATA_VERSION_MASK;
+import static com.twitter.distributedlog.LogRecordSet.NULL_OP_STATS_LOGGER;
+import static com.twitter.distributedlog.LogRecordSet.VERSION;
+
import com.twitter.distributedlog.io.CompressionCodec;
import com.twitter.distributedlog.io.CompressionUtils;
-
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
-import static com.twitter.distributedlog.LogRecordSet.*;
/**
* Record reader to read records from an enveloped entry buffer.
@@ -63,8 +67,8 @@ class EnvelopedRecordSetReader implements LogRecordSet.Reader {
int metadata = src.readInt();
int version = metadata & METADATA_VERSION_MASK;
if (version != VERSION) {
- throw new IOException(String.format("Version mismatch while reading. Received: %d," +
- " Required: %d", version, VERSION));
+ throw new IOException(String.format("Version mismatch while reading. Received: %d,"
+ + " Required: %d", version, VERSION));
}
int codecCode = metadata & METADATA_COMPRESSION_MASK;
this.numRecords = src.readInt();
@@ -76,7 +80,7 @@ class EnvelopedRecordSetReader implements LogRecordSet.Reader {
if (COMPRESSION_CODEC_LZ4 == codecCode) {
CompressionCodec codec = CompressionUtils.getCompressionCodec(CompressionCodec.Type.LZ4);
byte[] decompressedData = codec.decompress(compressedData, 0, actualDataLen,
- originDataLen, NullOpStatsLogger);
+ originDataLen, NULL_OP_STATS_LOGGER);
this.reader = ByteBuffer.wrap(decompressedData);
} else {
if (originDataLen != actualDataLen) {
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/EnvelopedRecordSetWriter.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/EnvelopedRecordSetWriter.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/EnvelopedRecordSetWriter.java
index 32b3cf4..7f64a6d 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/EnvelopedRecordSetWriter.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/EnvelopedRecordSetWriter.java
@@ -17,15 +17,21 @@
*/
package com.twitter.distributedlog;
+import static com.twitter.distributedlog.LogRecord.MAX_LOGRECORD_SIZE;
+import static com.twitter.distributedlog.LogRecordSet.COMPRESSION_CODEC_LZ4;
+import static com.twitter.distributedlog.LogRecordSet.COMPRESSION_CODEC_NONE;
+import static com.twitter.distributedlog.LogRecordSet.HEADER_LEN;
+import static com.twitter.distributedlog.LogRecordSet.METADATA_COMPRESSION_MASK;
+import static com.twitter.distributedlog.LogRecordSet.METADATA_VERSION_MASK;
+import static com.twitter.distributedlog.LogRecordSet.NULL_OP_STATS_LOGGER;
+import static com.twitter.distributedlog.LogRecordSet.VERSION;
+
+import com.twitter.distributedlog.exceptions.LogRecordTooLongException;
+import com.twitter.distributedlog.exceptions.WriteException;
import com.twitter.distributedlog.io.Buffer;
import com.twitter.distributedlog.io.CompressionCodec;
import com.twitter.distributedlog.io.CompressionUtils;
-import com.twitter.distributedlog.exceptions.LogRecordTooLongException;
-import com.twitter.distributedlog.exceptions.WriteException;
import com.twitter.util.Promise;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
@@ -33,16 +39,15 @@ import java.nio.channels.Channels;
import java.nio.channels.WritableByteChannel;
import java.util.LinkedList;
import java.util.List;
-
-import static com.twitter.distributedlog.LogRecord.MAX_LOGRECORD_SIZE;
-import static com.twitter.distributedlog.LogRecordSet.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* {@link Buffer} based log record set writer.
*/
class EnvelopedRecordSetWriter implements LogRecordSet.Writer {
- static final Logger logger = LoggerFactory.getLogger(EnvelopedRecordSetWriter.class);
+ private static final Logger logger = LoggerFactory.getLogger(EnvelopedRecordSetWriter.class);
private final Buffer buffer;
private final DataOutputStream writer;
@@ -158,7 +163,7 @@ class EnvelopedRecordSetWriter implements LogRecordSet.Writer {
CompressionCodec compressor =
CompressionUtils.getCompressionCodec(codec);
byte[] compressed =
- compressor.compress(data, dataOffset, dataLen, NullOpStatsLogger);
+ compressor.compress(data, dataOffset, dataLen, NULL_OP_STATS_LOGGER);
ByteBuffer recordSetBuffer;
if (compressed.length > dataLen) {
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecord.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecord.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecord.java
index c104212..74df400 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecord.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecord.java
@@ -17,14 +17,13 @@
*/
package com.twitter.distributedlog;
+import com.google.common.annotations.VisibleForTesting;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
-
-import com.google.common.annotations.VisibleForTesting;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,38 +40,39 @@ import org.slf4j.LoggerFactory;
*
* <h3>User Record</h3>
*
- * User records are the records written by applications and read by applications. They
+ * <p>User records are the records written by applications and read by applications. They
* are constructed via {@link #LogRecord(long, byte[])} by applications and appended to
* logs by writers. And they would be deserialized from bytes by the readers and return
* to applications.
*
* <h3>Control Record</h3>
*
- * Control records are special records that written by distributedlog. They are invisible
+ * <p>Control records are special records that written by distributedlog. They are invisible
* to applications. They could be treated as <i>commit requests</i> as what people could find
* in distributed consensus algorithms, since they are usually written by distributedlog to
* commit application written records. <i>Commit</i> means making application written records
* visible to readers to achieve consistent views among them.
- * <p>
- * They are named as 'Control Records' for controlling visibility of application written records.
- * <p>
- * The transaction id of 'Control Records' are assigned by distributedlog by inheriting from last
+ *
+ * <p>They are named as 'Control Records' for controlling visibility of application written records.
+ *
+ * <p>The transaction id of 'Control Records' are assigned by distributedlog by inheriting from last
* written user records. So we could indicate what user records that a control record is committing
* by looking at its transaction id.
*
* <h4>EndOfStream Record</h4>
*
- * <code>EoS</code>(EndOfStream) is a special control record that would be written by a writer
+ * <p><code>EoS</code>(EndOfStream) is a special control record that would be written by a writer
* to seal a log. After a <i>EoS</i> record is written to a log, no writers could append any record
* after that and readers will get {@link com.twitter.distributedlog.exceptions.EndOfStreamException}
* when they reach EoS.
+ *
* <p>TransactionID of EoS is <code>Long.MAX_VALUE</code>.
*
* <h3>Serialization & Deserialization</h3>
*
- * Data type in brackets. Interpretation should be on the basis of data types and not individual
+ * <p>Data type in brackets. Interpretation should be on the basis of data types and not individual
* bytes to honor Endianness.
- * <p>
+ *
* <pre>
* LogRecord structure:
* -------------------
@@ -98,13 +98,14 @@ import org.slf4j.LoggerFactory;
*
* <h3>Sequence Numbers</h3>
*
- * A record is associated with three types of sequence numbers. They are generated
+ * <p>A record is associated with three types of sequence numbers. They are generated
* and used for different purposes. Check {@link LogRecordWithDLSN} for more details.
*
* @see LogRecordWithDLSN
*/
public class LogRecord {
- static final Logger LOG = LoggerFactory.getLogger(LogRecord.class);
+
+ private static final Logger LOG = LoggerFactory.getLogger(LogRecord.class);
// Allow 4K overhead for metadata within the max transmission size
public static final int MAX_LOGRECORD_SIZE = 1024 * 1024 - 8 * 1024; //1MB - 8KB
@@ -131,8 +132,8 @@ public class LogRecord {
/**
* Construct an uninitialized log record.
- * <p>
- * NOTE: only deserializer should call this constructor.
+ *
+ * <p>NOTE: only deserializer should call this constructor.
*/
protected LogRecord() {
this.txid = 0;
@@ -141,6 +142,7 @@ public class LogRecord {
/**
* Construct a log record with <i>TransactionId</i> and payload.
+ *
* <p>Usually writer would construct the log record for writing.
*
* @param txid
@@ -223,8 +225,8 @@ public class LogRecord {
*/
void setPositionWithinLogSegment(int positionWithinLogSegment) {
assert(positionWithinLogSegment >= 0);
- metadata = (metadata & LOGRECORD_METADATA_POSITION_UMASK) |
- (((long) positionWithinLogSegment) << LOGRECORD_METADATA_POSITION_SHIFT);
+ metadata = (metadata & LOGRECORD_METADATA_POSITION_UMASK)
+ | (((long) positionWithinLogSegment) << LOGRECORD_METADATA_POSITION_SHIFT);
}
/**
@@ -243,6 +245,7 @@ public class LogRecord {
/**
* Get the last position of this record in the log segment.
+ *
* <p>If the record isn't record set, it would be same as {@link #getPositionWithinLogSegment()},
* otherwise, it would be {@link #getPositionWithinLogSegment()} + numRecords - 1. If the record set
* version is unknown, it would be same as {@link #getPositionWithinLogSegment()}.
@@ -264,6 +267,7 @@ public class LogRecord {
/**
* Set the record to represent a set of records.
+ *
* <p>The bytes in this record is the serialized format of {@link LogRecordSet}.
*/
public void setRecordSet() {
@@ -319,6 +323,7 @@ public class LogRecord {
/**
* Check if the record is a <code>EoS</code> mark.
+ *
* <p><code>EoS</code> mark is a special record that writer would
* add to seal a log. after <code>Eos</code> mark is written,
* writers can't write any more records and readers will get
@@ -356,8 +361,9 @@ public class LogRecord {
}
/**
- * The size of the serialized log record, this is used to estimate how much will
- * be be appended to the in-memory buffer
+ * The size of the serialized log record.
+ *
+ * <p>This is used to estimate how much will be be appended to the in-memory buffer.
*
* @return serialized size
*/
@@ -367,7 +373,7 @@ public class LogRecord {
}
/**
- * Class for writing log records
+ * Writer class to write log records into an output {@code stream}.
*/
public static class Writer {
private final DataOutputStream buf;
@@ -377,7 +383,7 @@ public class LogRecord {
}
/**
- * Write an operation to the output stream
+ * Write an operation to the output stream.
*
* @param record The operation to write
* @throws IOException if an error occurs during writing.
@@ -392,8 +398,7 @@ public class LogRecord {
}
/**
- * This class is a package private class for reading log records
- * from the persistent
+ * Reader class to read log records from an input {@code stream}.
*/
public static class Reader {
private final RecordStream recordStream;
@@ -405,9 +410,11 @@ public class LogRecord {
private LogRecordWithDLSN lastRecordSkipTo = null;
/**
- * Construct the reader
+ * Construct the reader.
*
+ * @param recordStream the record stream for generating {@code DLSN}s.
* @param in The stream to read from.
+ * @param startSequenceId the start sequence id.
*/
public Reader(RecordStream recordStream,
DataInputStream in,
@@ -426,9 +433,9 @@ public class LogRecord {
}
/**
- * Read an operation from the input stream.
- * <p/>
- * Note that the objects returned from this method may be re-used by future
+ * Read an log record from the input stream.
+ *
+ * <p/> Note that the objects returned from this method may be re-used by future
* calls to the same method.
*
* @return the operation read from the stream, or null at the end of the file
@@ -466,9 +473,11 @@ public class LogRecord {
nextRecordInStream.readPayload(in);
if (LOG.isTraceEnabled()) {
if (nextRecordInStream.isControl()) {
- LOG.trace("Reading {} Control DLSN {}", recordStream.getName(), nextRecordInStream.getDlsn());
+ LOG.trace("Reading {} Control DLSN {}",
+ recordStream.getName(), nextRecordInStream.getDlsn());
} else {
- LOG.trace("Reading {} Valid DLSN {}", recordStream.getName(), nextRecordInStream.getDlsn());
+ LOG.trace("Reading {} Valid DLSN {}",
+ recordStream.getName(), nextRecordInStream.getDlsn());
}
}
@@ -525,7 +534,7 @@ public class LogRecord {
currTxId = lastRecordSkipTo.getTransactionId();
}
- if ((null != dlsn) && (recordStream.getCurrentPosition().compareTo(dlsn) >=0)) {
+ if ((null != dlsn) && (recordStream.getCurrentPosition().compareTo(dlsn) >= 0)) {
if (LOG.isTraceEnabled()) {
LOG.trace("Found position {} beyond {}", recordStream.getCurrentPosition(), dlsn);
}
@@ -556,7 +565,8 @@ public class LogRecord {
// get the num of records to skip
if (isRecordSet(flags)) {
// read record set
- LogRecordWithDLSN record = new LogRecordWithDLSN(recordStream.getCurrentPosition(), startSequenceId);
+ LogRecordWithDLSN record =
+ new LogRecordWithDLSN(recordStream.getCurrentPosition(), startSequenceId);
record.setMetadata(flags);
record.setTransactionId(currTxId);
record.readPayload(in);
@@ -580,7 +590,8 @@ public class LogRecord {
read += bytesToRead;
}
if (LOG.isTraceEnabled()) {
- LOG.trace("Skipped Record with TxId {} DLSN {}", currTxId, recordStream.getCurrentPosition());
+ LOG.trace("Skipped Record with TxId {} DLSN {}",
+ currTxId, recordStream.getCurrentPosition());
}
recordStream.advance(1);
}
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecordSet.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecordSet.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecordSet.java
index dad8e3e..52970c7 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecordSet.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecordSet.java
@@ -17,20 +17,21 @@
*/
package com.twitter.distributedlog;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
import com.twitter.distributedlog.exceptions.LogRecordTooLongException;
import com.twitter.distributedlog.exceptions.WriteException;
import com.twitter.distributedlog.io.CompressionCodec;
import com.twitter.util.Promise;
-import org.apache.bookkeeper.stats.NullStatsLogger;
-import org.apache.bookkeeper.stats.OpStatsLogger;
-
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
+import org.apache.bookkeeper.stats.NullStatsLogger;
+import org.apache.bookkeeper.stats.OpStatsLogger;
/**
* A set of {@link LogRecord}s.
+ *
* <pre>
* Structure:
* Bytes 0 - 4 : Metadata (version + flags)
@@ -56,7 +57,7 @@ import java.nio.ByteBuffer;
*/
public class LogRecordSet {
- static final OpStatsLogger NullOpStatsLogger =
+ static final OpStatsLogger NULL_OP_STATS_LOGGER =
NullStatsLogger.INSTANCE.getOpStatsLogger("");
public static final int HEADER_LEN =
@@ -77,7 +78,7 @@ public class LogRecordSet {
static final int COMPRESSION_CODEC_LZ4 = 0X1;
public static int numRecords(LogRecord record) throws IOException {
- Preconditions.checkArgument(record.isRecordSet(),
+ checkArgument(record.isRecordSet(),
"record is not a recordset");
byte[] data = record.getPayload();
return numRecords(data);
@@ -88,8 +89,8 @@ public class LogRecordSet {
int metadata = buffer.getInt();
int version = (metadata & METADATA_VERSION_MASK);
if (version != VERSION) {
- throw new IOException(String.format("Version mismatch while reading. Received: %d," +
- " Required: %d", version, VERSION));
+ throw new IOException(String.format("Version mismatch while reading. Received: %d,"
+ + " Required: %d", version, VERSION));
}
return buffer.getInt();
}
@@ -100,7 +101,7 @@ public class LogRecordSet {
}
public static Reader of(LogRecordWithDLSN record) throws IOException {
- Preconditions.checkArgument(record.isRecordSet(),
+ checkArgument(record.isRecordSet(),
"record is not a recordset");
byte[] data = record.getPayload();
DLSN dlsn = record.getDlsn();
@@ -120,7 +121,7 @@ public class LogRecordSet {
/**
* Writer to append {@link LogRecord}s to {@link LogRecordSet}.
*/
- public static interface Writer extends LogRecordSetBuffer {
+ public interface Writer extends LogRecordSetBuffer {
/**
* Write a {@link LogRecord} to this record set.
@@ -140,7 +141,7 @@ public class LogRecordSet {
/**
* Reader to read {@link LogRecord}s from this record set.
*/
- public static interface Reader {
+ public interface Reader {
/**
* Read next log record from this record set.
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecordWithDLSN.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecordWithDLSN.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecordWithDLSN.java
index 521e452..14c8e76 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecordWithDLSN.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/LogRecordWithDLSN.java
@@ -24,7 +24,7 @@ import com.google.common.annotations.VisibleForTesting;
*
* <h3>Sequence Numbers</h3>
*
- * A log record will be assigned with an unique system generated sequence number {@link DLSN} when it is
+ * <p>A log record will be assigned with an unique system generated sequence number {@link DLSN} when it is
* written to a log. At the mean time, a 64-bits long number is assigned to the record indicates its position
* within a log, which is called <code>SequenceId</code>. Besides {@link DLSN} and <code>SequenceID</code>,
* application can assign its own sequence number (called <code>TransactionID</code>) to the log record while
@@ -32,7 +32,7 @@ import com.google.common.annotations.VisibleForTesting;
*
* <h4>Transaction ID</h4>
*
- * Transaction ID is a positive 64-bits long number that is assigned by the application. It is a very helpful
+ * <p>Transaction ID is a positive 64-bits long number that is assigned by the application. It is a very helpful
* field when application wants to organize the records and position the readers using their own sequencing method.
* A typical use case of <code>TransactionID</code> is DistributedLog Write Proxy. It assigns the non-decreasing
* timestamps to log records, which the timestamps could be used as `physical time` to implement `TTL` in a strong
@@ -40,14 +40,14 @@ import com.google.common.annotations.VisibleForTesting;
*
* <h4>DLSN</h4>
*
- * DistributedLog Sequence Number (<i>DLSN</i>) is the sequence number generated during written time. It is comparable
- * and could be used to figure out the order between records. The DLSN is comprised with 3 components. They are
- * <i>Log Segment Sequence Number</i>, <i>Entry Id</i> and <i>Slot Id</i>. (See {@link DLSN} for more details).
+ * <p>DistributedLog Sequence Number (<i>DLSN</i>) is the sequence number generated during written time.
+ * It is comparable and could be used to figure out the order between records. The DLSN is comprised with 3 components.
+ * They are <i>Log Segment Sequence Number</i>, <i>Entry Id</i> and <i>Slot Id</i>. (See {@link DLSN} for more details).
* The DLSN is usually used for comparison, positioning and truncation.
*
* <h4>Sequence ID</h4>
*
- * Sequence ID is introduced to address the drawback of <code>DLSN</code>, in favor of answering questions like
+ * <p>Sequence ID is introduced to address the drawback of <code>DLSN</code>, in favor of answering questions like
* `how many records written between two DLSNs`. It is a 64-bits monotonic increasing number (starting from zero).
* Sequence ids are only accessible by readers. That means writers don't know the sequence ids of records after they
* wrote them.
@@ -96,12 +96,12 @@ public class LogRecordWithDLSN extends LogRecord {
@Override
public String toString() {
- return "LogRecordWithDLSN{" +
- "dlsn=" + dlsn +
- ", txid=" + getTransactionId() +
- ", position=" + getPositionWithinLogSegment() +
- ", isControl=" + isControl() +
- ", isEndOfStream=" + isEndOfStream() +
- '}';
+ return "LogRecordWithDLSN{"
+ + "dlsn=" + dlsn
+ + ", txid=" + getTransactionId()
+ + ", position=" + getPositionWithinLogSegment()
+ + ", isControl=" + isControl()
+ + ", isEndOfStream=" + isEndOfStream()
+ + '}';
}
}
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/RecordStream.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/RecordStream.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/RecordStream.java
index a2b5537..d920ea1 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/RecordStream.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/RecordStream.java
@@ -18,7 +18,7 @@
package com.twitter.distributedlog;
/**
- * Stream of records
+ * A iterator to iterate records in the stream.
*/
public interface RecordStream {
/**
@@ -27,14 +27,14 @@ public interface RecordStream {
void advance(int numRecords);
/**
- * Get postion of current record in the stream
+ * Get position of current record in the stream.
*
* @return position of current record
*/
DLSN getCurrentPosition();
/**
- * Get the name of the stream
+ * Get the name of the stream.
*
* @return the name of the stream
*/
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/annotations/DistributedLogAnnotations.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/annotations/DistributedLogAnnotations.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/annotations/DistributedLogAnnotations.java
index d2d19b2..2859008 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/annotations/DistributedLogAnnotations.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/annotations/DistributedLogAnnotations.java
@@ -17,6 +17,9 @@
*/
package com.twitter.distributedlog.annotations;
+/**
+ * Common annotation types.
+ */
public class DistributedLogAnnotations {
/**
* Annotation to identify flaky tests in DistributedLog.
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/annotations/package-info.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/annotations/package-info.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/annotations/package-info.java
new file mode 100644
index 0000000..24bb36b
--- /dev/null
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/annotations/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.
+ */
+/**
+ * Defines annotations used across distributedlog project.
+ */
+package com.twitter.distributedlog.annotations;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/AlreadyClosedException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/AlreadyClosedException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/AlreadyClosedException.java
index f8bb7b8..abbce5f 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/AlreadyClosedException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/AlreadyClosedException.java
@@ -17,12 +17,12 @@
*/
package com.twitter.distributedlog.exceptions;
-import com.twitter.distributedlog.exceptions.DLException;
import com.twitter.distributedlog.thrift.service.StatusCode;
/**
- * Thrown when the distributed log manager has already been closed
- * (connections have been torn down)
+ * Thrown when any distributedlog resources have already been closed.
+ *
+ * <p>For example, it might be thrown when the connections have been torn down.
*/
public class AlreadyClosedException extends DLException {
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/AlreadyTruncatedTransactionException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/AlreadyTruncatedTransactionException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/AlreadyTruncatedTransactionException.java
index fa3fb4b..788b4d8 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/AlreadyTruncatedTransactionException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/AlreadyTruncatedTransactionException.java
@@ -17,12 +17,10 @@
*/
package com.twitter.distributedlog.exceptions;
-import com.twitter.distributedlog.exceptions.DLException;
import com.twitter.distributedlog.thrift.service.StatusCode;
/**
- * Thrown when the transaction Id specified in the API is in the range that has already been
- * truncated
+ * Thrown when the transaction Id specified in the API is in the range that has already been truncated.
*/
public class AlreadyTruncatedTransactionException extends DLException {
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/BKTransmitException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/BKTransmitException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/BKTransmitException.java
index 158ce31..8f29628 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/BKTransmitException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/BKTransmitException.java
@@ -17,12 +17,12 @@
*/
package com.twitter.distributedlog.exceptions;
-import com.twitter.distributedlog.exceptions.DLException;
import com.twitter.distributedlog.thrift.service.StatusCode;
/**
- * Thrown when the send to bookkeeper fails
- * This is thrown by the next attempt to write, send or flush
+ * Thrown when the send to bookkeeper fails.
+ *
+ * <p>This is thrown by the next attempt to write, send or flush
*/
public class BKTransmitException extends DLException {
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ChecksumFailedException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ChecksumFailedException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ChecksumFailedException.java
index 111dff6..4b67299 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ChecksumFailedException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/ChecksumFailedException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception thrown when checksum failures occurred.
+ */
public class ChecksumFailedException extends DLException {
private static final long serialVersionUID = 288438128880378812L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLClientClosedException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLClientClosedException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLClientClosedException.java
index 6c947c2..2f506ba 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLClientClosedException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLClientClosedException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exceptions thrown when a distributedlog client is closed.
+ */
public class DLClientClosedException extends DLException {
private static final long serialVersionUID = -8876218750540927584L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLException.java
index 1e654bf..23af0c5 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLException.java
@@ -19,9 +19,11 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.ResponseHeader;
import com.twitter.distributedlog.thrift.service.StatusCode;
-
import java.io.IOException;
+/**
+ * The basic exception of all distributedlog exceptions.
+ */
public class DLException extends IOException {
private static final long serialVersionUID = -4485775468586114393L;
protected final StatusCode code;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLIllegalStateException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLIllegalStateException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLIllegalStateException.java
index 78e5e9c..c80b9db 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLIllegalStateException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/DLIllegalStateException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Signals that a method has been invoked at an illegal or inappropriate time.
+ */
public class DLIllegalStateException extends DLException {
private static final long serialVersionUID = -6721471104777747420L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/EndOfStreamException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/EndOfStreamException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/EndOfStreamException.java
index 663b18b..a62e629 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/EndOfStreamException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/EndOfStreamException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception thrown when a reader reaches end of a sealed log stream.
+ */
public class EndOfStreamException extends DLException {
private static final long serialVersionUID = -6398949401860680263L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/FlushException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/FlushException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/FlushException.java
index 331de00..f984b6c 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/FlushException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/FlushException.java
@@ -17,9 +17,11 @@
*/
package com.twitter.distributedlog.exceptions;
-import com.twitter.distributedlog.exceptions.DLException;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception indicates that errors occurred on flushing data.
+ */
public class FlushException extends DLException {
private final long lastTxIdWritten;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/IdleReaderException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/IdleReaderException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/IdleReaderException.java
index 475606f..1f6923a 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/IdleReaderException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/IdleReaderException.java
@@ -19,6 +19,11 @@ package com.twitter.distributedlog.exceptions;
import java.io.IOException;
+/**
+ * An exception is thrown when a log reader becomes idle.
+ *
+ * <p>A log reader can become idle when there is no records written to the stream.
+ */
public class IdleReaderException extends IOException {
private static final long serialVersionUID = 4882278671396434834L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InternalServerException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InternalServerException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InternalServerException.java
index 4b46396..2aea152 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InternalServerException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InternalServerException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception indicates that there is an internal error at distributedlog service side.
+ */
public class InternalServerException extends DLException {
private static final long serialVersionUID = 288438028880978802L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InvalidEnvelopedEntryException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InvalidEnvelopedEntryException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InvalidEnvelopedEntryException.java
index fdc50c1..09e146c 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InvalidEnvelopedEntryException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InvalidEnvelopedEntryException.java
@@ -20,7 +20,7 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
/**
- * Exception thrown when encounter invalid enveloped entry
+ * Exception thrown when encounter invalid enveloped entry.
*/
public class InvalidEnvelopedEntryException extends DLException {
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InvalidStreamNameException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InvalidStreamNameException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InvalidStreamNameException.java
index a7d9202..1e8f445 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InvalidStreamNameException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/InvalidStreamNameException.java
@@ -19,6 +19,9 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception is thrown when encountered invalid log stream.
+ */
public class InvalidStreamNameException extends DLException {
private static final long serialVersionUID = 6393315766140568100L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LockCancelledException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LockCancelledException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LockCancelledException.java
index 65e8692..98131ee 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LockCancelledException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LockCancelledException.java
@@ -17,6 +17,9 @@
*/
package com.twitter.distributedlog.exceptions;
+/**
+ * A lock is cancelled when waiting for locking a stream.
+ */
public class LockCancelledException extends LockingException {
private static final long serialVersionUID = -148795017092861106L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LockingException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LockingException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LockingException.java
index 92ff8d6..326a1cd 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LockingException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LockingException.java
@@ -17,9 +17,11 @@
*/
package com.twitter.distributedlog.exceptions;
-import com.twitter.distributedlog.exceptions.DLException;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception when a log writer attempts to acquire a lock to write data to the stream.
+ */
public class LockingException extends DLException {
private static final long serialVersionUID = -4960278188448464473L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogEmptyException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogEmptyException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogEmptyException.java
index 84813c1..7dcd644 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogEmptyException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogEmptyException.java
@@ -17,9 +17,11 @@
*/
package com.twitter.distributedlog.exceptions;
-import com.twitter.distributedlog.exceptions.DLException;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exceptions are thrown when attempt to read a log stream that doesn't have any records.
+ */
public class LogEmptyException extends DLException {
private static final long serialVersionUID = -1106184127178002282L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogExistsException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogExistsException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogExistsException.java
index 84ac10e..e7a0d6d 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogExistsException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogExistsException.java
@@ -20,7 +20,7 @@ package com.twitter.distributedlog.exceptions;
import com.twitter.distributedlog.thrift.service.StatusCode;
/**
- * Log Already Exists
+ * Exception thrown on creating a log stream but the log stream already exists.
*/
public class LogExistsException extends DLException {
private static final long serialVersionUID = 1794053581673506784L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogNotFoundException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogNotFoundException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogNotFoundException.java
index 5fc8438..e2c93e8 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogNotFoundException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogNotFoundException.java
@@ -17,9 +17,11 @@
*/
package com.twitter.distributedlog.exceptions;
-import com.twitter.distributedlog.exceptions.DLException;
import com.twitter.distributedlog.thrift.service.StatusCode;
+/**
+ * Exception is thrown when a reader attempts to read a log stream that doesn't exist.
+ */
public class LogNotFoundException extends DLException {
private static final long serialVersionUID = 871435700699403164L;
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogReadException.java
----------------------------------------------------------------------
diff --git a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogReadException.java b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogReadException.java
index a4c346b..6b08f53 100644
--- a/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogReadException.java
+++ b/distributedlog-protocol/src/main/java/com/twitter/distributedlog/exceptions/LogReadException.java
@@ -17,7 +17,6 @@
*/
package com.twitter.distributedlog.exceptions;
-import com.twitter.distributedlog.exceptions.DLException;
import com.twitter.distributedlog.thrift.service.StatusCode;
/**
[3/3] incubator-distributedlog git commit: DL-129: Enable checkstyle
plugin for distributedlog-protocol module
Posted by si...@apache.org.
DL-129: Enable checkstyle plugin for distributedlog-protocol module
- add build-tools module for check style configurations
- fix style problems in distributedlog-protocol
* sorted import
* fix javadoc
* constant static name and static name
Author: Xi Liu <xi...@gmail.com>
Reviewers: Sijie Guo <si...@apache.org>
Closes #54 from xiliuant/xi/checkstyle
Project: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/commit/3bd16202
Tree: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/tree/3bd16202
Diff: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/diff/3bd16202
Branch: refs/heads/master
Commit: 3bd162027c0533abce5eb49de6dffb37eab711a7
Parents: 26942a9
Author: Xi Liu <xi...@gmail.com>
Authored: Tue Dec 20 17:00:37 2016 -0800
Committer: Sijie Guo <si...@twitter.com>
Committed: Tue Dec 20 17:00:37 2016 -0800
----------------------------------------------------------------------
dev-support/DL_formatter.xml | 310 -------------
distributedlog-build-tools/pom.xml | 30 ++
.../resources/distributedlog/checkstyle.xml | 443 +++++++++++++++++++
.../resources/distributedlog/suppressions.xml | 29 ++
.../main/resources/ide/eclipse/DL_formatter.xml | 310 +++++++++++++
distributedlog-protocol/pom.xml | 33 ++
.../java/com/twitter/distributedlog/DLSN.java | 67 +--
.../EnvelopedRecordSetReader.java | 14 +-
.../EnvelopedRecordSetWriter.java | 25 +-
.../com/twitter/distributedlog/LogRecord.java | 75 ++--
.../twitter/distributedlog/LogRecordSet.java | 23 +-
.../distributedlog/LogRecordWithDLSN.java | 26 +-
.../twitter/distributedlog/RecordStream.java | 6 +-
.../annotations/DistributedLogAnnotations.java | 3 +
.../annotations/package-info.java | 21 +
.../exceptions/AlreadyClosedException.java | 6 +-
.../AlreadyTruncatedTransactionException.java | 4 +-
.../exceptions/BKTransmitException.java | 6 +-
.../exceptions/ChecksumFailedException.java | 3 +
.../exceptions/DLClientClosedException.java | 3 +
.../distributedlog/exceptions/DLException.java | 4 +-
.../exceptions/DLIllegalStateException.java | 3 +
.../exceptions/EndOfStreamException.java | 3 +
.../exceptions/FlushException.java | 4 +-
.../exceptions/IdleReaderException.java | 5 +
.../exceptions/InternalServerException.java | 3 +
.../InvalidEnvelopedEntryException.java | 2 +-
.../exceptions/InvalidStreamNameException.java | 3 +
.../exceptions/LockCancelledException.java | 3 +
.../exceptions/LockingException.java | 4 +-
.../exceptions/LogEmptyException.java | 4 +-
.../exceptions/LogExistsException.java | 2 +-
.../exceptions/LogNotFoundException.java | 4 +-
.../exceptions/LogReadException.java | 1 -
.../exceptions/LogRecordTooLongException.java | 5 +
.../exceptions/MetadataException.java | 3 +
.../exceptions/NotYetImplementedException.java | 3 +
.../exceptions/OverCapacityException.java | 6 +
.../OwnershipAcquireFailedException.java | 5 +
.../exceptions/ReadCancelledException.java | 3 +
.../exceptions/RegionUnavailableException.java | 5 +
.../exceptions/RequestDeniedException.java | 3 +
.../exceptions/RetryableReadException.java | 3 +
.../exceptions/ServiceUnavailableException.java | 3 +
.../exceptions/StreamNotReadyException.java | 3 +
.../exceptions/StreamUnavailableException.java | 3 +
.../exceptions/TooManyStreamsException.java | 3 +
.../TransactionIdOutOfOrderException.java | 3 +
.../exceptions/UnexpectedException.java | 3 +
.../UnsupportedMetadataVersionException.java | 3 +
.../exceptions/WriteCancelledException.java | 11 +-
.../exceptions/WriteException.java | 6 +-
.../distributedlog/exceptions/package-info.java | 21 +
.../distributedlog/io/CompressionCodec.java | 5 +-
.../distributedlog/io/CompressionUtils.java | 15 +-
.../io/IdentityCompressionCodec.java | 15 +-
.../distributedlog/io/LZ4CompressionCodec.java | 37 +-
.../twitter/distributedlog/io/package-info.java | 21 +
.../twitter/distributedlog/package-info.java | 21 +
.../distributedlog/util/BitMaskUtils.java | 13 +-
.../distributedlog/util/ProtocolUtils.java | 5 +-
.../distributedlog/util/package-info.java | 21 +
.../com/twitter/distributedlog/TestDLSN.java | 7 +-
.../distributedlog/TestLogRecordSet.java | 17 +-
pom.xml | 1 +
65 files changed, 1267 insertions(+), 488 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/dev-support/DL_formatter.xml
----------------------------------------------------------------------
diff --git a/dev-support/DL_formatter.xml b/dev-support/DL_formatter.xml
deleted file mode 100644
index a73e7c4..0000000
--- a/dev-support/DL_formatter.xml
+++ /dev/null
@@ -1,310 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <!--
-/**
- * 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.
- */
--->
-<profiles version="1">
-<profile kind="CodeFormatterProfile" name="'DL'" version="1">
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="20"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
-<setting id="org.eclipse.jdt.core.compiler.source" value="1.7"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="100"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.7"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="true"/>
-</profile>
-</profiles>
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-build-tools/pom.xml
----------------------------------------------------------------------
diff --git a/distributedlog-build-tools/pom.xml b/distributedlog-build-tools/pom.xml
new file mode 100644
index 0000000..45b0b81
--- /dev/null
+++ b/distributedlog-build-tools/pom.xml
@@ -0,0 +1,30 @@
+<?xml version="1.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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>com.twitter</groupId>
+ <artifactId>distributedlog</artifactId>
+ <version>0.4.0-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>distributedlog-build-tools</artifactId>
+ <name>Apache DistributedLog :: Build Tools</name>
+ <version>0.4.0-incubating-SNAPSHOT</version>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-build-tools/src/main/resources/distributedlog/checkstyle.xml
----------------------------------------------------------------------
diff --git a/distributedlog-build-tools/src/main/resources/distributedlog/checkstyle.xml b/distributedlog-build-tools/src/main/resources/distributedlog/checkstyle.xml
new file mode 100644
index 0000000..e1117c8
--- /dev/null
+++ b/distributedlog-build-tools/src/main/resources/distributedlog/checkstyle.xml
@@ -0,0 +1,443 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+
+<!-- This is a checkstyle configuration file. For descriptions of
+what the following rules do, please see the checkstyle configuration
+page at http://checkstyle.sourceforge.net/config.html -->
+
+<module name="Checker">
+
+ <module name="FileTabCharacter">
+ <!-- Checks that there are no tab characters in the file. -->
+ </module>
+
+ <module name="RegexpSingleline">
+ <!-- Checks that TODOs don't have stuff in parenthesis, e.g., username. -->
+ <property name="format" value="((//.*)|(\*.*))TODO\(" />
+ <property name="message" value="TODO comments must not include usernames." />
+ <property name="severity" value="error" />
+ </module>
+
+ <module name="RegexpSingleline">
+ <property name="format" value="\s+$"/>
+ <property name="message" value="Trailing whitespace"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="RegexpSingleline">
+ <property name="format" value="Throwables.propagate\("/>
+ <property name="message" value="Throwables.propagate is deprecated"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <!-- Prevent *Tests.java as tools may not pick them up -->
+ <module name="RegexpOnFilename">
+ <property name="fileNamePattern" value=".*Tests\.java$" />
+ </module>
+
+ <!-- Allow use of comment to suppress javadocstyle -->
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
+ <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
+ <module name="SuppressionFilter">
+ <property name="file" value="${checkstyle.suppressions.file}" default="suppressions.xml" />
+ </module>
+
+ <!-- Check that every module has a package-info.java -->
+ <module name="JavadocPackage"/>
+
+ <!-- All Java AST specific tests live under TreeWalker module. -->
+ <module name="TreeWalker">
+
+ <module name="TodoComment">
+ <!-- Checks that disallowed strings are not used in comments. -->
+ <property name="format" value="(FIXME)|(XXX)|(@author)" />
+ </module>
+
+ <!--
+
+ IMPORT CHECKS
+
+ -->
+
+ <module name="RedundantImport">
+ <!-- Checks for redundant import statements. -->
+ <property name="severity" value="error"/>
+ <message key="import.redundancy"
+ value="Redundant import {0}."/>
+ </module>
+
+ <module name="ImportOrder">
+ <!-- Checks for out of order import statements. -->
+ <property name="severity" value="error"/>
+ <!-- This ensures that static imports go first. -->
+ <property name="option" value="top"/>
+ <property name="sortStaticImportsAlphabetically" value="true"/>
+ <property name="tokens" value="STATIC_IMPORT, IMPORT"/>
+ <message key="import.ordering"
+ value="Import {0} appears after other imports that it should precede"/>
+ </module>
+
+ <module name="AvoidStarImport">
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="IllegalImport">
+ <property name="illegalPkgs" value="autovalue.shaded, avro.shaded, bk-shade, com.google.api.client.repackaged, com.google.appengine.repackaged, io.netty.util.internal"/>
+ </module>
+
+ <module name="RedundantModifier">
+ <!-- Checks for redundant modifiers on various symbol definitions.
+ See: http://checkstyle.sourceforge.net/config_modifier.html#RedundantModifier
+ -->
+ <property name="tokens" value="METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, CLASS_DEF, ENUM_DEF"/>
+ </module>
+
+ <!--
+ IllegalImport cannot blacklist classes, and c.g.api.client.util is used for some shaded
+ code and some useful code. So we need to fall back to Regexp.
+ -->
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="com\.google\.api\.client\.util\.(ByteStreams|Charsets|Collections2|Joiner|Lists|Maps|Objects|Preconditions|Sets|Strings|Throwables)"/>
+ </module>
+
+ <!--
+ Require static importing from Preconditions.
+ -->
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="^import com.google.common.base.Preconditions;$"/>
+ <property name="message" value="Static import functions from Guava Preconditions"/>
+ </module>
+
+ <module name="UnusedImports">
+ <property name="severity" value="error"/>
+ <property name="processJavadoc" value="true"/>
+ <message key="import.unused"
+ value="Unused import: {0}."/>
+ </module>
+
+ <!--
+
+ JAVADOC CHECKS
+
+ -->
+
+ <!-- Checks for Javadoc comments. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html -->
+ <module name="JavadocMethod">
+ <property name="scope" value="protected"/>
+ <property name="severity" value="error"/>
+ <property name="allowMissingJavadoc" value="true"/>
+ <property name="allowMissingParamTags" value="true"/>
+ <property name="allowMissingReturnTag" value="true"/>
+ <property name="allowMissingThrowsTags" value="true"/>
+ <property name="allowThrowsTagsForSubclasses" value="true"/>
+ <property name="allowUndeclaredRTE" value="true"/>
+ </module>
+
+ <!-- Check that paragraph tags are used correctly in Javadoc. -->
+ <module name="JavadocParagraph"/>
+
+ <module name="JavadocType">
+ <property name="scope" value="protected"/>
+ <property name="severity" value="error"/>
+ <property name="allowMissingParamTags" value="true"/>
+ </module>
+
+ <module name="JavadocStyle">
+ <property name="severity" value="error"/>
+ <property name="checkHtml" value="true"/>
+ </module>
+
+ <!--
+
+ NAMING CHECKS
+
+ -->
+
+ <!-- Item 38 - Adhere to generally accepted naming conventions -->
+
+ <module name="PackageName">
+ <!-- Validates identifiers for package names against the
+ supplied expression. -->
+ <!-- Here the default checkstyle rule restricts package name parts to
+ seven characters, this is not in line with common practice at Google.
+ -->
+ <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]{1,})*$"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="TypeNameCheck">
+ <!-- Validates static, final fields against the
+ expression "^[A-Z][a-zA-Z0-9]*$". -->
+ <metadata name="altname" value="TypeName"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="ConstantNameCheck">
+ <!-- Validates non-private, static, final fields against the supplied
+ public/package final fields "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$". -->
+ <metadata name="altname" value="ConstantName"/>
+ <property name="applyToPublic" value="true"/>
+ <property name="applyToProtected" value="true"/>
+ <property name="applyToPackage" value="true"/>
+ <property name="applyToPrivate" value="false"/>
+ <property name="format" value="^([A-Z][A-Za-z0-9_]*|FLAG_.*)$"/>
+ <message key="name.invalidPattern"
+ value="Variable ''{0}'' should be in ALL_CAPS (if it is a constant) or be private (otherwise)."/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="StaticVariableNameCheck">
+ <!-- Validates static, non-final fields against the supplied
+ expression "^[a-z][a-zA-Z0-9]*_?$". -->
+ <metadata name="altname" value="StaticVariableName"/>
+ <property name="applyToPublic" value="true"/>
+ <property name="applyToProtected" value="true"/>
+ <property name="applyToPackage" value="true"/>
+ <property name="applyToPrivate" value="true"/>
+ <property name="format" value="^[a-z][a-zA-Z0-9]*_?$"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="MemberNameCheck">
+ <!-- Validates non-static members against the supplied expression. -->
+ <metadata name="altname" value="MemberName"/>
+ <property name="applyToPublic" value="true"/>
+ <property name="applyToProtected" value="true"/>
+ <property name="applyToPackage" value="true"/>
+ <property name="applyToPrivate" value="true"/>
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="MethodNameCheck">
+ <!-- Validates identifiers for method names. -->
+ <metadata name="altname" value="MethodName"/>
+ <property name="format" value="^[a-z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="ParameterName">
+ <!-- Validates identifiers for method parameters against the
+ expression "^[a-z][a-zA-Z0-9]*$". -->
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="LocalFinalVariableName">
+ <!-- Validates identifiers for local final variables against the
+ expression "^[a-z][a-zA-Z0-9]*$". -->
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="LocalVariableName">
+ <!-- Validates identifiers for local variables against the
+ expression "^[a-z][a-zA-Z0-9]*$". -->
+ <property name="severity" value="error"/>
+ </module>
+
+ <!-- Type parameters must be either one of the four blessed letters
+ T, K, V, W, X or else be capital-case terminated with a T,
+ such as MyGenericParameterT -->
+ <module name="ClassTypeParameterName">
+ <property name="format" value="^(((T|K|V|W|X)[0-9]*)|([A-Z][a-z][a-zA-Z]*T))$"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="MethodTypeParameterName">
+ <property name="format" value="^(((T|K|V|W|X)[0-9]*)|([A-Z][a-z][a-zA-Z]*T))$"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="InterfaceTypeParameterName">
+ <property name="format" value="^(((T|K|V|W|X)[0-9]*)|([A-Z][a-z][a-zA-Z]*T))$"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <!--
+
+ LENGTH and CODING CHECKS
+
+ -->
+
+ <module name="LineLength">
+ <!-- Checks if a line is too long. -->
+ <property name="max" value="120"/>
+ <property name="severity" value="error"/>
+
+ <!--
+ The default ignore pattern exempts the following elements:
+ - import statements
+ - long URLs inside comments
+ -->
+
+ <property name="ignorePattern"
+ value="^(package .*;\s*)|(import .*;\s*)|( *\* .*https?://.*)$"/>
+ </module>
+
+ <module name="LeftCurly">
+ <!-- Checks for placement of the left curly brace ('{'). -->
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="RightCurly">
+ <!-- Checks right curlies on CATCH, ELSE, and TRY blocks are on
+ the same line. e.g., the following example is fine:
+ <pre>
+ if {
+ ...
+ } else
+ </pre>
+ -->
+ <!-- This next example is not fine:
+ <pre>
+ if {
+ ...
+ }
+ else
+ </pre>
+ -->
+ <property name="option" value="same"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <!-- Checks for braces around if and else blocks -->
+ <module name="NeedBraces">
+ <property name="severity" value="error"/>
+ <property name="tokens" value="LITERAL_IF, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO"/>
+ </module>
+
+ <module name="UpperEll">
+ <!-- Checks that long constants are defined with an upper ell.-->
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="FallThrough">
+ <!-- Warn about falling through to the next case statement. Similar to
+ javac -Xlint:fallthrough, but the check is suppressed if a single-line comment
+ on the last non-blank line preceding the fallen-into case contains 'fall through' (or
+ some other variants that we don't publicized to promote consistency).
+ -->
+ <property name="reliefPattern"
+ value="fall through|Fall through|fallthru|Fallthru|falls through|Falls through|fallthrough|Fallthrough|No break|NO break|no break|continue on"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <!-- Checks for over-complicated boolean expressions. -->
+ <module name="SimplifyBooleanExpression"/>
+
+ <!-- Detects empty statements (standalone ";" semicolon). -->
+ <module name="EmptyStatement"/>
+
+ <!--
+
+ MODIFIERS CHECKS
+
+ -->
+
+ <module name="ModifierOrder">
+ <!-- Warn if modifier order is inconsistent with JLS3 8.1.1, 8.3.1, and
+ 8.4.3. The prescribed order is:
+ public, protected, private, abstract, static, final, transient, volatile,
+ synchronized, native, strictfp
+ -->
+ <property name="severity" value="error"/>
+ </module>
+
+
+ <!--
+
+ WHITESPACE CHECKS
+
+ -->
+
+ <module name="WhitespaceAround">
+ <!-- Checks that various tokens are surrounded by whitespace.
+ This includes most binary operators and keywords followed
+ by regular or curly braces.
+ -->
+ <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR,
+ BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN,
+ EQUAL, GE, GT, LAND, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE,
+ LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN,
+ LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS,
+ MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION,
+ SL, SL_ASSIGN, SR_ASSIGN, STAR, STAR_ASSIGN"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="WhitespaceAfter">
+ <!-- Checks that commas, semicolons and typecasts are followed by
+ whitespace.
+ -->
+ <property name="tokens" value="COMMA, SEMI, TYPECAST"/>
+ </module>
+
+ <module name="NoWhitespaceAfter">
+ <!-- Checks that there is no whitespace after various unary operators.
+ Linebreaks are allowed.
+ -->
+ <property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS,
+ UNARY_PLUS"/>
+ <property name="allowLineBreaks" value="true"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="NoWhitespaceBefore">
+ <!-- Checks that there is no whitespace before various unary operators.
+ Linebreaks are allowed.
+ -->
+ <property name="tokens" value="SEMI, DOT, POST_DEC, POST_INC"/>
+ <property name="allowLineBreaks" value="true"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="OperatorWrap">
+ <!-- Checks that operators like + and ? appear at newlines rather than
+ at the end of the previous line.
+ -->
+ <property name="option" value="NL"/>
+ <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL,
+ GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD,
+ NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
+ </module>
+
+ <module name="OperatorWrap">
+ <!-- Checks that assignment operators are at the end of the line. -->
+ <property name="option" value="eol"/>
+ <property name="tokens" value="ASSIGN"/>
+ </module>
+
+ <module name="ParenPad">
+ <!-- Checks that there is no whitespace before close parens or after
+ open parens.
+ -->
+ <property name="severity" value="error"/>
+ </module>
+
+ <!-- Required to support SuppressWarningsComment -->
+ <module name="FileContentsHolder"/>
+
+ </module>
+</module>
+
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/3bd16202/distributedlog-build-tools/src/main/resources/distributedlog/suppressions.xml
----------------------------------------------------------------------
diff --git a/distributedlog-build-tools/src/main/resources/distributedlog/suppressions.xml b/distributedlog-build-tools/src/main/resources/distributedlog/suppressions.xml
new file mode 100644
index 0000000..9f60c25
--- /dev/null
+++ b/distributedlog-build-tools/src/main/resources/distributedlog/suppressions.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--
+ Licensed 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. See accompanying LICENSE file.
+-->
+<!DOCTYPE suppressions PUBLIC
+"-//Puppy Crawl//DTD Suppressions 1.1//EN"
+"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+
+<suppressions>
+ <suppress checks="JavadocPackage" files=".*[\\/]src[\\/]test[\\/].*"/>
+ <suppress checks="JavadocPackage" files=".*[\\/]maven-archetypes[\\/].*"/>
+ <suppress checks="JavadocPackage" files=".*[\\/]examples[\\/].*"/>
+
+ <!-- suppress all checks in the generated directories -->
+ <suppress checks=".*" files=".+[\\/]generated[\\/].+\.java" />
+ <suppress checks=".*" files=".+[\\/]generated-sources[\\/].+\.java" />
+ <suppress checks=".*" files=".+[\\/]generated-test-sources[\\/].+\.java" />
+</suppressions>
+