code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
@Override public boolean accept(final File dir, final String name) { return name.startsWith(JobRunner.this.logFile.getName()); }
If pipelining is set, will block on another flow's jobs.
accept
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private void finalizeAttachmentFile() { if (this.attachmentFileName == null) { this.flowLogger.info("Attachment file for job " + this.jobId + " is null"); return; } try { final File file = new File(this.attachmentFileName); if (!file.exists()) { this.flowLogger.info("No atta...
If pipelining is set, will block on another flow's jobs.
finalizeAttachmentFile
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private boolean IsSpecifiedWorkingDirectoryValid() { final File usersWorkingDir = new File(this.props.get(AbstractProcessJob.WORKING_DIR)); try { if (!usersWorkingDir.getCanonicalPath().startsWith(this.workingDir.getCanonicalPath())) { return false; } } catch (final IOException e) { ...
Validates execution directory specified by user.
IsSpecifiedWorkingDirectoryValid
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private void insertJVMAargs() { final String flowName = this.node.getParentFlow().getFlowId(); final String jobId = this.node.getId(); String jobJVMArgs = String.format( "'-Dazkaban.flowid=%s' '-Dazkaban.execid=%s' '-Dazkaban.jobid=%s'", flowName, this.executionId, jobId); ...
Add useful JVM arguments so it is easier to map a running Java process to a flow, execution id and job
insertJVMAargs
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private String insertJavaOptions() { if (this.jobtypeManager.getCommonPluginLoadProps() == null) { return null; } final String appendJavaOpts = this.jobtypeManager.getCommonPluginLoadProps().getString( Constants.AZ_JOBS_JAVA_OPTS, null); logger.info("JAVA OPTS appended to each command : " ...
Add useful Java options for java jobs provided through properties.
insertJavaOptions
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private void insertJobMetadata() { final String baseURL = this.azkabanProps.get(AZKABAN_WEBSERVER_URL); if (baseURL != null) { URL webserverURL = null; try { webserverURL = new URL(baseURL); } catch (MalformedURLException e) { logger.error(String.format("Exception in parsing ur...
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
insertJobMetadata
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private Status runJob() { Status finalStatus; try { this.job.run(); finalStatus = this.node.getStatus(); } catch (final Throwable e) { synchronized (this.syncObject) { if (this.props.getBoolean("job.succeed.on.failure", false)) { finalStatus = changeStatus(Status.FAILED_S...
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
runJob
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private Status changeStatus(final Status status) { changeStatus(status, System.currentTimeMillis()); return status; }
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
changeStatus
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private Status changeStatus(final Status status, final long time) { this.node.setStatus(status); this.node.setUpdateTime(time); return status; }
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
changeStatus
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private void fireEvent(final Event event) { fireEvent(event, true); }
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
fireEvent
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private void fireEvent(final Event event, final boolean updateTime) { if (updateTime) { this.node.setUpdateTime(System.currentTimeMillis()); } this.fireEventListeners(event); }
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
fireEvent
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
public void killBySLA() { synchronized (this.syncObject) { kill(); this.getNode().setModifiedBy("SLA"); this.getNode().setKilledBySLA(true); } }
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
killBySLA
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
public void kill() { synchronized (this.syncObject) { if (Status.isStatusFinished(this.node.getStatus())) { return; } logError("Kill has been called."); this.changeStatus(Status.KILLING); this.killed = true; final BlockingStatus status = this.currentBlockStatus; if...
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
kill
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
public boolean isKilled() { return this.killed; }
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
isKilled
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
public Status getStatus() { return this.node.getStatus(); }
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
getStatus
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private void logError(final String message) { if (this.logger != null) { this.logger.error(message); } }
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
logError
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private void logError(final String message, final Throwable t) { if (this.logger != null) { this.logger.error(message, t); } }
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
logError
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private void logInfo(final String message) { if (this.logger != null) { this.logger.info(message); } }
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
logInfo
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
public File getLogFile() { return this.logFile; }
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
getLogFile
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
Apache-2.0
private ProjectDirectoryMetadata fetchProjectMetadata(final Path project) { ProjectDirectoryMetadata projectDirectoryMetadata = this.cachedProjects.get(project); try { if (projectDirectoryMetadata == null) { final String fileName = project.getFileName().toString(); final int projectId = I...
Get metadata from the OS for the underlying path, lastAccessTime is fetched from the OS regardless of whether the given project already exists, but the space calculation for a project directory is only performed one-time. @param project path for the project cache. Project filepath encodes projectID & version ...
fetchProjectMetadata
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
Apache-2.0
private void loadAllProjects() { final List<Path> projects = new ArrayList<>(); for (final File project : Objects .requireNonNull(this.projectCacheDir.listFiles(new FilenameFilter() { String pattern = "[0-9]+\\.[0-9]+"; @Override public boolean accept(final File dir, final ...
Browse Cache root directory to fetch all valid projects and unclean files. If a project already exists in the cache, don't bother to re-fetch the OS metadata again.
loadAllProjects
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
Apache-2.0
@Override public boolean accept(final File dir, final String name) { return name.matches(this.pattern); }
Browse Cache root directory to fetch all valid projects and unclean files. If a project already exists in the cache, don't bother to re-fetch the OS metadata again.
accept
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
Apache-2.0
private long getProjectDirsTotalSizeInBytes() { long totalSizeInBytes = 0; for (ProjectDirectoryMetadata metadata : cachedProjects.values()) { totalSizeInBytes += metadata.getDirSizeInByte(); } return totalSizeInBytes; }
@return sum of the size of all project dirs
getProjectDirsTotalSizeInBytes
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
Apache-2.0
private void addToDeletionQueue(final File toDelete) { try { barrier.lock(); projectsUnderDeletion.put(toDelete.toPath(), toDelete); } finally { barrier.unlock(); } }
@return sum of the size of all project dirs
addToDeletionQueue
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
Apache-2.0
private void removeFromDeletionQueue(final Path toDelete) { try { barrier.lock(); projectsUnderDeletion.remove(toDelete); emptyQCond.signal(); } finally { barrier.unlock(); } }
@return sum of the size of all project dirs
removeFromDeletionQueue
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
Apache-2.0
private void deleteLeastRecentlyUsedProjects(long sizeToFreeInBytes) { final List<ProjectDirectoryMetadata> lruList = new ArrayList<>(cachedProjects.values()); lruList.sort(Comparator.comparing(ProjectDirectoryMetadata::getLastAccessTime)); for (ProjectDirectoryMetadata lruEntry : lruList) { if (size...
Delete least recently used projects to free up space @param sizeToFreeInBytes space to free up
deleteLeastRecentlyUsedProjects
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
Apache-2.0
private long bytesToMB(final long bytes) { return bytes / (1024 * 1024); }
Delete least recently used projects to free up space @param sizeToFreeInBytes space to free up
bytesToMB
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
Apache-2.0
public void deleteProjectDirsIfNecessary(final long newProjectSizeInBytes) { final long cachePartitionSize = this.projectCacheDir.getTotalSpace(); final long availablePartitionSize = this.projectCacheDir.getUsableSpace(); final long start = System.currentTimeMillis(); loadAllProjects(); log.info("L...
Deleting least recently accessed project dirs when there's no room to accommodate new project. The logic: 1. Calculates the total dynamic size available for the project cache. This = (Usable space left in the disk partition + Space currently occupied by the project cache). 2. Calculates high water mark & throttle w...
deleteProjectDirsIfNecessary
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
Apache-2.0
public String queryState() { if (projectsUnderDeletion.isEmpty()) { return STATE_AVAILABLE; } return STATE_CLEANING; }
@return Return the current state of the cleaner service
queryState
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
Apache-2.0
public void shutdown() { try { new ExecutorServiceUtils().gracefulShutdown(deletionService, Duration.ofDays(1)); } catch (final InterruptedException e) { log.warn("Error when deleting files", e); } }
Makes sure the Cache deletion process cleanly terminates so the possibility of unclean cache directories is eliminated.
shutdown
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java
Apache-2.0
Long getDirSizeInByte() { return this.dirSizeInByte; }
Used in project cache clean-up
getDirSizeInByte
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
Apache-2.0
void setDirSizeInByte(final Long dirSize) { this.dirSizeInByte = dirSize; }
Used in project cache clean-up
setDirSizeInByte
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
Apache-2.0
int getProjectId() { return this.projectId; }
Used in project cache clean-up
getProjectId
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
Apache-2.0
int getVersion() { return this.version; }
Used in project cache clean-up
getVersion
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
Apache-2.0
String getProjectName() { return this.projectName; }
Used in project cache clean-up
getProjectName
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
Apache-2.0
File getInstalledDir() { return this.installedDir; }
Used in project cache clean-up
getInstalledDir
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
Apache-2.0
void setInstalledDir(final File installedDir) { this.installedDir = installedDir; }
Used in project cache clean-up
setInstalledDir
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
Apache-2.0
@Override public String toString() { return "ProjectVersion{" + "projectId=" + this.projectId + ", version=" + this.version + ", installedDir=" + this.installedDir + ", dirSizeInByte=" + this.dirSizeInByte + ", lastAccessTime=" + this.lastAccessTime + '}'; }
Used in project cache clean-up
toString
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
Apache-2.0
FileTime getLastAccessTime() { return this.lastAccessTime; }
Used in project cache clean-up
getLastAccessTime
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
Apache-2.0
void setLastAccessTime(final FileTime lastAccessTime) { this.lastAccessTime = lastAccessTime; }
Used in project cache clean-up
setLastAccessTime
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectDirectoryMetadata.java
Apache-2.0
@Deprecated @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doPost(req, resp); }
@deprecated GET available for seamless upgrade. azkaban-web now uses POST.
doGet
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
Apache-2.0
@Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { final boolean noCache = null != req && Boolean.valueOf(req.getParameter(noCacheParamName)); if (noCache || System.currentTimeMillis() - lastRefreshedTime > cacheTimeInMi...
Handle all requests to Statistics Servlet {@inheritDoc}
doPost
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
Apache-2.0
protected void fillRemainingMemoryPercent(final ExecutorInfo stats) { if (exists_Bash && exists_Cat && exists_Grep && exists_Meminfo) { try { final ArrayList<String> output = Utils.runProcess("/bin/bash", "-c", "/bin/cat /proc/meminfo | grep -E \"^MemTotal:|^MemFree:|^Buffers:|^Cached:|^Sw...
fill the result set with the percent of the remaining system memory on the server. @param stats reference to the result container which contains all the results, this specific method will only work work on the property "remainingMemory" and "remainingMemoryPercent". NOTE: a double value will be used to present the re...
fillRemainingMemoryPercent
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
Apache-2.0
private Long extractMemoryInfo(final String field, final String result) { Long returnResult = null; if (null != result && null != field && result.matches(String.format("^%s:.*", field)) && result.split("\\s+").length > 2) { try { returnResult = Long.parseLong(result.split("\\s+")[1]); ...
fill the result set with the percent of the remaining system memory on the server. @param stats reference to the result container which contains all the results, this specific method will only work work on the property "remainingMemory" and "remainingMemoryPercent". NOTE: a double value will be used to present the re...
extractMemoryInfo
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
Apache-2.0
protected synchronized void populateStatistics(final boolean noCache) { //check again before starting the work. if (noCache || System.currentTimeMillis() - lastRefreshedTime > cacheTimeInMilliseconds) { final ExecutorInfo stats = new ExecutorInfo(); fillRemainingMemoryPercent(stats); fillRema...
call the data providers to fill the returning data container for statistics data. This function refreshes the static cached copy of data in case if necessary.
populateStatistics
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
Apache-2.0
protected void fillRemainingFlowCapacityAndLastDispatchedTime(final ExecutorInfo stats) { final AzkabanExecutorServer server = AzkabanExecutorServer.getApp(); if (server != null) { final FlowRunnerManager runnerMgr = AzkabanExecutorServer.getApp().getFlowRunnerManager(); final int assignedFlows = r...
fill the result set with the remaining flow capacity . @param stats reference to the result container which contains all the results, this specific method will only work on the property "remainingFlowCapacity".
fillRemainingFlowCapacityAndLastDispatchedTime
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
Apache-2.0
protected void fillCpuUsage(final ExecutorInfo stats) { if (exists_Bash && exists_Cat && exists_LoadAvg) { try { final ArrayList<String> output = Utils .runProcess("/bin/bash", "-c", "/bin/cat /proc/loadavg"); // process the output from bash call. if (output.size() > 0) { ...
<pre> fill the result set with the CPU usage . Note : As the 'Top' bash call doesn't yield accurate result for the system load, the implementation has been changed to load from the "proc/loadavg" which keeps the moving average of the system load, we are pulling the average for the recent 1 min. </pre> @p...
fillCpuUsage
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
Apache-2.0
public boolean hasParam(final HttpServletRequest request, final String param) { return HttpRequestUtils.hasParam(request, param); }
Servlet to communicate with Azkaban exec server This servlet get requests from stats servlet in Azkaban Web server
hasParam
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
Apache-2.0
public String getParam(final HttpServletRequest request, final String name) throws ServletException { return HttpRequestUtils.getParam(request, name); }
Servlet to communicate with Azkaban exec server This servlet get requests from stats servlet in Azkaban Web server
getParam
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
Apache-2.0
public Boolean getBooleanParam(final HttpServletRequest request, final String name) throws ServletException { return HttpRequestUtils.getBooleanParam(request, name); }
Servlet to communicate with Azkaban exec server This servlet get requests from stats servlet in Azkaban Web server
getBooleanParam
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
Apache-2.0
public long getLongParam(final HttpServletRequest request, final String name) throws ServletException { return HttpRequestUtils.getLongParam(request, name); }
Servlet to communicate with Azkaban exec server This servlet get requests from stats servlet in Azkaban Web server
getLongParam
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
Apache-2.0
@Deprecated @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doPost(req, resp); }
@deprecated GET available for seamless upgrade. azkaban-web now uses POST.
doGet
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
Apache-2.0
@Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { final Map<String, Object> ret = new HashMap<>(); if (hasParam(req, ACTION_PARAM)) { final String action = getParam(req, ACTION_PARAM); if (action.equals(STATS...
Handle all requests to Stats Servlet {@inheritDoc}
doPost
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
Apache-2.0
private void handleChangeEmitterPoints(final HttpServletRequest req, final Map<String, Object> ret) { try { final long numInstance = getLongParam(req, STATS_MAP_EMITTERNUMINSTANCES); if (MetricReportManager.isAvailable()) { final MetricReportManager metricManager = MetricReportManager.getI...
Update number of display snapshots for /stats graphs
handleChangeEmitterPoints
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
Apache-2.0
private void handleGetMetricHistory(final HttpServletRequest req, final Map<String, Object> ret) throws ServletException { if (MetricReportManager.isAvailable()) { final MetricReportManager metricManager = MetricReportManager.getInstance(); final InMemoryMetricEmitter memoryEmitter = ext...
Get metric snapshots for a metric and date specification
handleGetMetricHistory
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
Apache-2.0
private void handleGetAllMMetricsName(final HttpServletRequest req, final Map<String, Object> ret) { if (MetricReportManager.isAvailable()) { final MetricReportManager metricManager = MetricReportManager.getInstance(); final List<IMetric<?>> result = metricManager.getAllMetrics(); if (result...
Get all the metrics tracked by metric manager
handleGetAllMMetricsName
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
Apache-2.0
private void handleChangeMetricInterval(final HttpServletRequest req, final Map<String, Object> ret) throws ServletException { try { final String metricName = getParam(req, STATS_MAP_METRICNAMEPARAM); final long newInterval = getLongParam(req, STATS_MAP_REPORTINGINTERVAL); if (MetricReportMa...
Update tracking interval for a given metrics
handleChangeMetricInterval
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
Apache-2.0
private Date parseDate(final String date) throws ParseException { final DateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz"); return format.parse(date); }
Update tracking interval for a given metrics
parseDate
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java
Apache-2.0
@Override public void run() { logger.info("Running trigger for " + this); if (isTriggerExpired()) { logger.info(this + " expired"); return; } logger.info("Check if trigger condition met for " + this); final boolean isTriggerConditionMet = this.triggerCondition.isMet(); logger.info...
Perform the action if trigger condition is met
run
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/Trigger.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/Trigger.java
Apache-2.0
public boolean isTriggerExpired() { return this.expireCondition.isMet(); }
Check if the trigger is expired and reset isExpired @return true if trigger is expired
isTriggerExpired
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/Trigger.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/Trigger.java
Apache-2.0
@Override public String toString() { final StringBuilder actionsString = new StringBuilder(); for (final TriggerAction act : this.actions) { actionsString.append(", "); actionsString.append(act.getDescription()); } return "Trigger for execution " + this.execId + " with trigger condition o...
Check if the trigger is expired and reset isExpired @return true if trigger is expired
toString
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/Trigger.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/Trigger.java
Apache-2.0
protected synchronized void handleJobStatusChange(final String jobId, final Status status) { final BlockingStatus block = this.map.get(jobId); if (block != null) { block.changeStatus(status); } }
Called to fire events to the JobRunner listeners
handleJobStatusChange
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
Apache-2.0
public int getExecId() { return this.execId; }
Called to fire events to the JobRunner listeners
getExecId
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
Apache-2.0
public synchronized BlockingStatus getBlockingStatus(final String jobId) { if (this.cancelWatch) { return null; } final ExecutableNode node = this.flow.getExecutableNodePath(jobId); if (node == null) { return null; } BlockingStatus blockingStatus = this.map.get(jobId); if (bloc...
Called to fire events to the JobRunner listeners
getBlockingStatus
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
Apache-2.0
public Status peekStatus(final String jobId) { if (Status.isStatusFinished(this.flow.getStatus())) { return null; } final ExecutableNode node = this.flow.getExecutableNodePath(jobId); if (node != null) { ExecutableFlowBase parentFlow = node.getParentFlow(); while (parentFlow != null) {...
Called to fire events to the JobRunner listeners
peekStatus
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
Apache-2.0
public synchronized void unblockAllWatches() { this.logger.info("Unblock all watches on " + this.execId); this.cancelWatch = true; for (final BlockingStatus status : this.map.values()) { this.logger.info("Unblocking " + status.getJobId()); status.changeStatus(Status.SKIPPED); status.unblo...
Called to fire events to the JobRunner listeners
unblockAllWatches
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
Apache-2.0
public boolean isWatchCancelled() { return this.cancelWatch; }
Called to fire events to the JobRunner listeners
isWatchCancelled
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
Apache-2.0
@Override public synchronized void handleEvent(final Event event) { if (event.getData().isRootFlowEvent() && event.getType() == EventType.FLOW_FINISHED) { final FlowRunner runner = (FlowRunner) event.getRunner(); if (runner != null && runner.getExecutableFlow().getStatus().equals(Status.FAILED)) { ...
Listen for events to maintain correct value of number of failed flows {@inheritDoc} @see azkaban.event.EventListener#handleEvent(azkaban.event.Event)
handleEvent
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedFlowMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedFlowMetric.java
Apache-2.0
@Override protected void preTrackingEventMethod() { // Nothing to finalize before tracking event }
Listen for events to maintain correct value of number of failed flows {@inheritDoc} @see azkaban.event.EventListener#handleEvent(azkaban.event.Event)
preTrackingEventMethod
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedFlowMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedFlowMetric.java
Apache-2.0
@Override protected synchronized void postTrackingEventMethod() { this.value = 0; }
Listen for events to maintain correct value of number of failed flows {@inheritDoc} @see azkaban.event.EventListener#handleEvent(azkaban.event.Event)
postTrackingEventMethod
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedFlowMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedFlowMetric.java
Apache-2.0
@Override public synchronized void handleEvent(final Event event) { if (event.getType() == EventType.JOB_FINISHED && Status.FAILED .equals(event.getData().getStatus())) { this.value = this.value + 1; } }
Listen for events to maintain correct value of number of failed jobs {@inheritDoc} @see azkaban.event.EventListener#handleEvent(azkaban.event.Event)
handleEvent
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedJobMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedJobMetric.java
Apache-2.0
@Override protected void preTrackingEventMethod() { // Nothing to finalize before tracking event }
Listen for events to maintain correct value of number of failed jobs {@inheritDoc} @see azkaban.event.EventListener#handleEvent(azkaban.event.Event)
preTrackingEventMethod
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedJobMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedJobMetric.java
Apache-2.0
@Override protected synchronized void postTrackingEventMethod() { this.value = 0; }
Listen for events to maintain correct value of number of failed jobs {@inheritDoc} @see azkaban.event.EventListener#handleEvent(azkaban.event.Event)
postTrackingEventMethod
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedJobMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumFailedJobMetric.java
Apache-2.0
@Override protected synchronized void preTrackingEventMethod() { this.value = this.flowManager.getNumQueuedFlows(); }
Update value using flow manager {@inheritDoc} @see azkaban.metric.TimeBasedReportingMetric#preTrackingEventMethod()
preTrackingEventMethod
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumQueuedFlowMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumQueuedFlowMetric.java
Apache-2.0
@Override protected void postTrackingEventMethod() { // nothing to post process }
Update value using flow manager {@inheritDoc} @see azkaban.metric.TimeBasedReportingMetric#preTrackingEventMethod()
postTrackingEventMethod
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumQueuedFlowMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumQueuedFlowMetric.java
Apache-2.0
@Override protected synchronized void preTrackingEventMethod() { this.value = this.flowManager.getNumRunningFlows(); }
Update value using flow manager {@inheritDoc} @see azkaban.metric.TimeBasedReportingMetric#preTrackingEventMethod()
preTrackingEventMethod
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumRunningFlowMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumRunningFlowMetric.java
Apache-2.0
@Override protected void postTrackingEventMethod() { // nothing to post process }
Update value using flow manager {@inheritDoc} @see azkaban.metric.TimeBasedReportingMetric#preTrackingEventMethod()
postTrackingEventMethod
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumRunningFlowMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumRunningFlowMetric.java
Apache-2.0
@Override public synchronized void handleEvent(final Event event) { if (event.getType() == EventType.JOB_STARTED) { this.value = this.value + 1; } else if (event.getType() == EventType.JOB_FINISHED) { this.value = this.value - 1; } }
Listen for events to maintain correct value of number of running jobs {@inheritDoc} @see azkaban.event.EventListener#handleEvent(azkaban.event.Event)
handleEvent
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumRunningJobMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumRunningJobMetric.java
Apache-2.0
@Override protected void preTrackingEventMethod() { // nothing to finalize value is already updated }
Listen for events to maintain correct value of number of running jobs {@inheritDoc} @see azkaban.event.EventListener#handleEvent(azkaban.event.Event)
preTrackingEventMethod
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumRunningJobMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumRunningJobMetric.java
Apache-2.0
@Override protected void postTrackingEventMethod() { // nothing to post process }
Listen for events to maintain correct value of number of running jobs {@inheritDoc} @see azkaban.event.EventListener#handleEvent(azkaban.event.Event)
postTrackingEventMethod
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumRunningJobMetric.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/NumRunningJobMetric.java
Apache-2.0
@Override public synchronized Ratio getRatio() { final long hitCount = Arrays.stream(this.hits.getSnapshot().getValues()).sum(); return Ratio.of(hitCount, this.hits.getSnapshot().size()); }
Project cache hit ratio of last 100 cache accesses. <p>The advantage of sampling last 100 caches accesses over time-based sampling like last hour's cache accesses is the former is more deterministic. Suppose there's only few execution in last hour, then hit ratio might not be truly informative, which doesn't necessari...
getRatio
java
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/metric/ProjectCacheHitRatio.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/main/java/azkaban/execapp/metric/ProjectCacheHitRatio.java
Apache-2.0
@Test public void testSslDisabledJettyServer() throws Exception { ExecJettyServerModule execJettyServerModule = new ExecJettyServerModule(); Props props = new Props(); props.put("jetty.use.ssl", "false"); props.put("executor.port", JETTY_PORT); Server jettyServer = execJettyServerModule.createJet...
This test tries to create the jetty-server and verify that it is reachable on the attached port via Http.
testSslDisabledJettyServer
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/common/ExecJettyServerModuleTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/common/ExecJettyServerModuleTest.java
Apache-2.0
@Test public void testSslEnabledJettyServer() throws Exception { ExecJettyServerModule execJettyServerModule = new ExecJettyServerModule(); Props props = new Props(); props.put("jetty.use.ssl", "true"); props.put("executor.ssl.port", JETTY_TLS_PORT); props.put("jetty.keystore", KEYSTORE_PATH); ...
This test tries to create the jetty-server and verify that it is reachable on the attached port via Https.
testSslEnabledJettyServer
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/common/ExecJettyServerModuleTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/common/ExecJettyServerModuleTest.java
Apache-2.0
@Test public void testRetryFailures() throws IOException, ServletException, ExecutorManagerException { init(); Mockito.when(this.mockHttpServletRequest.getParameter(ConnectorParams.ACTION_PARAM)) .thenReturn(ConnectorParams.MODIFY_EXECUTION_ACTION); Mockito.when( this.mockHttpServletReques...
Verify that the method handleModifyExecutionRequest indeed is getting called. Verify that the method retryFailures for FlowContainer indeed is getting called.
testRetryFailures
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/container/ContainerServletTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/container/ContainerServletTest.java
Apache-2.0
@Test public void testUnsupportedActions() throws IOException { init(); Mockito.when(this.mockHttpServletRequest.getParameter(ConnectorParams.ACTION_PARAM)) .thenReturn("SomeAction"); this.mockContainerServlet.handleRequest(this.mockHttpServletRequest, this.mockHttpServletResponse); th...
Verify that the method handleModifyExecutionRequest indeed is getting called. Verify that the method retryFailures for FlowContainer indeed is getting called.
testUnsupportedActions
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/container/ContainerServletTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/container/ContainerServletTest.java
Apache-2.0
private ServletOutputStream getServletOutputStream(ByteArrayOutputStream baos) { return new ServletOutputStream() { @Override public void write(int b) throws IOException { baos.write(b); } }; }
Verify that the method handleModifyExecutionRequest indeed is getting called. Verify that the method retryFailures for FlowContainer indeed is getting called.
getServletOutputStream
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/container/ContainerServletTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/container/ContainerServletTest.java
Apache-2.0
@Override public void write(int b) throws IOException { baos.write(b); }
Verify that the method handleModifyExecutionRequest indeed is getting called. Verify that the method retryFailures for FlowContainer indeed is getting called.
write
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/container/ContainerServletTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/container/ContainerServletTest.java
Apache-2.0
@Test public void testCallBackManager() throws Exception { // Enable jobcallback explicitly. props.put("azkaban.executor.jobcallback.enabled", "true"); startFlowContainer(); // The callback manager must be set. assert JobCallbackManager.isInitialized(); // Get the instance final JobCallba...
Test if Callback Manager is created when Flow Container starts
testCallBackManager
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/container/FlowContainerTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/container/FlowContainerTest.java
Apache-2.0
@Test public void testSetResourceUtilization() { FlowContainer flowContainerMock = mock(FlowContainer.class); FlowRunner flowRunnerMock = mock(FlowRunner.class); FlowRunnerProxy flowRunnerProxyMock = mock(FlowRunnerProxy.class); Mockito.doReturn(flowRunnerProxyMock).when(flowRunnerMock).getProxy(); ...
Test if Callback Manager is created when Flow Container starts
testSetResourceUtilization
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/container/FlowContainerTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/container/FlowContainerTest.java
Apache-2.0
private void addParentNode(final String childName, final String parentName) { this.dagBuilder.addParentNode(childName, parentName); }
Adds parent as the child's parent node.
addParentNode
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
Apache-2.0
private void assertDagNodes(final Dag dag) { final List<Node> nodes = dag.getNodes(); assertThat(nodes.size()).isEqualTo(2); final Node node1 = nodes.get(0); final Node node2 = nodes.get(1); assertThat(node1.getName()).isEqualTo("nb1"); assertThat(node2.getName()).isEqualTo("nb2"); assertT...
Adds parent as the child's parent node.
assertDagNodes
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
Apache-2.0
private Node createNode(final String name) { return this.dagBuilder.createNode(name, mock(NodeProcessor.class)); }
Adds parent as the child's parent node.
createNode
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
Apache-2.0
@Test public void build_should_throw_exception_when_circular_dependency_is_detected() { // given final String n1Name = "nb1"; final String n2Name = "nb2"; final String n3Name = "nb3"; createNode(n1Name); createNode(n2Name); createNode(n3Name); addParentNode(n2Name, n1Name); addPar...
Adds parent as the child's parent node.
build_should_throw_exception_when_circular_dependency_is_detected
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
Apache-2.0
@Test public void can_not_call_createNode_after_dag_already_built() { // given this.dagBuilder.build(); // when final Throwable thrown = catchThrowable(() -> createNode("a")); // then assertThrownIsDagBuilderException(thrown); }
Adds parent as the child's parent node.
can_not_call_createNode_after_dag_already_built
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
Apache-2.0
@Test public void can_not_call_addParentNode_after_dag_already_built() { // given this.dagBuilder.build(); // when final Throwable thrown = catchThrowable(() -> addParentNode("n1", "n2")); // then assertThrownIsDagBuilderException(thrown); }
Adds parent as the child's parent node.
can_not_call_addParentNode_after_dag_already_built
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
Apache-2.0
@Test public void can_not_call_build_after_dag_already_built() { // given this.dagBuilder.build(); // when final Throwable thrown = catchThrowable(this.dagBuilder::build); // then assertThrownIsDagBuilderException(thrown); }
Adds parent as the child's parent node.
can_not_call_build_after_dag_already_built
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
Apache-2.0
@Test public void test_toString() { // given // when final String stringRepresentation = this.dagBuilder.toString(); // then assertThat(stringRepresentation).isEqualTo("DagBuilder (dag builder)"); }
Adds parent as the child's parent node.
test_toString
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/dag/DagBuilderTest.java
Apache-2.0
@After public void tearDown() throws InterruptedException { this.dagService.shutdownAndAwaitTermination(); }
Tests {@link DagService} <p>Naming conventions: nodes are named with letters such as a, b. Dags are named with 'f' prefix. e.g. "fa". A sub DAG has the prefix "sf" such as "sfb". A sub DAG is a node within the parent DAG.
tearDown
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/dag/DagServiceTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/dag/DagServiceTest.java
Apache-2.0
@Test public void shutdown_calls_service_util_graceful_shutdown() throws InterruptedException { // given final ExecutorServiceUtils serviceUtils = mock(ExecutorServiceUtils.class); final DagService testDagService = new DagService(serviceUtils); // when testDagService.shutdownAndAwaitTermination()...
Tests {@link DagService} <p>Naming conventions: nodes are named with letters such as a, b. Dags are named with 'f' prefix. e.g. "fa". A sub DAG has the prefix "sf" such as "sfb". A sub DAG is a node within the parent DAG.
shutdown_calls_service_util_graceful_shutdown
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/dag/DagServiceTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/dag/DagServiceTest.java
Apache-2.0
@Test public void oneNodeSuccess() throws Exception { createNodeInTestDag("a"); addToExpectedSequence("fa", Status.RUNNING); addToExpectedSequence("a", Status.RUNNING); addToExpectedSequence("a", Status.SUCCESS); addToExpectedSequence("fa", Status.SUCCESS); buildDagRunAndVerify(); }
Tests a DAG with one node which will run successfully.
oneNodeSuccess
java
azkaban/azkaban
azkaban-exec-server/src/test/java/azkaban/dag/DagServiceTest.java
https://github.com/azkaban/azkaban/blob/master/azkaban-exec-server/src/test/java/azkaban/dag/DagServiceTest.java
Apache-2.0