id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
130,700
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java
FlowRunner.getImpliedStatus
public Status getImpliedStatus(final ExecutableNode node) { // If it's running or finished with 'SUCCEEDED', than don't even // bother starting this job. if (Status.isStatusRunning(node.getStatus()) || node.getStatus() == Status.SUCCEEDED) { return null; } // Go through the node's dep...
java
public Status getImpliedStatus(final ExecutableNode node) { // If it's running or finished with 'SUCCEEDED', than don't even // bother starting this job. if (Status.isStatusRunning(node.getStatus()) || node.getStatus() == Status.SUCCEEDED) { return null; } // Go through the node's dep...
[ "public", "Status", "getImpliedStatus", "(", "final", "ExecutableNode", "node", ")", "{", "// If it's running or finished with 'SUCCEEDED', than don't even", "// bother starting this job.", "if", "(", "Status", ".", "isStatusRunning", "(", "node", ".", "getStatus", "(", ")"...
Determines what the state of the next node should be. Returns null if the node should not be run.
[ "Determines", "what", "the", "state", "of", "the", "next", "node", "should", "be", ".", "Returns", "null", "if", "the", "node", "should", "not", "be", "run", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java#L909-L958
130,701
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java
FlowRunner.configureJobLevelMetrics
private void configureJobLevelMetrics(final JobRunner jobRunner) { this.logger.info("Configuring Azkaban metrics tracking for jobrunner object"); if (MetricReportManager.isAvailable()) { final MetricReportManager metricManager = MetricReportManager.getInstance(); // Adding NumRunningJobMetric liste...
java
private void configureJobLevelMetrics(final JobRunner jobRunner) { this.logger.info("Configuring Azkaban metrics tracking for jobrunner object"); if (MetricReportManager.isAvailable()) { final MetricReportManager metricManager = MetricReportManager.getInstance(); // Adding NumRunningJobMetric liste...
[ "private", "void", "configureJobLevelMetrics", "(", "final", "JobRunner", "jobRunner", ")", "{", "this", ".", "logger", ".", "info", "(", "\"Configuring Azkaban metrics tracking for jobrunner object\"", ")", ";", "if", "(", "MetricReportManager", ".", "isAvailable", "("...
Configure Azkaban metrics tracking for a new jobRunner instance
[ "Configure", "Azkaban", "metrics", "tracking", "for", "a", "new", "jobRunner", "instance" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java#L1082-L1098
130,702
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/flowtrigger/FlowTriggerService.java
FlowTriggerService.recoverIncompleteTriggerInstances
public void recoverIncompleteTriggerInstances() { final Collection<TriggerInstance> unfinishedTriggerInstances = this.flowTriggerInstanceLoader .getIncompleteTriggerInstances(); for (final TriggerInstance triggerInstance : unfinishedTriggerInstances) { if (triggerInstance.getFlowTrigger() != null)...
java
public void recoverIncompleteTriggerInstances() { final Collection<TriggerInstance> unfinishedTriggerInstances = this.flowTriggerInstanceLoader .getIncompleteTriggerInstances(); for (final TriggerInstance triggerInstance : unfinishedTriggerInstances) { if (triggerInstance.getFlowTrigger() != null)...
[ "public", "void", "recoverIncompleteTriggerInstances", "(", ")", "{", "final", "Collection", "<", "TriggerInstance", ">", "unfinishedTriggerInstances", "=", "this", ".", "flowTriggerInstanceLoader", ".", "getIncompleteTriggerInstances", "(", ")", ";", "for", "(", "final...
Resume executions of all incomplete trigger instances by recovering the state from db.
[ "Resume", "executions", "of", "all", "incomplete", "trigger", "instances", "by", "recovering", "the", "state", "from", "db", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/FlowTriggerService.java#L262-L295
130,703
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/flowtrigger/FlowTriggerService.java
FlowTriggerService.startTrigger
public void startTrigger(final FlowTrigger flowTrigger, final String flowId, final int flowVersion, final String submitUser, final Project project) { final TriggerInstance triggerInst = createTriggerInstance(flowTrigger, flowId, flowVersion, submitUser, project); this.flowTriggerExecutorService.su...
java
public void startTrigger(final FlowTrigger flowTrigger, final String flowId, final int flowVersion, final String submitUser, final Project project) { final TriggerInstance triggerInst = createTriggerInstance(flowTrigger, flowId, flowVersion, submitUser, project); this.flowTriggerExecutorService.su...
[ "public", "void", "startTrigger", "(", "final", "FlowTrigger", "flowTrigger", ",", "final", "String", "flowId", ",", "final", "int", "flowVersion", ",", "final", "String", "submitUser", ",", "final", "Project", "project", ")", "{", "final", "TriggerInstance", "t...
Start the trigger. The method will be scheduled to invoke by azkaban scheduler.
[ "Start", "the", "trigger", ".", "The", "method", "will", "be", "scheduled", "to", "invoke", "by", "azkaban", "scheduler", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/FlowTriggerService.java#L375-L384
130,704
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/flowtrigger/FlowTriggerService.java
FlowTriggerService.cancelTriggerInstance
public void cancelTriggerInstance(final TriggerInstance triggerInst, final CancellationCause cause) { if (triggerInst.getStatus() == Status.RUNNING) { this.flowTriggerExecutorService.submit(() -> cancel(triggerInst, cause)); } }
java
public void cancelTriggerInstance(final TriggerInstance triggerInst, final CancellationCause cause) { if (triggerInst.getStatus() == Status.RUNNING) { this.flowTriggerExecutorService.submit(() -> cancel(triggerInst, cause)); } }
[ "public", "void", "cancelTriggerInstance", "(", "final", "TriggerInstance", "triggerInst", ",", "final", "CancellationCause", "cause", ")", "{", "if", "(", "triggerInst", ".", "getStatus", "(", ")", "==", "Status", ".", "RUNNING", ")", "{", "this", ".", "flowT...
Cancel a trigger instance @param triggerInst trigger instance to be cancelled @param cause cause of cancelling
[ "Cancel", "a", "trigger", "instance" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/FlowTriggerService.java#L438-L443
130,705
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/flowtrigger/FlowTriggerService.java
FlowTriggerService.shutdown
public void shutdown() { this.flowTriggerExecutorService.shutdown(); this.cancelExecutorService.shutdown(); this.timeoutService.shutdown(); this.flowTriggerExecutorService.shutdownNow(); this.cancelExecutorService.shutdownNow(); this.timeoutService.shutdownNow(); this.triggerProcessor.shut...
java
public void shutdown() { this.flowTriggerExecutorService.shutdown(); this.cancelExecutorService.shutdown(); this.timeoutService.shutdown(); this.flowTriggerExecutorService.shutdownNow(); this.cancelExecutorService.shutdownNow(); this.timeoutService.shutdownNow(); this.triggerProcessor.shut...
[ "public", "void", "shutdown", "(", ")", "{", "this", ".", "flowTriggerExecutorService", ".", "shutdown", "(", ")", ";", "this", ".", "cancelExecutorService", ".", "shutdown", "(", ")", ";", "this", ".", "timeoutService", ".", "shutdown", "(", ")", ";", "th...
Shuts down the service immediately.
[ "Shuts", "down", "the", "service", "immediately", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/FlowTriggerService.java#L547-L559
130,706
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java
FileIOUtils.isDirWritable
public static boolean isDirWritable(final File dir) { File testFile = null; try { testFile = new File(dir, "_tmp"); /* * Create and delete a dummy file in order to check file permissions. Maybe * there is a safer way for this check. */ testFile.createNewFile(); } catch...
java
public static boolean isDirWritable(final File dir) { File testFile = null; try { testFile = new File(dir, "_tmp"); /* * Create and delete a dummy file in order to check file permissions. Maybe * there is a safer way for this check. */ testFile.createNewFile(); } catch...
[ "public", "static", "boolean", "isDirWritable", "(", "final", "File", "dir", ")", "{", "File", "testFile", "=", "null", ";", "try", "{", "testFile", "=", "new", "File", "(", "dir", ",", "\"_tmp\"", ")", ";", "/*\n * Create and delete a dummy file in order ...
Check if a directory is writable @param dir directory file object @return true if it is writable. false, otherwise
[ "Check", "if", "a", "directory", "is", "writable" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java#L61-L78
130,707
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java
FileIOUtils.deleteDirectorySilently
public static void deleteDirectorySilently(final File dir) { if (dir != null) { try { FileUtils.deleteDirectory(dir); } catch (final IOException e) { log.error("error when deleting dir {}", dir, e); } } }
java
public static void deleteDirectorySilently(final File dir) { if (dir != null) { try { FileUtils.deleteDirectory(dir); } catch (final IOException e) { log.error("error when deleting dir {}", dir, e); } } }
[ "public", "static", "void", "deleteDirectorySilently", "(", "final", "File", "dir", ")", "{", "if", "(", "dir", "!=", "null", ")", "{", "try", "{", "FileUtils", ".", "deleteDirectory", "(", "dir", ")", ";", "}", "catch", "(", "final", "IOException", "e",...
Delete a directory, log the error if deletion fails.
[ "Delete", "a", "directory", "log", "the", "error", "if", "deletion", "fails", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java#L83-L91
130,708
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java
FileIOUtils.dumpNumberToFile
public static void dumpNumberToFile(final Path filePath, final long num) throws IOException { try (final BufferedWriter writer = Files .newBufferedWriter(filePath, StandardCharsets.UTF_8)) { writer.write(String.valueOf(num)); } catch (final IOException e) { log.error("Failed to write the num...
java
public static void dumpNumberToFile(final Path filePath, final long num) throws IOException { try (final BufferedWriter writer = Files .newBufferedWriter(filePath, StandardCharsets.UTF_8)) { writer.write(String.valueOf(num)); } catch (final IOException e) { log.error("Failed to write the num...
[ "public", "static", "void", "dumpNumberToFile", "(", "final", "Path", "filePath", ",", "final", "long", "num", ")", "throws", "IOException", "{", "try", "(", "final", "BufferedWriter", "writer", "=", "Files", ".", "newBufferedWriter", "(", "filePath", ",", "St...
Dumps a number into a new file. @param filePath the target file @param num the number to dump @throws IOException if file already exists
[ "Dumps", "a", "number", "into", "a", "new", "file", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java#L101-L109
130,709
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java
FileIOUtils.readNumberFromFile
public static long readNumberFromFile(final Path filePath) throws IOException, NumberFormatException { final List<String> allLines = Files.readAllLines(filePath); if (!allLines.isEmpty()) { return Long.parseLong(allLines.get(0)); } else { throw new NumberFormatException("unable to parse em...
java
public static long readNumberFromFile(final Path filePath) throws IOException, NumberFormatException { final List<String> allLines = Files.readAllLines(filePath); if (!allLines.isEmpty()) { return Long.parseLong(allLines.get(0)); } else { throw new NumberFormatException("unable to parse em...
[ "public", "static", "long", "readNumberFromFile", "(", "final", "Path", "filePath", ")", "throws", "IOException", ",", "NumberFormatException", "{", "final", "List", "<", "String", ">", "allLines", "=", "Files", ".", "readAllLines", "(", "filePath", ")", ";", ...
Reads a number from a file. @param filePath the target file
[ "Reads", "a", "number", "from", "a", "file", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java#L116-L124
130,710
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java
FileIOUtils.createDeepHardlink
public static int createDeepHardlink(final File sourceDir, final File destDir) throws IOException { if (!sourceDir.exists()) { throw new IOException("Source directory " + sourceDir.getPath() + " doesn't exist"); } else if (!destDir.exists()) { throw new IOException("Destination direc...
java
public static int createDeepHardlink(final File sourceDir, final File destDir) throws IOException { if (!sourceDir.exists()) { throw new IOException("Source directory " + sourceDir.getPath() + " doesn't exist"); } else if (!destDir.exists()) { throw new IOException("Destination direc...
[ "public", "static", "int", "createDeepHardlink", "(", "final", "File", "sourceDir", ",", "final", "File", "destDir", ")", "throws", "IOException", "{", "if", "(", "!", "sourceDir", ".", "exists", "(", ")", ")", "{", "throw", "new", "IOException", "(", "\"S...
Hard link files and recurse into directories.
[ "Hard", "link", "files", "and", "recurse", "into", "directories", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java#L148-L180
130,711
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java
FileIOUtils.getUtf8Range
public static Pair<Integer, Integer> getUtf8Range(final byte[] buffer, final int offset, final int length) { final int start = getUtf8ByteStart(buffer, offset); final int end = getUtf8ByteEnd(buffer, offset + length - 1); return new Pair<>(start, end - start + 1); }
java
public static Pair<Integer, Integer> getUtf8Range(final byte[] buffer, final int offset, final int length) { final int start = getUtf8ByteStart(buffer, offset); final int end = getUtf8ByteEnd(buffer, offset + length - 1); return new Pair<>(start, end - start + 1); }
[ "public", "static", "Pair", "<", "Integer", ",", "Integer", ">", "getUtf8Range", "(", "final", "byte", "[", "]", "buffer", ",", "final", "int", "offset", ",", "final", "int", "length", ")", "{", "final", "int", "start", "=", "getUtf8ByteStart", "(", "buf...
Returns first and length.
[ "Returns", "first", "and", "length", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/FileIOUtils.java#L293-L299
130,712
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java
ProjectManagerServlet.handlePurgeProject
private void handlePurgeProject(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException { final User user = session.getUser(); final HashMap<String, Object> ret = new HashMap<>(); boolean isOperationSuccessful = true; try { ...
java
private void handlePurgeProject(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException { final User user = session.getUser(); final HashMap<String, Object> ret = new HashMap<>(); boolean isOperationSuccessful = true; try { ...
[ "private", "void", "handlePurgeProject", "(", "final", "HttpServletRequest", "req", ",", "final", "HttpServletResponse", "resp", ",", "final", "Session", "session", ")", "throws", "ServletException", ",", "IOException", "{", "final", "User", "user", "=", "session", ...
validate readiness of a project and user permission and use projectManager to purge the project if things looks good
[ "validate", "readiness", "of", "a", "project", "and", "user", "permission", "and", "use", "projectManager", "to", "purge", "the", "project", "if", "things", "looks", "good" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java#L566-L620
130,713
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java
ProjectManagerServlet.ajaxGetPermissions
private void ajaxGetPermissions(final Project project, final HashMap<String, Object> ret) { final ArrayList<HashMap<String, Object>> permissions = new ArrayList<>(); for (final Pair<String, Permission> perm : project.getUserPermissions()) { final HashMap<String, Object> permObj = new HashMap<>(); ...
java
private void ajaxGetPermissions(final Project project, final HashMap<String, Object> ret) { final ArrayList<HashMap<String, Object>> permissions = new ArrayList<>(); for (final Pair<String, Permission> perm : project.getUserPermissions()) { final HashMap<String, Object> permObj = new HashMap<>(); ...
[ "private", "void", "ajaxGetPermissions", "(", "final", "Project", "project", ",", "final", "HashMap", "<", "String", ",", "Object", ">", "ret", ")", "{", "final", "ArrayList", "<", "HashMap", "<", "String", ",", "Object", ">", ">", "permissions", "=", "new...
this only returns user permissions, but not group permissions and proxy users
[ "this", "only", "returns", "user", "permissions", "but", "not", "group", "permissions", "and", "proxy", "users" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java#L1075-L1088
130,714
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java
ProjectManagerServlet.ajaxSetFlowLock
private void ajaxSetFlowLock(final Project project, final HashMap<String, Object> ret, final HttpServletRequest req) throws ServletException { final String flowName = getParam(req, FLOW_NAME_PARAM); final Flow flow = project.getFlow(flowName); if (flow == null) { ret.put(ERROR_PARAM, ...
java
private void ajaxSetFlowLock(final Project project, final HashMap<String, Object> ret, final HttpServletRequest req) throws ServletException { final String flowName = getParam(req, FLOW_NAME_PARAM); final Flow flow = project.getFlow(flowName); if (flow == null) { ret.put(ERROR_PARAM, ...
[ "private", "void", "ajaxSetFlowLock", "(", "final", "Project", "project", ",", "final", "HashMap", "<", "String", ",", "Object", ">", "ret", ",", "final", "HttpServletRequest", "req", ")", "throws", "ServletException", "{", "final", "String", "flowName", "=", ...
Set if a flow is locked. @param project the project for the flow. @param ret the return value. @param req the http request. @throws ServletException
[ "Set", "if", "a", "flow", "is", "locked", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java#L1124-L1169
130,715
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java
ProjectManagerServlet.ajaxIsFlowLocked
private void ajaxIsFlowLocked(final Project project, final HashMap<String, Object> ret, final HttpServletRequest req) throws ServletException { final String flowName = getParam(req, FLOW_NAME_PARAM); final Flow flow = project.getFlow(flowName); if (flow == null) { ret.put(ERROR_PARAM, ...
java
private void ajaxIsFlowLocked(final Project project, final HashMap<String, Object> ret, final HttpServletRequest req) throws ServletException { final String flowName = getParam(req, FLOW_NAME_PARAM); final Flow flow = project.getFlow(flowName); if (flow == null) { ret.put(ERROR_PARAM, ...
[ "private", "void", "ajaxIsFlowLocked", "(", "final", "Project", "project", ",", "final", "HashMap", "<", "String", ",", "Object", ">", "ret", ",", "final", "HttpServletRequest", "req", ")", "throws", "ServletException", "{", "final", "String", "flowName", "=", ...
Returns true if the flow is locked, false if it is unlocked. @param project the project containing the flow. @param ret the return value. @param req the http request. @throws ServletException
[ "Returns", "true", "if", "the", "flow", "is", "locked", "false", "if", "it", "is", "unlocked", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java#L1179-L1193
130,716
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java
ProjectManagerServlet.lockFlowsForProject
private void lockFlowsForProject(Project project, List<String> lockedFlows) { for (String flowId: lockedFlows) { Flow flow = project.getFlow(flowId); if (flow != null) { flow.setLocked(true); } } }
java
private void lockFlowsForProject(Project project, List<String> lockedFlows) { for (String flowId: lockedFlows) { Flow flow = project.getFlow(flowId); if (flow != null) { flow.setLocked(true); } } }
[ "private", "void", "lockFlowsForProject", "(", "Project", "project", ",", "List", "<", "String", ">", "lockedFlows", ")", "{", "for", "(", "String", "flowId", ":", "lockedFlows", ")", "{", "Flow", "flow", "=", "project", ".", "getFlow", "(", "flowId", ")",...
Lock the specified flows for the project. @param project the project @param lockedFlows list of flow IDs of flows to lock
[ "Lock", "the", "specified", "flows", "for", "the", "project", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java#L1925-L1932
130,717
azkaban/azkaban
azkaban-common/src/main/java/azkaban/database/DataSourceUtils.java
DataSourceUtils.getDataSource
public static AzkabanDataSource getDataSource(final Props props) { final String databaseType = props.getString("database.type"); AzkabanDataSource dataSource = null; if (databaseType.equals("mysql")) { final int port = props.getInt("mysql.port"); final String host = props.getString("mysql.host"...
java
public static AzkabanDataSource getDataSource(final Props props) { final String databaseType = props.getString("database.type"); AzkabanDataSource dataSource = null; if (databaseType.equals("mysql")) { final int port = props.getInt("mysql.port"); final String host = props.getString("mysql.host"...
[ "public", "static", "AzkabanDataSource", "getDataSource", "(", "final", "Props", "props", ")", "{", "final", "String", "databaseType", "=", "props", ".", "getString", "(", "\"database.type\"", ")", ";", "AzkabanDataSource", "dataSource", "=", "null", ";", "if", ...
Create Datasource from parameters in the properties
[ "Create", "Datasource", "from", "parameters", "in", "the", "properties" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/database/DataSourceUtils.java#L37-L60
130,718
azkaban/azkaban
azkaban-common/src/main/java/azkaban/database/DataSourceUtils.java
DataSourceUtils.getMySQLDataSource
public static AzkabanDataSource getMySQLDataSource(final String host, final Integer port, final String dbName, final String user, final String password, final Integer numConnections) { return new MySQLBasicDataSource(host, port, dbName, user, password, numConnections); }
java
public static AzkabanDataSource getMySQLDataSource(final String host, final Integer port, final String dbName, final String user, final String password, final Integer numConnections) { return new MySQLBasicDataSource(host, port, dbName, user, password, numConnections); }
[ "public", "static", "AzkabanDataSource", "getMySQLDataSource", "(", "final", "String", "host", ",", "final", "Integer", "port", ",", "final", "String", "dbName", ",", "final", "String", "user", ",", "final", "String", "password", ",", "final", "Integer", "numCon...
Create a MySQL DataSource
[ "Create", "a", "MySQL", "DataSource" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/database/DataSourceUtils.java#L65-L69
130,719
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
JobRunner.blockOnPipeLine
private boolean blockOnPipeLine() { if (this.isKilled()) { return true; } // For pipelining of jobs. Will watch other jobs. if (!this.pipelineJobs.isEmpty()) { String blockedList = ""; final ArrayList<BlockingStatus> blockingStatus = new ArrayList<>(); for (final Strin...
java
private boolean blockOnPipeLine() { if (this.isKilled()) { return true; } // For pipelining of jobs. Will watch other jobs. if (!this.pipelineJobs.isEmpty()) { String blockedList = ""; final ArrayList<BlockingStatus> blockingStatus = new ArrayList<>(); for (final Strin...
[ "private", "boolean", "blockOnPipeLine", "(", ")", "{", "if", "(", "this", ".", "isKilled", "(", ")", ")", "{", "return", "true", ";", "}", "// For pipelining of jobs. Will watch other jobs.", "if", "(", "!", "this", ".", "pipelineJobs", ".", "isEmpty", "(", ...
If pipelining is set, will block on another flow's jobs.
[ "If", "pipelining", "is", "set", "will", "block", "on", "another", "flow", "s", "jobs", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java#L443-L481
130,720
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
JobRunner.getProjectPermissionsURL
private String getProjectPermissionsURL() { String projectPermissionsURL = null; final String baseURL = this.azkabanProps.get(AZKABAN_WEBSERVER_URL); if (baseURL != null) { final String projectName = this.node.getParentFlow().getProjectName(); projectPermissionsURL = String .format("%s...
java
private String getProjectPermissionsURL() { String projectPermissionsURL = null; final String baseURL = this.azkabanProps.get(AZKABAN_WEBSERVER_URL); if (baseURL != null) { final String projectName = this.node.getParentFlow().getProjectName(); projectPermissionsURL = String .format("%s...
[ "private", "String", "getProjectPermissionsURL", "(", ")", "{", "String", "projectPermissionsURL", "=", "null", ";", "final", "String", "baseURL", "=", "this", ".", "azkabanProps", ".", "get", "(", "AZKABAN_WEBSERVER_URL", ")", ";", "if", "(", "baseURL", "!=", ...
Get project permissions page URL
[ "Get", "project", "permissions", "page", "URL" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java#L716-L725
130,721
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
JobRunner.insertJVMAargs
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); ...
java
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); ...
[ "private", "void", "insertJVMAargs", "(", ")", "{", "final", "String", "flowName", "=", "this", ".", "node", ".", "getParentFlow", "(", ")", ".", "getFlowId", "(", ")", ";", "final", "String", "jobId", "=", "this", ".", "node", ".", "getId", "(", ")", ...
Add useful JVM arguments so it is easier to map a running Java process to a flow, execution id and job
[ "Add", "useful", "JVM", "arguments", "so", "it", "is", "easier", "to", "map", "a", "running", "Java", "process", "to", "a", "flow", "execution", "id", "and", "job" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java#L731-L745
130,722
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java
JobRunner.insertJobMetadata
private void insertJobMetadata() { final String baseURL = this.azkabanProps.get(AZKABAN_WEBSERVER_URL); if (baseURL != null) { final String flowName = this.node.getParentFlow().getFlowId(); final String projectName = this.node.getParentFlow().getProjectName(); this.props.put(CommonJobProperti...
java
private void insertJobMetadata() { final String baseURL = this.azkabanProps.get(AZKABAN_WEBSERVER_URL); if (baseURL != null) { final String flowName = this.node.getParentFlow().getFlowId(); final String projectName = this.node.getParentFlow().getProjectName(); this.props.put(CommonJobProperti...
[ "private", "void", "insertJobMetadata", "(", ")", "{", "final", "String", "baseURL", "=", "this", ".", "azkabanProps", ".", "get", "(", "AZKABAN_WEBSERVER_URL", ")", ";", "if", "(", "baseURL", "!=", "null", ")", "{", "final", "String", "flowName", "=", "th...
Add relevant links to the job properties so that downstream consumers may know what executions initiated their execution.
[ "Add", "relevant", "links", "to", "the", "job", "properties", "so", "that", "downstream", "consumers", "may", "know", "what", "executions", "initiated", "their", "execution", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java#L751-L782
130,723
azkaban/azkaban
az-reportal/src/main/java/azkaban/reportal/util/Reportal.java
Reportal.updatePermissions
public void updatePermissions() { final String[] accessViewerList = this.accessViewer.trim().split(ACCESS_LIST_SPLIT_REGEX); final String[] accessExecutorList = this.accessExecutor.trim().split(ACCESS_LIST_SPLIT_REGEX); final String[] accessOwnerList = this.accessOwner.trim().split(A...
java
public void updatePermissions() { final String[] accessViewerList = this.accessViewer.trim().split(ACCESS_LIST_SPLIT_REGEX); final String[] accessExecutorList = this.accessExecutor.trim().split(ACCESS_LIST_SPLIT_REGEX); final String[] accessOwnerList = this.accessOwner.trim().split(A...
[ "public", "void", "updatePermissions", "(", ")", "{", "final", "String", "[", "]", "accessViewerList", "=", "this", ".", "accessViewer", ".", "trim", "(", ")", ".", "split", "(", "ACCESS_LIST_SPLIT_REGEX", ")", ";", "final", "String", "[", "]", "accessExecut...
Updates the project permissions in MEMORY, but does NOT update the project in the database.
[ "Updates", "the", "project", "permissions", "in", "MEMORY", "but", "does", "NOT", "update", "the", "project", "in", "the", "database", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java#L311-L349
130,724
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/ExecutorServlet.java
ExecutorServlet.ajaxFetchExecFlowLogs
private void ajaxFetchExecFlowLogs(final HttpServletRequest req, final HttpServletResponse resp, final HashMap<String, Object> ret, final User user, final ExecutableFlow exFlow) throws ServletException { final long startMs = System.currentTimeMillis(); final Project project = getProjectAjaxByPermiss...
java
private void ajaxFetchExecFlowLogs(final HttpServletRequest req, final HttpServletResponse resp, final HashMap<String, Object> ret, final User user, final ExecutableFlow exFlow) throws ServletException { final long startMs = System.currentTimeMillis(); final Project project = getProjectAjaxByPermiss...
[ "private", "void", "ajaxFetchExecFlowLogs", "(", "final", "HttpServletRequest", "req", ",", "final", "HttpServletResponse", "resp", ",", "final", "HashMap", "<", "String", ",", "Object", ">", "ret", ",", "final", "User", "user", ",", "final", "ExecutableFlow", "...
Gets the logs through plain text stream to reduce memory overhead.
[ "Gets", "the", "logs", "through", "plain", "text", "stream", "to", "reduce", "memory", "overhead", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/ExecutorServlet.java#L528-L557
130,725
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/ExecutorServlet.java
ExecutorServlet.ajaxFetchJobLogs
private void ajaxFetchJobLogs(final HttpServletRequest req, final HttpServletResponse resp, final HashMap<String, Object> ret, final User user, final ExecutableFlow exFlow) throws ServletException { final Project project = getProjectAjaxByPermission(ret, exFlow.getProjectId(), user, Type.READ); if (...
java
private void ajaxFetchJobLogs(final HttpServletRequest req, final HttpServletResponse resp, final HashMap<String, Object> ret, final User user, final ExecutableFlow exFlow) throws ServletException { final Project project = getProjectAjaxByPermission(ret, exFlow.getProjectId(), user, Type.READ); if (...
[ "private", "void", "ajaxFetchJobLogs", "(", "final", "HttpServletRequest", "req", ",", "final", "HttpServletResponse", "resp", ",", "final", "HashMap", "<", "String", ",", "Object", ">", "ret", ",", "final", "User", "user", ",", "final", "ExecutableFlow", "exFlo...
Gets the logs through ajax plain text stream to reduce memory overhead.
[ "Gets", "the", "logs", "through", "ajax", "plain", "text", "stream", "to", "reduce", "memory", "overhead", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/ExecutorServlet.java#L562-L590
130,726
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/validator/ValidationReport.java
ValidationReport.getInfoMsgLevel
public static ValidationStatus getInfoMsgLevel(final String msg) { if (msg.startsWith("ERROR")) { return ValidationStatus.ERROR; } if (msg.startsWith("WARN")) { return ValidationStatus.WARN; } return ValidationStatus.PASS; }
java
public static ValidationStatus getInfoMsgLevel(final String msg) { if (msg.startsWith("ERROR")) { return ValidationStatus.ERROR; } if (msg.startsWith("WARN")) { return ValidationStatus.WARN; } return ValidationStatus.PASS; }
[ "public", "static", "ValidationStatus", "getInfoMsgLevel", "(", "final", "String", "msg", ")", "{", "if", "(", "msg", ".", "startsWith", "(", "\"ERROR\"", ")", ")", "{", "return", "ValidationStatus", ".", "ERROR", ";", "}", "if", "(", "msg", ".", "startsWi...
Return the severity level this information message is associated with.
[ "Return", "the", "severity", "level", "this", "information", "message", "is", "associated", "with", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/validator/ValidationReport.java#L30-L38
130,727
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/validator/ValidationReport.java
ValidationReport.getInfoMsg
public static String getInfoMsg(final String msg) { if (msg.startsWith("ERROR")) { return msg.replaceFirst("ERROR", ""); } if (msg.startsWith("WARN")) { return msg.replaceFirst("WARN", ""); } return msg; }
java
public static String getInfoMsg(final String msg) { if (msg.startsWith("ERROR")) { return msg.replaceFirst("ERROR", ""); } if (msg.startsWith("WARN")) { return msg.replaceFirst("WARN", ""); } return msg; }
[ "public", "static", "String", "getInfoMsg", "(", "final", "String", "msg", ")", "{", "if", "(", "msg", ".", "startsWith", "(", "\"ERROR\"", ")", ")", "{", "return", "msg", ".", "replaceFirst", "(", "\"ERROR\"", ",", "\"\"", ")", ";", "}", "if", "(", ...
Get the raw information message.
[ "Get", "the", "raw", "information", "message", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/validator/ValidationReport.java#L43-L51
130,728
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/javautils/FileUtils.java
FileUtils.tryDeleteFileOrDirectory
public static boolean tryDeleteFileOrDirectory(File file) { try { deleteFileOrDirectory(file); return true; } catch (Exception e) { logger.warn("Failed to delete file. file = " + file.getAbsolutePath(), e); return false; } }
java
public static boolean tryDeleteFileOrDirectory(File file) { try { deleteFileOrDirectory(file); return true; } catch (Exception e) { logger.warn("Failed to delete file. file = " + file.getAbsolutePath(), e); return false; } }
[ "public", "static", "boolean", "tryDeleteFileOrDirectory", "(", "File", "file", ")", "{", "try", "{", "deleteFileOrDirectory", "(", "file", ")", ";", "return", "true", ";", "}", "catch", "(", "Exception", "e", ")", "{", "logger", ".", "warn", "(", "\"Faile...
Try to delete File or Directory @param file file object @return success delete or not
[ "Try", "to", "delete", "File", "or", "Directory" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/javautils/FileUtils.java#L65-L73
130,729
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.getParam
public String getParam(final HttpServletRequest request, final String name, final String defaultVal) { return HttpRequestUtils.getParam(request, name, defaultVal); }
java
public String getParam(final HttpServletRequest request, final String name, final String defaultVal) { return HttpRequestUtils.getParam(request, name, defaultVal); }
[ "public", "String", "getParam", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "name", ",", "final", "String", "defaultVal", ")", "{", "return", "HttpRequestUtils", ".", "getParam", "(", "request", ",", "name", ",", "defaultVal", ")", "...
Retrieves the param from the http servlet request.
[ "Retrieves", "the", "param", "from", "the", "http", "servlet", "request", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L138-L141
130,730
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.setSessionValue
protected void setSessionValue(final HttpServletRequest request, final String key, final Object value) { request.getSession(true).setAttribute(key, value); }
java
protected void setSessionValue(final HttpServletRequest request, final String key, final Object value) { request.getSession(true).setAttribute(key, value); }
[ "protected", "void", "setSessionValue", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "key", ",", "final", "Object", "value", ")", "{", "request", ".", "getSession", "(", "true", ")", ".", "setAttribute", "(", "key", ",", "value", ")...
Returns the session value of the request.
[ "Returns", "the", "session", "value", "of", "the", "request", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L175-L178
130,731
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.addSessionValue
protected void addSessionValue(final HttpServletRequest request, final String key, final Object value) { List l = (List) request.getSession(true).getAttribute(key); if (l == null) { l = new ArrayList(); } l.add(value); request.getSession(true).setAttribute(key, l); }
java
protected void addSessionValue(final HttpServletRequest request, final String key, final Object value) { List l = (List) request.getSession(true).getAttribute(key); if (l == null) { l = new ArrayList(); } l.add(value); request.getSession(true).setAttribute(key, l); }
[ "protected", "void", "addSessionValue", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "key", ",", "final", "Object", "value", ")", "{", "List", "l", "=", "(", "List", ")", "request", ".", "getSession", "(", "true", ")", ".", "getAt...
Adds a session value to the request
[ "Adds", "a", "session", "value", "to", "the", "request" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L183-L191
130,732
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.setErrorMessageInCookie
protected void setErrorMessageInCookie(final HttpServletResponse response, final String errorMsg) { final Cookie cookie = new Cookie(AZKABAN_FAILURE_MESSAGE, errorMsg); cookie.setPath("/"); response.addCookie(cookie); }
java
protected void setErrorMessageInCookie(final HttpServletResponse response, final String errorMsg) { final Cookie cookie = new Cookie(AZKABAN_FAILURE_MESSAGE, errorMsg); cookie.setPath("/"); response.addCookie(cookie); }
[ "protected", "void", "setErrorMessageInCookie", "(", "final", "HttpServletResponse", "response", ",", "final", "String", "errorMsg", ")", "{", "final", "Cookie", "cookie", "=", "new", "Cookie", "(", "AZKABAN_FAILURE_MESSAGE", ",", "errorMsg", ")", ";", "cookie", "...
Sets an error message in azkaban.failure.message in the cookie. This will be used by the web client javascript to somehow display the message
[ "Sets", "an", "error", "message", "in", "azkaban", ".", "failure", ".", "message", "in", "the", "cookie", ".", "This", "will", "be", "used", "by", "the", "web", "client", "javascript", "to", "somehow", "display", "the", "message" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L197-L202
130,733
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.setWarnMessageInCookie
protected void setWarnMessageInCookie(final HttpServletResponse response, final String errorMsg) { final Cookie cookie = new Cookie(AZKABAN_WARN_MESSAGE, errorMsg); cookie.setPath("/"); response.addCookie(cookie); }
java
protected void setWarnMessageInCookie(final HttpServletResponse response, final String errorMsg) { final Cookie cookie = new Cookie(AZKABAN_WARN_MESSAGE, errorMsg); cookie.setPath("/"); response.addCookie(cookie); }
[ "protected", "void", "setWarnMessageInCookie", "(", "final", "HttpServletResponse", "response", ",", "final", "String", "errorMsg", ")", "{", "final", "Cookie", "cookie", "=", "new", "Cookie", "(", "AZKABAN_WARN_MESSAGE", ",", "errorMsg", ")", ";", "cookie", ".", ...
Sets a warning message in azkaban.warn.message in the cookie. This will be used by the web client javascript to somehow display the message
[ "Sets", "a", "warning", "message", "in", "azkaban", ".", "warn", ".", "message", "in", "the", "cookie", ".", "This", "will", "be", "used", "by", "the", "web", "client", "javascript", "to", "somehow", "display", "the", "message" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L208-L213
130,734
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.setSuccessMessageInCookie
protected void setSuccessMessageInCookie(final HttpServletResponse response, final String message) { final Cookie cookie = new Cookie(AZKABAN_SUCCESS_MESSAGE, message); cookie.setPath("/"); response.addCookie(cookie); }
java
protected void setSuccessMessageInCookie(final HttpServletResponse response, final String message) { final Cookie cookie = new Cookie(AZKABAN_SUCCESS_MESSAGE, message); cookie.setPath("/"); response.addCookie(cookie); }
[ "protected", "void", "setSuccessMessageInCookie", "(", "final", "HttpServletResponse", "response", ",", "final", "String", "message", ")", "{", "final", "Cookie", "cookie", "=", "new", "Cookie", "(", "AZKABAN_SUCCESS_MESSAGE", ",", "message", ")", ";", "cookie", "...
Sets a message in azkaban.success.message in the cookie. This will be used by the web client javascript to somehow display the message
[ "Sets", "a", "message", "in", "azkaban", ".", "success", ".", "message", "in", "the", "cookie", ".", "This", "will", "be", "used", "by", "the", "web", "client", "javascript", "to", "somehow", "display", "the", "message" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L219-L224
130,735
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.getSuccessMessageFromCookie
protected String getSuccessMessageFromCookie(final HttpServletRequest request) { final Cookie cookie = getCookieByName(request, AZKABAN_SUCCESS_MESSAGE); if (cookie == null) { return null; } return cookie.getValue(); }
java
protected String getSuccessMessageFromCookie(final HttpServletRequest request) { final Cookie cookie = getCookieByName(request, AZKABAN_SUCCESS_MESSAGE); if (cookie == null) { return null; } return cookie.getValue(); }
[ "protected", "String", "getSuccessMessageFromCookie", "(", "final", "HttpServletRequest", "request", ")", "{", "final", "Cookie", "cookie", "=", "getCookieByName", "(", "request", ",", "AZKABAN_SUCCESS_MESSAGE", ")", ";", "if", "(", "cookie", "==", "null", ")", "{...
Retrieves a success message from a cookie. azkaban.success.message
[ "Retrieves", "a", "success", "message", "from", "a", "cookie", ".", "azkaban", ".", "success", ".", "message" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L229-L236
130,736
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.getWarnMessageFromCookie
protected String getWarnMessageFromCookie(final HttpServletRequest request) { final Cookie cookie = getCookieByName(request, AZKABAN_WARN_MESSAGE); if (cookie == null) { return null; } return cookie.getValue(); }
java
protected String getWarnMessageFromCookie(final HttpServletRequest request) { final Cookie cookie = getCookieByName(request, AZKABAN_WARN_MESSAGE); if (cookie == null) { return null; } return cookie.getValue(); }
[ "protected", "String", "getWarnMessageFromCookie", "(", "final", "HttpServletRequest", "request", ")", "{", "final", "Cookie", "cookie", "=", "getCookieByName", "(", "request", ",", "AZKABAN_WARN_MESSAGE", ")", ";", "if", "(", "cookie", "==", "null", ")", "{", "...
Retrieves a warn message from a cookie. azkaban.warn.message
[ "Retrieves", "a", "warn", "message", "from", "a", "cookie", ".", "azkaban", ".", "warn", ".", "message" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L241-L248
130,737
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.getErrorMessageFromCookie
protected String getErrorMessageFromCookie(final HttpServletRequest request) { final Cookie cookie = getCookieByName(request, AZKABAN_FAILURE_MESSAGE); if (cookie == null) { return null; } return cookie.getValue(); }
java
protected String getErrorMessageFromCookie(final HttpServletRequest request) { final Cookie cookie = getCookieByName(request, AZKABAN_FAILURE_MESSAGE); if (cookie == null) { return null; } return cookie.getValue(); }
[ "protected", "String", "getErrorMessageFromCookie", "(", "final", "HttpServletRequest", "request", ")", "{", "final", "Cookie", "cookie", "=", "getCookieByName", "(", "request", ",", "AZKABAN_FAILURE_MESSAGE", ")", ";", "if", "(", "cookie", "==", "null", ")", "{",...
Retrieves a success message from a cookie. azkaban.failure.message
[ "Retrieves", "a", "success", "message", "from", "a", "cookie", ".", "azkaban", ".", "failure", ".", "message" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L253-L260
130,738
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.newPage
protected Page newPage(final HttpServletRequest req, final HttpServletResponse resp, final Session session, final String template) { final Page page = new Page(req, resp, getApplication().getVelocityEngine(), template); page.add("version", jarVersion); page.add("azkaban_name", this.name); page.add...
java
protected Page newPage(final HttpServletRequest req, final HttpServletResponse resp, final Session session, final String template) { final Page page = new Page(req, resp, getApplication().getVelocityEngine(), template); page.add("version", jarVersion); page.add("azkaban_name", this.name); page.add...
[ "protected", "Page", "newPage", "(", "final", "HttpServletRequest", "req", ",", "final", "HttpServletResponse", "resp", ",", "final", "Session", "session", ",", "final", "String", "template", ")", "{", "final", "Page", "page", "=", "new", "Page", "(", "req", ...
Creates a new velocity page to use. With session.
[ "Creates", "a", "new", "velocity", "page", "to", "use", ".", "With", "session", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L282-L329
130,739
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.newPage
protected Page newPage(final HttpServletRequest req, final HttpServletResponse resp, final String template) { final Page page = new Page(req, resp, getApplication().getVelocityEngine(), template); page.add("version", jarVersion); page.add("azkaban_name", this.name); page.add("azkaban_label", this....
java
protected Page newPage(final HttpServletRequest req, final HttpServletResponse resp, final String template) { final Page page = new Page(req, resp, getApplication().getVelocityEngine(), template); page.add("version", jarVersion); page.add("azkaban_name", this.name); page.add("azkaban_label", this....
[ "protected", "Page", "newPage", "(", "final", "HttpServletRequest", "req", ",", "final", "HttpServletResponse", "resp", ",", "final", "String", "template", ")", "{", "final", "Page", "page", "=", "new", "Page", "(", "req", ",", "resp", ",", "getApplication", ...
Creates a new velocity page to use.
[ "Creates", "a", "new", "velocity", "page", "to", "use", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L334-L362
130,740
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.writeJSON
protected void writeJSON(final HttpServletResponse resp, final Object obj) throws IOException { writeJSON(resp, obj, false); }
java
protected void writeJSON(final HttpServletResponse resp, final Object obj) throws IOException { writeJSON(resp, obj, false); }
[ "protected", "void", "writeJSON", "(", "final", "HttpServletResponse", "resp", ",", "final", "Object", "obj", ")", "throws", "IOException", "{", "writeJSON", "(", "resp", ",", "obj", ",", "false", ")", ";", "}" ]
Writes json out to the stream.
[ "Writes", "json", "out", "to", "the", "stream", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L367-L370
130,741
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureHiveWrapper.java
HadoopSecureHiveWrapper.populateHiveConf
private static void populateHiveConf(HiveConf hiveConf, String[] args) { if (args == null) { return; } int index = 0; for (; index < args.length; index++) { if ("-hiveconf".equals(args[index])) { String hiveConfParam = stripSingleDoubleQuote(args[++index]); String[] tokens...
java
private static void populateHiveConf(HiveConf hiveConf, String[] args) { if (args == null) { return; } int index = 0; for (; index < args.length; index++) { if ("-hiveconf".equals(args[index])) { String hiveConfParam = stripSingleDoubleQuote(args[++index]); String[] tokens...
[ "private", "static", "void", "populateHiveConf", "(", "HiveConf", "hiveConf", ",", "String", "[", "]", "args", ")", "{", "if", "(", "args", "==", "null", ")", "{", "return", ";", "}", "int", "index", "=", "0", ";", "for", "(", ";", "index", "<", "a...
Extract hiveconf from command line arguments and populate them into HiveConf An example: -hiveconf 'zipcode=10', -hiveconf hive.root.logger=INFO,console
[ "Extract", "hiveconf", "from", "command", "line", "arguments", "and", "populate", "them", "into", "HiveConf" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureHiveWrapper.java#L210-L232
130,742
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureHiveWrapper.java
HadoopSecureHiveWrapper.stripSingleDoubleQuote
private static String stripSingleDoubleQuote(String input) { if (StringUtils.isEmpty(input)) { return input; } if (input.startsWith(SINGLE_QUOTE_STRING) || input.startsWith(DOUBLE_QUOTE_STRING)) { input = input.substring(1); } if (input.endsWith(SINGLE_QUOTE_STRING) || ...
java
private static String stripSingleDoubleQuote(String input) { if (StringUtils.isEmpty(input)) { return input; } if (input.startsWith(SINGLE_QUOTE_STRING) || input.startsWith(DOUBLE_QUOTE_STRING)) { input = input.substring(1); } if (input.endsWith(SINGLE_QUOTE_STRING) || ...
[ "private", "static", "String", "stripSingleDoubleQuote", "(", "String", "input", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "input", ")", ")", "{", "return", "input", ";", "}", "if", "(", "input", ".", "startsWith", "(", "SINGLE_QUOTE_STRING", ...
Strip single quote or double quote at either end of the string @return string with w/o leading or trailing single or double quote
[ "Strip", "single", "quote", "or", "double", "quote", "at", "either", "end", "of", "the", "string" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureHiveWrapper.java#L264-L280
130,743
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/ActiveExecutors.java
ActiveExecutors.setupExecutors
public void setupExecutors() throws ExecutorManagerException { final ImmutableSet<Executor> newExecutors = loadExecutors(); if (newExecutors.isEmpty()) { final String error = "No active executors found"; logger.error(error); throw new ExecutorManagerException(error); } else { this.ac...
java
public void setupExecutors() throws ExecutorManagerException { final ImmutableSet<Executor> newExecutors = loadExecutors(); if (newExecutors.isEmpty()) { final String error = "No active executors found"; logger.error(error); throw new ExecutorManagerException(error); } else { this.ac...
[ "public", "void", "setupExecutors", "(", ")", "throws", "ExecutorManagerException", "{", "final", "ImmutableSet", "<", "Executor", ">", "newExecutors", "=", "loadExecutors", "(", ")", ";", "if", "(", "newExecutors", ".", "isEmpty", "(", ")", ")", "{", "final",...
Loads executors. Can be also used to reload executors if there have been changes in the DB. @throws ExecutorManagerException if no active executors are found or if loading executors fails.
[ "Loads", "executors", ".", "Can", "be", "also", "used", "to", "reload", "executors", "if", "there", "have", "been", "changes", "in", "the", "DB", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ActiveExecutors.java#L47-L56
130,744
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/event/JobCallbackUtil.java
JobCallbackUtil.isThereJobCallbackProperty
public static boolean isThereJobCallbackProperty(final Props props, final JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } final String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return pr...
java
public static boolean isThereJobCallbackProperty(final Props props, final JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } final String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return pr...
[ "public", "static", "boolean", "isThereJobCallbackProperty", "(", "final", "Props", "props", ",", "final", "JobCallbackStatusEnum", "status", ")", "{", "if", "(", "props", "==", "null", "||", "status", "==", "null", ")", "{", "throw", "new", "NullPointerExceptio...
Use to quickly determine if there is a job callback related property in the Props. @return true if there is job callback related property
[ "Use", "to", "quickly", "determine", "if", "there", "is", "a", "job", "callback", "related", "property", "in", "the", "Props", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/event/JobCallbackUtil.java#L63-L72
130,745
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/event/JobCallbackUtil.java
JobCallbackUtil.parseJobCallbackProperties
public static List<HttpRequestBase> parseJobCallbackProperties(final Props props, final JobCallbackStatusEnum status, final Map<String, String> contextInfo, final int maxNumCallback, final Logger privateLogger) { String callbackUrl = null; if (!isThereJobCallbackProperty(props, status)) { // ...
java
public static List<HttpRequestBase> parseJobCallbackProperties(final Props props, final JobCallbackStatusEnum status, final Map<String, String> contextInfo, final int maxNumCallback, final Logger privateLogger) { String callbackUrl = null; if (!isThereJobCallbackProperty(props, status)) { // ...
[ "public", "static", "List", "<", "HttpRequestBase", ">", "parseJobCallbackProperties", "(", "final", "Props", "props", ",", "final", "JobCallbackStatusEnum", "status", ",", "final", "Map", "<", "String", ",", "String", ">", "contextInfo", ",", "final", "int", "m...
This method is responsible for parsing job call URL properties and convert them into a list of HttpRequestBase, which callers can use to execute. In addition to parsing, it will also replace the tokens with actual values. @return List<HttpRequestBase> - empty if no job callback related properties
[ "This", "method", "is", "responsible", "for", "parsing", "job", "call", "URL", "properties", "and", "convert", "them", "into", "a", "list", "of", "HttpRequestBase", "which", "callers", "can", "use", "to", "execute", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/event/JobCallbackUtil.java#L105-L188
130,746
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/event/JobCallbackUtil.java
JobCallbackUtil.buildJobContextInfoMap
public static Map<String, String> buildJobContextInfoMap(final Event event, final String server) { if (event.getRunner() instanceof JobRunner) { final JobRunner jobRunner = (JobRunner) event.getRunner(); final ExecutableNode node = jobRunner.getNode(); final EventData eventData = event.getD...
java
public static Map<String, String> buildJobContextInfoMap(final Event event, final String server) { if (event.getRunner() instanceof JobRunner) { final JobRunner jobRunner = (JobRunner) event.getRunner(); final ExecutableNode node = jobRunner.getNode(); final EventData eventData = event.getD...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "buildJobContextInfoMap", "(", "final", "Event", "event", ",", "final", "String", "server", ")", "{", "if", "(", "event", ".", "getRunner", "(", ")", "instanceof", "JobRunner", ")", "{", "final"...
This method takes the job context info. and put the values into a map with keys as the tokens. @return Map<String,String>
[ "This", "method", "takes", "the", "job", "context", "info", ".", "and", "put", "the", "values", "into", "a", "map", "with", "keys", "as", "the", "tokens", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/event/JobCallbackUtil.java#L232-L265
130,747
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/event/JobCallbackUtil.java
JobCallbackUtil.replaceTokens
public static String replaceTokens(final String value, final Map<String, String> contextInfo, final boolean withEncoding) { String result = value; String tokenValue = encodeQueryParam(contextInfo.get(CONTEXT_SERVER_TOKEN), withEncoding); result = result.replaceFirst(Pattern.quote(CONTEXT_SERV...
java
public static String replaceTokens(final String value, final Map<String, String> contextInfo, final boolean withEncoding) { String result = value; String tokenValue = encodeQueryParam(contextInfo.get(CONTEXT_SERVER_TOKEN), withEncoding); result = result.replaceFirst(Pattern.quote(CONTEXT_SERV...
[ "public", "static", "String", "replaceTokens", "(", "final", "String", "value", ",", "final", "Map", "<", "String", ",", "String", ">", "contextInfo", ",", "final", "boolean", "withEncoding", ")", "{", "String", "result", "=", "value", ";", "String", "tokenV...
Replace the supported tokens in the URL with values in the contextInfo. This will also make sure the values are HTTP encoded. @param withEncoding - whether the token values will be HTTP encoded @return String - value with tokens replaced with values
[ "Replace", "the", "supported", "tokens", "in", "the", "URL", "with", "values", "in", "the", "contextInfo", ".", "This", "will", "also", "make", "sure", "the", "values", "are", "HTTP", "encoded", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/event/JobCallbackUtil.java#L274-L301
130,748
azkaban/azkaban
azkaban-common/src/main/java/azkaban/storage/StorageManager.java
StorageManager.uploadProject
public void uploadProject( final Project project, final int version, final File localFile, final User uploader) { byte[] md5 = null; if (!(this.storage instanceof DatabaseStorage)) { md5 = computeHash(localFile); } final StorageMetadata metadata = new StorageMetadata( ...
java
public void uploadProject( final Project project, final int version, final File localFile, final User uploader) { byte[] md5 = null; if (!(this.storage instanceof DatabaseStorage)) { md5 = computeHash(localFile); } final StorageMetadata metadata = new StorageMetadata( ...
[ "public", "void", "uploadProject", "(", "final", "Project", "project", ",", "final", "int", "version", ",", "final", "File", "localFile", ",", "final", "User", "uploader", ")", "{", "byte", "[", "]", "md5", "=", "null", ";", "if", "(", "!", "(", "this"...
API to a project file into Azkaban Storage TODO clean up interface @param project project @param version The new version to be uploaded @param localFile local file @param uploader the user who uploaded
[ "API", "to", "a", "project", "file", "into", "Azkaban", "Storage" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/storage/StorageManager.java#L88-L122
130,749
azkaban/azkaban
azkaban-common/src/main/java/azkaban/storage/StorageManager.java
StorageManager.getProjectFile
public ProjectFileHandler getProjectFile(final int projectId, final int version) { log.info( String.format("Fetching project file. project ID: %d version: %d", projectId, version)); // TODO spyne: remove huge hack ! There should not be any special handling for Database Storage. if (this.storage inst...
java
public ProjectFileHandler getProjectFile(final int projectId, final int version) { log.info( String.format("Fetching project file. project ID: %d version: %d", projectId, version)); // TODO spyne: remove huge hack ! There should not be any special handling for Database Storage. if (this.storage inst...
[ "public", "ProjectFileHandler", "getProjectFile", "(", "final", "int", "projectId", ",", "final", "int", "version", ")", "{", "log", ".", "info", "(", "String", ".", "format", "(", "\"Fetching project file. project ID: %d version: %d\"", ",", "projectId", ",", "vers...
Fetch project file from storage. @param projectId required project ID @param version version to be fetched @return Handler object containing hooks to fetched project file
[ "Fetch", "project", "file", "from", "storage", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/storage/StorageManager.java#L152-L185
130,750
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/flowtrigger/plugin/FlowTriggerDependencyPluginManager.java
FlowTriggerDependencyPluginManager.readPrivateConfig
private Map<String, String> readPrivateConfig(final File privateConfigFile) { try { return readConfig(privateConfigFile); } catch (final Exception ex) { return new HashMap<>(); } }
java
private Map<String, String> readPrivateConfig(final File privateConfigFile) { try { return readConfig(privateConfigFile); } catch (final Exception ex) { return new HashMap<>(); } }
[ "private", "Map", "<", "String", ",", "String", ">", "readPrivateConfig", "(", "final", "File", "privateConfigFile", ")", "{", "try", "{", "return", "readConfig", "(", "privateConfigFile", ")", ";", "}", "catch", "(", "final", "Exception", "ex", ")", "{", ...
read config from private property file, if the file is not present, then return empty.
[ "read", "config", "from", "private", "property", "file", "if", "the", "file", "is", "not", "present", "then", "return", "empty", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/plugin/FlowTriggerDependencyPluginManager.java#L218-L224
130,751
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Utils.java
Utils.croak
public static void croak(final String message, final int exitCode) { System.err.println(message); System.exit(exitCode); }
java
public static void croak(final String message, final int exitCode) { System.err.println(message); System.exit(exitCode); }
[ "public", "static", "void", "croak", "(", "final", "String", "message", ",", "final", "int", "exitCode", ")", "{", "System", ".", "err", ".", "println", "(", "message", ")", ";", "System", ".", "exit", "(", "exitCode", ")", ";", "}" ]
Print the message and then exit with the given exit code @param message The message to print @param exitCode The exit code
[ "Print", "the", "message", "and", "then", "exit", "with", "the", "given", "exit", "code" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Utils.java#L120-L123
130,752
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Utils.java
Utils.callConstructor
public static Object callConstructor(final Class<?> cls, final Object... args) { return callConstructor(cls, getTypes(args), args); }
java
public static Object callConstructor(final Class<?> cls, final Object... args) { return callConstructor(cls, getTypes(args), args); }
[ "public", "static", "Object", "callConstructor", "(", "final", "Class", "<", "?", ">", "cls", ",", "final", "Object", "...", "args", ")", "{", "return", "callConstructor", "(", "cls", ",", "getTypes", "(", "args", ")", ",", "args", ")", ";", "}" ]
Construct a class object with the given arguments @param cls The class @param args The arguments @return Constructed Object
[ "Construct", "a", "class", "object", "with", "the", "given", "arguments" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Utils.java#L277-L279
130,753
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Utils.java
Utils.getTypes
private static Class<?>[] getTypes(final Object... args) { final Class<?>[] argTypes = new Class<?>[args.length]; for (int i = 0; i < argTypes.length; i++) { argTypes[i] = args[i].getClass(); } return argTypes; }
java
private static Class<?>[] getTypes(final Object... args) { final Class<?>[] argTypes = new Class<?>[args.length]; for (int i = 0; i < argTypes.length; i++) { argTypes[i] = args[i].getClass(); } return argTypes; }
[ "private", "static", "Class", "<", "?", ">", "[", "]", "getTypes", "(", "final", "Object", "...", "args", ")", "{", "final", "Class", "<", "?", ">", "[", "]", "argTypes", "=", "new", "Class", "<", "?", ">", "[", "args", ".", "length", "]", ";", ...
Get the Class of all the objects @param args The objects to get the Classes from @return The classes as an array
[ "Get", "the", "Class", "of", "all", "the", "objects" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Utils.java#L287-L293
130,754
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Utils.java
Utils.runProcess
public static ArrayList<String> runProcess(String... commands) throws InterruptedException, IOException { final java.lang.ProcessBuilder processBuilder = new java.lang.ProcessBuilder(commands); final ArrayList<String> output = new ArrayList<>(); final Process process = processBuilder.start(); proc...
java
public static ArrayList<String> runProcess(String... commands) throws InterruptedException, IOException { final java.lang.ProcessBuilder processBuilder = new java.lang.ProcessBuilder(commands); final ArrayList<String> output = new ArrayList<>(); final Process process = processBuilder.start(); proc...
[ "public", "static", "ArrayList", "<", "String", ">", "runProcess", "(", "String", "...", "commands", ")", "throws", "InterruptedException", ",", "IOException", "{", "final", "java", ".", "lang", ".", "ProcessBuilder", "processBuilder", "=", "new", "java", ".", ...
Run a sequence of commands @param commands sequence of commands @return list of output result
[ "Run", "a", "sequence", "of", "commands" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Utils.java#L422-L440
130,755
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Utils.java
Utils.mergeTypeClassPaths
public static void mergeTypeClassPaths( List<String> destinationPaths, final List<String> sourcePaths, final String rootPath) { if (sourcePaths != null) { for (String jar : sourcePaths) { File file = new File(jar); if (!file.isAbsolute()) { file = new File(rootPath + File.separ...
java
public static void mergeTypeClassPaths( List<String> destinationPaths, final List<String> sourcePaths, final String rootPath) { if (sourcePaths != null) { for (String jar : sourcePaths) { File file = new File(jar); if (!file.isAbsolute()) { file = new File(rootPath + File.separ...
[ "public", "static", "void", "mergeTypeClassPaths", "(", "List", "<", "String", ">", "destinationPaths", ",", "final", "List", "<", "String", ">", "sourcePaths", ",", "final", "String", "rootPath", ")", "{", "if", "(", "sourcePaths", "!=", "null", ")", "{", ...
Merge the absolute paths of source paths into the list of destination paths @param destinationPaths the path list which the source paths will be merged into @param sourcePaths source paths @param rootPath defined root path for source paths when they are not absolute path
[ "Merge", "the", "absolute", "paths", "of", "source", "paths", "into", "the", "list", "of", "destination", "paths" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Utils.java#L449-L464
130,756
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Utils.java
Utils.mergeStringList
public static void mergeStringList( final List<String> destinationList, final List<String> sourceList) { if (sourceList != null) { for (String item : sourceList) { if (!destinationList.contains(item)) { destinationList.add(item); } } } }
java
public static void mergeStringList( final List<String> destinationList, final List<String> sourceList) { if (sourceList != null) { for (String item : sourceList) { if (!destinationList.contains(item)) { destinationList.add(item); } } } }
[ "public", "static", "void", "mergeStringList", "(", "final", "List", "<", "String", ">", "destinationList", ",", "final", "List", "<", "String", ">", "sourceList", ")", "{", "if", "(", "sourceList", "!=", "null", ")", "{", "for", "(", "String", "item", "...
Merge elements in Source List into the Destination List @param destinationList the list which the source elements will be merged into @param sourceList source List
[ "Merge", "elements", "in", "Source", "List", "into", "the", "Destination", "List" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Utils.java#L472-L481
130,757
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/hiveutils/HiveUtils.java
HiveUtils.expandHiveAuxJarsPath
static String expandHiveAuxJarsPath(String original) throws IOException { if (original == null || original.contains(".jar")) return original; File[] files = new File(original).listFiles(); if (files == null || files.length == 0) { LOG.info("No files in to expand in aux jar path. Returning orig...
java
static String expandHiveAuxJarsPath(String original) throws IOException { if (original == null || original.contains(".jar")) return original; File[] files = new File(original).listFiles(); if (files == null || files.length == 0) { LOG.info("No files in to expand in aux jar path. Returning orig...
[ "static", "String", "expandHiveAuxJarsPath", "(", "String", "original", ")", "throws", "IOException", "{", "if", "(", "original", "==", "null", "||", "original", ".", "contains", "(", "\".jar\"", ")", ")", "return", "original", ";", "File", "[", "]", "files"...
Normally hive.aux.jars.path is expanded from just being a path to the full list of files in the directory by the hive shell script. Since we normally won't be running from the script, it's up to us to do that work here. We use a heuristic that if there is no occurrence of ".jar" in the original, it needs expansion. Oth...
[ "Normally", "hive", ".", "aux", ".", "jars", ".", "path", "is", "expanded", "from", "just", "being", "a", "path", "to", "the", "full", "list", "of", "files", "in", "the", "directory", "by", "the", "hive", "shell", "script", ".", "Since", "we", "normall...
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/hiveutils/HiveUtils.java#L55-L68
130,758
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/dag/Dag.java
Dag.updateDagStatus
void updateDagStatus() { // A dag may have nodes that are disabled. It's safer to scan all the nodes. // Assume the overhead is minimal. If it is not the case, we can optimize later. boolean failed = false; for (final Node node : this.nodes) { final Status nodeStatus = node.getStatus(); if (...
java
void updateDagStatus() { // A dag may have nodes that are disabled. It's safer to scan all the nodes. // Assume the overhead is minimal. If it is not the case, we can optimize later. boolean failed = false; for (final Node node : this.nodes) { final Status nodeStatus = node.getStatus(); if (...
[ "void", "updateDagStatus", "(", ")", "{", "// A dag may have nodes that are disabled. It's safer to scan all the nodes.", "// Assume the overhead is minimal. If it is not the case, we can optimize later.", "boolean", "failed", "=", "false", ";", "for", "(", "final", "Node", "node", ...
Update the final dag status when all nodes are done. <p>If any node has not reached its terminal state, this method will simply return.
[ "Update", "the", "final", "dag", "status", "when", "all", "nodes", "are", "done", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/dag/Dag.java#L93-L109
130,759
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/dag/Dag.java
Dag.updateDagStatusInternal
private void updateDagStatusInternal(final boolean failed) { if (this.status == Status.KILLING) { /* It's possible that some nodes have failed when the dag is killed. Since killing a dag signals an intent from an operator, it is more important to make the dag status reflect the result of tha...
java
private void updateDagStatusInternal(final boolean failed) { if (this.status == Status.KILLING) { /* It's possible that some nodes have failed when the dag is killed. Since killing a dag signals an intent from an operator, it is more important to make the dag status reflect the result of tha...
[ "private", "void", "updateDagStatusInternal", "(", "final", "boolean", "failed", ")", "{", "if", "(", "this", ".", "status", "==", "Status", ".", "KILLING", ")", "{", "/*\n It's possible that some nodes have failed when the dag is killed.\n Since killing a dag signa...
Update the final dag status. @param failed true if any of the jobs has failed
[ "Update", "the", "final", "dag", "status", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/dag/Dag.java#L116-L132
130,760
azkaban/azkaban
azkaban-common/src/main/java/azkaban/scheduler/ScheduleManager.java
ScheduleManager.updateLocal
private synchronized void updateLocal() throws ScheduleManagerException { final List<Schedule> updates = this.loader.loadUpdatedSchedules(); for (final Schedule s : updates) { if (s.getStatus().equals(TriggerStatus.EXPIRED.toString())) { onScheduleExpire(s); } else { internalSchedule...
java
private synchronized void updateLocal() throws ScheduleManagerException { final List<Schedule> updates = this.loader.loadUpdatedSchedules(); for (final Schedule s : updates) { if (s.getStatus().equals(TriggerStatus.EXPIRED.toString())) { onScheduleExpire(s); } else { internalSchedule...
[ "private", "synchronized", "void", "updateLocal", "(", ")", "throws", "ScheduleManagerException", "{", "final", "List", "<", "Schedule", ">", "updates", "=", "this", ".", "loader", ".", "loadUpdatedSchedules", "(", ")", ";", "for", "(", "final", "Schedule", "s...
only do this when using external runner
[ "only", "do", "this", "when", "using", "external", "runner" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/scheduler/ScheduleManager.java#L71-L80
130,761
azkaban/azkaban
azkaban-common/src/main/java/azkaban/scheduler/ScheduleManager.java
ScheduleManager.getSchedule
public Schedule getSchedule(final int projectId, final String flowId) throws ScheduleManagerException { updateLocal(); return this.scheduleIdentityPairMap.get(new Pair<>(projectId, flowId)); }
java
public Schedule getSchedule(final int projectId, final String flowId) throws ScheduleManagerException { updateLocal(); return this.scheduleIdentityPairMap.get(new Pair<>(projectId, flowId)); }
[ "public", "Schedule", "getSchedule", "(", "final", "int", "projectId", ",", "final", "String", "flowId", ")", "throws", "ScheduleManagerException", "{", "updateLocal", "(", ")", ";", "return", "this", ".", "scheduleIdentityPairMap", ".", "get", "(", "new", "Pair...
Returns the scheduled flow for the flow name
[ "Returns", "the", "scheduled", "flow", "for", "the", "flow", "name" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/scheduler/ScheduleManager.java#L107-L112
130,762
azkaban/azkaban
azkaban-common/src/main/java/azkaban/scheduler/ScheduleManager.java
ScheduleManager.removeSchedule
public synchronized void removeSchedule(final Schedule sched) { final Pair<Integer, String> identityPairMap = sched.getScheduleIdentityPair(); final Schedule schedule = this.scheduleIdentityPairMap.get(identityPairMap); if (schedule != null) { this.scheduleIdentityPairMap.remove(identityPairMap); ...
java
public synchronized void removeSchedule(final Schedule sched) { final Pair<Integer, String> identityPairMap = sched.getScheduleIdentityPair(); final Schedule schedule = this.scheduleIdentityPairMap.get(identityPairMap); if (schedule != null) { this.scheduleIdentityPairMap.remove(identityPairMap); ...
[ "public", "synchronized", "void", "removeSchedule", "(", "final", "Schedule", "sched", ")", "{", "final", "Pair", "<", "Integer", ",", "String", ">", "identityPairMap", "=", "sched", ".", "getScheduleIdentityPair", "(", ")", ";", "final", "Schedule", "schedule",...
Removes the flow from the schedule if it exists.
[ "Removes", "the", "flow", "from", "the", "schedule", "if", "it", "exists", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/scheduler/ScheduleManager.java#L128-L143
130,763
azkaban/azkaban
azkaban-common/src/main/java/azkaban/scheduler/ScheduleManager.java
ScheduleManager.internalSchedule
private synchronized void internalSchedule(final Schedule s) { this.scheduleIDMap.put(s.getScheduleId(), s); this.scheduleIdentityPairMap.put(s.getScheduleIdentityPair(), s); }
java
private synchronized void internalSchedule(final Schedule s) { this.scheduleIDMap.put(s.getScheduleId(), s); this.scheduleIdentityPairMap.put(s.getScheduleIdentityPair(), s); }
[ "private", "synchronized", "void", "internalSchedule", "(", "final", "Schedule", "s", ")", "{", "this", ".", "scheduleIDMap", ".", "put", "(", "s", ".", "getScheduleId", "(", ")", ",", "s", ")", ";", "this", ".", "scheduleIdentityPairMap", ".", "put", "(",...
Schedules the flow, but doesn't save the schedule afterwards.
[ "Schedules", "the", "flow", "but", "doesn", "t", "save", "the", "schedule", "afterwards", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/scheduler/ScheduleManager.java#L201-L204
130,764
azkaban/azkaban
azkaban-common/src/main/java/azkaban/scheduler/ScheduleManager.java
ScheduleManager.insertSchedule
public synchronized void insertSchedule(final Schedule s) { final Schedule exist = this.scheduleIdentityPairMap.get(s.getScheduleIdentityPair()); if (s.updateTime()) { try { if (exist == null) { this.loader.insertSchedule(s); internalSchedule(s); } else { s.se...
java
public synchronized void insertSchedule(final Schedule s) { final Schedule exist = this.scheduleIdentityPairMap.get(s.getScheduleIdentityPair()); if (s.updateTime()) { try { if (exist == null) { this.loader.insertSchedule(s); internalSchedule(s); } else { s.se...
[ "public", "synchronized", "void", "insertSchedule", "(", "final", "Schedule", "s", ")", "{", "final", "Schedule", "exist", "=", "this", ".", "scheduleIdentityPairMap", ".", "get", "(", "s", ".", "getScheduleIdentityPair", "(", ")", ")", ";", "if", "(", "s", ...
Adds a flow to the schedule.
[ "Adds", "a", "flow", "to", "the", "schedule", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/scheduler/ScheduleManager.java#L209-L229
130,765
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/ExecutorHealthChecker.java
ExecutorHealthChecker.checkExecutorHealth
public void checkExecutorHealth() { final Map<Optional<Executor>, List<ExecutableFlow>> exFlowMap = getFlowToExecutorMap(); for (final Map.Entry<Optional<Executor>, List<ExecutableFlow>> entry : exFlowMap.entrySet()) { final Optional<Executor> executorOption = entry.getKey(); if (!executorOption.isP...
java
public void checkExecutorHealth() { final Map<Optional<Executor>, List<ExecutableFlow>> exFlowMap = getFlowToExecutorMap(); for (final Map.Entry<Optional<Executor>, List<ExecutableFlow>> entry : exFlowMap.entrySet()) { final Optional<Executor> executorOption = entry.getKey(); if (!executorOption.isP...
[ "public", "void", "checkExecutorHealth", "(", ")", "{", "final", "Map", "<", "Optional", "<", "Executor", ">", ",", "List", "<", "ExecutableFlow", ">", ">", "exFlowMap", "=", "getFlowToExecutorMap", "(", ")", ";", "for", "(", "final", "Map", ".", "Entry", ...
Checks executor health. Finalizes the flow if its executor is already removed from DB or sends alert emails if the executor isn't alive any more.
[ "Checks", "executor", "health", ".", "Finalizes", "the", "flow", "if", "its", "executor", "is", "already", "removed", "from", "DB", "or", "sends", "alert", "emails", "if", "the", "executor", "isn", "t", "alive", "any", "more", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutorHealthChecker.java#L94-L130
130,766
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/ExecutorHealthChecker.java
ExecutorHealthChecker.getFlowToExecutorMap
private Map<Optional<Executor>, List<ExecutableFlow>> getFlowToExecutorMap() { final HashMap<Optional<Executor>, List<ExecutableFlow>> exFlowMap = new HashMap<>(); try { for (final Pair<ExecutionReference, ExecutableFlow> runningFlow : this .executorLoader.fetchActiveFlows().values()) { ...
java
private Map<Optional<Executor>, List<ExecutableFlow>> getFlowToExecutorMap() { final HashMap<Optional<Executor>, List<ExecutableFlow>> exFlowMap = new HashMap<>(); try { for (final Pair<ExecutionReference, ExecutableFlow> runningFlow : this .executorLoader.fetchActiveFlows().values()) { ...
[ "private", "Map", "<", "Optional", "<", "Executor", ">", ",", "List", "<", "ExecutableFlow", ">", ">", "getFlowToExecutorMap", "(", ")", "{", "final", "HashMap", "<", "Optional", "<", "Executor", ">", ",", "List", "<", "ExecutableFlow", ">", ">", "exFlowMa...
Groups Executable flow by Executors to reduce number of REST calls. @return executor to list of flows map
[ "Groups", "Executable", "flow", "by", "Executors", "to", "reduce", "number", "of", "REST", "calls", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutorHealthChecker.java#L137-L154
130,767
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/ExecutorHealthChecker.java
ExecutorHealthChecker.handleExecutorNotAliveCase
private void handleExecutorNotAliveCase( final Entry<Optional<Executor>, List<ExecutableFlow>> entry, final Executor executor, final ExecutorManagerException e) { logger.error("Failed to get update from executor " + executor.getId(), e); this.executorFailureCount.put(executor.getId(), this.executorF...
java
private void handleExecutorNotAliveCase( final Entry<Optional<Executor>, List<ExecutableFlow>> entry, final Executor executor, final ExecutorManagerException e) { logger.error("Failed to get update from executor " + executor.getId(), e); this.executorFailureCount.put(executor.getId(), this.executorF...
[ "private", "void", "handleExecutorNotAliveCase", "(", "final", "Entry", "<", "Optional", "<", "Executor", ">", ",", "List", "<", "ExecutableFlow", ">", ">", "entry", ",", "final", "Executor", "executor", ",", "final", "ExecutorManagerException", "e", ")", "{", ...
Increments executor failure count. If it reaches max failure count, sends alert emails to AZ admin. @param entry executor to list of flows map entry @param executor the executor @param e Exception thrown when the executor is not alive
[ "Increments", "executor", "failure", "count", ".", "If", "it", "reaches", "max", "failure", "count", "sends", "alert", "emails", "to", "AZ", "admin", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutorHealthChecker.java#L164-L178
130,768
azkaban/azkaban
az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java
ReportalUtil.sortExecutableNodes
public static List<ExecutableNode> sortExecutableNodes(final ExecutableFlow flow) { final List<ExecutableNode> sortedNodes = new ArrayList<>(); if (flow != null) { final List<String> startNodeIds = flow.getStartNodes(); String nextNodeId = startNodeIds.isEmpty() ? null : startNodeIds.get(0); ...
java
public static List<ExecutableNode> sortExecutableNodes(final ExecutableFlow flow) { final List<ExecutableNode> sortedNodes = new ArrayList<>(); if (flow != null) { final List<String> startNodeIds = flow.getStartNodes(); String nextNodeId = startNodeIds.isEmpty() ? null : startNodeIds.get(0); ...
[ "public", "static", "List", "<", "ExecutableNode", ">", "sortExecutableNodes", "(", "final", "ExecutableFlow", "flow", ")", "{", "final", "List", "<", "ExecutableNode", ">", "sortedNodes", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "flow", "!="...
Returns a list of the executable nodes in the specified flow in execution order. Assumes that the flow is linear.
[ "Returns", "a", "list", "of", "the", "executable", "nodes", "in", "the", "specified", "flow", "in", "execution", "order", ".", "Assumes", "that", "the", "flow", "is", "linear", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java#L46-L64
130,769
azkaban/azkaban
az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java
ReportalUtil.getRunTimeVariables
public static List<Variable> getRunTimeVariables( final Collection<Variable> variables) { final List<Variable> runtimeVariables = ReportalUtil.getVariablesByRegex(variables, Reportal.REPORTAL_CONFIG_PREFIX_NEGATION_REGEX); return runtimeVariables; }
java
public static List<Variable> getRunTimeVariables( final Collection<Variable> variables) { final List<Variable> runtimeVariables = ReportalUtil.getVariablesByRegex(variables, Reportal.REPORTAL_CONFIG_PREFIX_NEGATION_REGEX); return runtimeVariables; }
[ "public", "static", "List", "<", "Variable", ">", "getRunTimeVariables", "(", "final", "Collection", "<", "Variable", ">", "variables", ")", "{", "final", "List", "<", "Variable", ">", "runtimeVariables", "=", "ReportalUtil", ".", "getVariablesByRegex", "(", "va...
Get runtime variables to be set in unscheduled mode of execution. Returns empty list, if no runtime variable is found
[ "Get", "runtime", "variables", "to", "be", "set", "in", "unscheduled", "mode", "of", "execution", ".", "Returns", "empty", "list", "if", "no", "runtime", "variable", "is", "found" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java#L70-L77
130,770
azkaban/azkaban
az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java
ReportalUtil.getVariablesByRegex
public static List<Variable> getVariablesByRegex( final Collection<Variable> variables, final String regex) { final List<Variable> shortlistedVariables = new ArrayList<>(); if (variables != null && regex != null) { for (final Variable var : variables) { if (var.getTitle().matches(regex)) { ...
java
public static List<Variable> getVariablesByRegex( final Collection<Variable> variables, final String regex) { final List<Variable> shortlistedVariables = new ArrayList<>(); if (variables != null && regex != null) { for (final Variable var : variables) { if (var.getTitle().matches(regex)) { ...
[ "public", "static", "List", "<", "Variable", ">", "getVariablesByRegex", "(", "final", "Collection", "<", "Variable", ">", "variables", ",", "final", "String", "regex", ")", "{", "final", "List", "<", "Variable", ">", "shortlistedVariables", "=", "new", "Array...
Shortlist variables which match a given regex. Returns empty empty list, if no eligible variable is found
[ "Shortlist", "variables", "which", "match", "a", "given", "regex", ".", "Returns", "empty", "empty", "list", "if", "no", "eligible", "variable", "is", "found" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java#L83-L94
130,771
azkaban/azkaban
az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java
ReportalUtil.getVariableMapByPrefix
public static Map<String, String> getVariableMapByPrefix( final Collection<Variable> variables, final String prefix) { final Map<String, String> shortlistMap = new HashMap<>(); if (variables != null && prefix != null) { for (final Variable var : getVariablesByRegex(variables, Reportal.REPO...
java
public static Map<String, String> getVariableMapByPrefix( final Collection<Variable> variables, final String prefix) { final Map<String, String> shortlistMap = new HashMap<>(); if (variables != null && prefix != null) { for (final Variable var : getVariablesByRegex(variables, Reportal.REPO...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "getVariableMapByPrefix", "(", "final", "Collection", "<", "Variable", ">", "variables", ",", "final", "String", "prefix", ")", "{", "final", "Map", "<", "String", ",", "String", ">", "shortlistMa...
Shortlist variables which match a given prefix. Returns empty map, if no eligible variable is found. @param variables variables to be processed @param prefix prefix to be matched @return a map with shortlisted variables and prefix removed
[ "Shortlist", "variables", "which", "match", "a", "given", "prefix", ".", "Returns", "empty", "map", "if", "no", "eligible", "variable", "is", "found", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java#L104-L115
130,772
azkaban/azkaban
azkaban-common/src/main/java/azkaban/server/session/SessionCache.java
SessionCache.getSession
public Session getSession(final String sessionId) { final Session elem = this.cache.getIfPresent(sessionId); return elem; }
java
public Session getSession(final String sessionId) { final Session elem = this.cache.getIfPresent(sessionId); return elem; }
[ "public", "Session", "getSession", "(", "final", "String", "sessionId", ")", "{", "final", "Session", "elem", "=", "this", ".", "cache", ".", "getIfPresent", "(", "sessionId", ")", ";", "return", "elem", ";", "}" ]
Returns the cached session using the session id.
[ "Returns", "the", "cached", "session", "using", "the", "session", "id", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/server/session/SessionCache.java#L65-L68
130,773
azkaban/azkaban
azkaban-common/src/main/java/azkaban/server/session/SessionCache.java
SessionCache.findSessionsByIP
public Set<Session> findSessionsByIP(final String ip) { final Set<Session> ret = new HashSet<>(); final Map<String, Session> cacheSnapshot = this.cache.asMap(); for (final Entry<String, Session> entry : cacheSnapshot.entrySet()) { if (entry.getValue().getIp().equals(ip)) { ret.add(entry.getVa...
java
public Set<Session> findSessionsByIP(final String ip) { final Set<Session> ret = new HashSet<>(); final Map<String, Session> cacheSnapshot = this.cache.asMap(); for (final Entry<String, Session> entry : cacheSnapshot.entrySet()) { if (entry.getValue().getIp().equals(ip)) { ret.add(entry.getVa...
[ "public", "Set", "<", "Session", ">", "findSessionsByIP", "(", "final", "String", "ip", ")", "{", "final", "Set", "<", "Session", ">", "ret", "=", "new", "HashSet", "<>", "(", ")", ";", "final", "Map", "<", "String", ",", "Session", ">", "cacheSnapshot...
Returns sessions whose IP equals to the given IP.
[ "Returns", "sessions", "whose", "IP", "equals", "to", "the", "given", "IP", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/server/session/SessionCache.java#L96-L107
130,774
azkaban/azkaban
azkaban-common/src/main/java/azkaban/jobtype/JobTypePluginSet.java
JobTypePluginSet.addPluginClass
public void addPluginClass(final String jobTypeName, final Class<? extends Job> jobTypeClass) { this.jobToClass.put(jobTypeName, jobTypeClass); }
java
public void addPluginClass(final String jobTypeName, final Class<? extends Job> jobTypeClass) { this.jobToClass.put(jobTypeName, jobTypeClass); }
[ "public", "void", "addPluginClass", "(", "final", "String", "jobTypeName", ",", "final", "Class", "<", "?", "extends", "Job", ">", "jobTypeClass", ")", "{", "this", ".", "jobToClass", ".", "put", "(", "jobTypeName", ",", "jobTypeClass", ")", ";", "}" ]
Adds plugin jobtype class
[ "Adds", "plugin", "jobtype", "class" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobtype/JobTypePluginSet.java#L113-L116
130,775
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/FetchActiveFlowDao.java
FetchActiveFlowDao.fetchUnfinishedFlows
Map<Integer, Pair<ExecutionReference, ExecutableFlow>> fetchUnfinishedFlows() throws ExecutorManagerException { try { return this.dbOperator.query(FetchActiveExecutableFlows.FETCH_UNFINISHED_EXECUTABLE_FLOWS, new FetchActiveExecutableFlows()); } catch (final SQLException e) { throw n...
java
Map<Integer, Pair<ExecutionReference, ExecutableFlow>> fetchUnfinishedFlows() throws ExecutorManagerException { try { return this.dbOperator.query(FetchActiveExecutableFlows.FETCH_UNFINISHED_EXECUTABLE_FLOWS, new FetchActiveExecutableFlows()); } catch (final SQLException e) { throw n...
[ "Map", "<", "Integer", ",", "Pair", "<", "ExecutionReference", ",", "ExecutableFlow", ">", ">", "fetchUnfinishedFlows", "(", ")", "throws", "ExecutorManagerException", "{", "try", "{", "return", "this", ".", "dbOperator", ".", "query", "(", "FetchActiveExecutableF...
Fetch flows that are not in finished status, including both dispatched and non-dispatched flows. @return unfinished flows map @throws ExecutorManagerException the executor manager exception
[ "Fetch", "flows", "that", "are", "not", "in", "finished", "status", "including", "both", "dispatched", "and", "non", "-", "dispatched", "flows", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/FetchActiveFlowDao.java#L113-L121
130,776
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/FetchActiveFlowDao.java
FetchActiveFlowDao.fetchActiveFlows
Map<Integer, Pair<ExecutionReference, ExecutableFlow>> fetchActiveFlows() throws ExecutorManagerException { try { return this.dbOperator.query(FetchActiveExecutableFlows.FETCH_ACTIVE_EXECUTABLE_FLOWS, new FetchActiveExecutableFlows()); } catch (final SQLException e) { throw new Execu...
java
Map<Integer, Pair<ExecutionReference, ExecutableFlow>> fetchActiveFlows() throws ExecutorManagerException { try { return this.dbOperator.query(FetchActiveExecutableFlows.FETCH_ACTIVE_EXECUTABLE_FLOWS, new FetchActiveExecutableFlows()); } catch (final SQLException e) { throw new Execu...
[ "Map", "<", "Integer", ",", "Pair", "<", "ExecutionReference", ",", "ExecutableFlow", ">", ">", "fetchActiveFlows", "(", ")", "throws", "ExecutorManagerException", "{", "try", "{", "return", "this", ".", "dbOperator", ".", "query", "(", "FetchActiveExecutableFlows...
Fetch flows that are dispatched and not yet finished. @return active flows map @throws ExecutorManagerException the executor manager exception
[ "Fetch", "flows", "that", "are", "dispatched", "and", "not", "yet", "finished", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/FetchActiveFlowDao.java#L145-L153
130,777
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/FetchActiveFlowDao.java
FetchActiveFlowDao.fetchActiveFlowByExecId
Pair<ExecutionReference, ExecutableFlow> fetchActiveFlowByExecId(final int execId) throws ExecutorManagerException { try { return this.dbOperator.query(FetchActiveExecutableFlow .FETCH_ACTIVE_EXECUTABLE_FLOW_BY_EXEC_ID, new FetchActiveExecutableFlow(), execId); } catch (final...
java
Pair<ExecutionReference, ExecutableFlow> fetchActiveFlowByExecId(final int execId) throws ExecutorManagerException { try { return this.dbOperator.query(FetchActiveExecutableFlow .FETCH_ACTIVE_EXECUTABLE_FLOW_BY_EXEC_ID, new FetchActiveExecutableFlow(), execId); } catch (final...
[ "Pair", "<", "ExecutionReference", ",", "ExecutableFlow", ">", "fetchActiveFlowByExecId", "(", "final", "int", "execId", ")", "throws", "ExecutorManagerException", "{", "try", "{", "return", "this", ".", "dbOperator", ".", "query", "(", "FetchActiveExecutableFlow", ...
Fetch the flow that is dispatched and not yet finished by execution id. @return active flow pair @throws ExecutorManagerException the executor manager exception
[ "Fetch", "the", "flow", "that", "is", "dispatched", "and", "not", "yet", "finished", "by", "execution", "id", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/FetchActiveFlowDao.java#L161-L170
130,778
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java
HadoopJobUtils.cancelHadoopTokens
public static void cancelHadoopTokens(HadoopSecurityManager hadoopSecurityManager, String userToProxy, File tokenFile, Logger log) { if (tokenFile == null) { return; } try { hadoopSecurityManager.cancelTokens(tokenFile, userToProxy, log); } catch (HadoopSecurityManagerException e) { ...
java
public static void cancelHadoopTokens(HadoopSecurityManager hadoopSecurityManager, String userToProxy, File tokenFile, Logger log) { if (tokenFile == null) { return; } try { hadoopSecurityManager.cancelTokens(tokenFile, userToProxy, log); } catch (HadoopSecurityManagerException e) { ...
[ "public", "static", "void", "cancelHadoopTokens", "(", "HadoopSecurityManager", "hadoopSecurityManager", ",", "String", "userToProxy", ",", "File", "tokenFile", ",", "Logger", "log", ")", "{", "if", "(", "tokenFile", "==", "null", ")", "{", "return", ";", "}", ...
Invalidates a Hadoop authentication token file
[ "Invalidates", "a", "Hadoop", "authentication", "token", "file" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java#L94-L109
130,779
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java
HadoopJobUtils.loadHadoopSecurityManager
public static HadoopSecurityManager loadHadoopSecurityManager(Props props, Logger log) throws RuntimeException { Class<?> hadoopSecurityManagerClass = props.getClass(HADOOP_SECURITY_MANAGER_CLASS_PARAM, true, HadoopJobUtils.class.getClassLoader()); log.info("Loading hadoop security manager " + ha...
java
public static HadoopSecurityManager loadHadoopSecurityManager(Props props, Logger log) throws RuntimeException { Class<?> hadoopSecurityManagerClass = props.getClass(HADOOP_SECURITY_MANAGER_CLASS_PARAM, true, HadoopJobUtils.class.getClassLoader()); log.info("Loading hadoop security manager " + ha...
[ "public", "static", "HadoopSecurityManager", "loadHadoopSecurityManager", "(", "Props", "props", ",", "Logger", "log", ")", "throws", "RuntimeException", "{", "Class", "<", "?", ">", "hadoopSecurityManagerClass", "=", "props", ".", "getClass", "(", "HADOOP_SECURITY_MA...
Based on the HADOOP_SECURITY_MANAGER_CLASS_PARAM setting in the incoming props, finds the correct HadoopSecurityManager Java class @return a HadoopSecurityManager object. Will throw exception if any errors occur (including not finding a class) @throws RuntimeException : If any errors happen along the way.
[ "Based", "on", "the", "HADOOP_SECURITY_MANAGER_CLASS_PARAM", "setting", "in", "the", "incoming", "props", "finds", "the", "correct", "HadoopSecurityManager", "Java", "class" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java#L119-L141
130,780
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java
HadoopJobUtils.getHadoopTokens
public static File getHadoopTokens(HadoopSecurityManager hadoopSecurityManager, Props props, Logger log) throws HadoopSecurityManagerException { File tokenFile = null; try { tokenFile = File.createTempFile("mr-azkaban", ".token"); } catch (Exception e) { throw new HadoopSecurityManagerExc...
java
public static File getHadoopTokens(HadoopSecurityManager hadoopSecurityManager, Props props, Logger log) throws HadoopSecurityManagerException { File tokenFile = null; try { tokenFile = File.createTempFile("mr-azkaban", ".token"); } catch (Exception e) { throw new HadoopSecurityManagerExc...
[ "public", "static", "File", "getHadoopTokens", "(", "HadoopSecurityManager", "hadoopSecurityManager", ",", "Props", "props", ",", "Logger", "log", ")", "throws", "HadoopSecurityManagerException", "{", "File", "tokenFile", "=", "null", ";", "try", "{", "tokenFile", "...
Fetching token with the Azkaban user
[ "Fetching", "token", "with", "the", "Azkaban", "user" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java#L184-L197
130,781
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java
HadoopJobUtils.proxyUserKillAllSpawnedHadoopJobs
public static void proxyUserKillAllSpawnedHadoopJobs(final String logFilePath, Props jobProps, File tokenFile, final Logger log) { Properties properties = new Properties(); properties.putAll(jobProps.getFlattened()); try { if (HadoopSecureWrapperUtils.shouldProxy(properties)) { UserGrou...
java
public static void proxyUserKillAllSpawnedHadoopJobs(final String logFilePath, Props jobProps, File tokenFile, final Logger log) { Properties properties = new Properties(); properties.putAll(jobProps.getFlattened()); try { if (HadoopSecureWrapperUtils.shouldProxy(properties)) { UserGrou...
[ "public", "static", "void", "proxyUserKillAllSpawnedHadoopJobs", "(", "final", "String", "logFilePath", ",", "Props", "jobProps", ",", "File", "tokenFile", ",", "final", "Logger", "log", ")", "{", "Properties", "properties", "=", "new", "Properties", "(", ")", "...
This method is a decorator around the KillAllSpawnedHadoopJobs method. This method takes additional parameters to determine whether KillAllSpawnedHadoopJobs needs to be executed using doAs as a different user @param logFilePath Azkaban log file path @param jobProps Azkaban job props @param tokenFile Pass in the tokenF...
[ "This", "method", "is", "a", "decorator", "around", "the", "KillAllSpawnedHadoopJobs", "method", ".", "This", "method", "takes", "additional", "parameters", "to", "determine", "whether", "KillAllSpawnedHadoopJobs", "needs", "to", "be", "executed", "using", "doAs", "...
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java#L376-L399
130,782
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java
HadoopJobUtils.killAllSpawnedHadoopJobs
public static Set<String> killAllSpawnedHadoopJobs(String logFilePath, Logger log) { Set<String> allSpawnedJobs = findApplicationIdFromLog(logFilePath, log); log.info("applicationIds to kill: " + allSpawnedJobs); for (String appId : allSpawnedJobs) { try { killJobOnCluster(appId, log); ...
java
public static Set<String> killAllSpawnedHadoopJobs(String logFilePath, Logger log) { Set<String> allSpawnedJobs = findApplicationIdFromLog(logFilePath, log); log.info("applicationIds to kill: " + allSpawnedJobs); for (String appId : allSpawnedJobs) { try { killJobOnCluster(appId, log); ...
[ "public", "static", "Set", "<", "String", ">", "killAllSpawnedHadoopJobs", "(", "String", "logFilePath", ",", "Logger", "log", ")", "{", "Set", "<", "String", ">", "allSpawnedJobs", "=", "findApplicationIdFromLog", "(", "logFilePath", ",", "log", ")", ";", "lo...
Pass in a log file, this method will find all the hadoop jobs it has launched, and kills it Only works with Hadoop2 @return a Set<String>. The set will contain the applicationIds that this job tried to kill.
[ "Pass", "in", "a", "log", "file", "this", "method", "will", "find", "all", "the", "hadoop", "jobs", "it", "has", "launched", "and", "kills", "it" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java#L409-L422
130,783
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java
HadoopJobUtils.filterCommands
public static List<String> filterCommands(Collection<String> commands, String whitelistRegex, String blacklistRegex, Logger log) { List<String> filteredCommands = new LinkedList<String>(); Pattern whitelistPattern = Pattern.compile(whitelistRegex); Pattern blacklistPattern = Pattern.compile(blacklistR...
java
public static List<String> filterCommands(Collection<String> commands, String whitelistRegex, String blacklistRegex, Logger log) { List<String> filteredCommands = new LinkedList<String>(); Pattern whitelistPattern = Pattern.compile(whitelistRegex); Pattern blacklistPattern = Pattern.compile(blacklistR...
[ "public", "static", "List", "<", "String", ">", "filterCommands", "(", "Collection", "<", "String", ">", "commands", ",", "String", "whitelistRegex", ",", "String", "blacklistRegex", ",", "Logger", "log", ")", "{", "List", "<", "String", ">", "filteredCommands...
Filter a collection of String commands to match a whitelist regex and not match a blacklist regex. @param commands Collection of commands to be filtered @param whitelistRegex whitelist regex to work as inclusion criteria @param blacklistRegex blacklist regex to work as exclusion criteria @param log logger to report vi...
[ "Filter", "a", "collection", "of", "String", "commands", "to", "match", "a", "whitelist", "regex", "and", "not", "match", "a", "blacklist", "regex", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java#L539-L553
130,784
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java
HadoopJobUtils.constructHadoopTags
public static String constructHadoopTags(Props props, String[] keys) { String[] keysAndValues = new String[keys.length]; for (int i = 0; i < keys.length; i++) { if (props.containsKey(keys[i])) { keysAndValues[i] = keys[i] + ":" + props.get(keys[i]); } } Joiner joiner = Joiner.on(',')...
java
public static String constructHadoopTags(Props props, String[] keys) { String[] keysAndValues = new String[keys.length]; for (int i = 0; i < keys.length; i++) { if (props.containsKey(keys[i])) { keysAndValues[i] = keys[i] + ":" + props.get(keys[i]); } } Joiner joiner = Joiner.on(',')...
[ "public", "static", "String", "constructHadoopTags", "(", "Props", "props", ",", "String", "[", "]", "keys", ")", "{", "String", "[", "]", "keysAndValues", "=", "new", "String", "[", "keys", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ...
Construct a CSV of tags for the Hadoop application. @param props job properties @param keys list of keys to construct tags from. @return a CSV of tags
[ "Construct", "a", "CSV", "of", "tags", "for", "the", "Hadoop", "application", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java#L581-L590
130,785
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/OsMemoryUtil.java
OsMemoryUtil.getOsTotalFreeMemorySize
long getOsTotalFreeMemorySize() { if (!Files.isRegularFile(Paths.get(MEM_INFO_FILE))) { // Mac doesn't support /proc/meminfo for example. return 0; } final List<String> lines; // The file /proc/meminfo is assumed to contain only ASCII characters. // The assumption is that the file is no...
java
long getOsTotalFreeMemorySize() { if (!Files.isRegularFile(Paths.get(MEM_INFO_FILE))) { // Mac doesn't support /proc/meminfo for example. return 0; } final List<String> lines; // The file /proc/meminfo is assumed to contain only ASCII characters. // The assumption is that the file is no...
[ "long", "getOsTotalFreeMemorySize", "(", ")", "{", "if", "(", "!", "Files", ".", "isRegularFile", "(", "Paths", ".", "get", "(", "MEM_INFO_FILE", ")", ")", ")", "{", "// Mac doesn't support /proc/meminfo for example.", "return", "0", ";", "}", "final", "List", ...
Includes OS cache and free swap. @return the total free memory size of the OS. 0 if there is an error or the OS doesn't support this memory check.
[ "Includes", "OS", "cache", "and", "free", "swap", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/OsMemoryUtil.java#L34-L52
130,786
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/ExecuteAsUser.java
ExecuteAsUser.execute
public int execute(final String user, final List<String> command) throws IOException { log.info("Command: " + command); final Process process = new ProcessBuilder() .command(constructExecuteAsCommand(user, command)) .inheritIO() .start(); int exitCode; try { exitCode = pro...
java
public int execute(final String user, final List<String> command) throws IOException { log.info("Command: " + command); final Process process = new ProcessBuilder() .command(constructExecuteAsCommand(user, command)) .inheritIO() .start(); int exitCode; try { exitCode = pro...
[ "public", "int", "execute", "(", "final", "String", "user", ",", "final", "List", "<", "String", ">", "command", ")", "throws", "IOException", "{", "log", ".", "info", "(", "\"Command: \"", "+", "command", ")", ";", "final", "Process", "process", "=", "n...
API to execute a command on behalf of another user. @param user The proxy user @param command the list containing the program and its arguments @return The return value of the shell command
[ "API", "to", "execute", "a", "command", "on", "behalf", "of", "another", "user", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/ExecuteAsUser.java#L59-L74
130,787
azkaban/azkaban
azkaban-common/src/main/java/azkaban/server/HttpRequestUtils.java
HttpRequestUtils.validateIntegerParam
public static boolean validateIntegerParam(final Map<String, String> params, final String paramName) throws ExecutorManagerException { if (params != null && params.containsKey(paramName) && !StringUtils.isNumeric(params.get(paramName))) { throw new ExecutorManagerException(paramName + " should b...
java
public static boolean validateIntegerParam(final Map<String, String> params, final String paramName) throws ExecutorManagerException { if (params != null && params.containsKey(paramName) && !StringUtils.isNumeric(params.get(paramName))) { throw new ExecutorManagerException(paramName + " should b...
[ "public", "static", "boolean", "validateIntegerParam", "(", "final", "Map", "<", "String", ",", "String", ">", "params", ",", "final", "String", "paramName", ")", "throws", "ExecutorManagerException", "{", "if", "(", "params", "!=", "null", "&&", "params", "."...
parse a string as number and throws exception if parsed value is not a valid integer @throws ExecutorManagerException if paramName is not a valid integer
[ "parse", "a", "string", "as", "number", "and", "throws", "exception", "if", "parsed", "value", "is", "not", "a", "valid", "integer" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/server/HttpRequestUtils.java#L153-L160
130,788
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/FlowPreparer.java
FlowPreparer.calculateDirSizeAndSave
static long calculateDirSizeAndSave(final File dir) throws IOException { final Path path = Paths.get(dir.getPath(), FlowPreparer.PROJECT_DIR_SIZE_FILE_NAME); if (!Files.exists(path)) { final long sizeInByte = FileUtils.sizeOfDirectory(dir); FileIOUtils.dumpNumberToFile(path, sizeInByte); retur...
java
static long calculateDirSizeAndSave(final File dir) throws IOException { final Path path = Paths.get(dir.getPath(), FlowPreparer.PROJECT_DIR_SIZE_FILE_NAME); if (!Files.exists(path)) { final long sizeInByte = FileUtils.sizeOfDirectory(dir); FileIOUtils.dumpNumberToFile(path, sizeInByte); retur...
[ "static", "long", "calculateDirSizeAndSave", "(", "final", "File", "dir", ")", "throws", "IOException", "{", "final", "Path", "path", "=", "Paths", ".", "get", "(", "dir", ".", "getPath", "(", ")", ",", "FlowPreparer", ".", "PROJECT_DIR_SIZE_FILE_NAME", ")", ...
Calculate the directory size and save it to a file. @param dir the directory whose size needs to be saved. @return the size of the dir.
[ "Calculate", "the", "directory", "size", "and", "save", "it", "to", "a", "file", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowPreparer.java#L85-L94
130,789
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/FlowPreparer.java
FlowPreparer.setup
void setup(final ExecutableFlow flow) throws ExecutorManagerException { final ProjectFileHandler projectFileHandler = null; File tempDir = null; try { final ProjectDirectoryMetadata project = new ProjectDirectoryMetadata( flow.getProjectId(), flow.getVersion()); final long f...
java
void setup(final ExecutableFlow flow) throws ExecutorManagerException { final ProjectFileHandler projectFileHandler = null; File tempDir = null; try { final ProjectDirectoryMetadata project = new ProjectDirectoryMetadata( flow.getProjectId(), flow.getVersion()); final long f...
[ "void", "setup", "(", "final", "ExecutableFlow", "flow", ")", "throws", "ExecutorManagerException", "{", "final", "ProjectFileHandler", "projectFileHandler", "=", "null", ";", "File", "tempDir", "=", "null", ";", "try", "{", "final", "ProjectDirectoryMetadata", "pro...
Prepare the flow directory for execution. @param flow Executable Flow instance.
[ "Prepare", "the", "flow", "directory", "for", "execution", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowPreparer.java#L102-L158
130,790
azkaban/azkaban
az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaEventMonitor.java
KafkaEventMonitor.consumerSubscriptionRebalance
@VisibleForTesting synchronized void consumerSubscriptionRebalance() { log.debug("Subscribed Topics " + this.consumer.subscription()); if (!this.subscribedTopics.isEmpty()) { final Iterator<String> iter = this.subscribedTopics.iterator(); final List<String> topics = new ArrayList<>(); while ...
java
@VisibleForTesting synchronized void consumerSubscriptionRebalance() { log.debug("Subscribed Topics " + this.consumer.subscription()); if (!this.subscribedTopics.isEmpty()) { final Iterator<String> iter = this.subscribedTopics.iterator(); final List<String> topics = new ArrayList<>(); while ...
[ "@", "VisibleForTesting", "synchronized", "void", "consumerSubscriptionRebalance", "(", ")", "{", "log", ".", "debug", "(", "\"Subscribed Topics \"", "+", "this", ".", "consumer", ".", "subscription", "(", ")", ")", ";", "if", "(", "!", "this", ".", "subscribe...
Dynamically tune subscription only for the topic that dependencies need.
[ "Dynamically", "tune", "subscription", "only", "for", "the", "topic", "that", "dependencies", "need", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaEventMonitor.java#L131-L144
130,791
azkaban/azkaban
az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaEventMonitor.java
KafkaEventMonitor.triggerDependencies
private void triggerDependencies(final Set<String> matchedList, final ConsumerRecord<String, String> record) { final List<KafkaDependencyInstanceContext> deleteList = new LinkedList<>(); for (final String it : matchedList) { final List<KafkaDependencyInstanceContext> possibleAvailableDeps = this...
java
private void triggerDependencies(final Set<String> matchedList, final ConsumerRecord<String, String> record) { final List<KafkaDependencyInstanceContext> deleteList = new LinkedList<>(); for (final String it : matchedList) { final List<KafkaDependencyInstanceContext> possibleAvailableDeps = this...
[ "private", "void", "triggerDependencies", "(", "final", "Set", "<", "String", ">", "matchedList", ",", "final", "ConsumerRecord", "<", "String", ",", "String", ">", "record", ")", "{", "final", "List", "<", "KafkaDependencyInstanceContext", ">", "deleteList", "=...
If the matcher returns true, remove the dependency from collection.
[ "If", "the", "matcher", "returns", "true", "remove", "the", "dependency", "from", "collection", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaEventMonitor.java#L149-L163
130,792
azkaban/azkaban
azkaban-common/src/main/java/azkaban/storage/HdfsAuth.java
HdfsAuth.authorize
public void authorize() { if (this.isSecurityEnabled) { try { login(this.keytabPrincipal, this.keytabPath); } catch (final IOException e) { log.error(e); throw new AzkabanException(String.format( "Error: Unable to authorize to Hadoop. Principal: %s Keytab: %s", this.k...
java
public void authorize() { if (this.isSecurityEnabled) { try { login(this.keytabPrincipal, this.keytabPath); } catch (final IOException e) { log.error(e); throw new AzkabanException(String.format( "Error: Unable to authorize to Hadoop. Principal: %s Keytab: %s", this.k...
[ "public", "void", "authorize", "(", ")", "{", "if", "(", "this", ".", "isSecurityEnabled", ")", "{", "try", "{", "login", "(", "this", ".", "keytabPrincipal", ",", "this", ".", "keytabPath", ")", ";", "}", "catch", "(", "final", "IOException", "e", ")"...
API to authorize HDFS access. This logins in the configured user via the keytab. If the user is already logged in then it renews the TGT.
[ "API", "to", "authorize", "HDFS", "access", ".", "This", "logins", "in", "the", "configured", "user", "via", "the", "keytab", ".", "If", "the", "user", "is", "already", "logged", "in", "then", "it", "renews", "the", "TGT", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/storage/HdfsAuth.java#L64-L75
130,793
azkaban/azkaban
azkaban-common/src/main/java/azkaban/jobcallback/JobCallbackValidator.java
JobCallbackValidator.validate
public static int validate(final String jobName, final Props serverProps, final Props jobProps, final Collection<String> errors) { final int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUN...
java
public static int validate(final String jobName, final Props serverProps, final Props jobProps, final Collection<String> errors) { final int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUN...
[ "public", "static", "int", "validate", "(", "final", "String", "jobName", ",", "final", "Props", "serverProps", ",", "final", "Props", "jobProps", ",", "final", "Collection", "<", "String", ">", "errors", ")", "{", "final", "int", "maxNumCallback", "=", "ser...
Make sure all the job callback related properties are valid @return number of valid job callback properties. Mainly for testing purpose.
[ "Make", "sure", "all", "the", "job", "callback", "related", "properties", "are", "valid" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobcallback/JobCallbackValidator.java#L32-L55
130,794
azkaban/azkaban
az-reportal/src/main/java/azkaban/jobtype/ReportalHiveRunner.java
ReportalHiveRunner.expandHiveAuxJarsPath
static String expandHiveAuxJarsPath(final String original) throws IOException { if (original == null || original.endsWith(".jar")) { return original; } final File[] files = new File(original).listFiles(); if (files == null || files.length == 0) { return original; } return filesToU...
java
static String expandHiveAuxJarsPath(final String original) throws IOException { if (original == null || original.endsWith(".jar")) { return original; } final File[] files = new File(original).listFiles(); if (files == null || files.length == 0) { return original; } return filesToU...
[ "static", "String", "expandHiveAuxJarsPath", "(", "final", "String", "original", ")", "throws", "IOException", "{", "if", "(", "original", "==", "null", "||", "original", ".", "endsWith", "(", "\".jar\"", ")", ")", "{", "return", "original", ";", "}", "final...
Normally hive.aux.jars.path is expanded from just being a path to the full list of files in the directory by the hive shell script. Since we normally won't be running from the script, it's up to us to do that work here. We use a heuristic that if there is no occurrence of ".jar" in the original, it needs expansion. Oth...
[ "Normally", "hive", ".", "aux", ".", "jars", ".", "path", "is", "expanded", "from", "just", "being", "a", "path", "to", "the", "full", "list", "of", "files", "in", "the", "directory", "by", "the", "hive", "shell", "script", ".", "Since", "we", "normall...
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-reportal/src/main/java/azkaban/jobtype/ReportalHiveRunner.java#L60-L73
130,795
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/javautils/ValidationUtils.java
ValidationUtils.validateAllOrNone
public static void validateAllOrNone(Props props, String... keys) { Objects.requireNonNull(keys); boolean allExist = true; boolean someExist = false; for (String key : keys) { Object val = props.get(key); allExist &= val != null; someExist |= val != null; } if (someExist && !...
java
public static void validateAllOrNone(Props props, String... keys) { Objects.requireNonNull(keys); boolean allExist = true; boolean someExist = false; for (String key : keys) { Object val = props.get(key); allExist &= val != null; someExist |= val != null; } if (someExist && !...
[ "public", "static", "void", "validateAllOrNone", "(", "Props", "props", ",", "String", "...", "keys", ")", "{", "Objects", ".", "requireNonNull", "(", "keys", ")", ";", "boolean", "allExist", "=", "true", ";", "boolean", "someExist", "=", "false", ";", "fo...
Validates if all of the keys exist of none of them exist @throws IllegalArgumentException only if some of the keys exist
[ "Validates", "if", "all", "of", "the", "keys", "exist", "of", "none", "of", "them", "exist" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/javautils/ValidationUtils.java#L38-L54
130,796
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/javautils/ValidationUtils.java
ValidationUtils.validateAllNotEmpty
public static void validateAllNotEmpty(Props props, String... keys) { for (String key : keys) { props.getString(key); } }
java
public static void validateAllNotEmpty(Props props, String... keys) { for (String key : keys) { props.getString(key); } }
[ "public", "static", "void", "validateAllNotEmpty", "(", "Props", "props", ",", "String", "...", "keys", ")", "{", "for", "(", "String", "key", ":", "keys", ")", "{", "props", ".", "getString", "(", "key", ")", ";", "}", "}" ]
Validates all keys present in props
[ "Validates", "all", "keys", "present", "in", "props" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/javautils/ValidationUtils.java#L59-L63
130,797
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.copyNext
private static Props copyNext(final Props source) { Props priorNodeCopy = null; if (source.getParent() != null) { priorNodeCopy = copyNext(source.getParent()); } final Props dest = new Props(priorNodeCopy); for (final String key : source.localKeySet()) { dest.put(key, source.get(key)); ...
java
private static Props copyNext(final Props source) { Props priorNodeCopy = null; if (source.getParent() != null) { priorNodeCopy = copyNext(source.getParent()); } final Props dest = new Props(priorNodeCopy); for (final String key : source.localKeySet()) { dest.put(key, source.get(key)); ...
[ "private", "static", "Props", "copyNext", "(", "final", "Props", "source", ")", "{", "Props", "priorNodeCopy", "=", "null", ";", "if", "(", "source", ".", "getParent", "(", ")", "!=", "null", ")", "{", "priorNodeCopy", "=", "copyNext", "(", "source", "."...
Recursive Clone function of Props @param source the source Props object @return the cloned Props object
[ "Recursive", "Clone", "function", "of", "Props" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L166-L177
130,798
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.containsKey
public boolean containsKey(final Object k) { return this._current.containsKey(k) || (this._parent != null && this._parent.containsKey(k)); }
java
public boolean containsKey(final Object k) { return this._current.containsKey(k) || (this._parent != null && this._parent.containsKey(k)); }
[ "public", "boolean", "containsKey", "(", "final", "Object", "k", ")", "{", "return", "this", ".", "_current", ".", "containsKey", "(", "k", ")", "||", "(", "this", ".", "_parent", "!=", "null", "&&", "this", ".", "_parent", ".", "containsKey", "(", "k"...
Check key in current Props then search in parent
[ "Check", "key", "in", "current", "Props", "then", "search", "in", "parent" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L224-L227
130,799
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.containsValue
public boolean containsValue(final Object value) { return this._current.containsValue(value) || (this._parent != null && this._parent.containsValue(value)); }
java
public boolean containsValue(final Object value) { return this._current.containsValue(value) || (this._parent != null && this._parent.containsValue(value)); }
[ "public", "boolean", "containsValue", "(", "final", "Object", "value", ")", "{", "return", "this", ".", "_current", ".", "containsValue", "(", "value", ")", "||", "(", "this", ".", "_parent", "!=", "null", "&&", "this", ".", "_parent", ".", "containsValue"...
Check value in current Props then search in parent
[ "Check", "value", "in", "current", "Props", "then", "search", "in", "parent" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L232-L235