public void append(T record) {
        try {
            if (currentLog.out.size() > 128 * 1024 * 1024) {
                currentLog.out.close();
                currentLog = new CurrentLog(logDir, ++currentLog.logNameIndex, 0, userRecordCount);
            }
            AtomicInteger count = userRecordCount.get(record.getImsi());
            if (count == null) {
                count = new AtomicInteger(-1);
                userRecordCount.put(record.getImsi(), count);
            }
//        record.setSync(false);
            record.setSync((count.incrementAndGet() & 127) == 0); //等效于(count.incrementAndGet() % 128) == 0
            int size = currentLog.out.size();
            record.writeTo(currentLog.out);
            currentLog.out.writeInt(size);
            if (size - currentLog.syncPositon > 8 * 1024 * 1024) {
                currentLog.syncPositon = size;
            }
            currentLog.out.writeInt(currentLog.syncPositon);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }