Search in sources :

Example 6 with KuduClusterTestContext

use of org.apache.apex.malhar.kudu.test.KuduClusterTestContext in project apex-malhar by apache.

the class KuduPartitionScannerCallableTest method testSettersForPojo.

@KuduClusterTestContext(kuduClusterBasedTest = true)
@Test
public void testSettersForPojo() throws Exception {
    initOperatorState();
    AbstractKuduPartitionScanner<UnitTestTablePojo, InputOperatorControlTuple> currentScanner = unitTestStepwiseScanInputOperator.getScanner();
    SQLToKuduPredicatesTranslator translator = new SQLToKuduPredicatesTranslator("select introwkey as intColumn from unittests", new ArrayList<ColumnSchema>(columnDefs.values()));
    List<KuduPartitionScanAssignmentMeta> scansForThisQuery = currentScanner.preparePlanForScanners(translator);
    KuduPartitionScannerCallable<UnitTestTablePojo, InputOperatorControlTuple> threadToScan = new KuduPartitionScannerCallable<>(unitTestStepwiseScanInputOperator, scansForThisQuery.get(0), currentScanner.getConnectionPoolForThreads().get(0), unitTestStepwiseScanInputOperator.extractSettersForResultObject(translator), translator);
    long countOfScan = threadToScan.call();
}
Also used : InputOperatorControlTuple(org.apache.apex.malhar.kudu.InputOperatorControlTuple) ColumnSchema(org.apache.kudu.ColumnSchema) SQLToKuduPredicatesTranslator(org.apache.apex.malhar.kudu.sqltranslator.SQLToKuduPredicatesTranslator) UnitTestTablePojo(org.apache.apex.malhar.kudu.UnitTestTablePojo) Test(org.junit.Test) KuduClusterTestContext(org.apache.apex.malhar.kudu.test.KuduClusterTestContext)

Aggregations

KuduClusterTestContext (org.apache.apex.malhar.kudu.test.KuduClusterTestContext)6 Test (org.junit.Test)5 InputOperatorControlTuple (org.apache.apex.malhar.kudu.InputOperatorControlTuple)4 UnitTestTablePojo (org.apache.apex.malhar.kudu.UnitTestTablePojo)4 SQLToKuduPredicatesTranslator (org.apache.apex.malhar.kudu.sqltranslator.SQLToKuduPredicatesTranslator)4 ColumnSchema (org.apache.kudu.ColumnSchema)4 Attribute (com.datatorrent.api.Attribute)2 ArrayList (java.util.ArrayList)2 TestPortContext (org.apache.apex.malhar.lib.helper.TestPortContext)2 Operator (com.datatorrent.api.Operator)1 Partitioner (com.datatorrent.api.Partitioner)1 List (java.util.List)1 Before (org.junit.Before)1