From 192012391ed4872a16075eeaeba7723841be4e47 Mon Sep 17 00:00:00 2001 From: Jordan Halterman Date: Tue, 12 Sep 2017 17:20:26 -0700 Subject: [PATCH] Upgrade Atomix dependency version to 2.0.2 Change-Id: I6559beff9cc49768aa07d7e08e84eabd96ecb862 --- core/store/primitives/pom.xml | 2 +- .../store/primitives/impl/StoragePartitionServer.java | 8 +++++++- features/features.xml | 2 +- lib/BUCK | 10 +++++----- lib/deps.json | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/core/store/primitives/pom.xml b/core/store/primitives/pom.xml index 544be38eed..88f30a5662 100644 --- a/core/store/primitives/pom.xml +++ b/core/store/primitives/pom.xml @@ -70,7 +70,7 @@ io.atomix atomix - 2.0.0 + 2.0.2 diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java index 60286859e5..36b854f65b 100644 --- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java +++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java @@ -16,6 +16,7 @@ package org.onosproject.store.primitives.impl; import java.io.File; +import java.time.Duration; import java.util.Collection; import java.util.concurrent.CompletableFuture; import java.util.function.Supplier; @@ -41,6 +42,9 @@ public class StoragePartitionServer implements Managed { private static final int MAX_ENTRIES_PER_LOG_SEGMENT = 32768; private static final int MAX_SEGMENT_SIZE = 1024 * 1024 * 64; + private static final long ELECTION_TIMEOUT_MILLIS = 2500; + private static final long HEARTBEAT_INTERVAL_MILLIS = 1000; + private final MemberId localMemberId; private final StoragePartition partition; private final Supplier protocol; @@ -98,8 +102,10 @@ public class StoragePartitionServer implements Managed { RaftServer.Builder builder = RaftServer.newBuilder(localMemberId) .withName("partition-" + partition.getId()) .withProtocol(protocol.get()) + .withElectionTimeout(Duration.ofMillis(ELECTION_TIMEOUT_MILLIS)) + .withHeartbeatInterval(Duration.ofMillis(HEARTBEAT_INTERVAL_MILLIS)) .withStorage(RaftStorage.newBuilder() - .withStorageLevel(StorageLevel.DISK) + .withStorageLevel(StorageLevel.MAPPED) .withSerializer(new AtomixSerializerAdapter(Serializer.using(StorageNamespaces.RAFT_STORAGE))) .withDirectory(dataFolder) .withMaxEntriesPerSegment(MAX_ENTRIES_PER_LOG_SEGMENT) diff --git a/features/features.xml b/features/features.xml index c95b3a9289..e920ab0364 100644 --- a/features/features.xml +++ b/features/features.xml @@ -59,7 +59,7 @@ mvn:com.typesafe/config/1.2.1 mvn:com.googlecode.concurrent-trees/concurrent-trees/2.6.0 mvn:commons-io/commons-io/2.4 - mvn:io.atomix/atomix/2.0.0 + mvn:io.atomix/atomix/2.0.2 mvn:org.glassfish.jersey.core/jersey-client/2.25.1 diff --git a/lib/BUCK b/lib/BUCK index 1ca9fbbdf3..c4d7137ed3 100644 --- a/lib/BUCK +++ b/lib/BUCK @@ -1,4 +1,4 @@ -# ***** This file was auto-generated at Sun, 3 Sep 2017 12:12:12 GMT. Do not edit this file manually. ***** +# ***** This file was auto-generated at Wed, 13 Sep 2017 00:20:11 GMT. Do not edit this file manually. ***** # ***** Use onos-lib-gen ***** pass_thru_pom( @@ -208,10 +208,10 @@ remote_jar ( remote_jar ( name = 'atomix', - out = 'atomix-2.0.0.jar', - url = 'mvn:io.atomix:atomix:jar:2.0.0', - sha1 = '44b1271a4a77d9831b000f2eedf52587969ae9fb', - maven_coords = 'io.atomix:atomix:2.0.0', + out = 'atomix-2.0.2.jar', + url = 'mvn:io.atomix:atomix:jar:2.0.2', + sha1 = '9b3b05af6337c35bc69922fb7b535c78f07a5f5b', + maven_coords = 'io.atomix:atomix:2.0.2', visibility = [ 'PUBLIC' ], ) diff --git a/lib/deps.json b/lib/deps.json index 7ed72bc016..b19991053f 100644 --- a/lib/deps.json +++ b/lib/deps.json @@ -118,7 +118,7 @@ "aopalliance-repackaged": "mvn:org.glassfish.hk2.external:aopalliance-repackaged:2.5.0-b32", "amqp-client": "mvn:com.rabbitmq:amqp-client:jar:3.6.1", "asm": "mvn:org.ow2.asm:asm:5.0.4", - "atomix": "mvn:io.atomix:atomix:2.0.0", + "atomix": "mvn:io.atomix:atomix:2.0.2", "commons-codec": "mvn:commons-codec:commons-codec:1.10", "commons-collections": "mvn:commons-collections:commons-collections:3.2.2", "commons-configuration": "mvn:commons-configuration:commons-configuration:1.10",