use of org.apache.apex.malhar.lib.util.TableInfo in project apex-malhar by apache.
the class MemcachePOJOOperatorTest method testMemcacheOutputOperatorInternal.
@SuppressWarnings("unchecked")
@Test
public void testMemcacheOutputOperatorInternal() throws Exception {
MemcachePOJOOutputOperator operator = new MemcachePOJOOutputOperator();
operator.setStore(store);
TableInfo tableInfo = new TableInfo();
tableInfo.setRowOrIdExpression(TestPOJO.getRowExpression());
tableInfo.setFieldsInfo(TestPOJO.getFieldsInfo());
tableInfo.setRowOrIdExpression(TestPOJO.getRowExpression());
operator.setTableInfo(tableInfo);
operator.setup(null);
TupleGenerator<TestPOJO> generator = new TupleGenerator<TestPOJO>(TestPOJO.class);
for (int i = 0; i < TUPLE_SIZE; ++i) {
operator.processTuple(generator.getNextTuple());
}
readDataAndVerify(operator.getStore(), generator);
}
use of org.apache.apex.malhar.lib.util.TableInfo in project apex-malhar by apache.
the class GeodePOJOOperatorTest method testGeodeOutputOperatorInternal.
@SuppressWarnings("unchecked")
@Test
public void testGeodeOutputOperatorInternal() throws Exception {
GeodePOJOOutputOperator operator = new GeodePOJOOutputOperator();
operator.setStore(store);
TableInfo tableInfo = new TableInfo();
tableInfo.setRowOrIdExpression(TestPOJO.getRowExpression());
tableInfo.setFieldsInfo(TestPOJO.getFieldsInfo());
tableInfo.setRowOrIdExpression(TestPOJO.getRowExpression());
operator.setTableInfo(tableInfo);
operator.setup(null);
TupleGenerator<TestPOJO> generator = new TupleGenerator<TestPOJO>(TestPOJO.class);
for (int i = 0; i < TUPLE_SIZE; ++i) {
operator.processTuple(generator.getNextTuple());
}
generator.reset();
for (int i = 0; i < TUPLE_SIZE; ++i) {
operator.processTuple(generator.getNextTuple());
}
// readDataAndVerify(operator.getStore(), generator);
}
use of org.apache.apex.malhar.lib.util.TableInfo in project apex-malhar by apache.
the class HBasePOJOInputOperatorTest method setupOperators.
protected void setupOperators() {
TableInfo<HBaseFieldInfo> tableInfo = new TableInfo<HBaseFieldInfo>();
tableInfo.setRowOrIdExpression("row");
List<HBaseFieldInfo> fieldsInfo = new ArrayList<HBaseFieldInfo>();
fieldsInfo.add(new HBaseFieldInfo("name", "name", SupportType.STRING, "f0"));
fieldsInfo.add(new HBaseFieldInfo("age", "age", SupportType.INTEGER, "f1"));
fieldsInfo.add(new HBaseFieldInfo("address", "address", SupportType.STRING, "f1"));
tableInfo.setFieldsInfo(fieldsInfo);
hbaseInputOperator.setTableInfo(tableInfo);
hbaseOutputOperator.setTableInfo(tableInfo);
store = new HBaseStore();
store.setTableName("test");
store.setZookeeperQuorum("localhost");
store.setZookeeperClientPort(2181);
hbaseInputOperator.setStore(store);
hbaseOutputOperator.setStore(store);
OperatorContext context = mockOperatorContext(OPERATOR_ID, new AttributeMap.DefaultAttributeMap());
hbaseInputOperator.setup(context);
hbaseOutputOperator.setup(context);
}
Aggregations