本文整理汇总了Java中azkaban.executor.ExecutorManagerException类的典型用法代码示例。如果您正苦于以下问题:Java ExecutorManagerException类的具体用法?Java ExecutorManagerException怎么用?Java ExecutorManagerException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExecutorManagerException类属于azkaban.executor包,在下文中一共展示了ExecutorManagerException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleGetAllMetricName
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
/**
* Get all metrics tracked by the given executor
*
* @param executorId
* @param req
* @param ret
*/
private void handleGetAllMetricName(int executorId, HttpServletRequest req,
HashMap<String, Object> ret) throws IOException {
Map<String, Object> result;
try {
result =
execManager.callExecutorStats(executorId,
ConnectorParams.STATS_GET_ALLMETRICSNAME,
(Pair<String, String>[]) null);
if (result.containsKey(ConnectorParams.RESPONSE_ERROR)) {
ret.put("error", result.get(ConnectorParams.RESPONSE_ERROR).toString());
} else {
ret.put("metricList", result.get("data"));
}
} catch (ExecutorManagerException e) {
ret.put("error", "Failed to fetch metric names for executor : "
+ executorId);
}
}
示例2: handleChangeConfigurationRequest
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
/**
* Generic method to facilitate actionName action using Azkaban exec server
* @param executorId
* @param actionName Name of the action
* @throws ExecutorManagerException
*/
private void handleChangeConfigurationRequest(int executorId, String actionName, HttpServletRequest req, HashMap<String, Object> ret)
throws ServletException, IOException {
try {
Map<String, Object> result =
execManager
.callExecutorStats(executorId, actionName, getAllParams(req));
if (result.containsKey(ConnectorParams.RESPONSE_ERROR)) {
ret.put(ConnectorParams.RESPONSE_ERROR,
result.get(ConnectorParams.RESPONSE_ERROR).toString());
} else {
ret.put(ConnectorParams.STATUS_PARAM,
result.get(ConnectorParams.STATUS_PARAM));
}
} catch (ExecutorManagerException ex) {
ret.put("error", "Failed to change config change");
}
}
示例3: handleGetMetricHistory
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
/**
* Get metric snapshots for a metric and date specification
* @param executorId
* @throws ServletException
* @throws ExecutorManagerException
*/
private void handleGetMetricHistory(int executorId, HttpServletRequest req,
HashMap<String, Object> ret, User user) throws IOException,
ServletException {
try {
Map<String, Object> result =
execManager.callExecutorStats(executorId,
ConnectorParams.STATS_GET_METRICHISTORY, getAllParams(req));
if (result.containsKey(ConnectorParams.RESPONSE_ERROR)) {
ret.put(ConnectorParams.RESPONSE_ERROR,
result.get(ConnectorParams.RESPONSE_ERROR).toString());
} else {
ret.put("data", result.get("data"));
}
} catch (ExecutorManagerException ex) {
ret.put("error", "Failed to fetch metric history");
}
}
示例4: filterAdminOnlyFlowParams
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
/**
* <pre>
* Remove following flow param if submitting user is not an Azkaban admin
* FLOW_PRIORITY
* USE_EXECUTOR
* @param userManager
* @param options
* @param user
* </pre>
*/
public static void filterAdminOnlyFlowParams(UserManager userManager,
ExecutionOptions options, User user) throws ExecutorManagerException {
if (options == null || options.getFlowParameters() == null)
return;
Map<String, String> params = options.getFlowParameters();
// is azkaban Admin
if (!hasPermission(userManager, user, Type.ADMIN)) {
params.remove(ExecutionOptions.FLOW_PRIORITY);
// params.remove(ExecutionOptions.USE_EXECUTOR);
} else {
validateIntegerParam(params, ExecutionOptions.FLOW_PRIORITY);
// validateIntegerParam(params, ExecutionOptions.USE_EXECUTOR);
}
}
示例5: eval
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
@Override
public Object eval() {
ExecutableFlow exflow;
try {
exflow = executorManager.getExecutableFlow(execId);
} catch (ExecutorManagerException e) {
e.printStackTrace();
return Boolean.FALSE;
}
if (jobName != null) {
ExecutableNode job = exflow.getExecutableNode(jobName);
if (job != null) {
return job.getStatus().equals(wantedStatus);
} else {
return Boolean.FALSE;
}
} else {
return exflow.getStatus().equals(wantedStatus);
}
}
示例6: RemoteFlowWatcher
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
public RemoteFlowWatcher(int execId, ExecutorLoader loader, long interval) {
super(execId);
checkIntervalMs = interval;
try {
flow = loader.fetchExecutableFlow(execId);
} catch (ExecutorManagerException e) {
return;
}
super.setFlow(flow);
this.loader = loader;
this.execId = execId;
if (flow != null) {
this.thread = new RemoteUpdaterThread();
this.thread.setName("Remote-watcher-flow-" + execId);
this.thread.start();
}
}
示例7: finalizeLogFile
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
private void finalizeLogFile(int attemptNo) {
closeLogger();
if (logFile == null) {
flowLogger.info("Log file for job " + this.jobId + " is null");
return;
}
try {
File[] files = logFile.getParentFile().listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.startsWith(logFile.getName());
}
});
Arrays.sort(files, Collections.reverseOrder());
loader.uploadLogFile(executionId, this.node.getNestedId(), attemptNo,
files);
} catch (ExecutorManagerException e) {
flowLogger.error(
"Error writing out logs for job " + this.node.getNestedId(), e);
}
}
示例8: finalizeAttachmentFile
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
private void finalizeAttachmentFile() {
if (attachmentFileName == null) {
flowLogger.info("Attachment file for job " + this.jobId + " is null");
return;
}
try {
File file = new File(attachmentFileName);
if (!file.exists()) {
flowLogger.info("No attachment file for job " + this.jobId
+ " written.");
return;
}
loader.uploadAttachmentFile(node, file);
} catch (ExecutorManagerException e) {
flowLogger.error(
"Error writing out attachment for job " + this.node.getNestedId(), e);
}
}
示例9: handleModifyExecutionRequest
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
private void handleModifyExecutionRequest(Map<String, Object> respMap,
int execId, String user, HttpServletRequest req) throws ServletException {
if (!hasParam(req, MODIFY_EXECUTION_ACTION_TYPE)) {
respMap.put(RESPONSE_ERROR, "Modification type not set.");
}
String modificationType = getParam(req, MODIFY_EXECUTION_ACTION_TYPE);
try {
if (MODIFY_RETRY_FAILURES.equals(modificationType)) {
flowRunnerManager.retryFailures(execId, user);
}
} catch (ExecutorManagerException e) {
logger.error(e);
respMap.put("error", e.getMessage());
}
}
示例10: handleAjaxResumeRetry
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
private void handleAjaxResumeRetry(Map<String, Object> respMap, int execid, String user) {
if (user == null) {
respMap.put(RESPONSE_ERROR, "User has not benn set.");
return;
}
try {
logger.info("resume all flow of " + execid);
flowRunnerManager.setIsResumeRetry(true);
flowRunnerManager.submitFlow(execid);
respMap.put(STATUS_PARAM, RESPONSE_SUCCESS);
} catch (ExecutorManagerException e) {
logger.error("Resume all flows action error:", e);
respMap.put(RESPONSE_ERROR, e.getMessage());
} finally {
flowRunnerManager.setIsResumeRetry(false);
}
}
示例11: updateExecutableNode
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
@Override
public void updateExecutableNode(ExecutableNode node) throws ExecutorManagerException {
ExecutableNode foundNode = nodes.get(node.getId());
foundNode.setEndTime(node.getEndTime());
foundNode.setStartTime(node.getStartTime());
foundNode.setStatus(node.getStatus());
foundNode.setUpdateTime(node.getUpdateTime());
Integer value = jobUpdateCount.get(node.getId());
if (value == null) {
throw new ExecutorManagerException("The node has not been uploaded");
}
else {
jobUpdateCount.put(node.getId(), ++value);
}
flowUpdateCount++;
}
示例12: testSmallUploadLog
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
@Test
public void testSmallUploadLog() throws ExecutorManagerException {
File logDir = new File("unit/executions/logtest");
File[] smalllog = {new File(logDir, "log1.log"), new File(logDir, "log2.log"), new File(logDir, "log3.log")};
ExecutorLoader loader = createLoader();
loader.uploadLogFile(1, "smallFiles", 0, smalllog);
LogData data = loader.fetchLogs(1, "smallFiles", 0, 0, 50000);
Assert.assertNotNull(data);
Assert.assertEquals("Logs length is " + data.getLength(), data.getLength(), 53);
System.out.println(data.toString());
LogData data2 = loader.fetchLogs(1, "smallFiles", 0, 10, 20);
System.out.println(data2.toString());
Assert.assertNotNull(data2);
Assert.assertEquals("Logs length is " + data2.getLength(), data2.getLength(), 20);
}
示例13: testRemoveExecutionLogsByTime
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
@SuppressWarnings("static-access")
@Test
public void testRemoveExecutionLogsByTime() throws ExecutorManagerException, IOException, InterruptedException {
ExecutorLoader loader = createLoader();
File logDir = new File("unit/executions/logtest");
// Multiple of 255 for Henry the Eigth
File[] largelog = {new File(logDir, "largeLog1.log"), new File(logDir, "largeLog2.log"), new File(logDir, "largeLog3.log")};
DateTime time1 = DateTime.now();
loader.uploadLogFile(1, "oldlog", 0, largelog);
// sleep for 5 seconds
Thread.currentThread().sleep(5000);
loader.uploadLogFile(2, "newlog", 0, largelog);
DateTime time2 = time1.plusMillis(2500);
int count = loader.removeExecutionLogsByTime(time2.getMillis());
System.out.print("Removed " + count + " records");
LogData logs = loader.fetchLogs(1, "oldlog", 0, 0, 22222);
Assert.assertTrue(logs == null);
logs = loader.fetchLogs(2, "newlog", 0, 0, 22222);
Assert.assertFalse(logs == null);
}
示例14: ajaxFetchLastSuccessfulFlowExecution
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
private void ajaxFetchLastSuccessfulFlowExecution(Project project,
HashMap<String, Object> ret, HttpServletRequest req)
throws ServletException {
String flowId = getParam(req, "flow");
List<ExecutableFlow> exFlows = null;
try {
exFlows = executorManager.getExecutableFlows(
project.getId(), flowId, 0, 1, Status.SUCCEEDED);
}
catch (ExecutorManagerException e) {
ret.put("error", "Error retrieving executable flows");
return;
}
if (exFlows.size() == 0) {
ret.put("success", "false");
ret.put("message", "This flow has no successful run.");
return;
}
ret.put("success", "true");
ret.put("message", "");
ret.put("execId", exFlows.get(0).getExecutionId());
}
示例15: ajaxRestartFailed
import azkaban.executor.ExecutorManagerException; //导入依赖的package包/类
private void ajaxRestartFailed(HttpServletRequest req, HttpServletResponse resp, HashMap<String, Object> ret, User user, ExecutableFlow exFlow) throws ServletException {
Project project = getProjectAjaxByPermission(ret, exFlow.getProjectId(), user, Type.EXECUTE);
if (project == null) {
return;
}
if (exFlow.getStatus() == Status.FAILED || exFlow.getStatus() == Status.SUCCEEDED) {
ret.put("error", "Flow has already finished. Please re-execute.");
return;
}
try {
executorManager.retryFailures(exFlow, user.getUserId());
} catch (ExecutorManagerException e) {
ret.put("error", e.getMessage());
}
}