Search in sources :

Example 1 with DumpJobStatus

use of com.qlangtech.tis.cloud.dump.DumpJobStatus in project tis by qlangtech.

the class AbstractIndexBuildJob method startBuildIndex.

/**
 * 执行单组build任務
 *
 * @return
 * @throws Exception
 */
@SuppressWarnings("all")
public final BuildResult startBuildIndex() throws Exception {
    // final String coreName = state.getIndexName() + '-' + groupNum;
    // + '-' + groupNum;
    final String coreName = state.getCoreName(groupNum);
    final String timePoint = state.getTimepoint();
    final DumpJobStatus status = new DumpJobStatus();
    // status.setUserName(userName);
    status.setTimepoint(state.getTimepoint());
    status.setDumpType("remote");
    DumpJobId dumpJobId = new DumpJobId("jtIdentifier", jobid++);
    status.setDumpJobID(dumpJobId);
    status.setCoreName(coreName);
    RunEnvironment runtime = RunEnvironment.getSysRuntime();
    long now = System.currentTimeMillis();
    final String outPath = state.getIndexBuildOutputPath((this.groupNum));
    logger.info("build out path:" + outPath);
    ITISFileSystem fileSystem = indexBuildFS;
    appDomain.writeResource2fs(fileSystem, coreName, ConfigFileReader.FILE_SCHEMA);
    appDomain.writeResource2fs(fileSystem, coreName, ConfigFileReader.FILE_SOLR);
    // writeResource2Hdfs(coreName, domain, ConfigFileReader.FILE_CORE_PROPERTIES, "config");
    // // TODO 为了兼容老的索引先加上,到时候要删除掉的
    // writeResource2Hdfs(coreName, domain, ConfigFileReader.FILE_SCHEMA, SCHEMA);
    // writeResource2Hdfs(coreName, domain, ConfigFileReader.FILE_APPLICATION, "app");
    // writeResource2Hdfs(coreName, domain, ConfigFileReader.FILE_CORE_PROPERTIES, "core");
    // TODO 为了兼容老的索引先加上,到时候要删除掉的 end
    logger.info("Excute  RemoteDumpJob: Sbumit Remote Job .....  ");
    status.setStartTime(now);
    // String[] core = this.coreName.split("-");
    String serviceName = state.getIndexName();
    // ///////////////////////////////////////////
    logger.info("Excute Remote Dump Job Status: Sbumit  ");
    return buildSliceIndex(coreName, timePoint, status, outPath, serviceName);
}
Also used : DumpJobStatus(com.qlangtech.tis.cloud.dump.DumpJobStatus) RunEnvironment(com.qlangtech.tis.pubhook.common.RunEnvironment) ITISFileSystem(com.qlangtech.tis.fs.ITISFileSystem) DumpJobId(com.qlangtech.tis.cloud.dump.DumpJobId)

Aggregations

DumpJobId (com.qlangtech.tis.cloud.dump.DumpJobId)1 DumpJobStatus (com.qlangtech.tis.cloud.dump.DumpJobStatus)1 ITISFileSystem (com.qlangtech.tis.fs.ITISFileSystem)1 RunEnvironment (com.qlangtech.tis.pubhook.common.RunEnvironment)1