use of edu.uci.ics.textdb.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 TextDBException
*/
public void deletePlan(String planName) throws TextDBException {
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();
}
use of edu.uci.ics.textdb.storage.DataWriter 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.DataWriter 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.DataWriter 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();
}
use of edu.uci.ics.textdb.storage.DataWriter in project textdb by TextDB.
the class ScanBasedSourceOperatorTest method setUp.
@BeforeClass
public static void setUp() throws TextDBException {
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