Search in sources :

Example 1 with PrimitiveId

use of io.atomix.primitive.PrimitiveId in project atomix by atomix.

the class RaftServiceManager method installService.

/**
 * Restores the service associated with the given snapshot.
 *
 * @param reader the snapshot reader
 */
private void installService(SnapshotReader reader) {
    PrimitiveId primitiveId = PrimitiveId.from(reader.readLong());
    PrimitiveType primitiveType = raft.getPrimitiveTypes().get(reader.readString());
    String serviceName = reader.readString();
    // Get or create the service associated with the snapshot.
    logger.debug("Installing service {} {}", primitiveId, serviceName);
    RaftServiceContext service = initializeService(primitiveId, primitiveType, serviceName);
    if (service != null) {
        service.installSnapshot(reader);
    }
}
Also used : RaftServiceContext(io.atomix.protocols.raft.service.RaftServiceContext) PrimitiveType(io.atomix.primitive.PrimitiveType) PrimitiveId(io.atomix.primitive.PrimitiveId)

Aggregations

PrimitiveId (io.atomix.primitive.PrimitiveId)1 PrimitiveType (io.atomix.primitive.PrimitiveType)1 RaftServiceContext (io.atomix.protocols.raft.service.RaftServiceContext)1