public class BioStore extends Object implements IndexStore
BioStore
s represent directory and file structures
which index flat files according to the OBDA specification. The
preferred method of constructing new instances is to use
BioStoreFactory
.Constructor and Description |
---|
BioStore(File location,
boolean cache)
Creates a new
BioStore flatfile index at the
specified location with the specified caching behaviour. |
Modifier and Type | Method and Description |
---|---|
void |
commit()
commit writes an index to disk. |
Record |
get(String id)
get returns a record specified by a primary
identifier. |
List |
get(String id,
String namespace)
get returns a list of Record s by
searching against the primary identifiers if the namespace
argument is equal to the primary namespace or otherwise by
searching the secondary namespaces. |
File |
getLocation()
getLocation returns the directory where the index
is located. |
Annotation |
getMetaData()
getMetaData returns a data structure which
represents an OBDA "config.dat" flatfile indexing configuration
file. |
String |
getName()
The name of this store or null if the name has not been set.
|
List |
getRecordList()
getRecordList returns all the Record s
in the index. |
void |
writeRecord(RAF file,
long offset,
int length,
String id,
Map secIDs)
writeRecord creates and writes a new
Record |
public BioStore(File location, boolean cache) throws IOException, BioException
BioStore
flatfile index at the
specified location with the specified caching behaviour.location
- a File
indicating the index
directory.cache
- a boolean
indicating whether the
implementation should cache its state.IOException
- if an error occurs.BioException
- if an error occurs.public File getLocation()
getLocation
returns the directory where the index
is located.File
.public Annotation getMetaData()
IndexStore
getMetaData
returns a data structure which
represents an OBDA "config.dat" flatfile indexing configuration
file.getMetaData
in interface IndexStore
Annotation
.public Record get(String id)
IndexStore
get
returns a record specified by a primary
identifier.get
in interface IndexStore
id
- a String
primary ID.Record
.public List get(String id, String namespace) throws BioException
IndexStore
get
returns a list of Record
s by
searching against the primary identifiers if the namespace
argument is equal to the primary namespace or otherwise by
searching the secondary namespaces. The list of Record instances retuned
may be empty, but is never null.get
in interface IndexStore
id
- a String
primary ID.namespace
- a String
.List
of Record
s.BioException
- if an error occurs.public void writeRecord(RAF file, long offset, int length, String id, Map secIDs)
IndexStore
writeRecord
creates and writes a new
Record
writeRecord
in interface IndexStore
file
- a RAF
file.offset
- a long
byte offset.length
- an int
byte record length.id
- a String
primary ID.secIDs
- a Map
of primary ID to a
List
of secondary IDs.public List getRecordList()
getRecordList
returns all the Record
s
in the index.List
of Record
s.public void commit() throws CommitFailure
commit
writes an index to disk.CommitFailure
- if an error occurs.Copyright © 2014 BioJava. All rights reserved.