org.hornetq.core.asyncio
Interface AsynchronousFile

All Known Implementing Classes:
AsynchronousFileImpl

public interface AsynchronousFile

Author:
clebert.suconic@jboss.com

Method Summary
 void close()
           
 void fill(long position, int blocks, long size, byte fillChar)
           
 int getBlockSize()
           
 java.lang.String getFileName()
           
 void open(java.lang.String fileName, int maxIO)
          Note: If you are using a native Linux implementation, maxIO can't be higher than what's defined on /proc/sys/fs/aio-max-nr, or you would get an error
 void read(long position, long size, java.nio.ByteBuffer directByteBuffer, AIOCallback aioCallback)
           
 void setBufferCallback(BufferCallback callback)
           
 long size()
          Warning: This function will perform a synchronous IO, probably translating to a fstat call
 void write(long position, long size, java.nio.ByteBuffer directByteBuffer, AIOCallback aioCallback)
          Any error will be reported on the callback interface
 

Method Detail

close

void close()
           throws java.lang.Exception
Throws:
java.lang.Exception

open

void open(java.lang.String fileName,
          int maxIO)
          throws HornetQException
Note: If you are using a native Linux implementation, maxIO can't be higher than what's defined on /proc/sys/fs/aio-max-nr, or you would get an error

Parameters:
fileName -
maxIO - The number of max concurrent asynchrnous IO operations. It has to be balanced between the size of your writes and the capacity of your disk.
Throws:
HornetQException

size

long size()
          throws HornetQException
Warning: This function will perform a synchronous IO, probably translating to a fstat call

Throws:
HornetQException

write

void write(long position,
           long size,
           java.nio.ByteBuffer directByteBuffer,
           AIOCallback aioCallback)
Any error will be reported on the callback interface


read

void read(long position,
          long size,
          java.nio.ByteBuffer directByteBuffer,
          AIOCallback aioCallback)
          throws HornetQException
Throws:
HornetQException

fill

void fill(long position,
          int blocks,
          long size,
          byte fillChar)
          throws HornetQException
Throws:
HornetQException

setBufferCallback

void setBufferCallback(BufferCallback callback)

getBlockSize

int getBlockSize()

getFileName

java.lang.String getFileName()


Copyright © 2009 Red Hat Inc. All Rights Reserved.