public void seek(int logNameIndex, int startPosition) {
        try {
            currentLog.out.close();
            int maxIndex = currentLog.logNameIndex;
            while (maxIndex > logNameIndex) {
                boolean result = new File(logDir, String.valueOf(maxIndex)).delete();
                maxIndex--;
            }
            File newFile = File.createTempFile("storm", "tmp");
            newFile.delete();
            new File(logDir, String.valueOf(logNameIndex)).renameTo(newFile);
            currentLog = new CurrentLog(logDir, logNameIndex, 0, userRecordCount);
            DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(newFile)));
            while(true){
                T record = (T) readMethod.invoke(0, in);
                int thisStartPosition =in.readInt(); //startPostion
                in.readInt();// sycn postion
                if(thisStartPosition==startPosition){
                    break;
                }
                append(record);
//                record.writeTo(currentLog.out);
            }
            in.close();
            newFile.delete();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }