Search in sources :

Example 1 with MockThriftMetastoreClient

use of io.prestosql.plugin.hive.metastore.thrift.MockThriftMetastoreClient in project hetu-core by openlookeng.

the class TestCachingHiveMetastore method setUp.

@BeforeMethod
public void setUp() {
    mockClient = new MockThriftMetastoreClient();
    MetastoreLocator metastoreLocator = new MockMetastoreLocator(mockClient);
    ListeningExecutorService executor = listeningDecorator(newCachedThreadPool(daemonThreadsNamed("test-%s")));
    ListeningExecutorService executorRefresh = listeningDecorator(newCachedThreadPool(daemonThreadsNamed("test-%s")));
    ThriftHiveMetastore thriftHiveMetastore = new ThriftHiveMetastore(metastoreLocator, new ThriftHiveMetastoreConfig());
    metastore = new CachingHiveMetastore(new BridgingHiveMetastore(thriftHiveMetastore), executor, executorRefresh, new Duration(6, TimeUnit.MINUTES), new Duration(6, TimeUnit.MINUTES), new Duration(5, TimeUnit.MINUTES), new Duration(1, TimeUnit.MINUTES), 1000, false);
    stats = thriftHiveMetastore.getStats();
}
Also used : MockThriftMetastoreClient(io.prestosql.plugin.hive.metastore.thrift.MockThriftMetastoreClient) ThriftHiveMetastore(io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastore) MetastoreLocator(io.prestosql.plugin.hive.metastore.thrift.MetastoreLocator) ListeningExecutorService(com.google.common.util.concurrent.ListeningExecutorService) Duration(io.airlift.units.Duration) ThriftHiveMetastoreConfig(io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastoreConfig) BridgingHiveMetastore(io.prestosql.plugin.hive.metastore.thrift.BridgingHiveMetastore) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with MockThriftMetastoreClient

use of io.prestosql.plugin.hive.metastore.thrift.MockThriftMetastoreClient in project hetu-core by openlookeng.

the class TestSemiTransactionalHiveMetastore method setUp.

@BeforeMethod
public void setUp() {
    mockClient = new MockThriftMetastoreClient();
    MetastoreLocator metastoreLocator = new MockMetastoreLocator(mockClient);
    thriftHiveMetastore = new ThriftHiveMetastore(metastoreLocator, new ThriftHiveMetastoreConfig());
    stats = thriftHiveMetastore.getStats();
}
Also used : MockThriftMetastoreClient(io.prestosql.plugin.hive.metastore.thrift.MockThriftMetastoreClient) ThriftHiveMetastore(io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastore) MetastoreLocator(io.prestosql.plugin.hive.metastore.thrift.MetastoreLocator) ThriftHiveMetastoreConfig(io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastoreConfig) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 3 with MockThriftMetastoreClient

use of io.prestosql.plugin.hive.metastore.thrift.MockThriftMetastoreClient in project boostkit-bigdata by kunpengcompute.

the class TestHiveWriterFactory method setUp.

private void setUp() {
    mockClient = new MockThriftMetastoreClient();
    executor = newCachedThreadPool(daemonThreadsNamed("hive-%s"));
    executorRefresh = newCachedThreadPool(daemonThreadsNamed("hive-refresh-%s"));
    MetastoreLocator metastoreLocator = new MockMetastoreLocator(mockClient);
    metastore = new CachingHiveMetastore(new BridgingHiveMetastore(new ThriftHiveMetastore(metastoreLocator, new ThriftHiveMetastoreConfig())), executor, executorRefresh, Duration.valueOf("1m"), Duration.valueOf("15s"), Duration.valueOf("1m"), Duration.valueOf("15s"), 10000, false);
}
Also used : MockThriftMetastoreClient(io.prestosql.plugin.hive.metastore.thrift.MockThriftMetastoreClient) CachingHiveMetastore(io.prestosql.plugin.hive.metastore.CachingHiveMetastore) ThriftHiveMetastore(io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastore) MetastoreLocator(io.prestosql.plugin.hive.metastore.thrift.MetastoreLocator) ThriftHiveMetastoreConfig(io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastoreConfig) BridgingHiveMetastore(io.prestosql.plugin.hive.metastore.thrift.BridgingHiveMetastore)

Example 4 with MockThriftMetastoreClient

use of io.prestosql.plugin.hive.metastore.thrift.MockThriftMetastoreClient in project boostkit-bigdata by kunpengcompute.

the class TestSemiTransactionalHiveMetastore method setUp.

@BeforeMethod
public void setUp() {
    mockClient = new MockThriftMetastoreClient();
    MetastoreLocator metastoreLocator = new MockMetastoreLocator(mockClient);
    thriftHiveMetastore = new ThriftHiveMetastore(metastoreLocator, new ThriftHiveMetastoreConfig());
    stats = thriftHiveMetastore.getStats();
}
Also used : MockThriftMetastoreClient(io.prestosql.plugin.hive.metastore.thrift.MockThriftMetastoreClient) ThriftHiveMetastore(io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastore) MetastoreLocator(io.prestosql.plugin.hive.metastore.thrift.MetastoreLocator) ThriftHiveMetastoreConfig(io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastoreConfig) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 5 with MockThriftMetastoreClient

use of io.prestosql.plugin.hive.metastore.thrift.MockThriftMetastoreClient in project hetu-core by openlookeng.

the class TestHiveWriterFactory method setUp.

private void setUp() {
    mockClient = new MockThriftMetastoreClient();
    executor = newCachedThreadPool(daemonThreadsNamed("hive-%s"));
    executorRefresh = newCachedThreadPool(daemonThreadsNamed("hive-refresh-%s"));
    MetastoreLocator metastoreLocator = new MockMetastoreLocator(mockClient);
    metastore = new CachingHiveMetastore(new BridgingHiveMetastore(new ThriftHiveMetastore(metastoreLocator, new ThriftHiveMetastoreConfig())), executor, executorRefresh, Duration.valueOf("1m"), Duration.valueOf("15s"), Duration.valueOf("1m"), Duration.valueOf("15s"), 10000, false);
}
Also used : MockThriftMetastoreClient(io.prestosql.plugin.hive.metastore.thrift.MockThriftMetastoreClient) CachingHiveMetastore(io.prestosql.plugin.hive.metastore.CachingHiveMetastore) ThriftHiveMetastore(io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastore) MetastoreLocator(io.prestosql.plugin.hive.metastore.thrift.MetastoreLocator) ThriftHiveMetastoreConfig(io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastoreConfig) BridgingHiveMetastore(io.prestosql.plugin.hive.metastore.thrift.BridgingHiveMetastore)

Aggregations

MetastoreLocator (io.prestosql.plugin.hive.metastore.thrift.MetastoreLocator)6 MockThriftMetastoreClient (io.prestosql.plugin.hive.metastore.thrift.MockThriftMetastoreClient)6 ThriftHiveMetastore (io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastore)6 ThriftHiveMetastoreConfig (io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastoreConfig)6 BridgingHiveMetastore (io.prestosql.plugin.hive.metastore.thrift.BridgingHiveMetastore)4 BeforeMethod (org.testng.annotations.BeforeMethod)4 ListeningExecutorService (com.google.common.util.concurrent.ListeningExecutorService)2 Duration (io.airlift.units.Duration)2 CachingHiveMetastore (io.prestosql.plugin.hive.metastore.CachingHiveMetastore)2