public final class DataManagerImpl extends Object implements DataManager
Modifier and Type | Field and Description |
---|---|
static byte |
DATA_ITEM_TYPE |
static int |
ITEM_HEAD_SIZE |
static long |
MAX_FILE_LENGTH |
static byte |
REDO_ITEM_TYPE |
Constructor and Description |
---|
DataManagerImpl(File dir,
String name,
AtomicLong storeSize) |
Modifier and Type | Method and Description |
---|---|
void |
addInterestInFile(int file) |
void |
close() |
void |
consolidateDataFiles() |
protected SyncDataFileReader |
createReader() |
boolean |
delete() |
void |
force() |
long |
getMaxFileLength() |
String |
getName() |
SyncDataFileReader |
getReader() |
Marshaller |
getRedoMarshaller() |
SyncDataFileWriter |
getWriter() |
Object |
readItem(Marshaller marshaller,
StoreLocation item) |
void |
recoverRedoItems(RedoListener listener) |
void |
removeInterestInFile(int file) |
void |
setMaxFileLength(long maxFileLength) |
void |
setReader(SyncDataFileReader reader) |
void |
setRedoMarshaller(Marshaller redoMarshaller) |
void |
setWriter(SyncDataFileWriter writer) |
StoreLocation |
storeDataItem(Marshaller marshaller,
Object payload) |
StoreLocation |
storeRedoItem(Object payload) |
String |
toString() |
void |
updateItem(StoreLocation location,
Marshaller marshaller,
Object payload) |
public static final int ITEM_HEAD_SIZE
public static final byte DATA_ITEM_TYPE
public static final byte REDO_ITEM_TYPE
public static final long MAX_FILE_LENGTH
public DataManagerImpl(File dir, String name, AtomicLong storeSize)
public String getName()
getName
in interface DataManager
public Object readItem(Marshaller marshaller, StoreLocation item) throws IOException
readItem
in interface DataManager
IOException
public StoreLocation storeDataItem(Marshaller marshaller, Object payload) throws IOException
storeDataItem
in interface DataManager
IOException
public StoreLocation storeRedoItem(Object payload) throws IOException
storeRedoItem
in interface DataManager
IOException
public void updateItem(StoreLocation location, Marshaller marshaller, Object payload) throws IOException
updateItem
in interface DataManager
IOException
public void recoverRedoItems(RedoListener listener) throws IOException
recoverRedoItems
in interface DataManager
IOException
public void close() throws IOException
close
in interface DataManager
IOException
public void force() throws IOException
force
in interface DataManager
IOException
public boolean delete() throws IOException
delete
in interface DataManager
IOException
public void addInterestInFile(int file) throws IOException
addInterestInFile
in interface DataManager
IOException
public void removeInterestInFile(int file) throws IOException
removeInterestInFile
in interface DataManager
IOException
public void consolidateDataFiles() throws IOException
consolidateDataFiles
in interface DataManager
IOException
public Marshaller getRedoMarshaller()
getRedoMarshaller
in interface DataManager
public void setRedoMarshaller(Marshaller redoMarshaller)
setRedoMarshaller
in interface DataManager
public long getMaxFileLength()
public void setMaxFileLength(long maxFileLength)
maxFileLength
- the maxFileLength to setpublic SyncDataFileReader getReader()
protected SyncDataFileReader createReader()
public void setReader(SyncDataFileReader reader)
public SyncDataFileWriter getWriter()
public void setWriter(SyncDataFileWriter writer)
Copyright © 2005–2015 The Apache Software Foundation. All rights reserved.