当前位置: 首页>>代码示例>>Java>>正文


Java OozieClientException类代码示例

本文整理汇总了Java中org.apache.oozie.client.OozieClientException的典型用法代码示例。如果您正苦于以下问题:Java OozieClientException类的具体用法?Java OozieClientException怎么用?Java OozieClientException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OozieClientException类属于org.apache.oozie.client包,在下文中一共展示了OozieClientException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: submit

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
/**
 * Submit Oozie Job
 *
 * @param app_path
 * @throws OozieClientException
 * @throws IOException
 */
public static String submit(String app_path) throws OozieClientException,
IOException {
	// create a workflow job configuration and set the workflow application path
	Properties conf = wc.createConfiguration();

	conf.setProperty(OozieClient.APP_PATH, app_path);

	// setting workflow parameters
	conf.setProperty("queueName", Constants.QUEUE_NAME);
	conf.setProperty("nameNode", Constants.NAME_NODE);
	conf.setProperty("jobTracker", Constants.JOB_TRACKER);
	conf.setProperty("appPath", app_path);
	String jobId = wc.run(conf);
	logger.info("submit workflow job:" + jobId);

	return jobId;
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:25,代码来源:OozieUtil.java

示例2: kill

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
/**
 * Kill oozie job
 *
 * @param  jobID
 * @throws OozieClientException
 * @throws IOException
 */
public static void kill(String jobID) throws OozieClientException,
IOException {

	wc.kill(jobID);
	OozieJob job = new OozieJob();
	job.setId(jobID);
	try {
		OozieJob temp = SecureDao.getObject(job);
		if ( temp != null ) {
			job = temp;
		}
		job.setStatus(getJob(jobID).getStatus());
		System.out.println("[kill Status]" + job.getStatus());
		String[] setFields = {"status"};
		String[] condFields = {"jobid"};
		SecureDao.update(job, setFields, condFields);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:28,代码来源:OozieUtil.java

示例3: suspend

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
/**
 * Suspend oozie job
 *
 * @param jobID
 * @throws OozieClientException
 * @throws IOException
 */
public static void suspend(String jobID) throws OozieClientException,
IOException {

	wc.suspend(jobID);
	OozieJob job = new OozieJob();
	job.setId(jobID);
	try {
		OozieJob temp = SecureDao.getObject(job);
		if ( temp != null ) {
			job = temp;
		}
		job.setStatus(getJob(jobID).getStatus());
		System.out.println("[suspend Status]" + job.getStatus());
		String[] setFields = {"status"};
		String[] condFields = {"jobid"};
		SecureDao.update(job, setFields, condFields);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:28,代码来源:OozieUtil.java

示例4: resume

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
/**
 * Kill oozie job
 *
 * @throws OozieClientException
 * @throws IOException
 */
public static void resume(String jobID) throws OozieClientException,
IOException {

	wc.resume(jobID);
	OozieJob job = new OozieJob();
	job.setId(jobID);
	try {
		OozieJob temp = SecureDao.getObject(job);
		if ( temp != null ) {
			job = temp;
		}
		job.setStatus(getJob(jobID).getStatus());
		System.out.println("[resume Status]" + job.getStatus());
		String[] setFields = {"status"};
		String[] condFields = {"jobid"};
		SecureDao.update(job, setFields, condFields);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:27,代码来源:OozieUtil.java

示例5: start

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
/**
 * Starts the application in Oozie.
 */
private String start(OozieClient oozieClient, Path appPath) {

  Properties props = oozieClient.createConfiguration();

  Path bundlePath = new Path(appPath, "oozie/bundle.xml");

  props.setProperty(OozieClient.BUNDLE_APP_PATH, bundlePath.toString());
  props.setProperty(OozieClient.USE_SYSTEM_LIBPATH, "true");

  try {
    return oozieClient.run(props);

  } catch (OozieClientException e) {
    throw new AppException(e);
  }
}
 
开发者ID:rbrush,项目名称:kite-apps,代码行数:20,代码来源:AppDeployer.java

示例6: startHiveAddPartitionCoordJob

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
@Test
public void startHiveAddPartitionCoordJob() throws OozieClientException,
		InterruptedException, IllegalArgumentException, IOException {
	prepareHiveData();
	int itemsCount = printAndCountHdfsFileDirData(
			hadoopClusterService.getHDFSUri() + "/searchevents",
			"searchevents", false, true);
	assertEquals(200, itemsCount);
	hiveSearchClicksService.printHivePartitions(DBNAME_SEARCH,
			TBNAME_SEARCH_CLICKS);
	oozieJobsService.startHiveAddPartitionCoordJob();
	System.out.println("Coord job completed ...");
	hiveSearchClicksService.printHivePartitions(DBNAME_SEARCH,
			TBNAME_SEARCH_CLICKS);
	int totalRowCount = hiveSearchClicksService.getTotalRowCount(
			DBNAME_SEARCH, TBNAME_SEARCH_CLICKS);
	System.out.println("totalRowCount : " + totalRowCount);
	assertTrue(totalRowCount > 0);
}
 
开发者ID:jaibeermalik,项目名称:searchanalytics-bigdata,代码行数:20,代码来源:OozieJobsServiceImplTest.java

示例7: cancel

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
@Override
public void cancel(String downloadKey) {
  try {
    Download download = occurrenceDownloadService.get(downloadKey);
    if (download != null) {
      if (RUNNING_STATUSES.contains(download.getStatus())) {
        updateDownloadStatus(download, Download.Status.CANCELLED);
        client.kill(DownloadUtils.downloadToWorkflowId(downloadKey));
        LOG.info("Download {} cancelled", downloadKey);
      }
    } else {
      throw new NotFoundException(String.format("Download %s not found", downloadKey));
    }
  } catch (OozieClientException e) {
    throw new ServiceUnavailableException("Failed to cancel download " + downloadKey, e);
  }
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:18,代码来源:DownloadRequestServiceImpl.java

示例8: create

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
@Override
public String create(DownloadRequest request) {
  LOG.debug("Trying to create download from request [{}]", request);
  Preconditions.checkNotNull(request);
  try {
    if (!downloadLimitsService.isInDownloadLimits(request.getCreator())) {
      throw new WebApplicationException(Response.status(GbifResponseStatus.ENHANCE_YOUR_CALM.getStatus()).build());
    }
    String jobId = client.run(parametersBuilder.buildWorkflowParameters(request));
    LOG.debug("oozie job id is: [{}]", jobId);
    String downloadId = DownloadUtils.workflowToDownloadId(jobId);
    persistDownload(request, downloadId);
    return downloadId;
  } catch (OozieClientException e) {
    throw new ServiceUnavailableException("Failed to create download job", e);
  }

}
 
开发者ID:gbif,项目名称:occurrence,代码行数:19,代码来源:DownloadRequestServiceImpl.java

示例9: reRun

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
/**
 * Rerun oozie job
 *
 * @param jobID
 * @throws OozieClientException
 * @throws IOException
 */

public static void reRun(String jobID) throws OozieClientException,
IOException {
	logger.info("rerun job:" + jobID);
	// create a workflow job configuration and set the workflow application path
	Properties conf = wc.createConfiguration();
	String app_path = wc.getJobInfo(jobID).getAppPath();

	// Need to analyze conf_o
	conf.setProperty(OozieClient.APP_PATH, app_path);
	conf.setProperty("queueName", Constants.QUEUE_NAME);
	conf.setProperty("nameNode", Constants.NAME_NODE);
	conf.setProperty("jobTracker", Constants.JOB_TRACKER);
	conf.setProperty("appPath", app_path);
	conf.setProperty("oozie.wf.rerun.failnodes", "false");

	wc.reRun(jobID, conf);
	OozieJob job = new OozieJob();
	job.setId(jobID);
	try {
		OozieJob temp = SecureDao.getObject(job);
		if ( temp != null ) {
			job = temp;
		}
		job.setStatus(getJob(jobID).getStatus());
		job.setCreatedTime(TimeUtils.getTime());

		logger.info("[reRun Status]" + job.getStatus());
		String[] setFields = {"status", "createtime", "endtime"};
		String[] condFields = {"jobid"};
		SecureDao.update(job, setFields, condFields);
	} catch (Exception e) {
		e.printStackTrace();
	}

}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:44,代码来源:OozieUtil.java

示例10: getWorkflowJob

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
public WorkflowJob getWorkflowJob() throws OozieException {
    try {
        return oozieClient.getJobInfo(jobId);
    } catch (OozieClientException e) {
        throw new OozieException(e);
    }
}
 
开发者ID:intropro,项目名称:prairie,代码行数:8,代码来源:OozieJob.java

示例11: setUp

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
@Before
public void setUp() throws IOException, OozieClientException {
	
    mvnTestWorkflowRunner = new MavenTestWorkflowRunner(getMavenExecutable(), getOutputDirNameOrNull());
    
	log.debug("Setting up OozieClient at {}", getOozieServiceLoc());
	sshConnectionManager = new SshConnectionManager(getRemoteHostName(), getRemoteSshPort(), getRemoteUserName());
	sshOozieClient = new SshOozieClient(sshConnectionManager, getOozieServiceLoc());
	
	SshHdfsFileFetcher hdfsFileFetcher = new SshHdfsFileFetcher(sshConnectionManager, getRemoteTempDir());
	hdfsTestHelper = new HdfsTestHelper(hdfsFileFetcher);
	
	tempDir = Files.createTempDir();
}
 
开发者ID:openaire,项目名称:iis,代码行数:15,代码来源:AbstractOozieWorkflowTestCase.java

示例12: startHiveAddPartitionCoordJob

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
@Override
public void startHiveAddPartitionCoordJob() {
	try {
		String workFlowRoot = setupHiveAddPartitionWorkflowApp();
		submitCoordJob(workFlowRoot);
	} catch (OozieClientException | InterruptedException
			| IllegalArgumentException | IOException e) {
		String errMsg = "Error occured while starting hive add partition coord job!";
		LOG.error(errMsg, e);
		throw new RuntimeException(errMsg, e);
	}
}
 
开发者ID:jaibeermalik,项目名称:searchanalytics-bigdata,代码行数:13,代码来源:OozieJobsServiceImpl.java

示例13: runHiveAddPartitionWorkflowJob

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
@Override
public void runHiveAddPartitionWorkflowJob() {
	try {
		String workFlowRoot = setupHiveAddPartitionWorkflowApp();
		submitWorkflowJob(workFlowRoot);

	} catch (OozieClientException | InterruptedException
			| IllegalArgumentException | IOException e) {
		String errMsg = "Error occured while starting hive add partition Workflow job!";
		LOG.error(errMsg, e);
		throw new RuntimeException(errMsg, e);
	}
}
 
开发者ID:jaibeermalik,项目名称:searchanalytics-bigdata,代码行数:14,代码来源:OozieJobsServiceImpl.java

示例14: startIndexTopCustomerQueryBundleCoordJob

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
@Override
public void startIndexTopCustomerQueryBundleCoordJob() {
	try {
		String workFlowRoot = setupTopCustomerQueryBundleJobApp();
		submitTopQueriesBundleCoordJob(workFlowRoot);
	} catch (OozieClientException | InterruptedException
			| IllegalArgumentException | IOException e) {
		String errMsg = "Error occured while starting bundle job!";
		LOG.error(errMsg, e);
		throw new RuntimeException(errMsg, e);
	}
}
 
开发者ID:jaibeermalik,项目名称:searchanalytics-bigdata,代码行数:13,代码来源:OozieJobsServiceImpl.java

示例15: testAddHiveActionWorkflowJob

import org.apache.oozie.client.OozieClientException; //导入依赖的package包/类
@Test
public void testAddHiveActionWorkflowJob() throws OozieClientException,
		InterruptedException, IllegalArgumentException, IOException {
	prepareHiveData();
	oozieJobsService.runHiveAddPartitionWorkflowJob();
	System.out.println("Workflow job completed ...");
	int totalRowCount = hiveSearchClicksService.getTotalRowCount(
			DBNAME_SEARCH, TBNAME_SEARCH_CLICKS);
	System.out.println("totalRowCount : " + totalRowCount);
	assertTrue(totalRowCount > 0);
}
 
开发者ID:jaibeermalik,项目名称:searchanalytics-bigdata,代码行数:12,代码来源:OozieJobsServiceImplTest.java


注:本文中的org.apache.oozie.client.OozieClientException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。