use of com.qlangtech.tis.trigger.jst.ImportDataProcessInfo in project plugins by qlangtech.
the class TestLocalTableDumpAndIndex method startIndexBuild.
public void startIndexBuild(String solrCoreName, IJoinTaskContext execContext, ITISCoordinator zkCoordinator, String timePoint) throws Exception {
LocalIndexBuilderTriggerFactory builderTriggerFactory = new LocalIndexBuilderTriggerFactory();
File localOfflineDir = LocalTableDumpFactory.getLocalOfflineRootDir();
String indexName = ITestDumpCommon.INDEX_COLLECTION;
String groupNum = "0";
Integer taskId = 123;
ITISFileSystem fileSystem = builderTriggerFactory.getFileSystem();
ImportDataProcessInfo buildParam = new ImportDataProcessInfo(taskId, fileSystem, zkCoordinator);
buildParam.setIndexName(indexName);
MockDataSourceFactory employeesDataSource = MockDataSourceFactory.getMockEmployeesDataSource();
List<ColumnMetaData> eployeeTableMeta = employeesDataSource.getTableMetadata(TABLE_EMPLOYEES);
String colsLiteria = eployeeTableMeta.stream().map((c) -> c.getKey()).collect(Collectors.joining(","));
buildParam.setBuildTableTitleItems(colsLiteria);
SnapshotDomain snapshot = com.qlangtech.tis.manage.common.SnapshotDomainUtils.mockEmployeeSnapshotDomain();
snapshot.writeResource2fs(fileSystem, buildParam.getCoreName(Integer.parseInt(groupNum)), ConfigFileReader.FILE_SCHEMA);
snapshot.writeResource2fs(fileSystem, buildParam.getCoreName(Integer.parseInt(groupNum)), ConfigFileReader.FILE_SOLR);
IRemoteJobTrigger buildJob = builderTriggerFactory.createBuildJob(execContext, timePoint, indexName, groupNum, buildParam);
buildJob.submitJob();
/**
* -----------------------------------------------------------
* 开始执行索引build
* -----------------------------------------------------------
*/
TestLocalTableDumpAndIndex.waitJobTerminatorAndAssert(buildJob);
// long hdfsTimeStamp, String hdfsUser, SolrCore core, File indexDir, SolrQueryResponse rsp, String taskId
indexFlowback2SolrEngineNode(solrCoreName, timePoint, localOfflineDir, taskId);
}
Aggregations