use of edu.uci.ics.textdb.storage.RelationManager in project textdb by TextDB.
the class JoinTestHelper method clearTestTables.
/**
* Clears the data of the inner and outer test tables.
* @throws TextDBException
*/
public static void clearTestTables() throws TextDBException {
RelationManager relationManager = RelationManager.getRelationManager();
DataWriter bookDataWriter = relationManager.getTableDataWriter(BOOK_TABLE);
bookDataWriter.open();
bookDataWriter.clearData();
bookDataWriter.close();
DataWriter innerNewsDataWriter = relationManager.getTableDataWriter(NEWS_TABLE_INNER);
innerNewsDataWriter.open();
innerNewsDataWriter.clearData();
innerNewsDataWriter.close();
DataWriter outerNewsDataWriter = relationManager.getTableDataWriter(NEWS_TABLE_OUTER);
outerNewsDataWriter.open();
outerNewsDataWriter.clearData();
outerNewsDataWriter.close();
}
use of edu.uci.ics.textdb.storage.RelationManager in project textdb by TextDB.
the class ComparableMatcherTest method cleanUp.
@AfterClass
public static void cleanUp() throws TextDBException {
RelationManager relationManager = RelationManager.getRelationManager();
relationManager.deleteTable(PEOPLE_TABLE);
}
use of edu.uci.ics.textdb.storage.RelationManager in project textdb by TextDB.
the class WordCountTest method setUp.
@BeforeClass
public static void setUp() throws TextDBException {
cleanUp();
RelationManager relationManager = RelationManager.getRelationManager();
// Create the people table and write tuples
relationManager.createTable(COUNT_TABLE, "../index/test_tables/" + COUNT_TABLE, TestConstants.SCHEMA_PEOPLE, LuceneAnalyzerConstants.standardAnalyzerString());
DataWriter dataWriter = relationManager.getTableDataWriter(COUNT_TABLE);
dataWriter.open();
for (Tuple tuple : TestConstants.getSamplePeopleTuples()) {
dataWriter.insertTuple(tuple);
}
dataWriter.close();
expectedResult = computeExpectedResult(TestConstants.getSamplePeopleTuples(), TestConstants.DESCRIPTION, LuceneAnalyzerConstants.getStandardAnalyzer());
relationManager.createTable(COUNT_CHINESE_TABLE, "../index/test_tables/" + COUNT_CHINESE_TABLE, TestConstantsChineseWordCount.SCHEMA_PEOPLE, LuceneAnalyzerConstants.chineseAnalyzerString());
DataWriter dataWriterChinese = relationManager.getTableDataWriter(COUNT_CHINESE_TABLE);
dataWriterChinese.open();
for (Tuple tuple : TestConstantsChineseWordCount.getSamplePeopleTuples()) {
dataWriterChinese.insertTuple(tuple);
}
dataWriterChinese.close();
expectedResultChinese = computeExpectedResult(TestConstantsChineseWordCount.getSamplePeopleTuples(), TestConstantsChineseWordCount.DESCRIPTION, LuceneAnalyzerConstants.getLuceneAnalyzer(LuceneAnalyzerConstants.chineseAnalyzerString()));
}
use of edu.uci.ics.textdb.storage.RelationManager in project textdb by TextDB.
the class RegexSplitOperatorTest method setUp.
@BeforeClass
public static void setUp() throws TextDBException {
RelationManager relationManager = RelationManager.getRelationManager();
RelationManager.getRelationManager().deleteTable(REGEX_TABLE);
relationManager = RelationManager.getRelationManager();
relationManager.createTable(REGEX_TABLE, "../index/test_tables/" + REGEX_TABLE, TestConstantsRegexSplit.SCHEMA_PEOPLE, LuceneAnalyzerConstants.standardAnalyzerString());
DataWriter regexDataWriter = relationManager.getTableDataWriter(REGEX_TABLE);
regexDataWriter.open();
for (Tuple tuple : TestConstantsRegexSplit.constructSamplePeopleTuples()) {
regexDataWriter.insertTuple(tuple);
}
regexDataWriter.close();
// create the people table and write tuples in Chinese
relationManager.createTable(CHINESE_TABLE, "../index/test_tables/" + CHINESE_TABLE, TestConstantsChinese.SCHEMA_PEOPLE, LuceneAnalyzerConstants.chineseAnalyzerString());
DataWriter chineseDataWriter = relationManager.getTableDataWriter(CHINESE_TABLE);
chineseDataWriter.open();
for (Tuple tuple : TestConstantsChinese.getSamplePeopleTuples()) {
chineseDataWriter.insertTuple(tuple);
}
chineseDataWriter.close();
}
use of edu.uci.ics.textdb.storage.RelationManager in project textdb by TextDB.
the class SamplerTest method setUp.
@BeforeClass
public static void setUp() throws TextDBException {
RelationManager relationManager = RelationManager.getRelationManager();
// Create the people table and write tuples
RelationManager.getRelationManager().deleteTable(SAMPLER_TABLE);
relationManager.createTable(SAMPLER_TABLE, "../index/test_tables/" + SAMPLER_TABLE, TestConstants.SCHEMA_PEOPLE, LuceneAnalyzerConstants.standardAnalyzerString());
DataWriter dataWriter = relationManager.getTableDataWriter(SAMPLER_TABLE);
dataWriter.open();
indexSize = 0;
for (Tuple tuple : TestConstants.getSamplePeopleTuples()) {
dataWriter.insertTuple(tuple);
indexSize++;
}
dataWriter.close();
}
Aggregations