@Override
    public LogFileScanStatus onFileChange(File logfile, boolean isNewFile) throws SQLException, IOException {
        LogFileStatus fileStatus  = getLogFile(logfile, isNewFile);
        long lastPointer = fileStatus.getLastPointer();
        int id = fileStatus.getId();
        String fileName = fileStatus.getFileName();
        // 3. read log.
        EventMiner miner = EventMiner.getINSTANCE().setCurrentFileName(fileName)
                .setLastPointer(lastPointer);
        int i=0;
        boolean hasNext = miner.hasNext();
        if(!hasNext && !logfile.getAbsolutePath().equals(fileName)) {
            return LogFileScanStatus.CONTINUE_NEXT;
        }
        while(miner.hasNext()) {
            Event event = miner.next();
            event = EventParsers.parse(event);
            boolean isStopEvent = event.getHeader().getEventType().equals(LogEventType.STOP);
            if(i == 100 || isStopEvent) {
                lastPointer = miner.getLastPointer();
                CdDao.updateLogFileStatus(id, lastPointer);
            }
            if(isStopEvent) {
                return LogFileScanStatus.STOP;
            }
            eventProcessor.processEvent(event);
            i++;
        }
        lastPointer = miner.getLastPointer();
        CdDao.updateLogFileStatus(id, lastPointer);
        miner.release();
        return LogFileScanStatus.SUCCESS;
    }