use of edu.uci.ics.texera.storage.DataWriter in project textdb by TextDB.
the class FuzzyTokenMatcherTestHelper method writeTestTables.
/*
* Creates the test table(s) and writes data into it(them).
*/
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();
}
use of edu.uci.ics.texera.storage.DataWriter in project textdb by TextDB.
the class PlanStore method deletePlan.
/**
* Removess a plan by given name from plan store.
*
* @param planName, the name of the plan.
* @throws TexeraException
*/
public void deletePlan(String planName) throws TexeraException {
Tuple plan = getPlan(planName);
if (plan == null) {
return;
}
IDField idField = (IDField) plan.getField(SchemaConstants._ID);
DataWriter dataWriter = relationManager.getTableDataWriter(PlanStoreConstants.TABLE_NAME);
dataWriter.open();
dataWriter.deleteTupleByID(idField);
dataWriter.close();
}
Aggregations