public class DatasetGraphText extends DatasetGraphMonitor implements Transactional
| Constructor and Description |
|---|
DatasetGraphText(DatasetGraph dsg,
TextIndex index,
TextDocProducer producer) |
DatasetGraphText(DatasetGraph dsg,
TextIndex index,
TextDocProducer producer,
boolean closeIndexOnClose) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Rollback all changes, discarding any exceptions that occur.
|
void |
begin(ReadWrite readWrite) |
void |
close() |
void |
commit()
Perform a 2-phase commit by first calling prepareCommit() on the TextIndex
followed by committing the Transaction object, and then calling commit()
on the TextIndex().
|
void |
end() |
Graph |
getDefaultGraph() |
Graph |
getGraph(Node graphNode) |
TextIndex |
getTextIndex() |
boolean |
isInTransaction() |
Iterator<TextHit> |
search(String queryString)
Search the text index on the default text field
|
Iterator<TextHit> |
search(String queryString,
int limit)
Search the text index on the default text field
|
Iterator<TextHit> |
search(String queryString,
Node predicate)
Search the text index on the text field associated with the predicate
|
Iterator<TextHit> |
search(String queryString,
Node predicate,
int limit)
Search the text index on the text field associated with the predicate
|
boolean |
supportsTransactionAbort()
Declare whether
abort() is supported. |
boolean |
supportsTransactions() |
add, add, addGraph, delete, delete, deleteAny, getMonitor, monitored, removeGraph, syncclear, contains, contains, containsGraph, find, find, find, findNG, getBase, getContext, getLock, getWrapped, isEmpty, listGraphNodes, setDefaultGraph, size, toStringpublic DatasetGraphText(DatasetGraph dsg, TextIndex index, TextDocProducer producer)
public DatasetGraphText(DatasetGraph dsg, TextIndex index, TextDocProducer producer, boolean closeIndexOnClose)
public Graph getDefaultGraph()
getDefaultGraph in interface DatasetGraphgetDefaultGraph in class DatasetGraphWrapperpublic Graph getGraph(Node graphNode)
getGraph in interface DatasetGraphgetGraph in class DatasetGraphWrapperpublic TextIndex getTextIndex()
public Iterator<TextHit> search(String queryString)
public Iterator<TextHit> search(String queryString, Node predicate)
public Iterator<TextHit> search(String queryString, int limit)
public Iterator<TextHit> search(String queryString, Node predicate, int limit)
public void begin(ReadWrite readWrite)
begin in interface Transactionalbegin in class DatasetGraphWrapperpublic void abort()
abort in interface Transactionalabort in class DatasetGraphWrapperpublic void commit()
If either of the objects fail on either the preparation or actual commit,
it terminates and calls abort() on both of them.
NOTE: it may happen that the TextIndex fails to commit, after the Transactional has already successfully committed. A rollback instruction will still be issued, but depending on the implementation, it may not have any effect.
commit in interface Transactionalcommit in class DatasetGraphWrapperpublic boolean isInTransaction()
isInTransaction in interface TransactionalisInTransaction in class DatasetGraphWrapperpublic void end()
end in interface Transactionalend in class DatasetGraphWrapperpublic boolean supportsTransactions()
supportsTransactions in interface DatasetGraphsupportsTransactions in class DatasetGraphWrapperpublic boolean supportsTransactionAbort()
abort() is supported.
This goes along with clearing up after exceptions inside application transaction code.supportsTransactionAbort in interface DatasetGraphsupportsTransactionAbort in class DatasetGraphWrapperpublic void close()
close in interface org.apache.jena.atlas.lib.Closeableclose in interface DatasetGraphclose in class DatasetGraphWrapperLicenced under the Apache License, Version 2.0