Search in sources :

Example 1 with OperationType

use of io.atomix.primitive.operation.OperationType in project atomix by atomix.

the class PrimaryElectorServiceTest method newService.

PrimaryElectorService newService() {
    PrimaryElectorService elector = new PrimaryElectorService();
    elector.init(new ServiceContext() {

        @Override
        public PrimitiveId serviceId() {
            return PrimitiveId.from(1L);
        }

        @Override
        public String serviceName() {
            return "test-primary-elector";
        }

        @SuppressWarnings("rawtypes")
        @Override
        public PrimitiveType serviceType() {
            return PrimaryElectorType.instance();
        }

        @Override
        public MemberId localMemberId() {
            return null;
        }

        @Override
        public <C extends ServiceConfig> C serviceConfig() {
            return null;
        }

        @Override
        public long currentIndex() {
            return 0;
        }

        @Override
        public Session<?> currentSession() {
            return null;
        }

        @Override
        public OperationType currentOperation() {
            return null;
        }

        @Override
        public LogicalClock logicalClock() {
            return null;
        }

        @Override
        public WallClock wallClock() {
            return null;
        }
    });
    elector.tick(WallClockTimestamp.from(System.currentTimeMillis()));
    return elector;
}
Also used : ServiceContext(io.atomix.primitive.service.ServiceContext) LogicalClock(io.atomix.utils.time.LogicalClock) WallClock(io.atomix.utils.time.WallClock) MemberId(io.atomix.cluster.MemberId) PrimitiveType(io.atomix.primitive.PrimitiveType) OperationType(io.atomix.primitive.operation.OperationType) PrimitiveId(io.atomix.primitive.PrimitiveId) Session(io.atomix.primitive.session.Session)

Aggregations

MemberId (io.atomix.cluster.MemberId)1 PrimitiveId (io.atomix.primitive.PrimitiveId)1 PrimitiveType (io.atomix.primitive.PrimitiveType)1 OperationType (io.atomix.primitive.operation.OperationType)1 ServiceContext (io.atomix.primitive.service.ServiceContext)1 Session (io.atomix.primitive.session.Session)1 LogicalClock (io.atomix.utils.time.LogicalClock)1 WallClock (io.atomix.utils.time.WallClock)1