Search in sources :

Example 1 with HBaseRecordSetProvider

use of io.hetu.core.plugin.hbase.query.HBaseRecordSetProvider in project hetu-core by openlookeng.

the class TestHBase method testGetSRecordSet.

/**
 * testGetSRecordSet
 */
@Test
public void testGetSRecordSet() {
    List<HostAddress> hostAddressList = new ArrayList<>(1);
    Map<Integer, List<Range>> ranges = new HashMap<>();
    HBaseSplit split = new HBaseSplit("rowkey", TestUtils.createHBaseTableHandle(), hostAddressList, null, null, ranges, 0, false, null);
    HBaseRecordSetProvider hrsp = new HBaseRecordSetProvider(hconn);
    RecordSet rs = hrsp.getRecordSet(new HBaseTransactionHandle(), session, split, TestUtils.createHBaseTableHandle(), hconn.getTable("hbase.test_table").getColumns());
    assertEquals(5, rs.getColumnTypes().size());
}
Also used : HashMap(java.util.HashMap) HBaseRecordSetProvider(io.hetu.core.plugin.hbase.query.HBaseRecordSetProvider) ArrayList(java.util.ArrayList) HBaseTransactionHandle(io.hetu.core.plugin.hbase.connector.HBaseTransactionHandle) List(java.util.List) ArrayList(java.util.ArrayList) HBaseSplit(io.hetu.core.plugin.hbase.split.HBaseSplit) RecordSet(io.prestosql.spi.connector.RecordSet) HostAddress(io.prestosql.spi.HostAddress) Test(org.testng.annotations.Test)

Example 2 with HBaseRecordSetProvider

use of io.hetu.core.plugin.hbase.query.HBaseRecordSetProvider in project hetu-core by openlookeng.

the class TestHBase method setUp.

/**
 * setUp
 */
@BeforeClass
public void setUp() {
    hCConf.setZkClientPort("2181");
    hCConf.setZkQuorum("zk1");
    hetuMetastore = new TestingHetuMetastore();
    table = TestUtils.createHBaseTableHandle();
    schemaTableName = new SchemaTableName("hbase", "test_table");
    hconn = new TestHBaseClientConnection(hCConf, hetuMetastore.getHetuMetastore());
    hconn.createConnection();
    session = new TestingConnectorSession("root");
    hcm = new HBaseConnectorMetadata(hconn);
    hConnector = new HBaseConnector(new HBaseConnectorMetadataFactory(hconn, hCConf), new HBaseSplitManager(hconn), new HBasePageSinkProvider(hconn), new HBasePageSourceProvider(new HBaseRecordSetProvider(hconn), hconn), Optional.empty(), null);
}
Also used : HBasePageSinkProvider(io.hetu.core.plugin.hbase.query.HBasePageSinkProvider) TestingHetuMetastore(io.hetu.core.plugin.hbase.metadata.TestingHetuMetastore) TestHBaseClientConnection(io.hetu.core.plugin.hbase.connector.TestHBaseClientConnection) HBaseRecordSetProvider(io.hetu.core.plugin.hbase.query.HBaseRecordSetProvider) TestingConnectorSession(io.hetu.core.plugin.hbase.client.TestingConnectorSession) HBaseConnectorMetadataFactory(io.hetu.core.plugin.hbase.connector.HBaseConnectorMetadataFactory) HBaseSplitManager(io.hetu.core.plugin.hbase.split.HBaseSplitManager) HBasePageSourceProvider(io.hetu.core.plugin.hbase.query.HBasePageSourceProvider) SchemaTableName(io.prestosql.spi.connector.SchemaTableName) HBaseConnectorMetadata(io.hetu.core.plugin.hbase.metadata.HBaseConnectorMetadata) HBaseConnector(io.hetu.core.plugin.hbase.connector.HBaseConnector) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with HBaseRecordSetProvider

use of io.hetu.core.plugin.hbase.query.HBaseRecordSetProvider in project hetu-core by openlookeng.

the class TestHBaseConnector method setUp.

/**
 * setUp
 */
@BeforeClass
public void setUp() {
    hCConf.setZkClientPort("2181");
    hCConf.setZkQuorum("zk1");
    hetuMetastore = new TestingHetuMetastore();
    schemaTableName = new SchemaTableName("hbase", "test_table");
    hconn = new TestHBaseClientConnection(hCConf, hetuMetastore.getHetuMetastore());
    hconn.createConnection();
    session = new TestingConnectorSession("root");
    hcm = new HBaseConnectorMetadata(hconn);
    hConnector = new HBaseConnector(new HBaseConnectorMetadataFactory(hconn, hCConf), new HBaseSplitManager(hconn), new HBasePageSinkProvider(hconn), new HBasePageSourceProvider(new HBaseRecordSetProvider(hconn), hconn), Optional.empty(), new HBaseTableProperties());
}
Also used : HBasePageSinkProvider(io.hetu.core.plugin.hbase.query.HBasePageSinkProvider) TestingHetuMetastore(io.hetu.core.plugin.hbase.metadata.TestingHetuMetastore) HBaseRecordSetProvider(io.hetu.core.plugin.hbase.query.HBaseRecordSetProvider) HBaseTableProperties(io.hetu.core.plugin.hbase.conf.HBaseTableProperties) TestingConnectorSession(io.hetu.core.plugin.hbase.client.TestingConnectorSession) HBaseSplitManager(io.hetu.core.plugin.hbase.split.HBaseSplitManager) HBasePageSourceProvider(io.hetu.core.plugin.hbase.query.HBasePageSourceProvider) SchemaTableName(io.prestosql.spi.connector.SchemaTableName) HBaseConnectorMetadata(io.hetu.core.plugin.hbase.metadata.HBaseConnectorMetadata) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

HBaseRecordSetProvider (io.hetu.core.plugin.hbase.query.HBaseRecordSetProvider)3 TestingConnectorSession (io.hetu.core.plugin.hbase.client.TestingConnectorSession)2 HBaseConnectorMetadata (io.hetu.core.plugin.hbase.metadata.HBaseConnectorMetadata)2 TestingHetuMetastore (io.hetu.core.plugin.hbase.metadata.TestingHetuMetastore)2 HBasePageSinkProvider (io.hetu.core.plugin.hbase.query.HBasePageSinkProvider)2 HBasePageSourceProvider (io.hetu.core.plugin.hbase.query.HBasePageSourceProvider)2 HBaseSplitManager (io.hetu.core.plugin.hbase.split.HBaseSplitManager)2 SchemaTableName (io.prestosql.spi.connector.SchemaTableName)2 BeforeClass (org.testng.annotations.BeforeClass)2 HBaseTableProperties (io.hetu.core.plugin.hbase.conf.HBaseTableProperties)1 HBaseConnector (io.hetu.core.plugin.hbase.connector.HBaseConnector)1 HBaseConnectorMetadataFactory (io.hetu.core.plugin.hbase.connector.HBaseConnectorMetadataFactory)1 HBaseTransactionHandle (io.hetu.core.plugin.hbase.connector.HBaseTransactionHandle)1 TestHBaseClientConnection (io.hetu.core.plugin.hbase.connector.TestHBaseClientConnection)1 HBaseSplit (io.hetu.core.plugin.hbase.split.HBaseSplit)1 HostAddress (io.prestosql.spi.HostAddress)1 RecordSet (io.prestosql.spi.connector.RecordSet)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1