use of edu.uci.ics.textdb.storage.RelationManager in project textdb by TextDB.
the class KeywordTestHelper method getKeywordSourceResults.
public static List<Tuple> getKeywordSourceResults(String tableName, String keywordQuery, List<String> attributeNames, KeywordMatchingType matchingType, int limit, int offset) throws TextDBException {
RelationManager relationManager = RelationManager.getRelationManager();
KeywordSourcePredicate keywordSourcePredicate = new KeywordSourcePredicate(keywordQuery, attributeNames, relationManager.getTableAnalyzerString(tableName), matchingType, tableName, RESULTS, limit, offset);
KeywordMatcherSourceOperator keywordSource = new KeywordMatcherSourceOperator(keywordSourcePredicate);
Tuple tuple;
List<Tuple> results = new ArrayList<>();
keywordSource.open();
while ((tuple = keywordSource.getNextTuple()) != null) {
results.add(tuple);
}
keywordSource.close();
return results;
}
use of edu.uci.ics.textdb.storage.RelationManager in project textdb by TextDB.
the class JoinTestHelper method deleteTestTables.
/**
* Deletes all test tables
* @throws TextDBException
*/
public static void deleteTestTables() throws TextDBException {
RelationManager relationManager = RelationManager.getRelationManager();
relationManager.deleteTable(BOOK_TABLE);
relationManager.deleteTable(NEWS_TABLE_OUTER);
relationManager.deleteTable(NEWS_TABLE_INNER);
}
use of edu.uci.ics.textdb.storage.RelationManager in project textdb by TextDB.
the class JoinTestHelper method insertToTable.
public static void insertToTable(String tableName, Tuple... tuples) throws StorageException {
RelationManager relationManager = RelationManager.getRelationManager();
DataWriter tableDataWriter = relationManager.getTableDataWriter(tableName);
tableDataWriter.open();
for (Tuple tuple : Arrays.asList(tuples)) {
tableDataWriter.insertTuple(tuple);
}
tableDataWriter.close();
}
use of edu.uci.ics.textdb.storage.RelationManager in project textdb by TextDB.
the class ProjectionOperatorTest method cleanUp.
@AfterClass
public static void cleanUp() throws Exception {
RelationManager relationManager = RelationManager.getRelationManager();
relationManager.deleteTable(PEOPLE_TABLE);
}
use of edu.uci.ics.textdb.storage.RelationManager in project textdb by TextDB.
the class ProjectionOperatorTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
RelationManager relationManager = RelationManager.getRelationManager();
// create the people table and write tuples
relationManager.createTable(PEOPLE_TABLE, "../index/test_tables/" + PEOPLE_TABLE, TestConstants.SCHEMA_PEOPLE, LuceneAnalyzerConstants.standardAnalyzerString());
DataWriter peopleDataWriter = relationManager.getTableDataWriter(PEOPLE_TABLE);
peopleDataWriter.open();
for (Tuple tuple : TestConstants.getSamplePeopleTuples()) {
peopleDataWriter.insertTuple(tuple);
}
peopleDataWriter.close();
}
Aggregations