private void checkPoint() throws IOException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("checkpoint start"); } // 先将内容都强制刷到磁盘,因为后面会写头部汇总信息 if (fileLength != lastCheckPointLength) { fileChannel.force(true); lastCheckPointLength = fileLength; } if (LOGGER.isDebugEnabled()) { LOGGER.debug("checkpoint end: fileLength=" + fileLength); } }