Search in sources :

Example 1 with HBaseRowDataInputFormat

use of org.apache.flink.connector.hbase2.source.HBaseRowDataInputFormat in project flink by apache.

the class HBaseConnectorITCase method testTableInputFormatOpenClose.

@Test
public void testTableInputFormatOpenClose() throws IOException {
    HBaseTableSchema tableSchema = new HBaseTableSchema();
    tableSchema.addColumn(FAMILY1, F1COL1, byte[].class);
    AbstractTableInputFormat<?> inputFormat = new HBaseRowDataInputFormat(getConf(), TEST_TABLE_1, tableSchema, "null");
    inputFormat.open(inputFormat.createInputSplits(1)[0]);
    assertNotNull(inputFormat.getConnection());
    assertNotNull(inputFormat.getConnection().getTable(TableName.valueOf(TEST_TABLE_1)));
    inputFormat.close();
    assertNull(inputFormat.getConnection());
}
Also used : HBaseRowDataInputFormat(org.apache.flink.connector.hbase2.source.HBaseRowDataInputFormat) HBaseTableSchema(org.apache.flink.connector.hbase.util.HBaseTableSchema) Test(org.junit.Test)

Example 2 with HBaseRowDataInputFormat

use of org.apache.flink.connector.hbase2.source.HBaseRowDataInputFormat in project flink by apache.

the class HBaseConnectorITCase method testTableInputFormatOpenClose.

@Test
public void testTableInputFormatOpenClose() throws IOException {
    HBaseTableSchema tableSchema = new HBaseTableSchema();
    tableSchema.addColumn(FAMILY1, F1COL1, byte[].class);
    AbstractTableInputFormat<?> inputFormat = new HBaseRowDataInputFormat(getConf(), TEST_TABLE_1, tableSchema, "null");
    inputFormat.open(inputFormat.createInputSplits(1)[0]);
    assertNotNull(inputFormat.getConnection());
    assertNotNull(inputFormat.getConnection().getTable(TableName.valueOf(TEST_TABLE_1)));
    inputFormat.close();
    assertNull(inputFormat.getConnection());
}
Also used : HBaseRowDataInputFormat(org.apache.flink.connector.hbase1.source.HBaseRowDataInputFormat) HBaseTableSchema(org.apache.flink.connector.hbase.util.HBaseTableSchema) Test(org.junit.Test)

Aggregations

HBaseTableSchema (org.apache.flink.connector.hbase.util.HBaseTableSchema)2 Test (org.junit.Test)2 HBaseRowDataInputFormat (org.apache.flink.connector.hbase1.source.HBaseRowDataInputFormat)1 HBaseRowDataInputFormat (org.apache.flink.connector.hbase2.source.HBaseRowDataInputFormat)1