private void snapshotService ( SnapshotWriter writer , RaftServiceContext service ) { writer . writeLong ( service . serviceId ( ) . id ( ) ) ; writer . writeString ( service . serviceType ( ) . name ( ) ) ; writer . writeString ( service . serviceName ( ) ) ; byte [ ] config = Serializer . using ( service . serviceType ( ) . namespace ( ) ) . encode ( service . serviceConfig ( ) ) ; writer . writeInt ( config . length ) . writeBytes ( config ) ; try { service . takeSnapshot ( writer ) ; } catch ( Exception e ) { logger . error ( "Failed to take snapshot of service {}" , service . serviceId ( ) , e ) ; } }
Takes a snapshot of the given service .