Skip to content

Develop #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 57 commits into from
May 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
0783a7b
Add basic entities
Feb 2, 2018
ee7ee15
Add types
Feb 4, 2018
b584c87
Add ErlangList and Reference tests
xxlabaza Feb 4, 2018
aed7f13
Add few tests
Feb 5, 2018
420f990
Add Node's generators
Feb 5, 2018
2a5cdce
Implement compression/decompression logic
Feb 5, 2018
224cf99
Add Node.ping
Feb 5, 2018
49b0e00
Some changes
Feb 8, 2018
fbd40d2
Add control messages
Feb 8, 2018
346d32c
Add netty
Feb 12, 2018
5bf9a32
Correct tests
Feb 12, 2018
c02590a
popa
Feb 12, 2018
361a391
popa
Feb 12, 2018
b61a6e7
popa
Feb 12, 2018
cf8e848
popa
Feb 12, 2018
0feef31
should be ok
Feb 12, 2018
6aff2fb
ok
Feb 12, 2018
413cfa5
Ok, now it should be fine
Feb 12, 2018
14bcfc7
Try again
Feb 12, 2018
35e46df
Fix server module NPE
xxlabaza Feb 12, 2018
6db62a3
Clean up the tests
xxlabaza Feb 12, 2018
f7baf3a
Rename types
xxlabaza Feb 12, 2018
9f6cf3b
Refactoring
xxlabaza Feb 12, 2018
e40fa9a
Renames
xxlabaza Feb 12, 2018
90e5ec6
Add tests
Feb 13, 2018
56bd8d3
Add more encode tests
Feb 14, 2018
1777246
Add decode tests
xxlabaza Feb 14, 2018
97efe61
Add server
Feb 19, 2018
9537e63
Add Pipline abstraction
Feb 20, 2018
b6c89ef
Add configuration module
Mar 3, 2018
aaeab28
Reinvent node builder
Mar 5, 2018
87b4caf
Mailbox API refactoring
Mar 5, 2018
0074e2b
Add node to node test with different receive methods
Mar 5, 2018
323404b
Add configs in modules
Mar 6, 2018
557b215
Add named threads (client/server)
Mar 6, 2018
23acf62
Erts main class refactoring
Mar 6, 2018
4168234
CompletableFuture API rethink
xxlabaza Mar 8, 2018
6eb7d65
Small refactoring
Mar 10, 2018
f8a362c
Link/Unlink tests
xxlabaza Mar 11, 2018
f790ede
Add exit exception
Mar 12, 2018
d2c17fd
Add exceptions
Mar 12, 2018
128c95a
Formatting refactoring
Mar 13, 2018
741819a
Several check corrections
Mar 13, 2018
20e17c7
Refactoring
Mar 14, 2018
9dbca6a
Refactoring
Mar 14, 2018
278e7b9
PMD fixes
Mar 14, 2018
3e0ee88
Small fixes
Mar 14, 2018
4c81dae
Findbugs and PMD fixes
Mar 15, 2018
c965e62
Update dependencies
Mar 16, 2018
ad1ba25
Intermediate commit
xxlabaza Apr 21, 2018
352fd03
Speed-up handshake from encoding/decoding perspective
xxlabaza Apr 22, 2018
7ebf8fd
Smother handshake
Apr 23, 2018
8bc85a9
Smothe handshake
Apr 23, 2018
1671ca8
Quick fix
Apr 25, 2018
d0508a8
Fix some bugs
Apr 28, 2018
ac97e7c
Improve performance
xxlabaza Apr 29, 2018
ba98f4c
Quick fixes
xxlabaza May 1, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions .codestyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ limitations under the License.
</module>


<!--http://checkstyle.sourceforge.net/config_sizes.html#FileLength-->
<module name="FileLength">
<property name="max" value="300"/>
</module>


<!--http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter-->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
Expand All @@ -69,8 +63,11 @@ limitations under the License.
<module name="Translation"/>
<module name="UniqueProperties"/>

<module name="SuppressWarningsFilter" />


<module name="TreeWalker">
<module name="SuppressWarningsHolder" />

<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
Expand Down Expand Up @@ -191,7 +188,7 @@ limitations under the License.
</module>
<module name="MethodLength">
<property name="tokens" value="METHOD_DEF"/>
<property name="max" value="30"/>
<property name="max" value="60"/>
<property name="countEmpty" value="false"/>
</module>
<module name="ParameterNumber">
Expand Down Expand Up @@ -318,9 +315,6 @@ limitations under the License.
<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<module name="CovariantEquals"/>
<module name="DeclarationOrder">
<property name="ignoreConstructors" value="true"/>
</module>
<module name="DefaultComesLast"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
Expand Down Expand Up @@ -359,7 +353,6 @@ limitations under the License.
<module name="SuperClone"/>
<module name="SuperFinalize"/>
<module name="UnnecessaryParentheses"/>
<module name="VariableDeclarationUsageDistance"/>


<!-- Checks for class design -->
Expand All @@ -369,7 +362,6 @@ limitations under the License.
</module>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="MutableException"/>
<module name="OneTopLevelClass"/>

<!-- Miscellaneous other checks. -->
Expand All @@ -387,7 +379,7 @@ limitations under the License.
<property name="caseIndent" value="0"/>
<property name="throwsIndent" value="0"/>
<property name="lineWrappingIndentation" value="4"/>
<property name="arrayInitIndent" value="4"/>
<property name="arrayInitIndent" value="2"/>
<property name="forceStrictCondition" value="false"/>
</module>
<module name="OuterTypeFilename"/>
Expand Down
3 changes: 3 additions & 0 deletions .codestyle/findbugs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ limitations under the License.
<Match>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>
<Match>
<Bug pattern="BC_UNCONFIRMED_CAST"/>
</Match>
</FindBugsFilter>
166 changes: 39 additions & 127 deletions .codestyle/pmd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,144 +23,56 @@ limitations under the License.

<description>PMD Rules</description>

<rule ref="rulesets/java/basic.xml">
<exclude name="AvoidUsingHardCodedIP" />
<rule ref="category/java/bestpractices.xml">
</rule>

<rule ref="rulesets/java/braces.xml" />
<rule ref="rulesets/java/clone.xml" />
<rule ref="rulesets/java/unusedcode.xml"/>
<rule ref="rulesets/java/finalizers.xml" />


<rule ref="rulesets/java/imports.xml">
<!-- Stupid rule... -->
<rule ref="category/java/codestyle.xml">
<exclude name="AbstractNaming" />
<exclude name="AtLeastOneConstructor" />
<exclude name="AvoidPrefixingMethodParameters" />
<exclude name="CommentDefaultAccessModifier" />
<exclude name="DefaultPackage" />
<exclude name="FieldDeclarationsShouldBeAtStartOfClass" />
<exclude name="LocalVariableCouldBeFinal" />
<exclude name="LongVariable" />
<exclude name="MethodArgumentCouldBeFinal" />
<exclude name="OnlyOneReturn" />
<exclude name="ShortClassName" />
<exclude name="ShortMethodName" />
<exclude name="ShortVariable" />
<exclude name="TooManyStaticImports" />
<exclude name="UselessParentheses" />
</rule>

<rule ref="rulesets/java/codesize.xml" >
<!-- See the explanation for TooManyMethods.-->
<rule ref="category/java/design.xml">
<exclude name="AvoidCatchingGenericException" />
<exclude name="AvoidRethrowingException" />
<exclude name="AvoidThrowingNullPointerException" />
<exclude name="CyclomaticComplexity" />
<exclude name="ExcessiveImports" />
<exclude name="ExcessivePublicCount" />
<exclude name="LawOfDemeter" />
<exclude name="LoosePackageCoupling" />
<exclude name="TooManyFields" />
<!-- Design is very hard to measure by numbers like this.-->
<!-- The number and quality of dependencies might be a better indicator, -->
<!-- and that requires a different tool.-->
<exclude name="TooManyMethods" />
<!-- See the explanation for TooManyMethods.-->
<exclude name="ExcessivePublicCount" />
<!-- Needs better understanding and proper configuration-->
<exclude name="StdCyclomaticComplexity" />
<!-- Needs better understanding and proper configuration-->
<exclude name="ModifiedCyclomaticComplexity" />
<!-- See the explanation for TooManyMethods.-->
<exclude name="ExcessiveParameterList" />
<!-- Too abstract rule -->
<exclude name="CyclomaticComplexity" />
</rule>

<rule ref="rulesets/java/design.xml">
<!-- Sometimes important to avoid "DOS attack" but not as a general rule-->
<exclude name="AvoidSynchronizedAtMethodLevel" />
<!-- It's just extra effort to write and read the final keyword-->
<exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal" />
<!-- Maybe good idea if PMD could exclude null checks from this-->
<exclude name="ConfusingTernary" />
<!-- Statistical analysis is prone to givin false positives. Potential god classes-->
<!-- most probably violate something else, too.-->
<!-- And dependency analysis tools also help here.-->
<exclude name="GodClass" />
<!-- Switch is sometimes very readable-->
<exclude name="TooFewBranchesForASwitchStatement"/>
<!-- A static utility is a static utility even if it masquerades as something-->
<!-- else by using the Singleton pattern-->
<exclude name="UseUtilityClass" />
<!-- This is good advice, but since it's violated so much in this project-->
<!-- and the problem is not big (especially with good syntax colouring),-->
<!-- we'll keep this ignored for now.-->
<exclude name="AvoidReassigningParameters" />
<!-- Good idea almost always, but not quite.-->
<!--<exclude name="ReturnEmptyArrayRatherThanNull" />-->
<!-- Sometimes one step at a time makes clearer code.-->
<!-- Debugging is also easier if the return value is in a variable.-->
<exclude name="UnnecessaryLocalBeforeReturn" />
<!-- There are valid reasons for passing arrays (making it nullable for example)-->
<exclude name="UseVarargs" />
<!-- TODO explain what false positives this gives-->
<exclude name="MissingBreakInSwitch" />
<!-- TODO enable when all findings have been fixed-->
<exclude name="UseLocaleWithCaseConversions" />
<!-- It gives a lot of warnings on 'equals' method, fixing would decrease readability-->
<exclude name="SimplifyBooleanReturns"/>
<!--Gives false positive-->
<exclude name="FieldDeclarationsShouldBeAtStartOfClass"/>
<!-- Good rule but in practice to often suppressed -->
<exclude name="PreserveStackTrace"/>

<exclude name="AccessorMethodGeneration"/>
<!-- remove it -->
<exclude name="NcssCount" />
</rule>
<rule ref="category/java/documentation.xml">
<exclude name="CommentSize" />

<rule ref="rulesets/java/migrating.xml">
<!-- The annotation is not as readable and there is no way to state which-->
<!-- line should throw the exception and with what message-->
<exclude name="JUnitUseExpected" />
<!-- Main code is not junit code-->
<exclude name="JUnit4TestShouldUseTestAnnotation" />
<!-- remove it -->
<exclude name="CommentRequired" />
</rule>

<rule ref="rulesets/java/naming.xml">
<!-- Often good to start name with Abstract, but on the other hand this-->
<!-- rule is a bit too much like Hungarian notation and I in interface names.-->
<!-- Who cares if it's abstract or not when you are using it?-->
<exclude name="AbstractNaming" />
<!-- Opinion, for me a getter is not a command, it's a declarative-->
<!-- data reference-->
<rule ref="category/java/errorprone.xml">
<exclude name="AvoidFieldNameMatchingTypeName" />
<exclude name="AvoidFieldNameMatchingMethodName" />
<!-- Why should generics not be named properly, like all other things-->
<!-- (well, except Windows filesystem roots)?-->
<exclude name="GenericsNaming" />
<!-- It can be long if it's the only way to make it good-->
<exclude name="LongVariable" />
<!-- It can be short if it's good-->
<exclude name="ShortVariable" />
<!-- TODO explain why.-->
<exclude name="BooleanGetMethodName" />
<!-- It can be short if it's good-->
<exclude name="ShortClassName" />
<!-- It can be short if it's good-->
<exclude name="ShortMethodName" />
</rule>

<rule ref="rulesets/java/optimizations.xml">
<!-- Too many false hits. Optimization can't be done with static analysis.
Besides, following this may encourage the antipattern of using too broad
scope for stuff: -->
<exclude name="AvoidInstantiatingObjectsInLoops" />
<!-- Good principle but too verbose in practice: -->
<exclude name="MethodArgumentCouldBeFinal" />
<!-- Good principle and maybe sometimes even practical but not in this
project: -->
<exclude name="LocalVariableCouldBeFinal" />
<exclude name="RedundantFieldInitializer" />
<exclude name="BeanMembersShouldSerialize" />
<exclude name="DataflowAnomalyAnalysis" />
<exclude name="MissingBreakInSwitch" />
</rule>

<rule ref="rulesets/java/strictexception.xml" >
<!-- NPE communicates very cleary what is happening, it is not-->
<!-- interesting who reports it (jvm or user code)-->
<exclude name="AvoidThrowingNullPointerException" />
<!-- TODO explain why-->
<exclude name="AvoidCatchingGenericException" />
<!-- TODO explain why-->
<exclude name="AvoidThrowingRawExceptionTypes" />
<!-- One valid case is to catch runtime, throw as such and after that-->
<!-- catch Exception and wrap as runtime.-->
<!-- Without the first all runtimes are unnecessarily wrapped.-->
<exclude name="AvoidRethrowingException" />
<!-- There are case which should throws generic exceptions -->
<exclude name="SignatureDeclareThrowsException" />
<rule ref="category/java/multithreading.xml">
</rule>

<rule ref="rulesets/java/strings.xml" >
<!-- Splitting to multiple lines is sometimes more readable.-->
<!-- Besides, where's the proof that it affects performance?-->
<exclude name="ConsecutiveAppendsShouldReuse" />
<rule ref="category/java/performance.xml">
<exclude name="AvoidUsingShortType" />
</rule>
</ruleset>
29 changes: 19 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ language: java
jdk:
- oraclejdk8

services:
- docker
install:
mvn --settings .settings.xml install -DskipTests=true -Dmaven.javadoc.skip=true -Dgpg.skip -B -V

# Install Erlang for integration tests
before_install:
before_script:
- wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
- sudo dpkg -i erlang-solutions_1.0_all.deb
- sudo apt-get update -qq
- sudo apt-get install erlang -y

install:
mvn --settings .settings.xml install -DskipTests=true -Dmaven.javadoc.skip=true -Dgpg.skip -B -V
- sudo apt-get install elixir git -y
- git clone https://github.com/appulse-projects/echo-service-elixir.git
- (cd echo-service-elixir/; mix escript.build)
- epmd -daemon
- echo-service-elixir/echo --cookie=secret --name=echo@localhost &

script:
mvn --settings .settings.xml clean verify -DskipTests=false -Dmaven.javadoc.skip=true -Dgpg.skip -B -U
Expand All @@ -31,9 +34,15 @@ deploy:
api_key:
secure: YL2RHLS+TRdlGdkOveqdKzfexAoWdl4kJscmQiR2upAs355F6oOpaNvqae3jMtjDwb4ES7iDJZ/36bBAaF4oAe3ArEvHi4gIRtzLX1EkS5SeA1s3wiAgctp5JFkyo4FyRUgpXWiIGO0XL+qxGSc36t9rLOOJEAtwgPtpEEGB2rIwoYTwMCENcfV+NebXa9Lo2RTS84BwX6BzpyJDO5ZXg4skHzXMrcNmQV/+raX7J1jaTY++AIk0MRKwIpkXRJ4ozHt+Gxl31NBWN53A8Tu0mC2IkZ/fmNbZEbd8pR6UVhy3z+TBljgLfSLfSOjN+1h+4WSAMvEYzwmaFUuH+cfhhJesvjiw11o35+5wq189PK1h+Dj/+o8cemhNOtL/88CDsj36AEQiXTukIPKLPScrln5Ux/Z9so0oA9RYsLPX/tZU1WHak4S4lIcUlC2R3fDJEdNL6cf/bZIQXc9ld30qtlembOcx4aXnpLm64TR7UotppYTx4crs1GSTftqArfs/xSG4lmOuf2qW+Eyb1pZmycNzWo+K/RKCbcY9ep5dYnPyFTeY11EKLJK0FLQd2V0Q5NHpM6KjILA7bS8OpHVGsc4N9TawUCE2aokThbXJsPQE1K8Ya/Kaj9FdnlkQQrm5JkxsEJi+LXebWqLNACCOMhH4nYxDuMyMBUy1/OA+IZo=
file:
- "target/encon-java-$project_version.jar"
- "target/encon-java-$project_version-javadoc.jar"
- "target/encon-java-$project_version-sources.jar"
- "encon-common/target/core-$project_version.jar"
- "encon-common/target/core-$project_version-javadoc.jar"
- "encon-common/target/core-$project_version-sources.jar"
- "encon-terms/target/core-$project_version.jar"
- "encon-terms/target/core-$project_version-javadoc.jar"
- "encon-terms/target/core-$project_version-sources.jar"
- "encon/target/core-$project_version.jar"
- "encon/target/core-$project_version-javadoc.jar"
- "encon/target/core-$project_version-sources.jar"
skip_cleanup: true
on:
tags: true
Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

- Add code...
- Refactoring external and internal APIs.
- Speed-up serialization/deserialization.
- Provide more custom exceptions.
- Review debug logs.
- Add `monitor` functionality.
- Make receive/handler approaches in `mailbox` mutually exclusive.
- Add tests.
- Split `protocol`, `module` and `config` on separate sub-projects.
- Rething caches in terms ans modules.

## [1.0.0](https://github.com/appulse-projects/encon-java/releases/tag/1.0.0) - 2018-05-01

Initial release.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ $> mvn clean compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.365 s
[INFO] Finished at: 2018-02-02T00:15:57+03:00
[INFO] Final Memory: 21M/248M
[INFO] Total time: 20.719 s
[INFO] Finished at: 2018-02-02T13:25:56+03:00
[INFO] Final Memory: 41M/380M
[INFO] ------------------------------------------------------------------------
```

Expand All @@ -54,7 +54,7 @@ $> mvn clean test
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0
[INFO]
...
```
Expand Down
Loading