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 Scheduler scheduler
protected final Map<DataFileAppender.WriteKey,DataFileAppender.WriteCommand> inflightWrites
protected File directory
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 DataFile currentWriteFile
protected Location mark
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
IOException
public void lock() throws IOException
IOException
protected Location recoveryCheck(DataFile dataFile, Location location) throws IOException
IOException
protected void unmarshallState(ByteSequence sequence) throws IOException
IOException
public void removeLocation(Location location) throws IOException
IOException
public void close() throws IOException
IOException
public boolean delete() throws IOException
IOException
public void addInterestInFile(int file) throws IOException
IOException
public void removeInterestInFile(int file) throws IOException
IOException
public void consolidateDataFilesNotIn(Set<Integer> inUse, Set<Integer> inProgress) throws IOException
IOException
public void consolidateDataFilesNotIn(Set<Integer> inUse, Integer lastFile) throws IOException
IOException
public void consolidateDataFiles() throws IOException
IOException
public int getMaxFileLength()
public void setMaxFileLength(int maxFileLength)
maxFileLength
- the maxFileLength to setpublic Location getMark() throws IllegalStateException
IllegalStateException
public Location getNextLocation(Location location) throws IOException, IllegalStateException
IOException
IllegalStateException
public Location getNextLocation(File file, Location lastLocation, boolean thisFileOnly) throws IllegalStateException, IOException
IllegalStateException
IOException
public Location getNextLocation(DataFile dataFile, Location lastLocation, boolean thisFileOnly) throws IOException, IllegalStateException
IOException
IllegalStateException
public ByteSequence read(Location location) throws IOException, IllegalStateException
IOException
IllegalStateException
public void setMark(Location location, boolean sync) throws IOException, IllegalStateException
IOException
IllegalStateException
protected void storeState(boolean sync) throws IOException
IOException
public Location write(ByteSequence data, boolean sync) throws IOException, IllegalStateException
IOException
IllegalStateException
public Location write(ByteSequence data, Runnable onComplete) throws IOException, IllegalStateException
IOException
IllegalStateException
public Location write(ByteSequence data, byte type, boolean sync) throws IOException, IllegalStateException
IOException
IllegalStateException
public void update(Location location, ByteSequence data, boolean sync) throws IOException
IOException
public 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–2014 The Apache Software Foundation. All rights reserved.