Skip to content

Commit

Permalink
Checkstyle managed ledger (apache#1224)
Browse files Browse the repository at this point in the history
* Add projet wide checkstyle configuration

* Optimize imports for managed-ledger

* Clean checkstyle for managed-ledger
  • Loading branch information
mgodave authored and merlimat committed Feb 13, 2018
1 parent fbfd944 commit a5a7c79
Show file tree
Hide file tree
Showing 71 changed files with 608 additions and 636 deletions.
20 changes: 4 additions & 16 deletions buildtools/src/main/resources/pulsar/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ page at http://checkstyle.sourceforge.net/config.html -->

<module name="Checker">

<module name="SuppressWarningsFilter" />

<module name="FileTabCharacter">
<!-- Checks that there are no tab characters in the file. -->
</module>
Expand Down Expand Up @@ -73,6 +75,8 @@ page at http://checkstyle.sourceforge.net/config.html -->
<!-- All Java AST specific tests live under TreeWalker module. -->
<module name="TreeWalker">

<module name="SuppressWarningsHolder" />

<module name="TodoComment">
<!-- Checks that disallowed strings are not used in comments. -->
<property name="format" value="(FIXME)|(XXX)|(@author)" />
Expand Down Expand Up @@ -352,22 +356,6 @@ page at http://checkstyle.sourceforge.net/config.html -->
<!-- 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
Expand Down
18 changes: 5 additions & 13 deletions buildtools/src/main/resources/pulsar/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@
under the License.
-->
<!--
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">
Expand All @@ -41,11 +28,16 @@
<suppress checks="JavadocPackage" files=".*[\\/]maven-archetypes[\\/].*"/>
<suppress checks="JavadocPackage" files=".*[\\/]examples[\\/].*"/>

<!-- suppress javadoc check for impl classes -->
<suppress checks="JavadocType" files=".*Impl\.java$" />

<!-- 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" />

<!-- suppress all checks in the copied code -->
<suppress checks=".*" files=".+[\\/]com[\\/]scurrilous[\\/]circe[\\/].+\.java" />

<suppress checks=".*" files="MLDataFormats.java" />
</suppressions>
Original file line number Diff line number Diff line change
Expand Up @@ -18,111 +18,111 @@
*/
package org.apache.bookkeeper.mledger;

import java.util.List;

import com.google.common.annotations.Beta;
import java.util.List;

/**
* Definition of all the callbacks used for the ManagedLedger asynchronous API.
*
*/
@Beta
@SuppressWarnings("checkstyle:javadoctype")
public interface AsyncCallbacks {

public interface OpenLedgerCallback {
public void openLedgerComplete(ManagedLedger ledger, Object ctx);
interface OpenLedgerCallback {
void openLedgerComplete(ManagedLedger ledger, Object ctx);

public void openLedgerFailed(ManagedLedgerException exception, Object ctx);
void openLedgerFailed(ManagedLedgerException exception, Object ctx);
}

public interface DeleteLedgerCallback {
public void deleteLedgerComplete(Object ctx);
interface DeleteLedgerCallback {
void deleteLedgerComplete(Object ctx);

public void deleteLedgerFailed(ManagedLedgerException exception, Object ctx);
void deleteLedgerFailed(ManagedLedgerException exception, Object ctx);
}

public interface OpenCursorCallback {
public void openCursorComplete(ManagedCursor cursor, Object ctx);
interface OpenCursorCallback {
void openCursorComplete(ManagedCursor cursor, Object ctx);

public void openCursorFailed(ManagedLedgerException exception, Object ctx);
void openCursorFailed(ManagedLedgerException exception, Object ctx);
}

public interface DeleteCursorCallback {
public void deleteCursorComplete(Object ctx);
interface DeleteCursorCallback {
void deleteCursorComplete(Object ctx);

public void deleteCursorFailed(ManagedLedgerException exception, Object ctx);
void deleteCursorFailed(ManagedLedgerException exception, Object ctx);
}

public interface AddEntryCallback {
public void addComplete(Position position, Object ctx);
interface AddEntryCallback {
void addComplete(Position position, Object ctx);

public void addFailed(ManagedLedgerException exception, Object ctx);
void addFailed(ManagedLedgerException exception, Object ctx);
}

public interface CloseCallback {
public void closeComplete(Object ctx);
interface CloseCallback {
void closeComplete(Object ctx);

public void closeFailed(ManagedLedgerException exception, Object ctx);
void closeFailed(ManagedLedgerException exception, Object ctx);
}

public interface ReadEntriesCallback {
public void readEntriesComplete(List<Entry> entries, Object ctx);
interface ReadEntriesCallback {
void readEntriesComplete(List<Entry> entries, Object ctx);

public void readEntriesFailed(ManagedLedgerException exception, Object ctx);
void readEntriesFailed(ManagedLedgerException exception, Object ctx);
}

public interface ReadEntryCallback {
public void readEntryComplete(Entry entry, Object ctx);
interface ReadEntryCallback {
void readEntryComplete(Entry entry, Object ctx);

public void readEntryFailed(ManagedLedgerException exception, Object ctx);
void readEntryFailed(ManagedLedgerException exception, Object ctx);
}

public interface MarkDeleteCallback {
public void markDeleteComplete(Object ctx);
interface MarkDeleteCallback {
void markDeleteComplete(Object ctx);

public void markDeleteFailed(ManagedLedgerException exception, Object ctx);
void markDeleteFailed(ManagedLedgerException exception, Object ctx);
}

public interface ClearBacklogCallback {
public void clearBacklogComplete(Object ctx);
interface ClearBacklogCallback {
void clearBacklogComplete(Object ctx);

public void clearBacklogFailed(ManagedLedgerException exception, Object ctx);
void clearBacklogFailed(ManagedLedgerException exception, Object ctx);
}

public interface SkipEntriesCallback {
public void skipEntriesComplete(Object ctx);
interface SkipEntriesCallback {
void skipEntriesComplete(Object ctx);

public void skipEntriesFailed(ManagedLedgerException exception, Object ctx);
void skipEntriesFailed(ManagedLedgerException exception, Object ctx);
}

public interface DeleteCallback {
public void deleteComplete(Object ctx);
interface DeleteCallback {
void deleteComplete(Object ctx);

public void deleteFailed(ManagedLedgerException exception, Object ctx);
void deleteFailed(ManagedLedgerException exception, Object ctx);
}

public interface TerminateCallback {
public void terminateComplete(Position lastCommittedPosition, Object ctx);
interface TerminateCallback {
void terminateComplete(Position lastCommittedPosition, Object ctx);

public void terminateFailed(ManagedLedgerException exception, Object ctx);
void terminateFailed(ManagedLedgerException exception, Object ctx);
}

public interface FindEntryCallback {
public void findEntryComplete(Position position, Object ctx);
interface FindEntryCallback {
void findEntryComplete(Position position, Object ctx);

public void findEntryFailed(ManagedLedgerException exception, Object ctx);
void findEntryFailed(ManagedLedgerException exception, Object ctx);
}

public interface ResetCursorCallback {
public void resetComplete(Object ctx);
interface ResetCursorCallback {
void resetComplete(Object ctx);

public void resetFailed(ManagedLedgerException exception, Object ctx);
void resetFailed(ManagedLedgerException exception, Object ctx);
}

public interface ManagedLedgerInfoCallback {
public void getInfoComplete(ManagedLedgerInfo info, Object ctx);
interface ManagedLedgerInfoCallback {
void getInfoComplete(ManagedLedgerInfo info, Object ctx);

public void getInfoFailed(ManagedLedgerException exception, Object ctx);
void getInfoFailed(ManagedLedgerException exception, Object ctx);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.apache.bookkeeper.mledger;

import com.google.common.annotations.Beta;

import io.netty.buffer.ByteBuf;

/**
Expand Down Expand Up @@ -49,7 +48,7 @@ public interface Entry {
* @return the position at which the entry was stored
*/
Position getPosition();

/**
* @return ledgerId of the position
*/
Expand All @@ -62,7 +61,7 @@ public interface Entry {

/**
* Release the resources (data) allocated for this entry and recycle if all the resources are deallocated (ref-count
* of data reached to 0)
* of data reached to 0).
*/
boolean release();

Expand Down
Loading

0 comments on commit a5a7c79

Please sign in to comment.