use of org.apache.hudi.common.testutils.minicluster.ZookeeperTestService in project hudi by apache.
the class UtilitiesTestBase method initClass.
public static void initClass(boolean startHiveService) throws Exception {
hdfsTestService = new HdfsTestService();
zookeeperTestService = new ZookeeperTestService(hdfsTestService.getHadoopConf());
dfsCluster = hdfsTestService.start(true);
dfs = dfsCluster.getFileSystem();
dfsBasePath = dfs.getWorkingDirectory().toString();
dfs.mkdirs(new Path(dfsBasePath));
if (startHiveService) {
hiveTestService = new HiveTestService(hdfsTestService.getHadoopConf());
hiveServer = hiveTestService.start();
clearHiveDb();
}
zookeeperTestService.start();
}
use of org.apache.hudi.common.testutils.minicluster.ZookeeperTestService in project hudi by apache.
the class ZookeeperServiceProvider method stopLocalZookeeperIfNeeded.
public void stopLocalZookeeperIfNeeded() throws Exception {
if (config.isHiveLocal()) {
ZookeeperTestService zookeeperTestService = new ZookeeperTestService(configuration);
zookeeperTestService.stop();
}
}
use of org.apache.hudi.common.testutils.minicluster.ZookeeperTestService in project hudi by apache.
the class ZookeeperServiceProvider method startLocalZookeeperIfNeeded.
public void startLocalZookeeperIfNeeded() throws Exception {
if (config.isHiveLocal()) {
ZookeeperTestService zookeeperTestService = new ZookeeperTestService(configuration);
zookeeperTestService.start();
}
}
use of org.apache.hudi.common.testutils.minicluster.ZookeeperTestService in project hudi by apache.
the class HiveSyncFunctionalTestHarness method runBeforeEach.
@BeforeEach
public synchronized void runBeforeEach() throws IOException, InterruptedException {
initialized = hiveTestService != null && zookeeperTestService != null;
if (!initialized) {
hadoopConf = new Configuration();
zookeeperTestService = new ZookeeperTestService(hadoopConf);
zookeeperTestService.start();
hiveTestService = new HiveTestService(hadoopConf);
hiveTestService.start();
}
}
use of org.apache.hudi.common.testutils.minicluster.ZookeeperTestService in project hudi by apache.
the class HiveTestUtil method setUp.
public static void setUp() throws IOException, InterruptedException, HiveException, MetaException {
configuration = new Configuration();
if (zkServer == null) {
zkService = new ZookeeperTestService(configuration);
zkServer = zkService.start();
}
if (hiveServer == null) {
hiveTestService = new HiveTestService(configuration);
hiveServer = hiveTestService.start();
}
fileSystem = FileSystem.get(configuration);
hiveSyncConfig = new HiveSyncConfig();
hiveSyncConfig.jdbcUrl = hiveTestService.getJdbcHive2Url();
hiveSyncConfig.hiveUser = "";
hiveSyncConfig.hivePass = "";
hiveSyncConfig.databaseName = "testdb";
hiveSyncConfig.tableName = "test1";
hiveSyncConfig.basePath = Files.createTempDirectory("hivesynctest" + Instant.now().toEpochMilli()).toUri().toString();
hiveSyncConfig.assumeDatePartitioning = true;
hiveSyncConfig.usePreApacheInputFormat = false;
hiveSyncConfig.partitionFields = Collections.singletonList("datestr");
dtfOut = DateTimeFormatter.ofPattern("yyyy/MM/dd");
ddlExecutor = new HiveQueryDDLExecutor(hiveSyncConfig, fileSystem, getHiveConf());
clear();
}
Aggregations