本文整理汇总了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;
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
示例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);
}
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}