com.timeindexing.io
Interface IndexFileWriter

All Known Subinterfaces:
IndexFileInteractor
All Known Implementing Classes:
AbstractFileIO, ExternalIndexIO, InlineIndexIO, ShadowIndexIO

public interface IndexFileWriter

An interface for writers of indexes.


Method Summary
 long close()
          Close the index.
 long create(IndexProperties indexProperties)
          create an Index
 long flush()
          Flush the index.
 long getAppendPosition()
          Get the append position
 java.nio.channels.FileLock getWriteLock()
          Get a write-lock on this index.
 boolean gotoAppendPosition()
          Goto the append position
 boolean isWriteLocked()
          Has the Index been write-locked.
 long open(IndexProperties indexProperties)
           
 boolean releaseWriteLock()
          Release a FileLock.
 long writeHeader(byte headerType)
          Write the header to the index.
 long writeItem(ManagedIndexItem item)
          Write an IndexItem to the index.
 

Method Detail

open

long open(IndexProperties indexProperties)
          throws java.io.IOException,
                 IndexOpenException
Throws:
java.io.IOException
IndexOpenException

create

long create(IndexProperties indexProperties)
            throws java.io.IOException,
                   IndexCreateException
create an Index

Throws:
java.io.IOException
IndexCreateException

writeHeader

long writeHeader(byte headerType)
                 throws java.io.IOException
Write the header to the index.

Parameters:
headerType - the type of header, e.g FileType.INLINE_INDEX or FileType.EXTERNAL_INDEX
Throws:
java.io.IOException

writeItem

long writeItem(ManagedIndexItem item)
               throws java.io.IOException
Write an IndexItem to the index.

Throws:
java.io.IOException

getAppendPosition

long getAppendPosition()
Get the append position


gotoAppendPosition

boolean gotoAppendPosition()
                           throws java.io.IOException
Goto the append position

Throws:
java.io.IOException

flush

long flush()
           throws java.io.IOException
Flush the index.

Throws:
java.io.IOException

close

long close()
           throws java.io.IOException
Close the index.

Throws:
java.io.IOException

getWriteLock

java.nio.channels.FileLock getWriteLock()
Get a write-lock on this index.


releaseWriteLock

boolean releaseWriteLock()
Release a FileLock.


isWriteLocked

boolean isWriteLocked()
Has the Index been write-locked.



Timeindexing 2008