mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-05 04:06:49 +02:00
Upgrade to Atomix 2.0.18
Change-Id: I433e8b85d5aad007531c24495dd8298aeef9f79e
This commit is contained in:
parent
2d1b590ba3
commit
4ce65e8f8e
@ -69,7 +69,7 @@
|
||||
<dependency>
|
||||
<groupId>io.atomix</groupId>
|
||||
<artifactId>atomix</artifactId>
|
||||
<version>2.0.16</version>
|
||||
<version>2.0.18</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@ -206,8 +206,8 @@ public class StoragePartitionServer implements Managed<StoragePartitionServer> {
|
||||
.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)
|
||||
|
||||
@ -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 @@ public class AtomixAtomicCounterMapServiceTest {
|
||||
.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<>(
|
||||
|
||||
@ -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 @@ public class AtomixConsistentMapServiceTest {
|
||||
.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<>(
|
||||
|
||||
@ -18,7 +18,6 @@ package org.onosproject.store.primitives.resources.impl;
|
||||
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 @@ public class AtomixConsistentSetMultimapServiceTest {
|
||||
.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<>(
|
||||
|
||||
@ -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 @@ public class AtomixCounterServiceTest {
|
||||
.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<>(
|
||||
|
||||
@ -20,6 +20,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
||||
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 @@ public class AtomixDistributedLockServiceTest {
|
||||
.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);
|
||||
|
||||
|
||||
@ -17,7 +17,6 @@ package org.onosproject.store.primitives.resources.impl;
|
||||
|
||||
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 @@ public class AtomixDocumentTreeServiceTest {
|
||||
.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<>(
|
||||
|
||||
@ -34,7 +34,6 @@ import io.atomix.storage.StorageLevel;
|
||||
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 @@ public class AtomixLeaderElectorServiceTest {
|
||||
.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));
|
||||
|
||||
@ -37,7 +37,6 @@ import io.atomix.storage.StorageLevel;
|
||||
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 @@ public class AtomixWorkQueueServiceTest {
|
||||
.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));
|
||||
|
||||
@ -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>
|
||||
|
||||
|
||||
10
lib/BUCK
10
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 (
|
||||
|
||||
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' ],
|
||||
)
|
||||
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -39,5 +39,6 @@ fi
|
||||
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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user