org.compass.needle.gigaspaces.store
Class GigaSpaceDirectory

java.lang.Object
  extended by org.apache.lucene.store.Directory
      extended by org.compass.needle.gigaspaces.store.GigaSpaceDirectory

public class GigaSpaceDirectory
extends Directory

GigaSpace Directory is a Lucene directory built on top of GigaSpaces.

The direcotry implementation uses FileEntry as the meta data of a file written to the Space. And one or more FileBucketEntry to hold the entry data. Note, the bucket size can eb controlled during index creation, but if connecting to an existing index, the bucket index must be the same.

Author:
kimchy

Field Summary
static int DEFAULT_BUCKET_SIZE
           
static int DEFAULT_FLUSH_RATE
           
 
Fields inherited from class org.apache.lucene.store.Directory
lockFactory
 
Constructor Summary
GigaSpaceDirectory(org.openspaces.core.GigaSpace gigaSpace, String indexName)
           
GigaSpaceDirectory(com.j_spaces.core.IJSpace space, String indexName)
           
GigaSpaceDirectory(com.j_spaces.core.IJSpace space, String indexName, int bucketSize)
           
GigaSpaceDirectory(com.j_spaces.core.IJSpace space, String indexName, int bucketSize, int flushRate)
           
 
Method Summary
 void close()
          Does nothing since an already constructed Space is passes to this directory.
 IndexOutput createOutput(String fileName)
           
 void deleteContent()
           
 void deleteFile(String fileName)
           
 boolean fileExists(String fileName)
           
 long fileLength(String fileName)
           
 long fileModified(String fileName)
           
(package private)  int getBucketSize()
           
(package private)  int getFlushRate()
           
(package private)  String getIndexName()
           
(package private)  Map<String,IndexOutput> getOnGoingIndexOutputs()
           
 com.j_spaces.core.IJSpace getSpace()
           
 String[] list()
           
 IndexInput openInput(String fileName)
           
 void renameFile(String from, String to)
           
 void touchFile(String fileName)
           
 
Methods inherited from class org.apache.lucene.store.Directory
clearLock, copy, ensureOpen, getLockFactory, getLockID, makeLock, openInput, setLockFactory, sync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BUCKET_SIZE

public static final int DEFAULT_BUCKET_SIZE
See Also:
Constant Field Values

DEFAULT_FLUSH_RATE

public static final int DEFAULT_FLUSH_RATE
See Also:
Constant Field Values
Constructor Detail

GigaSpaceDirectory

public GigaSpaceDirectory(org.openspaces.core.GigaSpace gigaSpace,
                          String indexName)

GigaSpaceDirectory

public GigaSpaceDirectory(com.j_spaces.core.IJSpace space,
                          String indexName)

GigaSpaceDirectory

public GigaSpaceDirectory(com.j_spaces.core.IJSpace space,
                          String indexName,
                          int bucketSize)

GigaSpaceDirectory

public GigaSpaceDirectory(com.j_spaces.core.IJSpace space,
                          String indexName,
                          int bucketSize,
                          int flushRate)
Method Detail

deleteContent

public void deleteContent()
                   throws IOException
Throws:
IOException

getOnGoingIndexOutputs

Map<String,IndexOutput> getOnGoingIndexOutputs()

getSpace

public com.j_spaces.core.IJSpace getSpace()

getIndexName

String getIndexName()

getBucketSize

int getBucketSize()

getFlushRate

int getFlushRate()

deleteFile

public void deleteFile(String fileName)
                throws IOException
Specified by:
deleteFile in class Directory
Throws:
IOException

fileExists

public boolean fileExists(String fileName)
                   throws IOException
Specified by:
fileExists in class Directory
Throws:
IOException

fileLength

public long fileLength(String fileName)
                throws IOException
Specified by:
fileLength in class Directory
Throws:
IOException

fileModified

public long fileModified(String fileName)
                  throws IOException
Specified by:
fileModified in class Directory
Throws:
IOException

list

public String[] list()
              throws IOException
Specified by:
list in class Directory
Throws:
IOException

renameFile

public void renameFile(String from,
                       String to)
                throws IOException
Specified by:
renameFile in class Directory
Throws:
IOException

touchFile

public void touchFile(String fileName)
               throws IOException
Specified by:
touchFile in class Directory
Throws:
IOException

openInput

public IndexInput openInput(String fileName)
                     throws IOException
Specified by:
openInput in class Directory
Throws:
IOException

createOutput

public IndexOutput createOutput(String fileName)
                         throws IOException
Specified by:
createOutput in class Directory
Throws:
IOException

close

public void close()
           throws IOException
Does nothing since an already constructed Space is passes to this directory.

Specified by:
close in class Directory
Throws:
IOException


Copyright (c) 2004-2008 The Compass Project.