Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Turn on checkstyle JavaDocs module.
- Add updates to the protocol, like new `ControlMessage`.
- Add Spring Boot support.
- Remove non blocking queues, because it doesn't guarantee the order.

## [1.5.0](https://github.com/appulse-projects/encon-java/releases/tag/1.5.0) - 2018-07-07

Remove non blocking queues, because it doesn't guarantee the order.

### Changed

- Replaced non-blocking queue to blocking.
- Edit docs.

### Removed

- Non-blocking queues.

## [1.4.0](https://github.com/appulse-projects/encon-java/releases/tag/1.4.0) - 2018-07-07

Expand Down
2 changes: 1 addition & 1 deletion encon-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ limitations under the License.
<parent>
<groupId>io.appulse.encon</groupId>
<artifactId>encon-parent</artifactId>
<version>1.4.0</version>
<version>1.5.0</version>
</parent>

<artifactId>encon-common</artifactId>
Expand Down
15 changes: 2 additions & 13 deletions encon-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ First of all, add config's dependency:
<dependency>
<groupId>io.appulse.encon</groupId>
<artifactId>encon-config</artifactId>
<version>1.4.0</version>
<version>1.5.0</version>
</dependency>
...
</dependencies>
Expand All @@ -23,7 +23,7 @@ First of all, add config's dependency:
**Gradle**:

```groovy
compile 'io.appulse.encon.java:encon-config:1.4.0'
compile 'io.appulse.encon.java:encon-config:1.5.0'
```

### File based configuration
Expand Down Expand Up @@ -57,8 +57,6 @@ defaults:
distribution-flags:
- MAP_TAG
- BIG_CREATION
mailbox:
blocking: false
server:
boss-threads: 2
worker-threads: 4
Expand Down Expand Up @@ -87,9 +85,7 @@ nodes:
- BIG_CREATION
mailboxes:
- name: net_kernel
blocking: false
- name: another
blocking: true
- name: another_one
server:
port: 8971
Expand All @@ -101,7 +97,6 @@ nodes:
cookie: popa
mailboxes:
- name: net_kernel
blocking: false

```

Expand All @@ -123,9 +118,6 @@ Config config = Config.builder()
MAP_TAG,
BIG_CREATION
)))
.mailbox(MailboxConfig.builder()
.blocking(false)
.build())
.server(ServerConfig.builder()
.bossThreads(2)
.workerThreads(4)
Expand All @@ -150,11 +142,9 @@ Config config = Config.builder()
.distributionFlag(BIG_CREATION)
.mailbox(MailboxConfig.builder()
.name("net_kernel")
.blocking(false)
.build())
.mailbox(MailboxConfig.builder()
.name("another")
.blocking(true)
.build())
.mailbox(MailboxConfig.builder()
.name("another")
Expand All @@ -171,7 +161,6 @@ Config config = Config.builder()
.cookie("popa")
.mailbox(MailboxConfig.builder()
.name("net_kernel")
.blocking(false)
.build())
.build()
)
Expand Down
2 changes: 1 addition & 1 deletion encon-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ limitations under the License.
<parent>
<groupId>io.appulse.encon</groupId>
<artifactId>encon-parent</artifactId>
<version>1.4.0</version>
<version>1.5.0</version>
</parent>

<artifactId>encon-config</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ static CompressionConfig newInstance (@NonNull Map<String, Object> map) {

Integer level;

/**
* Copy constructor.
*
* @param compressionConfig config to copy
*/
public CompressionConfig (CompressionConfig compressionConfig) {
enabled = compressionConfig.getEnabled();
level = compressionConfig.getLevel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ private static Map<String, Map<String, Object>> parseYaml (@NonNull File file) {

Map<String, NodeConfig> nodes;

/**
* Copy constructor.
*
* @param config config to copy
*/
public Config (Config config) {
defaults = ofNullable(config.getDefaults())
.map(Defaults::new)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import static io.appulse.epmd.java.core.model.Protocol.TCP;
import static io.appulse.epmd.java.core.model.Version.R6;
import static java.lang.Boolean.FALSE;
import static java.lang.Boolean.TRUE;
import static java.util.Arrays.asList;
import static java.util.Locale.ENGLISH;
import static java.util.Optional.ofNullable;
Expand Down Expand Up @@ -223,7 +222,6 @@ static Defaults newInstance (@NonNull Map<String, Object> map) {

@Builder.Default
MailboxConfig mailbox = MailboxConfig.builder()
.blocking(TRUE)
.build();

@Builder.Default
Expand All @@ -238,6 +236,11 @@ static Defaults newInstance (@NonNull Map<String, Object> map) {
.level(-1)
.build();

/**
* Copy constructor.
*
* @param defaults config to copy
*/
public Defaults (Defaults defaults) {
epmdPort = defaults.getEpmdPort();
type = defaults.getType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,18 @@ static MailboxConfig newInstance (@NonNull Map<String, Object> map) {
.map(Object::toString)
.ifPresent(builder::name);

ofNullable(map.get("blocking"))
.map(Object::toString)
.map(Boolean::valueOf)
.ifPresent(builder::blocking);

return builder.build();
}

String name;

Boolean blocking;

/**
* Copy constructor.
*
* @param mailboxConfig config for copying
*/
public MailboxConfig (MailboxConfig mailboxConfig) {
name = mailboxConfig.getName();
blocking = mailboxConfig.getBlocking();
}

/**
Expand All @@ -73,9 +70,6 @@ public MailboxConfig (MailboxConfig mailboxConfig) {
* @return reference to this object (for chain calls)
*/
public MailboxConfig withDefaultsFrom (@NonNull MailboxConfig defaults) {
blocking = ofNullable(blocking)
.orElse(defaults.getBlocking());

return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ static NodeConfig newInstance (@NonNull Map<String, Object> map) {

CompressionConfig compression;

/**
* Copy constructor.
*
* @param nodeConfig config to copy
*/
public NodeConfig (NodeConfig nodeConfig) {
epmdPort = nodeConfig.getEpmdPort();
type = nodeConfig.getType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ static ServerConfig newInstance (@NonNull Map<String, Object> map) {

Integer workerThreads;

/**
* Copy constructor.
*
* @param serverConfig config to copy
*/
public ServerConfig (ServerConfig serverConfig) {
port = serverConfig.getPort();
bossThreads = serverConfig.getBossThreads();
Expand Down
36 changes: 0 additions & 36 deletions encon-config/src/test/java/io/appulse/encon/config/ConfigTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ public void defaultDefaults () {
softly.assertThat(defaults.getMailbox())
.isNotNull();

softly.assertThat(defaults.getMailbox().getBlocking())
.isTrue();

softly.assertThat(defaults.getServer())
.isNotNull();

Expand Down Expand Up @@ -141,7 +138,6 @@ public void nonDefaultDefaults () {
.high(high)
.distributionFlags(distributionFlags)
.mailbox(MailboxConfig.builder()
.blocking(false)
.build())
.server(ServerConfig.builder()
.bossThreads(bossThreads)
Expand Down Expand Up @@ -181,9 +177,6 @@ public void nonDefaultDefaults () {
softly.assertThat(defaults.getMailbox())
.isNotNull();

softly.assertThat(defaults.getMailbox().getBlocking())
.isFalse();

softly.assertThat(defaults.getServer())
.isNotNull();

Expand Down Expand Up @@ -282,12 +275,6 @@ public void load () {
softly.assertThat(defaults.getDistributionFlags())
.contains(MAP_TAG, BIG_CREATION);

softly.assertThat(defaults.getMailbox())
.isNotNull();

softly.assertThat(defaults.getMailbox().getBlocking())
.isFalse();

softly.assertThat(defaults.getServer())
.isNotNull();

Expand Down Expand Up @@ -350,26 +337,20 @@ public void load () {
.findFirst()
.orElse(null);
assertThat(mailbox1).isNotNull();
softly.assertThat(mailbox1.getBlocking())
.isFalse();

MailboxConfig mailbox2 = node1.getMailboxes()
.stream()
.filter(it -> "another".equals(it.getName()))
.findFirst()
.orElse(null);
assertThat(mailbox2).isNotNull();
softly.assertThat(mailbox2.getBlocking())
.isTrue();

MailboxConfig mailbox3 = node1.getMailboxes()
.stream()
.filter(it -> "another_one".equals(it.getName()))
.findFirst()
.orElse(null);
assertThat(mailbox3).isNotNull();
softly.assertThat(mailbox3.getBlocking())
.isFalse();

softly.assertThat(node1.getServer())
.isNotNull();
Expand Down Expand Up @@ -423,8 +404,6 @@ public void load () {
.findFirst()
.orElse(null);
assertThat(mailbox1).isNotNull();
softly.assertThat(mailbox1.getBlocking())
.isFalse();

softly.assertThat(node2.getServer())
.isNotNull();
Expand Down Expand Up @@ -456,7 +435,6 @@ public void manual () {
BIG_CREATION
)))
.mailbox(MailboxConfig.builder()
.blocking(false)
.build())
.server(ServerConfig.builder()
.bossThreads(2)
Expand Down Expand Up @@ -485,11 +463,9 @@ public void manual () {
.name("net_kernel")
.build())
.mailbox(MailboxConfig.builder()
.blocking(true)
.build())
.mailbox(MailboxConfig.builder()
.name("another")
.blocking(false)
.build())
.server(ServerConfig.builder()
.port(8971)
Expand All @@ -502,7 +478,6 @@ public void manual () {
.cookie("popa")
.mailbox(MailboxConfig.builder()
.name("net_kernel")
.blocking(false)
.build())
.build()
)
Expand Down Expand Up @@ -541,9 +516,6 @@ public void manual () {
softly.assertThat(defaults.getMailbox())
.isNotNull();

softly.assertThat(defaults.getMailbox().getBlocking())
.isFalse();

softly.assertThat(defaults.getServer())
.isNotNull();

Expand Down Expand Up @@ -606,26 +578,20 @@ public void manual () {
.findFirst()
.orElse(null);
assertThat(mailbox1).isNotNull();
softly.assertThat(mailbox1.getBlocking())
.isFalse();

MailboxConfig mailbox2 = node1.getMailboxes()
.stream()
.filter(it -> it.getName() == null)
.findFirst()
.orElse(null);
assertThat(mailbox2).isNotNull();
softly.assertThat(mailbox2.getBlocking())
.isTrue();

MailboxConfig mailbox3 = node1.getMailboxes()
.stream()
.filter(it -> "another".equals(it.getName()))
.findFirst()
.orElse(null);
assertThat(mailbox3).isNotNull();
softly.assertThat(mailbox3.getBlocking())
.isFalse();

softly.assertThat(node1.getServer())
.isNotNull();
Expand Down Expand Up @@ -679,8 +645,6 @@ public void manual () {
.findFirst()
.orElse(null);
assertThat(mailbox1).isNotNull();
softly.assertThat(mailbox1.getBlocking())
.isFalse();

softly.assertThat(node2.getServer())
.isNotNull();
Expand Down
Loading