Class JDBCSequentialFile
java.lang.Object
org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFile
- All Implemented Interfaces:
SequentialFile
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetaData(Object key, Object value) voidblockingWriteDirect(ByteBuffer bytes, boolean sync, boolean releaseBuffer) Write directly to the file without using any intermediate buffer and wait completion.intcalculateBlockStart(int position) voidclose()voidclose(boolean waitOnSync, boolean block) When closing a file from a finalize block, you cant wait on syncs or anything like that. otherwise the VM may hung.voidcopyTo(SequentialFile cloneFile) voiddelete()booleanexists()voidfill(int size) booleanfits(int size) longgetId()Returns a nativeFileof the file underlying this sequential file.getMetaData(Object key) intbooleanisOpen()intjdbcWrite(ActiveMQBuffer buffer, IOCallback callback) intjdbcWrite(ActiveMQBuffer buffer, IOCallback callback, boolean append) map(int position, long size) voidopen()voidopen(int maxIO, boolean useExecutor) The maximum number of simultaneous writes acceptedlongposition()voidposition(long pos) intread(ByteBuffer bytes) Read the file.intread(ByteBuffer bytes, IOCallback callback) Read the file.voidvoidsendToDB(ActiveMQBuffer bytes, IOCallback callback, boolean append) voidsetId(long id) voidsetTimedBuffer(TimedBuffer buffer) longsize()voidsync()voidwrite(ActiveMQBuffer bytes, boolean sync) voidwrite(ActiveMQBuffer bytes, boolean sync, IOCallback callback) voidwrite(EncodingSupport bytes, boolean sync) voidwrite(EncodingSupport bytes, boolean sync, IOCallback callback) voidwriteDirect(ByteBuffer bytes, boolean sync) Write directly to the file without using intermediate any buffervoidwriteDirect(ByteBuffer bytes, boolean sync, IOCallback callback) Write directly to the file without using any bufferMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.io.SequentialFile
afterComplete
-
Method Details
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceSequentialFile
-
exists
public boolean exists()- Specified by:
existsin interfaceSequentialFile
-
open
- Specified by:
openin interfaceSequentialFile- Throws:
Exception
-
open
Description copied from interface:SequentialFileThe maximum number of simultaneous writes accepted- Specified by:
openin interfaceSequentialFile- Throws:
Exception
-
fits
public boolean fits(int size) - Specified by:
fitsin interfaceSequentialFile
-
calculateBlockStart
- Specified by:
calculateBlockStartin interfaceSequentialFile- Throws:
Exception
-
getFileName
- Specified by:
getFileNamein interfaceSequentialFile
-
fill
- Specified by:
fillin interfaceSequentialFile- Throws:
Exception
-
map
- Specified by:
mapin interfaceSequentialFile- Throws:
IOException
-
delete
- Specified by:
deletein interfaceSequentialFile- Throws:
IOExceptionInterruptedExceptionActiveMQException
-
jdbcWrite
-
jdbcWrite
-
sendToDB
- Throws:
Exception
-
write
- Specified by:
writein interfaceSequentialFile- Throws:
Exception
-
write
- Specified by:
writein interfaceSequentialFile- Throws:
Exception
-
write
- Specified by:
writein interfaceSequentialFile- Throws:
Exception
-
write
- Specified by:
writein interfaceSequentialFile- Throws:
Exception
-
writeDirect
Description copied from interface:SequentialFileWrite directly to the file without using any buffer- Specified by:
writeDirectin interfaceSequentialFile- Parameters:
bytes- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, use a buffer from the correspondingSequentialFileFactory.newBuffer(int).
-
blockingWriteDirect
Description copied from interface:SequentialFileWrite directly to the file without using any intermediate buffer and wait completion.If
releaseBufferistruethe providedbytesshould be released throughSequentialFileFactory.releaseBuffer(ByteBuffer), if supported.- Specified by:
blockingWriteDirectin interfaceSequentialFile- Parameters:
bytes- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). IfreleaseBufferistrueuse a buffer fromSequentialFileFactory.newBuffer(int),SequentialFileFactory.allocateDirectBuffer(int)otherwise.sync- iftruewill durable flush the written data on the file,falseotherwisereleaseBuffer- iftruewill release the buffer,falseotherwise
-
writeDirect
Description copied from interface:SequentialFileWrite directly to the file without using intermediate any buffer- Specified by:
writeDirectin interfaceSequentialFile- Parameters:
bytes- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, use a buffer from the correspondingSequentialFileFactory.newBuffer(int).- Throws:
Exception
-
read
Description copied from interface:SequentialFileRead the file.- Specified by:
readin interfaceSequentialFile- Parameters:
bytes- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, use a buffer from the correspondingSequentialFileFactory.newBuffer(int).- Throws:
SQLException
-
read
Description copied from interface:SequentialFileRead the file.- Specified by:
readin interfaceSequentialFile- Parameters:
bytes- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, use a buffer from the correspondingSequentialFileFactory.newBuffer(int).- Throws:
Exception
-
position
- Specified by:
positionin interfaceSequentialFile- Throws:
IOException
-
position
public long position()- Specified by:
positionin interfaceSequentialFile
-
close
- Specified by:
closein interfaceSequentialFile- Throws:
Exception
-
close
Description copied from interface:SequentialFileWhen closing a file from a finalize block, you cant wait on syncs or anything like that. otherwise the VM may hung. Especially on the testsuite.- Specified by:
closein interfaceSequentialFile- Throws:
Exception
-
getNetworkTimeoutMillis
public int getNetworkTimeoutMillis() -
sync
- Specified by:
syncin interfaceSequentialFile- Throws:
IOException
-
size
- Specified by:
sizein interfaceSequentialFile- Throws:
Exception
-
renameTo
- Specified by:
renameToin interfaceSequentialFile- Throws:
Exception
-
cloneFile
- Specified by:
cloneFilein interfaceSequentialFile
-
copyTo
- Specified by:
copyToin interfaceSequentialFile- Throws:
Exception
-
getId
public long getId() -
setId
public void setId(long id) -
getFilename
-
getExtension
-
setTimedBuffer
- Specified by:
setTimedBufferin interfaceSequentialFile
-
getJavaFile
Description copied from interface:SequentialFileReturns a nativeFileof the file underlying this sequential file.- Specified by:
getJavaFilein interfaceSequentialFile- Returns:
- a native
Fileof the file underlying this sequential file
-
addMetaData
-
getMetaData
-