1 /*- 2 * See the file LICENSE for redistribution information. 3 * 4 * Copyright (c) 2002, 2014 Oracle and/or its affiliates. All rights reserved. 5 * 6 */ 7 8 package com.sleepycat.je.log; 9 10 import java.io.IOException; 11 12 import com.sleepycat.je.DatabaseException; 13 import com.sleepycat.je.dbi.EnvironmentImpl; 14 15 public class FileManagerTestUtils { createLogFile(FileManager fileManager, EnvironmentImpl envImpl, long logFileSize)16 public static void createLogFile(FileManager fileManager, 17 EnvironmentImpl envImpl, 18 long logFileSize) 19 throws DatabaseException, IOException { 20 21 LogBuffer logBuffer = new LogBuffer(50, envImpl); 22 logBuffer.getDataBuffer().flip(); 23 fileManager.bumpLsn(logFileSize - FileManager.firstLogEntryOffset()); 24 logBuffer.registerLsn(fileManager.getLastUsedLsn()); 25 fileManager.writeLogBuffer(logBuffer, true); 26 fileManager.syncLogEndAndFinishFile(); 27 } 28 } 29