use of edu.uci.ics.texera.storage.RelationManager in project textdb by TextDB.
the class NlpEntityTest method deleteData.
// table is cleared after each test case
@After
public void deleteData() throws TexeraException {
RelationManager relationManager = RelationManager.getInstance();
DataWriter oneSentenceDataWriter = relationManager.getTableDataWriter(ONE_SENTENCE_TABLE);
oneSentenceDataWriter.open();
oneSentenceDataWriter.clearData();
oneSentenceDataWriter.close();
DataWriter twoSentenceDataWriter = relationManager.getTableDataWriter(TWO_SENTENCE_TABLE);
twoSentenceDataWriter.open();
twoSentenceDataWriter.clearData();
twoSentenceDataWriter.close();
}
use of edu.uci.ics.texera.storage.RelationManager in project textdb by TextDB.
the class ProjectionOperatorTest method cleanUp.
@AfterClass
public static void cleanUp() throws Exception {
RelationManager relationManager = RelationManager.getInstance();
relationManager.deleteTable(PEOPLE_TABLE);
}
use of edu.uci.ics.texera.storage.RelationManager in project textdb by TextDB.
the class RegexMatcherTestHelper method writeTestTables.
public static void writeTestTables() throws TexeraException {
RelationManager relationManager = RelationManager.getInstance();
// create the people table and write tuples
relationManager.createTable(PEOPLE_TABLE, TestUtils.getDefaultTestIndex().resolve(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();
// create the corporation table and write tuples
relationManager.createTable(CORP_TABLE, TestUtils.getDefaultTestIndex().resolve(CORP_TABLE), RegexTestConstantsCorp.SCHEMA_CORP, LuceneAnalyzerConstants.nGramAnalyzerString(3));
DataWriter corpDataWriter = relationManager.getTableDataWriter(CORP_TABLE);
corpDataWriter.open();
for (Tuple tuple : RegexTestConstantsCorp.getSampleCorpTuples()) {
corpDataWriter.insertTuple(tuple);
}
corpDataWriter.close();
// create the staff table
relationManager.createTable(STAFF_TABLE, TestUtils.getDefaultTestIndex().resolve(STAFF_TABLE), RegexTestConstantStaff.SCHEMA_STAFF, LuceneAnalyzerConstants.nGramAnalyzerString(3));
DataWriter staffDataWriter = relationManager.getTableDataWriter(STAFF_TABLE);
staffDataWriter.open();
for (Tuple tuple : RegexTestConstantStaff.getSampleStaffTuples()) {
staffDataWriter.insertTuple(tuple);
}
staffDataWriter.close();
// create the text table
relationManager.createTable(TEXT_TABLE, TestUtils.getDefaultTestIndex().resolve(TEXT_TABLE), RegexTestConstantsText.SCHEMA_TEXT, LuceneAnalyzerConstants.nGramAnalyzerString(3));
DataWriter textDataWriter = relationManager.getTableDataWriter(TEXT_TABLE);
textDataWriter.open();
for (Tuple tuple : RegexTestConstantsText.getSampleTextTuples()) {
textDataWriter.insertTuple(tuple);
}
textDataWriter.close();
}
use of edu.uci.ics.texera.storage.RelationManager in project textdb by TextDB.
the class RegexMatcherTestHelper method deleteTestTables.
public static void deleteTestTables() throws TexeraException {
RelationManager relationManager = RelationManager.getInstance();
relationManager.deleteTable(PEOPLE_TABLE);
relationManager.deleteTable(CORP_TABLE);
relationManager.deleteTable(STAFF_TABLE);
relationManager.deleteTable(TEXT_TABLE);
}
use of edu.uci.ics.texera.storage.RelationManager in project textdb by TextDB.
the class ScanBasedSourceOperatorTest method setUp.
@BeforeClass
public static void setUp() throws TexeraException {
RelationManager relationManager = RelationManager.getInstance();
// create the people table and write tuples
relationManager.createTable(PEOPLE_TABLE, TestUtils.getDefaultTestIndex().resolve(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