Upgrade to Atomix 2.0.18
Change-Id: I433e8b85d5aad007531c24495dd8298aeef9f79e
diff --git a/core/store/primitives/pom.xml b/core/store/primitives/pom.xml
index ad29c36..aaa9bdf 100644
--- a/core/store/primitives/pom.xml
+++ b/core/store/primitives/pom.xml
@@ -69,7 +69,7 @@
<dependency>
<groupId>io.atomix</groupId>
<artifactId>atomix</artifactId>
- <version>2.0.16</version>
+ <version>2.0.18</version>
</dependency>
<dependency>
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 1b201cd..eb48f66 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
@@ -206,8 +206,8 @@
.withElectionThreshold(ELECTION_THRESHOLD)
.withStorage(RaftStorage.newBuilder()
.withPrefix(String.format("partition-%s", partition.getId()))
- .withStorageLevel(StorageLevel.DISK)
- .withFlushOnCommit()
+ .withStorageLevel(StorageLevel.MAPPED)
+ .withFlushOnCommit(false)
.withSerializer(new AtomixSerializerAdapter(Serializer.using(StorageNamespaces.RAFT_STORAGE)))
.withDirectory(partition.getDataFolder())
.withMaxSegmentSize(MAX_SEGMENT_SIZE)
diff --git a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixAtomicCounterMapServiceTest.java b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixAtomicCounterMapServiceTest.java
index 698f015..9d58758 100644
--- a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixAtomicCounterMapServiceTest.java
+++ b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixAtomicCounterMapServiceTest.java
@@ -15,7 +15,6 @@
*/
package org.onosproject.store.primitives.resources.impl;
-import io.atomix.protocols.raft.service.ServiceId;
import io.atomix.protocols.raft.service.impl.DefaultCommit;
import io.atomix.protocols.raft.session.impl.RaftSessionContext;
import io.atomix.protocols.raft.storage.RaftStorage;
@@ -42,7 +41,7 @@
.withPrefix("test")
.withStorageLevel(StorageLevel.MEMORY)
.build());
- Snapshot snapshot = store.newSnapshot(ServiceId.from(1), "test", 2, new WallClockTimestamp());
+ Snapshot snapshot = store.newSnapshot(2, new WallClockTimestamp());
AtomixAtomicCounterMapService service = new AtomixAtomicCounterMapService();
service.put(new DefaultCommit<>(
diff --git a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentMapServiceTest.java b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentMapServiceTest.java
index 09ac5ec..c292959 100644
--- a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentMapServiceTest.java
+++ b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentMapServiceTest.java
@@ -15,7 +15,6 @@
*/
package org.onosproject.store.primitives.resources.impl;
-import io.atomix.protocols.raft.service.ServiceId;
import io.atomix.protocols.raft.service.impl.DefaultCommit;
import io.atomix.protocols.raft.session.impl.RaftSessionContext;
import io.atomix.protocols.raft.storage.RaftStorage;
@@ -46,7 +45,7 @@
.withPrefix("test")
.withStorageLevel(StorageLevel.MEMORY)
.build());
- Snapshot snapshot = store.newSnapshot(ServiceId.from(1), "test", 2, new WallClockTimestamp());
+ Snapshot snapshot = store.newSnapshot(2, new WallClockTimestamp());
AtomixConsistentMapService service = new AtomixConsistentMapService();
service.put(new DefaultCommit<>(
diff --git a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentSetMultimapServiceTest.java b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentSetMultimapServiceTest.java
index 66173d0..f9418a4 100644
--- a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentSetMultimapServiceTest.java
+++ b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentSetMultimapServiceTest.java
@@ -18,7 +18,6 @@
import java.util.Collection;
import java.util.Collections;
-import io.atomix.protocols.raft.service.ServiceId;
import io.atomix.protocols.raft.service.impl.DefaultCommit;
import io.atomix.protocols.raft.session.impl.RaftSessionContext;
import io.atomix.protocols.raft.storage.RaftStorage;
@@ -50,7 +49,7 @@
.withPrefix("test")
.withStorageLevel(StorageLevel.MEMORY)
.build());
- Snapshot snapshot = store.newSnapshot(ServiceId.from(1), "test", 2, new WallClockTimestamp());
+ Snapshot snapshot = store.newSnapshot(2, new WallClockTimestamp());
AtomixConsistentSetMultimapService service = new AtomixConsistentSetMultimapService();
service.put(new DefaultCommit<>(
diff --git a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixCounterServiceTest.java b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixCounterServiceTest.java
index fa7161f..4dd4148 100644
--- a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixCounterServiceTest.java
+++ b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixCounterServiceTest.java
@@ -15,7 +15,6 @@
*/
package org.onosproject.store.primitives.resources.impl;
-import io.atomix.protocols.raft.service.ServiceId;
import io.atomix.protocols.raft.service.impl.DefaultCommit;
import io.atomix.protocols.raft.session.impl.RaftSessionContext;
import io.atomix.protocols.raft.storage.RaftStorage;
@@ -42,7 +41,7 @@
.withPrefix("test")
.withStorageLevel(StorageLevel.MEMORY)
.build());
- Snapshot snapshot = store.newSnapshot(ServiceId.from(1), "test", 2, new WallClockTimestamp());
+ Snapshot snapshot = store.newSnapshot(2, new WallClockTimestamp());
AtomixCounterService service = new AtomixCounterService();
service.set(new DefaultCommit<>(
diff --git a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixDistributedLockServiceTest.java b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixDistributedLockServiceTest.java
index 69942a7..fb92eba 100644
--- a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixDistributedLockServiceTest.java
+++ b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixDistributedLockServiceTest.java
@@ -20,6 +20,7 @@
import io.atomix.protocols.raft.ReadConsistency;
import io.atomix.protocols.raft.cluster.MemberId;
import io.atomix.protocols.raft.impl.RaftContext;
+import io.atomix.protocols.raft.impl.RaftServiceManager;
import io.atomix.protocols.raft.operation.OperationType;
import io.atomix.protocols.raft.protocol.RaftServerProtocol;
import io.atomix.protocols.raft.service.ServiceId;
@@ -55,19 +56,21 @@
.withPrefix("test")
.withStorageLevel(StorageLevel.MEMORY)
.build());
- Snapshot snapshot = store.newSnapshot(ServiceId.from(1), "test", 2, new WallClockTimestamp());
+ Snapshot snapshot = store.newSnapshot(2, new WallClockTimestamp());
AtomicLong index = new AtomicLong();
DefaultServiceContext context = mock(DefaultServiceContext.class);
expect(context.serviceType()).andReturn(ServiceType.from(LEADER_ELECTOR.name())).anyTimes();
expect(context.serviceName()).andReturn("test").anyTimes();
expect(context.serviceId()).andReturn(ServiceId.from(1)).anyTimes();
- expect(context.executor()).andReturn(mock(ThreadContext.class)).anyTimes();
expect(context.currentIndex()).andReturn(index.get()).anyTimes();
expect(context.currentOperation()).andReturn(OperationType.COMMAND).anyTimes();
RaftContext server = mock(RaftContext.class);
- expect(server.getProtocol()).andReturn(mock(RaftServerProtocol.class));
+ expect(server.getProtocol()).andReturn(mock(RaftServerProtocol.class)).anyTimes();
+ RaftServiceManager manager = mock(RaftServiceManager.class);
+ expect(manager.executor()).andReturn(mock(ThreadContext.class)).anyTimes();
+ expect(server.getServiceManager()).andReturn(manager).anyTimes();
replay(context, server);
diff --git a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixDocumentTreeServiceTest.java b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixDocumentTreeServiceTest.java
index fd92e2b..21c5621 100644
--- a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixDocumentTreeServiceTest.java
+++ b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixDocumentTreeServiceTest.java
@@ -17,7 +17,6 @@
import java.util.Optional;
-import io.atomix.protocols.raft.service.ServiceId;
import io.atomix.protocols.raft.service.impl.DefaultCommit;
import io.atomix.protocols.raft.session.impl.RaftSessionContext;
import io.atomix.protocols.raft.storage.RaftStorage;
@@ -59,7 +58,7 @@
.withPrefix("test")
.withStorageLevel(StorageLevel.MEMORY)
.build());
- Snapshot snapshot = store.newSnapshot(ServiceId.from(1), "test", 2, new WallClockTimestamp());
+ Snapshot snapshot = store.newSnapshot(2, new WallClockTimestamp());
AtomixDocumentTreeService service = new AtomixDocumentTreeService(ordering);
service.update(new DefaultCommit<>(
diff --git a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixLeaderElectorServiceTest.java b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixLeaderElectorServiceTest.java
index e422436..4f7aa72 100644
--- a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixLeaderElectorServiceTest.java
+++ b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixLeaderElectorServiceTest.java
@@ -34,7 +34,6 @@
import io.atomix.time.WallClockTimestamp;
import io.atomix.utils.concurrent.AtomixThreadFactory;
import io.atomix.utils.concurrent.SingleThreadContextFactory;
-import io.atomix.utils.concurrent.ThreadContext;
import org.junit.Test;
import org.onosproject.cluster.Leadership;
import org.onosproject.cluster.NodeId;
@@ -58,13 +57,12 @@
.withPrefix("test")
.withStorageLevel(StorageLevel.MEMORY)
.build());
- Snapshot snapshot = store.newSnapshot(ServiceId.from(1), "test", 2, new WallClockTimestamp());
+ Snapshot snapshot = store.newSnapshot(2, new WallClockTimestamp());
DefaultServiceContext context = mock(DefaultServiceContext.class);
expect(context.serviceType()).andReturn(ServiceType.from(LEADER_ELECTOR.name())).anyTimes();
expect(context.serviceName()).andReturn("test").anyTimes();
expect(context.serviceId()).andReturn(ServiceId.from(1)).anyTimes();
- expect(context.executor()).andReturn(mock(ThreadContext.class)).anyTimes();
RaftContext server = mock(RaftContext.class);
expect(server.getProtocol()).andReturn(mock(RaftServerProtocol.class));
diff --git a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixWorkQueueServiceTest.java b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixWorkQueueServiceTest.java
index 2529523..fdc1d97 100644
--- a/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixWorkQueueServiceTest.java
+++ b/core/store/primitives/src/test/java/org/onosproject/store/primitives/resources/impl/AtomixWorkQueueServiceTest.java
@@ -37,7 +37,6 @@
import io.atomix.time.WallClockTimestamp;
import io.atomix.utils.concurrent.AtomixThreadFactory;
import io.atomix.utils.concurrent.SingleThreadContextFactory;
-import io.atomix.utils.concurrent.ThreadContext;
import org.junit.Test;
import org.onosproject.store.service.Task;
@@ -61,13 +60,12 @@
.withPrefix("test")
.withStorageLevel(StorageLevel.MEMORY)
.build());
- Snapshot snapshot = store.newSnapshot(ServiceId.from(1), "test", 2, new WallClockTimestamp());
+ Snapshot snapshot = store.newSnapshot(2, new WallClockTimestamp());
DefaultServiceContext context = mock(DefaultServiceContext.class);
expect(context.serviceType()).andReturn(ServiceType.from(WORK_QUEUE.name())).anyTimes();
expect(context.serviceName()).andReturn("test").anyTimes();
expect(context.serviceId()).andReturn(ServiceId.from(1)).anyTimes();
- expect(context.executor()).andReturn(mock(ThreadContext.class)).anyTimes();
RaftContext server = mock(RaftContext.class);
expect(server.getProtocol()).andReturn(mock(RaftServerProtocol.class));
diff --git a/features/features.xml b/features/features.xml
index d591fce..e538d9f 100644
--- a/features/features.xml
+++ b/features/features.xml
@@ -59,7 +59,7 @@
<bundle>mvn:com.typesafe/config/1.2.1</bundle>
<bundle>mvn:com.googlecode.concurrent-trees/concurrent-trees/2.6.0</bundle>
<bundle>mvn:commons-io/commons-io/2.4</bundle>
- <bundle>mvn:io.atomix/atomix/2.0.16</bundle>
+ <bundle>mvn:io.atomix/atomix/2.0.18</bundle>
<bundle>mvn:org.glassfish.jersey.core/jersey-client/2.25.1</bundle>
diff --git a/lib/BUCK b/lib/BUCK
index ea4683b..8021a3d 100644
--- a/lib/BUCK
+++ b/lib/BUCK
@@ -1,4 +1,4 @@
-# ***** This file was auto-generated at Wed, 14 Feb 2018 23:03:52 GMT. Do not edit this file manually. *****
+# ***** This file was auto-generated at Fri, 16 Feb 2018 17:18:31 GMT. Do not edit this file manually. *****
# ***** Use onos-lib-gen *****
pass_thru_pom(
@@ -207,10 +207,10 @@
remote_jar (
name = 'atomix',
- out = 'atomix-2.0.16.jar',
- url = 'mvn:io.atomix:atomix:jar:2.0.16',
- sha1 = '17cf962384a7cfae95623af1ef861f1c052eb34b',
- maven_coords = 'io.atomix:atomix:2.0.16',
+ out = 'atomix-2.0.18.jar',
+ url = 'mvn:io.atomix:atomix:jar:2.0.18',
+ sha1 = 'e5a9ea68155a7c97c591a4c40d608bf5f80e5c73',
+ maven_coords = 'io.atomix:atomix:2.0.18',
visibility = [ 'PUBLIC' ],
)
diff --git a/lib/deps.json b/lib/deps.json
index 9b3e1a9..ede7521 100644
--- a/lib/deps.json
+++ b/lib/deps.json
@@ -116,7 +116,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.16",
+ "atomix": "mvn:io.atomix:atomix:2.0.18",
"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",
diff --git a/tools/test/bin/onos-fetch-db b/tools/test/bin/onos-fetch-db
index 0073465..b25adbf 100755
--- a/tools/test/bin/onos-fetch-db
+++ b/tools/test/bin/onos-fetch-db
@@ -39,5 +39,6 @@
for node in $nodes; do
echo "fetching from ${node}..."
mkdir -p ${node}
- scp -p -r $ONOS_USER@${node}:$ONOS_INSTALL_DIR/karaf/data/db/partitions/* ./${node}/
+ scp -p -r $ONOS_USER@${node}:$ONOS_INSTALL_DIR/karaf/data/partitions/* ./${node}/
done
+