in ratis-logservice/src/main/java/org/apache/ratis/logservice/server/LogStateMachine.java [151:177]
public void initialize(RaftServer server, RaftGroupId groupId,
RaftStorage raftStorage) throws IOException {
super.initialize(server, groupId, raftStorage);
this.storage.init(raftStorage);
this.proxy = server;
//TODO: using groupId for metric now but better to tag it with LogName
this.logServiceMetrics = new LogServiceMetrics(groupId.toString(),
server.getId().toString());
this.readNextQueryTimer = logServiceMetrics.getTimer("readNextQueryTime");
this.startIndexTimer= logServiceMetrics.getTimer("startIndexTime");
this.sizeRequestTimer = logServiceMetrics.getTimer("sizeRequestTime");
this.getStateTimer = logServiceMetrics.getTimer("getStateTime");
this.lastIndexQueryTimer = logServiceMetrics.getTimer("lastIndexQueryTime");
this.lengthQueryTimer = logServiceMetrics.getTimer("lengthQueryTime");
this.syncRequesTimer = logServiceMetrics.getTimer("syncRequesTime");
this.appendRequestTimer = logServiceMetrics.getTimer("appendRequestTime");
this.getCloseLogTimer = logServiceMetrics.getTimer("getCloseLogTime");
//archiving request time not the actual archiving time
this.archiveLogRequestTimer = logServiceMetrics.getTimer("archiveLogRequestTime");
this.archiveLogTimer = logServiceMetrics.getTimer("archiveLogTime");
loadSnapshot(storage.getLatestSnapshot());
executorService = Executors.newSingleThreadExecutor();
this.archivalInfo =
new ArchivalInfo(properties.get(Constants.LOG_SERVICE_ARCHIVAL_LOCATION_KEY));
}