public class AsyncDataManager extends Object
| Constructor and Description |
|---|
AsyncDataManager() |
AsyncDataManager(AtomicLong storeSize) |
public static final int CONTROL_RECORD_MAX_LENGTH
public static final int ITEM_HEAD_RESERVED_SPACE
public static final int ITEM_HEAD_SPACE
public static final int ITEM_HEAD_OFFSET_TO_SOR
public static final int ITEM_FOOT_SPACE
public static final int ITEM_HEAD_FOOT_SPACE
public static final byte[] ITEM_HEAD_SOR
public static final byte[] ITEM_HEAD_EOR
public static final byte DATA_ITEM_TYPE
public static final byte REDO_ITEM_TYPE
public static final String DEFAULT_DIRECTORY
public static final String DEFAULT_ARCHIVE_DIRECTORY
public static final String DEFAULT_FILE_PREFIX
public static final int DEFAULT_MAX_FILE_LENGTH
public static final int DEFAULT_CLEANUP_INTERVAL
public static final int PREFERED_DIFF
protected final Map<DataFileAppender.WriteKey,DataFileAppender.WriteCommand> inflightWrites
protected File directoryArchive
protected String filePrefix
protected ControlFile controlFile
protected boolean started
protected boolean useNio
protected int maxFileLength
protected int preferedFileLength
protected org.apache.activemq.kaha.impl.async.DataFileAppender appender
protected DataFileAccessorPool accessorPool
protected Map<File,DataFile> fileByFileMap
protected DataFile currentWriteFile
protected final AtomicReference<Location> lastAppendLocation
protected Runnable cleanupTask
protected final AtomicLong storeSize
protected boolean archiveDataLogs
public AsyncDataManager(AtomicLong storeSize)
public AsyncDataManager()
public void start() throws IOException
IOExceptionpublic void lock() throws IOException
IOExceptionprotected Location recoveryCheck(DataFile dataFile, Location location) throws IOException
IOExceptionprotected void unmarshallState(ByteSequence sequence) throws IOException
IOExceptionpublic void removeLocation(Location location) throws IOException
IOExceptionpublic void close() throws IOException
IOExceptionpublic boolean delete() throws IOException
IOExceptionpublic void addInterestInFile(int file) throws IOException
IOExceptionpublic void removeInterestInFile(int file) throws IOException
IOExceptionpublic void consolidateDataFilesNotIn(Set<Integer> inUse, Set<Integer> inProgress) throws IOException
IOExceptionpublic void consolidateDataFilesNotIn(Set<Integer> inUse, Integer lastFile) throws IOException
IOExceptionpublic void consolidateDataFiles() throws IOException
IOExceptionpublic int getMaxFileLength()
public void setMaxFileLength(int maxFileLength)
maxFileLength - the maxFileLength to setpublic Location getMark() throws IllegalStateException
IllegalStateExceptionpublic Location getNextLocation(Location location) throws IOException, IllegalStateException
IOExceptionIllegalStateExceptionpublic Location getNextLocation(File file, Location lastLocation, boolean thisFileOnly) throws IllegalStateException, IOException
IllegalStateExceptionIOExceptionpublic Location getNextLocation(DataFile dataFile, Location lastLocation, boolean thisFileOnly) throws IOException, IllegalStateException
IOExceptionIllegalStateExceptionpublic ByteSequence read(Location location) throws IOException, IllegalStateException
IOExceptionIllegalStateExceptionpublic void setMark(Location location, boolean sync) throws IOException, IllegalStateException
IOExceptionIllegalStateExceptionprotected void storeState(boolean sync) throws IOException
IOExceptionpublic Location write(ByteSequence data, boolean sync) throws IOException, IllegalStateException
IOExceptionIllegalStateExceptionpublic Location write(ByteSequence data, Runnable onComplete) throws IOException, IllegalStateException
IOExceptionIllegalStateExceptionpublic Location write(ByteSequence data, byte type, boolean sync) throws IOException, IllegalStateException
IOExceptionIllegalStateExceptionpublic void update(Location location, ByteSequence data, boolean sync) throws IOException
IOExceptionpublic File getDirectory()
public void setDirectory(File directory)
public String getFilePrefix()
public void setFilePrefix(String filePrefix)
public Map<DataFileAppender.WriteKey,DataFileAppender.WriteCommand> getInflightWrites()
public Location getLastAppendLocation()
public void setLastAppendLocation(Location lastSyncedLocation)
public boolean isUseNio()
public void setUseNio(boolean useNio)
public File getDirectoryArchive()
public void setDirectoryArchive(File directoryArchive)
public boolean isArchiveDataLogs()
public void setArchiveDataLogs(boolean archiveDataLogs)
public Integer getCurrentDataFileId()
public Set<File> getFiles()
public long getDiskSize()
public long getDiskSizeUntil(Location startPosition)
Copyright © 2005–2017. All rights reserved.