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,600 | azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopShell.java | HadoopShell.setupHadoopJobProperties | @Override
public void setupHadoopJobProperties() {
if (getJobProps().containsKey(HADOOP_GLOBAL_OPTS)) {
String hadoopGlobalOps = getJobProps().getString(HADOOP_GLOBAL_OPTS);
if (getJobProps().containsKey(HADOOP_OPTS)) {
String hadoopOps = getJobProps().getString(HADOOP_OPTS);
getJobPro... | java | @Override
public void setupHadoopJobProperties() {
if (getJobProps().containsKey(HADOOP_GLOBAL_OPTS)) {
String hadoopGlobalOps = getJobProps().getString(HADOOP_GLOBAL_OPTS);
if (getJobProps().containsKey(HADOOP_OPTS)) {
String hadoopOps = getJobProps().getString(HADOOP_OPTS);
getJobPro... | [
"@",
"Override",
"public",
"void",
"setupHadoopJobProperties",
"(",
")",
"{",
"if",
"(",
"getJobProps",
"(",
")",
".",
"containsKey",
"(",
"HADOOP_GLOBAL_OPTS",
")",
")",
"{",
"String",
"hadoopGlobalOps",
"=",
"getJobProps",
"(",
")",
".",
"getString",
"(",
... | Append HADOOP_GLOBAL_OPTS with HADOOP_OPTS in the given props | [
"Append",
"HADOOP_GLOBAL_OPTS",
"with",
"HADOOP_OPTS",
"in",
"the",
"given",
"props"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopShell.java#L63-L74 |
130,601 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/TimeUtils.java | TimeUtils.formatDuration | public static String formatDuration(final long startTime, final long endTime) {
if (startTime == -1) {
return "-";
}
final long durationMS;
if (endTime == -1) {
durationMS = System.currentTimeMillis() - startTime;
} else {
durationMS = endTime - startTime;
}
long seconds ... | java | public static String formatDuration(final long startTime, final long endTime) {
if (startTime == -1) {
return "-";
}
final long durationMS;
if (endTime == -1) {
durationMS = System.currentTimeMillis() - startTime;
} else {
durationMS = endTime - startTime;
}
long seconds ... | [
"public",
"static",
"String",
"formatDuration",
"(",
"final",
"long",
"startTime",
",",
"final",
"long",
"endTime",
")",
"{",
"if",
"(",
"startTime",
"==",
"-",
"1",
")",
"{",
"return",
"\"-\"",
";",
"}",
"final",
"long",
"durationMS",
";",
"if",
"(",
... | Format time period pair to Duration String
@param startTime start time
@param endTime end time
@return Duration String | [
"Format",
"time",
"period",
"pair",
"to",
"Duration",
"String"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/TimeUtils.java#L72-L104 |
130,602 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/TimeUtils.java | TimeUtils.parsePeriodString | public static ReadablePeriod parsePeriodString(final String periodStr) {
final ReadablePeriod period;
final char periodUnit = periodStr.charAt(periodStr.length() - 1);
if (periodStr.equals("null") || periodUnit == 'n') {
return null;
}
final int periodInt =
Integer.parseInt(periodStr.... | java | public static ReadablePeriod parsePeriodString(final String periodStr) {
final ReadablePeriod period;
final char periodUnit = periodStr.charAt(periodStr.length() - 1);
if (periodStr.equals("null") || periodUnit == 'n') {
return null;
}
final int periodInt =
Integer.parseInt(periodStr.... | [
"public",
"static",
"ReadablePeriod",
"parsePeriodString",
"(",
"final",
"String",
"periodStr",
")",
"{",
"final",
"ReadablePeriod",
"period",
";",
"final",
"char",
"periodUnit",
"=",
"periodStr",
".",
"charAt",
"(",
"periodStr",
".",
"length",
"(",
")",
"-",
... | Parse Period String to a ReadablePeriod Object
@param periodStr string formatted period
@return ReadablePeriod Object | [
"Parse",
"Period",
"String",
"to",
"a",
"ReadablePeriod",
"Object"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/TimeUtils.java#L151-L188 |
130,603 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/TimeUtils.java | TimeUtils.createPeriodString | public static String createPeriodString(final ReadablePeriod period) {
String periodStr = "null";
if (period == null) {
return periodStr;
}
if (period.get(DurationFieldType.years()) > 0) {
final int years = period.get(DurationFieldType.years());
periodStr = years + "y";
} else if... | java | public static String createPeriodString(final ReadablePeriod period) {
String periodStr = "null";
if (period == null) {
return periodStr;
}
if (period.get(DurationFieldType.years()) > 0) {
final int years = period.get(DurationFieldType.years());
periodStr = years + "y";
} else if... | [
"public",
"static",
"String",
"createPeriodString",
"(",
"final",
"ReadablePeriod",
"period",
")",
"{",
"String",
"periodStr",
"=",
"\"null\"",
";",
"if",
"(",
"period",
"==",
"null",
")",
"{",
"return",
"periodStr",
";",
"}",
"if",
"(",
"period",
".",
"ge... | Convert ReadablePeriod Object to string
@param period ReadablePeriod Object
@return string formatted ReadablePeriod Object | [
"Convert",
"ReadablePeriod",
"Object",
"to",
"string"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/TimeUtils.java#L196-L227 |
130,604 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/jobtype/JobTypeManager.java | JobTypeManager.loadPluginJobTypes | private void loadPluginJobTypes(final JobTypePluginSet plugins)
throws JobTypeManagerException {
final File jobPluginsDir = new File(this.jobTypePluginDir);
if (!jobPluginsDir.exists()) {
logger.error("Job type plugin dir " + this.jobTypePluginDir
+ " doesn't exist. Will not load any exte... | java | private void loadPluginJobTypes(final JobTypePluginSet plugins)
throws JobTypeManagerException {
final File jobPluginsDir = new File(this.jobTypePluginDir);
if (!jobPluginsDir.exists()) {
logger.error("Job type plugin dir " + this.jobTypePluginDir
+ " doesn't exist. Will not load any exte... | [
"private",
"void",
"loadPluginJobTypes",
"(",
"final",
"JobTypePluginSet",
"plugins",
")",
"throws",
"JobTypeManagerException",
"{",
"final",
"File",
"jobPluginsDir",
"=",
"new",
"File",
"(",
"this",
".",
"jobTypePluginDir",
")",
";",
"if",
"(",
"!",
"jobPluginsDi... | load Job Types from jobtype plugin dir | [
"load",
"Job",
"Types",
"from",
"jobtype",
"plugin",
"dir"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobtype/JobTypeManager.java#L96-L163 |
130,605 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/JdbcExecutorLoader.java | JdbcExecutorLoader.fetchRecentlyFinishedFlows | @Override
public List<ExecutableFlow> fetchRecentlyFinishedFlows(final Duration maxAge)
throws ExecutorManagerException {
return this.executionFlowDao.fetchRecentlyFinishedFlows(maxAge);
} | java | @Override
public List<ExecutableFlow> fetchRecentlyFinishedFlows(final Duration maxAge)
throws ExecutorManagerException {
return this.executionFlowDao.fetchRecentlyFinishedFlows(maxAge);
} | [
"@",
"Override",
"public",
"List",
"<",
"ExecutableFlow",
">",
"fetchRecentlyFinishedFlows",
"(",
"final",
"Duration",
"maxAge",
")",
"throws",
"ExecutorManagerException",
"{",
"return",
"this",
".",
"executionFlowDao",
".",
"fetchRecentlyFinishedFlows",
"(",
"maxAge",
... | maxAge indicates how long finished flows are shown in Recently Finished flow page. | [
"maxAge",
"indicates",
"how",
"long",
"finished",
"flows",
"are",
"shown",
"in",
"Recently",
"Finished",
"flow",
"page",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/JdbcExecutorLoader.java#L91-L95 |
130,606 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/dag/Node.java | Node.isReady | private boolean isReady() {
if (this.status != Status.READY) {
// e.g. if the node is disabled, it is not ready to run.
return false;
}
for (final Node parent : this.parents) {
if (!parent.status.isSuccessEffectively()) {
return false;
}
}
return true;
} | java | private boolean isReady() {
if (this.status != Status.READY) {
// e.g. if the node is disabled, it is not ready to run.
return false;
}
for (final Node parent : this.parents) {
if (!parent.status.isSuccessEffectively()) {
return false;
}
}
return true;
} | [
"private",
"boolean",
"isReady",
"(",
")",
"{",
"if",
"(",
"this",
".",
"status",
"!=",
"Status",
".",
"READY",
")",
"{",
"// e.g. if the node is disabled, it is not ready to run.",
"return",
"false",
";",
"}",
"for",
"(",
"final",
"Node",
"parent",
":",
"this... | Checks if the node is ready to run.
@return true if the node is ready to run | [
"Checks",
"if",
"the",
"node",
"is",
"ready",
"to",
"run",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/dag/Node.java#L82-L93 |
130,607 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/dag/Node.java | Node.markSuccess | void markSuccess() {
// It's possible that the dag is killed before this method is called.
assertRunningOrKilling();
changeStatus(Status.SUCCESS);
for (final Node child : this.children) {
child.runIfAllowed();
}
this.dag.updateDagStatus();
} | java | void markSuccess() {
// It's possible that the dag is killed before this method is called.
assertRunningOrKilling();
changeStatus(Status.SUCCESS);
for (final Node child : this.children) {
child.runIfAllowed();
}
this.dag.updateDagStatus();
} | [
"void",
"markSuccess",
"(",
")",
"{",
"// It's possible that the dag is killed before this method is called.",
"assertRunningOrKilling",
"(",
")",
";",
"changeStatus",
"(",
"Status",
".",
"SUCCESS",
")",
";",
"for",
"(",
"final",
"Node",
"child",
":",
"this",
".",
"... | Transitions the node to the success state. | [
"Transitions",
"the",
"node",
"to",
"the",
"success",
"state",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/dag/Node.java#L98-L106 |
130,608 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/dag/Node.java | Node.markFailed | void markFailed() {
// It's possible that the dag is killed before this method is called.
assertRunningOrKilling();
changeStatus(Status.FAILURE);
for (final Node child : this.children) {
child.cancel();
}
//todo: HappyRay support failure options "Finish Current Running" and "Cancel All"
... | java | void markFailed() {
// It's possible that the dag is killed before this method is called.
assertRunningOrKilling();
changeStatus(Status.FAILURE);
for (final Node child : this.children) {
child.cancel();
}
//todo: HappyRay support failure options "Finish Current Running" and "Cancel All"
... | [
"void",
"markFailed",
"(",
")",
"{",
"// It's possible that the dag is killed before this method is called.",
"assertRunningOrKilling",
"(",
")",
";",
"changeStatus",
"(",
"Status",
".",
"FAILURE",
")",
";",
"for",
"(",
"final",
"Node",
"child",
":",
"this",
".",
"c... | Transitions the node to the failure state. | [
"Transitions",
"the",
"node",
"to",
"the",
"failure",
"state",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/dag/Node.java#L120-L129 |
130,609 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/dag/Node.java | Node.kill | void kill() {
assert (this.dag.getStatus() == Status.KILLING);
if (this.status == Status.READY || this.status == Status.BLOCKED) {
// If the node is disabled, keep the status as disabled.
changeStatus(Status.CANCELED);
} else if (this.status == Status.RUNNING) {
changeStatus(Status.KILLING... | java | void kill() {
assert (this.dag.getStatus() == Status.KILLING);
if (this.status == Status.READY || this.status == Status.BLOCKED) {
// If the node is disabled, keep the status as disabled.
changeStatus(Status.CANCELED);
} else if (this.status == Status.RUNNING) {
changeStatus(Status.KILLING... | [
"void",
"kill",
"(",
")",
"{",
"assert",
"(",
"this",
".",
"dag",
".",
"getStatus",
"(",
")",
"==",
"Status",
".",
"KILLING",
")",
";",
"if",
"(",
"this",
".",
"status",
"==",
"Status",
".",
"READY",
"||",
"this",
".",
"status",
"==",
"Status",
"... | Kills a node.
<p>A node is not designed to be killed individually. This method expects {@link Dag#kill()}
method to kill all nodes. Thus this method itself doesn't need to propagate the kill signal to
the node's children nodes. | [
"Kills",
"a",
"node",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/dag/Node.java#L161-L170 |
130,610 | azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java | HadoopConfigurationInjector.getConfFile | public static File getConfFile(Props props, String workingDir, String fileName) {
File jobDir = new File(workingDir, getDirName(props));
if (!jobDir.exists()) {
jobDir.mkdir();
}
return new File(jobDir, fileName);
} | java | public static File getConfFile(Props props, String workingDir, String fileName) {
File jobDir = new File(workingDir, getDirName(props));
if (!jobDir.exists()) {
jobDir.mkdir();
}
return new File(jobDir, fileName);
} | [
"public",
"static",
"File",
"getConfFile",
"(",
"Props",
"props",
",",
"String",
"workingDir",
",",
"String",
"fileName",
")",
"{",
"File",
"jobDir",
"=",
"new",
"File",
"(",
"workingDir",
",",
"getDirName",
"(",
"props",
")",
")",
";",
"if",
"(",
"!",
... | Resolve the location of the file containing the configuration file.
@param props The Azkaban properties
@param workingDir The Azkaban job working directory
@param fileName The desired configuration file name | [
"Resolve",
"the",
"location",
"of",
"the",
"file",
"containing",
"the",
"configuration",
"file",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java#L154-L160 |
130,611 | azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java | HadoopConfigurationInjector.getDirName | public static String getDirName(Props props) {
String dirSuffix = props.get(CommonJobProperties.NESTED_FLOW_PATH);
if ((dirSuffix == null) || (dirSuffix.length() == 0)) {
dirSuffix = props.get(CommonJobProperties.JOB_ID);
if ((dirSuffix == null) || (dirSuffix.length() == 0)) {
throw new Run... | java | public static String getDirName(Props props) {
String dirSuffix = props.get(CommonJobProperties.NESTED_FLOW_PATH);
if ((dirSuffix == null) || (dirSuffix.length() == 0)) {
dirSuffix = props.get(CommonJobProperties.JOB_ID);
if ((dirSuffix == null) || (dirSuffix.length() == 0)) {
throw new Run... | [
"public",
"static",
"String",
"getDirName",
"(",
"Props",
"props",
")",
"{",
"String",
"dirSuffix",
"=",
"props",
".",
"get",
"(",
"CommonJobProperties",
".",
"NESTED_FLOW_PATH",
")",
";",
"if",
"(",
"(",
"dirSuffix",
"==",
"null",
")",
"||",
"(",
"dirSuff... | For classpath reasons, we'll put each link file in a separate directory.
This must be called only after the job id has been inserted by the job.
@param props The Azkaban properties | [
"For",
"classpath",
"reasons",
"we",
"ll",
"put",
"each",
"link",
"file",
"in",
"a",
"separate",
"directory",
".",
"This",
"must",
"be",
"called",
"only",
"after",
"the",
"job",
"id",
"has",
"been",
"inserted",
"by",
"the",
"job",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java#L168-L179 |
130,612 | azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java | HadoopConfigurationInjector.getPath | public static String getPath(Props props, String workingDir) {
return new File(workingDir, getDirName(props)).toString();
} | java | public static String getPath(Props props, String workingDir) {
return new File(workingDir, getDirName(props)).toString();
} | [
"public",
"static",
"String",
"getPath",
"(",
"Props",
"props",
",",
"String",
"workingDir",
")",
"{",
"return",
"new",
"File",
"(",
"workingDir",
",",
"getDirName",
"(",
"props",
")",
")",
".",
"toString",
"(",
")",
";",
"}"
] | Gets the path to the directory in which the generated links and Hadoop
conf properties files are written.
@param props The Azkaban properties
@param workingDir The Azkaban job working directory | [
"Gets",
"the",
"path",
"to",
"the",
"directory",
"in",
"which",
"the",
"generated",
"links",
"and",
"Hadoop",
"conf",
"properties",
"files",
"are",
"written",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java#L188-L190 |
130,613 | azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java | HadoopConfigurationInjector.loadProp | public static void loadProp(Props props, Configuration conf, String name) {
String prop = props.get(name);
if (prop != null) {
conf.set(name, prop);
}
} | java | public static void loadProp(Props props, Configuration conf, String name) {
String prop = props.get(name);
if (prop != null) {
conf.set(name, prop);
}
} | [
"public",
"static",
"void",
"loadProp",
"(",
"Props",
"props",
",",
"Configuration",
"conf",
",",
"String",
"name",
")",
"{",
"String",
"prop",
"=",
"props",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"prop",
"!=",
"null",
")",
"{",
"conf",
".",
... | Loads an Azkaban property into the Hadoop configuration.
@param props The Azkaban properties
@param conf The Hadoop configuration
@param name The property name to load from the Azkaban properties into the Hadoop configuration | [
"Loads",
"an",
"Azkaban",
"property",
"into",
"the",
"Hadoop",
"configuration",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java#L199-L204 |
130,614 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java | ExecutorManager.refreshExecutors | private void refreshExecutors() {
final List<Pair<Executor, Future<ExecutorInfo>>> futures =
new ArrayList<>();
for (final Executor executor : this.activeExecutors.getAll()) {
// execute each executorInfo refresh task to fetch
final Future<ExecutorInfo> fetchExecutionInfo =
this.e... | java | private void refreshExecutors() {
final List<Pair<Executor, Future<ExecutorInfo>>> futures =
new ArrayList<>();
for (final Executor executor : this.activeExecutors.getAll()) {
// execute each executorInfo refresh task to fetch
final Future<ExecutorInfo> fetchExecutionInfo =
this.e... | [
"private",
"void",
"refreshExecutors",
"(",
")",
"{",
"final",
"List",
"<",
"Pair",
"<",
"Executor",
",",
"Future",
"<",
"ExecutorInfo",
">",
">",
">",
"futures",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"Executor",
"executor",
... | Refresh Executor stats for all the actie executors in this executorManager | [
"Refresh",
"Executor",
"stats",
"for",
"all",
"the",
"actie",
"executors",
"in",
"this",
"executorManager"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java#L246-L287 |
130,615 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java | ExecutorManager.getQueuedFlowIds | public String getQueuedFlowIds() {
final List<Integer> allIds = new ArrayList<>();
getRunningFlowsIdsHelper(allIds, this.queuedFlows.getAllEntries());
Collections.sort(allIds);
return allIds.toString();
} | java | public String getQueuedFlowIds() {
final List<Integer> allIds = new ArrayList<>();
getRunningFlowsIdsHelper(allIds, this.queuedFlows.getAllEntries());
Collections.sort(allIds);
return allIds.toString();
} | [
"public",
"String",
"getQueuedFlowIds",
"(",
")",
"{",
"final",
"List",
"<",
"Integer",
">",
"allIds",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"getRunningFlowsIdsHelper",
"(",
"allIds",
",",
"this",
".",
"queuedFlows",
".",
"getAllEntries",
"(",
")",
... | Get execution Ids of all non-dispatched flows | [
"Get",
"execution",
"Ids",
"of",
"all",
"non",
"-",
"dispatched",
"flows"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java#L572-L577 |
130,616 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java | ExecutorManager.dispatch | private void dispatch(final ExecutionReference reference, final ExecutableFlow exflow,
final Executor choosenExecutor) throws ExecutorManagerException {
exflow.setUpdateTime(System.currentTimeMillis());
this.executorLoader.assignExecutor(choosenExecutor.getId(),
exflow.getExecutionId());
try ... | java | private void dispatch(final ExecutionReference reference, final ExecutableFlow exflow,
final Executor choosenExecutor) throws ExecutorManagerException {
exflow.setUpdateTime(System.currentTimeMillis());
this.executorLoader.assignExecutor(choosenExecutor.getId(),
exflow.getExecutionId());
try ... | [
"private",
"void",
"dispatch",
"(",
"final",
"ExecutionReference",
"reference",
",",
"final",
"ExecutableFlow",
"exflow",
",",
"final",
"Executor",
"choosenExecutor",
")",
"throws",
"ExecutorManagerException",
"{",
"exflow",
".",
"setUpdateTime",
"(",
"System",
".",
... | Calls executor to dispatch the flow, update db to assign the executor and in-memory state of
executableFlow. | [
"Calls",
"executor",
"to",
"dispatch",
"the",
"flow",
"update",
"db",
"to",
"assign",
"the",
"executor",
"and",
"in",
"-",
"memory",
"state",
"of",
"executableFlow",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java#L1112-L1146 |
130,617 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutionFlowDao.java | ExecutionFlowDao.unsetExecutorIdForExecution | public void unsetExecutorIdForExecution(final int executionId) throws ExecutorManagerException {
final String UNSET_EXECUTOR = "UPDATE execution_flows SET executor_id = null where exec_id = ?";
final SQLTransaction<Integer> unsetExecutor =
transOperator -> transOperator.update(UNSET_EXECUTOR, execution... | java | public void unsetExecutorIdForExecution(final int executionId) throws ExecutorManagerException {
final String UNSET_EXECUTOR = "UPDATE execution_flows SET executor_id = null where exec_id = ?";
final SQLTransaction<Integer> unsetExecutor =
transOperator -> transOperator.update(UNSET_EXECUTOR, execution... | [
"public",
"void",
"unsetExecutorIdForExecution",
"(",
"final",
"int",
"executionId",
")",
"throws",
"ExecutorManagerException",
"{",
"final",
"String",
"UNSET_EXECUTOR",
"=",
"\"UPDATE execution_flows SET executor_id = null where exec_id = ?\"",
";",
"final",
"SQLTransaction",
... | set executor id to null for the execution id | [
"set",
"executor",
"id",
"to",
"null",
"for",
"the",
"execution",
"id"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionFlowDao.java#L295-L307 |
130,618 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/jobExecutor/utils/process/AzkabanProcess.java | AzkabanProcess.run | public void run() throws IOException {
if (this.isStarted() || this.isComplete()) {
throw new IllegalStateException("The process can only be used once.");
}
final ProcessBuilder builder = new ProcessBuilder(this.cmd);
builder.directory(new File(this.workingDir));
builder.environment().putAll(... | java | public void run() throws IOException {
if (this.isStarted() || this.isComplete()) {
throw new IllegalStateException("The process can only be used once.");
}
final ProcessBuilder builder = new ProcessBuilder(this.cmd);
builder.directory(new File(this.workingDir));
builder.environment().putAll(... | [
"public",
"void",
"run",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"isStarted",
"(",
")",
"||",
"this",
".",
"isComplete",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The process can only be used once.\"",
")",
... | Execute this process, blocking until it has completed. | [
"Execute",
"this",
"process",
"blocking",
"until",
"it",
"has",
"completed",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobExecutor/utils/process/AzkabanProcess.java#L80-L133 |
130,619 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/jobExecutor/utils/process/AzkabanProcess.java | AzkabanProcess.softKill | public boolean softKill(final long time, final TimeUnit unit)
throws InterruptedException {
checkStarted();
if (this.processId != 0 && isStarted()) {
try {
if (this.isExecuteAsUser) {
final String cmd =
String.format("%s %s %s %d", this.executeAsUserBinary,
... | java | public boolean softKill(final long time, final TimeUnit unit)
throws InterruptedException {
checkStarted();
if (this.processId != 0 && isStarted()) {
try {
if (this.isExecuteAsUser) {
final String cmd =
String.format("%s %s %s %d", this.executeAsUserBinary,
... | [
"public",
"boolean",
"softKill",
"(",
"final",
"long",
"time",
",",
"final",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"checkStarted",
"(",
")",
";",
"if",
"(",
"this",
".",
"processId",
"!=",
"0",
"&&",
"isStarted",
"(",
")",
")",
... | Attempt to kill the process, waiting up to the given time for it to die
@param time The amount of time to wait
@param unit The time unit
@return true iff this soft kill kills the process in the given wait time. | [
"Attempt",
"to",
"kill",
"the",
"process",
"waiting",
"up",
"to",
"the",
"given",
"time",
"for",
"it",
"to",
"die"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobExecutor/utils/process/AzkabanProcess.java#L172-L193 |
130,620 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/jobExecutor/utils/process/AzkabanProcess.java | AzkabanProcess.hardKill | public void hardKill() {
checkStarted();
if (isRunning()) {
if (this.processId != 0) {
try {
if (this.isExecuteAsUser) {
final String cmd =
String.format("%s %s %s -9 %d", this.executeAsUserBinary,
this.effectiveUser, KILL_COMMAND, this.pro... | java | public void hardKill() {
checkStarted();
if (isRunning()) {
if (this.processId != 0) {
try {
if (this.isExecuteAsUser) {
final String cmd =
String.format("%s %s %s -9 %d", this.executeAsUserBinary,
this.effectiveUser, KILL_COMMAND, this.pro... | [
"public",
"void",
"hardKill",
"(",
")",
"{",
"checkStarted",
"(",
")",
";",
"if",
"(",
"isRunning",
"(",
")",
")",
"{",
"if",
"(",
"this",
".",
"processId",
"!=",
"0",
")",
"{",
"try",
"{",
"if",
"(",
"this",
".",
"isExecuteAsUser",
")",
"{",
"fi... | Force kill this process | [
"Force",
"kill",
"this",
"process"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobExecutor/utils/process/AzkabanProcess.java#L198-L218 |
130,621 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/jobExecutor/utils/process/AzkabanProcess.java | AzkabanProcess.processId | private int processId(final java.lang.Process process) {
int processId = 0;
try {
final Field f = process.getClass().getDeclaredField("pid");
f.setAccessible(true);
processId = f.getInt(process);
} catch (final Throwable e) {
e.printStackTrace();
}
return processId;
} | java | private int processId(final java.lang.Process process) {
int processId = 0;
try {
final Field f = process.getClass().getDeclaredField("pid");
f.setAccessible(true);
processId = f.getInt(process);
} catch (final Throwable e) {
e.printStackTrace();
}
return processId;
} | [
"private",
"int",
"processId",
"(",
"final",
"java",
".",
"lang",
".",
"Process",
"process",
")",
"{",
"int",
"processId",
"=",
"0",
";",
"try",
"{",
"final",
"Field",
"f",
"=",
"process",
".",
"getClass",
"(",
")",
".",
"getDeclaredField",
"(",
"\"pid... | Attempt to get the process id for this process
@param process The process to get the id from
@return The id of the process | [
"Attempt",
"to",
"get",
"the",
"process",
"id",
"for",
"this",
"process"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobExecutor/utils/process/AzkabanProcess.java#L226-L238 |
130,622 | azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/webapp/servlet/Page.java | Page.render | public void render() {
try {
this.response.setHeader("Content-type", "text/html; charset=UTF-8");
this.response.setCharacterEncoding("UTF-8");
this.response.setContentType(this.mimeType);
this.engine.mergeTemplate(this.template, "UTF-8", this.context, this.response.getWriter());
} catch ... | java | public void render() {
try {
this.response.setHeader("Content-type", "text/html; charset=UTF-8");
this.response.setCharacterEncoding("UTF-8");
this.response.setContentType(this.mimeType);
this.engine.mergeTemplate(this.template, "UTF-8", this.context, this.response.getWriter());
} catch ... | [
"public",
"void",
"render",
"(",
")",
"{",
"try",
"{",
"this",
".",
"response",
".",
"setHeader",
"(",
"\"Content-type\"",
",",
"\"text/html; charset=UTF-8\"",
")",
";",
"this",
".",
"response",
".",
"setCharacterEncoding",
"(",
"\"UTF-8\"",
")",
";",
"this",
... | Renders the page in UTF-8 | [
"Renders",
"the",
"page",
"in",
"UTF",
"-",
"8"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/Page.java#L57-L66 |
130,623 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/project/NodeBeanLoader.java | NodeBeanLoader.validateDepNameUniqueness | private void validateDepNameUniqueness(final List<TriggerDependencyBean> dependencies) {
final Set<String> seen = new HashSet<>();
for (final TriggerDependencyBean dep : dependencies) {
// set.add() returns false when there exists duplicate
Preconditions.checkArgument(seen.add(dep.getName()), String... | java | private void validateDepNameUniqueness(final List<TriggerDependencyBean> dependencies) {
final Set<String> seen = new HashSet<>();
for (final TriggerDependencyBean dep : dependencies) {
// set.add() returns false when there exists duplicate
Preconditions.checkArgument(seen.add(dep.getName()), String... | [
"private",
"void",
"validateDepNameUniqueness",
"(",
"final",
"List",
"<",
"TriggerDependencyBean",
">",
"dependencies",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"seen",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"TriggerDependencyBe... | check uniqueness of dependency.name | [
"check",
"uniqueness",
"of",
"dependency",
".",
"name"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/NodeBeanLoader.java#L144-L151 |
130,624 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/project/NodeBeanLoader.java | NodeBeanLoader.validateNameAndTypeArePresent | private void validateNameAndTypeArePresent(final List<TriggerDependencyBean> dependencies) {
for (final TriggerDependencyBean dep : dependencies) {
Preconditions.checkNotNull(dep.getName(), "dependency name is required");
Preconditions.checkNotNull(dep.getType(), "dependency type is required for " + dep... | java | private void validateNameAndTypeArePresent(final List<TriggerDependencyBean> dependencies) {
for (final TriggerDependencyBean dep : dependencies) {
Preconditions.checkNotNull(dep.getName(), "dependency name is required");
Preconditions.checkNotNull(dep.getType(), "dependency type is required for " + dep... | [
"private",
"void",
"validateNameAndTypeArePresent",
"(",
"final",
"List",
"<",
"TriggerDependencyBean",
">",
"dependencies",
")",
"{",
"for",
"(",
"final",
"TriggerDependencyBean",
"dep",
":",
"dependencies",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"dep... | validate name and type are present | [
"validate",
"name",
"and",
"type",
"are",
"present"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/NodeBeanLoader.java#L173-L178 |
130,625 | azkaban/azkaban | az-crypto/src/main/java/azkaban/crypto/EncryptionCLI.java | EncryptionCLI.main | public static void main(final String[] args) throws ParseException {
final CommandLineParser parser = new DefaultParser();
if (parser.parse(createHelpOptions(), args, true).hasOption(HELP_KEY)) {
new HelpFormatter().printHelp(EncryptionCLI.class.getSimpleName(), createOptions(), true);
return;
... | java | public static void main(final String[] args) throws ParseException {
final CommandLineParser parser = new DefaultParser();
if (parser.parse(createHelpOptions(), args, true).hasOption(HELP_KEY)) {
new HelpFormatter().printHelp(EncryptionCLI.class.getSimpleName(), createOptions(), true);
return;
... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"ParseException",
"{",
"final",
"CommandLineParser",
"parser",
"=",
"new",
"DefaultParser",
"(",
")",
";",
"if",
"(",
"parser",
".",
"parse",
"(",
"createHelpOptions... | Outputs ciphered text to STDOUT.
usage: EncryptionCLI [-h] -k <pass phrase> -p <plainText> -v <crypto version>
-h,--help print this message
-k,--key <pass phrase> Passphrase used for encrypting plain text
-p,--plaintext <plainText> Plaintext that needs to be encrypted
-v,--version <... | [
"Outputs",
"ciphered",
"text",
"to",
"STDOUT",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-crypto/src/main/java/azkaban/crypto/EncryptionCLI.java#L41-L59 |
130,626 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/selector/CandidateFilter.java | CandidateFilter.registerFactorFilter | protected void registerFactorFilter(final FactorFilter<T, V> filter) {
if (null == filter) {
throw new IllegalArgumentException("unable to register factor filter. " +
"The passed comaractor is null or has an invalid weight value.");
}
// add or replace the filter.
this.factorFilterList.... | java | protected void registerFactorFilter(final FactorFilter<T, V> filter) {
if (null == filter) {
throw new IllegalArgumentException("unable to register factor filter. " +
"The passed comaractor is null or has an invalid weight value.");
}
// add or replace the filter.
this.factorFilterList.... | [
"protected",
"void",
"registerFactorFilter",
"(",
"final",
"FactorFilter",
"<",
"T",
",",
"V",
">",
"filter",
")",
"{",
"if",
"(",
"null",
"==",
"filter",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"unable to register factor filter. \"",
"+",
"... | function to register a factorFilter to the internal Map for future reference.
@param factorfilter : the Filter object to be registered. | [
"function",
"to",
"register",
"a",
"factorFilter",
"to",
"the",
"internal",
"Map",
"for",
"future",
"reference",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/selector/CandidateFilter.java#L50-L60 |
130,627 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/selector/CandidateFilter.java | CandidateFilter.filterTarget | public boolean filterTarget(final T filteringTarget, final V referencingObject) {
logger.debug(String.format("start filtering '%s' with factor filter for '%s'",
filteringTarget == null ? "(null)" : filteringTarget.toString(),
this.getName()));
final Collection<FactorFilter<T, V>> filterList = t... | java | public boolean filterTarget(final T filteringTarget, final V referencingObject) {
logger.debug(String.format("start filtering '%s' with factor filter for '%s'",
filteringTarget == null ? "(null)" : filteringTarget.toString(),
this.getName()));
final Collection<FactorFilter<T, V>> filterList = t... | [
"public",
"boolean",
"filterTarget",
"(",
"final",
"T",
"filteringTarget",
",",
"final",
"V",
"referencingObject",
")",
"{",
"logger",
".",
"debug",
"(",
"String",
".",
"format",
"(",
"\"start filtering '%s' with factor filter for '%s'\"",
",",
"filteringTarget",
"=="... | function to analyze the target item according to the reference object to decide whether the
item should be filtered.
@param filteringTarget: object to be checked.
@param referencingObject: object which contains statistics based on which a decision is made
whether the object being checked need to be filtered or not.
@r... | [
"function",
"to",
"analyze",
"the",
"target",
"item",
"according",
"to",
"the",
"reference",
"object",
"to",
"decide",
"whether",
"the",
"item",
"should",
"be",
"filtered",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/selector/CandidateFilter.java#L72-L89 |
130,628 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutorUtils.java | ExecutorUtils.getMaxConcurrentRunsForFlow | public static int getMaxConcurrentRunsForFlow(String projectName, String flowName,
int defaultMaxConcurrentRuns, Map<Pair<String, String>, Integer> maxConcurrentRunsFlowMap) {
return maxConcurrentRunsFlowMap.getOrDefault(new Pair(projectName, flowName),
defaultMaxConcurrentRuns);
} | java | public static int getMaxConcurrentRunsForFlow(String projectName, String flowName,
int defaultMaxConcurrentRuns, Map<Pair<String, String>, Integer> maxConcurrentRunsFlowMap) {
return maxConcurrentRunsFlowMap.getOrDefault(new Pair(projectName, flowName),
defaultMaxConcurrentRuns);
} | [
"public",
"static",
"int",
"getMaxConcurrentRunsForFlow",
"(",
"String",
"projectName",
",",
"String",
"flowName",
",",
"int",
"defaultMaxConcurrentRuns",
",",
"Map",
"<",
"Pair",
"<",
"String",
",",
"String",
">",
",",
"Integer",
">",
"maxConcurrentRunsFlowMap",
... | Get the maximum number of concurrent runs for the specified flow, using the value in
azkaban.concurrent.runs.oneflow.whitelist if explictly specified for the flow, and otherwise
azkaban.max.concurrent.runs.oneflow or the default.
@param projectName project name
@param flowName flow name
@param defaultMaxConcurrentRuns... | [
"Get",
"the",
"maximum",
"number",
"of",
"concurrent",
"runs",
"for",
"the",
"specified",
"flow",
"using",
"the",
"value",
"in",
"azkaban",
".",
"concurrent",
".",
"runs",
".",
"oneflow",
".",
"whitelist",
"if",
"explictly",
"specified",
"for",
"the",
"flow"... | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutorUtils.java#L75-L79 |
130,629 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/jobExecutor/ProcessJob.java | ProcessJob.partitionCommandLine | public static String[] partitionCommandLine(final String command) {
final ArrayList<String> commands = new ArrayList<>();
int index = 0;
StringBuffer buffer = new StringBuffer(command.length());
boolean isApos = false;
boolean isQuote = false;
while (index < command.length()) {
final ch... | java | public static String[] partitionCommandLine(final String command) {
final ArrayList<String> commands = new ArrayList<>();
int index = 0;
StringBuffer buffer = new StringBuffer(command.length());
boolean isApos = false;
boolean isQuote = false;
while (index < command.length()) {
final ch... | [
"public",
"static",
"String",
"[",
"]",
"partitionCommandLine",
"(",
"final",
"String",
"command",
")",
"{",
"final",
"ArrayList",
"<",
"String",
">",
"commands",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"index",
"=",
"0",
";",
"StringBuffer",
... | Splits the command into a unix like command line structure. Quotes and single quotes are
treated as nested strings. | [
"Splits",
"the",
"command",
"into",
"a",
"unix",
"like",
"command",
"line",
"structure",
".",
"Quotes",
"and",
"single",
"quotes",
"are",
"treated",
"as",
"nested",
"strings",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobExecutor/ProcessJob.java#L83-L134 |
130,630 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/flow/FlowUtils.java | FlowUtils.applyDisabledJobs | public static void applyDisabledJobs(final List<DisabledJob> disabledJobs,
final ExecutableFlowBase exflow) {
for (final DisabledJob disabled : disabledJobs) {
if (disabled.isEmbeddedFlow()) {
final ExecutableNode node = exflow.getExecutableNode(disabled.getName());
if (node != null && n... | java | public static void applyDisabledJobs(final List<DisabledJob> disabledJobs,
final ExecutableFlowBase exflow) {
for (final DisabledJob disabled : disabledJobs) {
if (disabled.isEmbeddedFlow()) {
final ExecutableNode node = exflow.getExecutableNode(disabled.getName());
if (node != null && n... | [
"public",
"static",
"void",
"applyDisabledJobs",
"(",
"final",
"List",
"<",
"DisabledJob",
">",
"disabledJobs",
",",
"final",
"ExecutableFlowBase",
"exflow",
")",
"{",
"for",
"(",
"final",
"DisabledJob",
"disabled",
":",
"disabledJobs",
")",
"{",
"if",
"(",
"d... | Change job status to disabled in exflow if the job is in disabledJobs | [
"Change",
"job",
"status",
"to",
"disabled",
"in",
"exflow",
"if",
"the",
"job",
"is",
"in",
"disabledJobs"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/flow/FlowUtils.java#L71-L86 |
130,631 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/server/MBeanRegistrationManager.java | MBeanRegistrationManager.closeMBeans | public void closeMBeans() {
try {
for (final ObjectName name : registeredMBeans) {
getMbeanServer().unregisterMBean(name);
logger.info("Jmx MBean " + name.getCanonicalName() + " unregistered.");
}
} catch (final Exception e) {
logger.error("Failed to cleanup MBeanServer", e);
... | java | public void closeMBeans() {
try {
for (final ObjectName name : registeredMBeans) {
getMbeanServer().unregisterMBean(name);
logger.info("Jmx MBean " + name.getCanonicalName() + " unregistered.");
}
} catch (final Exception e) {
logger.error("Failed to cleanup MBeanServer", e);
... | [
"public",
"void",
"closeMBeans",
"(",
")",
"{",
"try",
"{",
"for",
"(",
"final",
"ObjectName",
"name",
":",
"registeredMBeans",
")",
"{",
"getMbeanServer",
"(",
")",
".",
"unregisterMBean",
"(",
"name",
")",
";",
"logger",
".",
"info",
"(",
"\"Jmx MBean \"... | Close all registered MBeans | [
"Close",
"all",
"registered",
"MBeans"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/server/MBeanRegistrationManager.java#L67-L76 |
130,632 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/server/MBeanRegistrationManager.java | MBeanRegistrationManager.getMBeanAttribute | public Object getMBeanAttribute(final ObjectName name, final String attribute) {
try {
return getMbeanServer().getAttribute(name, attribute);
} catch (final Exception e) {
logger.error(
"Retrieve MBeanServer attribute Failure. "
+ "ObjectName = " + name.toString() + ", "
... | java | public Object getMBeanAttribute(final ObjectName name, final String attribute) {
try {
return getMbeanServer().getAttribute(name, attribute);
} catch (final Exception e) {
logger.error(
"Retrieve MBeanServer attribute Failure. "
+ "ObjectName = " + name.toString() + ", "
... | [
"public",
"Object",
"getMBeanAttribute",
"(",
"final",
"ObjectName",
"name",
",",
"final",
"String",
"attribute",
")",
"{",
"try",
"{",
"return",
"getMbeanServer",
"(",
")",
".",
"getAttribute",
"(",
"name",
",",
"attribute",
")",
";",
"}",
"catch",
"(",
"... | Get MBean Attribute
@param name mbean name
@param attribute attribute name
@return object of MBean Attribute | [
"Get",
"MBean",
"Attribute"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/server/MBeanRegistrationManager.java#L106-L117 |
130,633 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/server/MBeanRegistrationManager.java | MBeanRegistrationManager.getMBeanResult | public Map<String, Object> getMBeanResult(final String mbeanName) {
final Map<String, Object> ret = new HashMap<>();
try {
final ObjectName name = new ObjectName(mbeanName);
final MBeanInfo info = getMBeanInfo(name);
final MBeanAttributeInfo[] mbeanAttrs = info.getAttributes();
final Ma... | java | public Map<String, Object> getMBeanResult(final String mbeanName) {
final Map<String, Object> ret = new HashMap<>();
try {
final ObjectName name = new ObjectName(mbeanName);
final MBeanInfo info = getMBeanInfo(name);
final MBeanAttributeInfo[] mbeanAttrs = info.getAttributes();
final Ma... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getMBeanResult",
"(",
"final",
"String",
"mbeanName",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"ret",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"try",
"{",
"final",
"ObjectName"... | Get MBean Result
@param mbeanName mbeanName
@return Map of MBean | [
"Get",
"MBean",
"Result"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/server/MBeanRegistrationManager.java#L124-L145 |
130,634 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/trigger/builtin/SlaChecker.java | SlaChecker.eval | @Override
public Object eval() {
logger.info("Checking sla for execution " + this.execId);
final ExecutableFlow flow;
try {
flow = this.executorLoader.fetchExecutableFlow(this.execId);
} catch (final ExecutorManagerException e) {
logger.error("Can't get executable flow.", e);
e.print... | java | @Override
public Object eval() {
logger.info("Checking sla for execution " + this.execId);
final ExecutableFlow flow;
try {
flow = this.executorLoader.fetchExecutableFlow(this.execId);
} catch (final ExecutorManagerException e) {
logger.error("Can't get executable flow.", e);
e.print... | [
"@",
"Override",
"public",
"Object",
"eval",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"Checking sla for execution \"",
"+",
"this",
".",
"execId",
")",
";",
"final",
"ExecutableFlow",
"flow",
";",
"try",
"{",
"flow",
"=",
"this",
".",
"executorLoader",
... | return true to trigger sla action | [
"return",
"true",
"to",
"trigger",
"sla",
"action"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/trigger/builtin/SlaChecker.java#L146-L159 |
130,635 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java | StatsServlet.handleChangeManagerStatusRequest | private void handleChangeManagerStatusRequest(final HttpServletRequest req,
final Map<String, Object> ret, final boolean enableMetricManager) {
try {
logger.info("Updating metric manager status");
if ((enableMetricManager && MetricReportManager.isInstantiated())
|| MetricReportManager.is... | java | private void handleChangeManagerStatusRequest(final HttpServletRequest req,
final Map<String, Object> ret, final boolean enableMetricManager) {
try {
logger.info("Updating metric manager status");
if ((enableMetricManager && MetricReportManager.isInstantiated())
|| MetricReportManager.is... | [
"private",
"void",
"handleChangeManagerStatusRequest",
"(",
"final",
"HttpServletRequest",
"req",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"ret",
",",
"final",
"boolean",
"enableMetricManager",
")",
"{",
"try",
"{",
"logger",
".",
"info",
"(",
"... | enable or disable metric Manager A disable will also purge all data from all metric emitters | [
"enable",
"or",
"disable",
"metric",
"Manager",
"A",
"disable",
"will",
"also",
"purge",
"all",
"data",
"from",
"all",
"metric",
"emitters"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java#L116-L136 |
130,636 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java | StatsServlet.handleChangeCleaningInterval | private void handleChangeCleaningInterval(final HttpServletRequest req,
final Map<String, Object> ret) {
try {
final long newInterval = getLongParam(req, STATS_MAP_CLEANINGINTERVAL);
if (MetricReportManager.isAvailable()) {
final MetricReportManager metricManager = MetricReportManager.getI... | java | private void handleChangeCleaningInterval(final HttpServletRequest req,
final Map<String, Object> ret) {
try {
final long newInterval = getLongParam(req, STATS_MAP_CLEANINGINTERVAL);
if (MetricReportManager.isAvailable()) {
final MetricReportManager metricManager = MetricReportManager.getI... | [
"private",
"void",
"handleChangeCleaningInterval",
"(",
"final",
"HttpServletRequest",
"req",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"ret",
")",
"{",
"try",
"{",
"final",
"long",
"newInterval",
"=",
"getLongParam",
"(",
"req",
",",
"STATS_MAP_... | Update InMemoryMetricEmitter interval to maintain metric snapshots | [
"Update",
"InMemoryMetricEmitter",
"interval",
"to",
"maintain",
"metric",
"snapshots"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java#L163-L180 |
130,637 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java | StatsServlet.extractInMemoryMetricEmitter | private InMemoryMetricEmitter extractInMemoryMetricEmitter(
final MetricReportManager metricManager) {
InMemoryMetricEmitter memoryEmitter = null;
for (final IMetricEmitter emitter : metricManager.getMetricEmitters()) {
if (emitter instanceof InMemoryMetricEmitter) {
memoryEmitter = (InMemor... | java | private InMemoryMetricEmitter extractInMemoryMetricEmitter(
final MetricReportManager metricManager) {
InMemoryMetricEmitter memoryEmitter = null;
for (final IMetricEmitter emitter : metricManager.getMetricEmitters()) {
if (emitter instanceof InMemoryMetricEmitter) {
memoryEmitter = (InMemor... | [
"private",
"InMemoryMetricEmitter",
"extractInMemoryMetricEmitter",
"(",
"final",
"MetricReportManager",
"metricManager",
")",
"{",
"InMemoryMetricEmitter",
"memoryEmitter",
"=",
"null",
";",
"for",
"(",
"final",
"IMetricEmitter",
"emitter",
":",
"metricManager",
".",
"ge... | Get InMemoryMetricEmitter, if available else null | [
"Get",
"InMemoryMetricEmitter",
"if",
"available",
"else",
"null"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java#L222-L232 |
130,638 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java | StatsServlet.handleGetAllMMetricsName | private void handleGetAllMMetricsName(final HttpServletRequest req,
final Map<String, Object> ret) {
if (MetricReportManager.isAvailable()) {
final MetricReportManager metricManager = MetricReportManager.getInstance();
final List<IMetric<?>> result = metricManager.getAllMetrics();
if (result... | java | private void handleGetAllMMetricsName(final HttpServletRequest req,
final Map<String, Object> ret) {
if (MetricReportManager.isAvailable()) {
final MetricReportManager metricManager = MetricReportManager.getInstance();
final List<IMetric<?>> result = metricManager.getAllMetrics();
if (result... | [
"private",
"void",
"handleGetAllMMetricsName",
"(",
"final",
"HttpServletRequest",
"req",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"ret",
")",
"{",
"if",
"(",
"MetricReportManager",
".",
"isAvailable",
"(",
")",
")",
"{",
"final",
"MetricReportM... | Get all the metrics tracked by metric manager | [
"Get",
"all",
"the",
"metrics",
"tracked",
"by",
"metric",
"manager"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java#L237-L254 |
130,639 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java | StatsServlet.handleChangeMetricInterval | private void handleChangeMetricInterval(final HttpServletRequest req,
final Map<String, Object> ret) throws ServletException {
try {
final String metricName = getParam(req, STATS_MAP_METRICNAMEPARAM);
final long newInterval = getLongParam(req, STATS_MAP_REPORTINGINTERVAL);
if (MetricReportMa... | java | private void handleChangeMetricInterval(final HttpServletRequest req,
final Map<String, Object> ret) throws ServletException {
try {
final String metricName = getParam(req, STATS_MAP_METRICNAMEPARAM);
final long newInterval = getLongParam(req, STATS_MAP_REPORTINGINTERVAL);
if (MetricReportMa... | [
"private",
"void",
"handleChangeMetricInterval",
"(",
"final",
"HttpServletRequest",
"req",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"ret",
")",
"throws",
"ServletException",
"{",
"try",
"{",
"final",
"String",
"metricName",
"=",
"getParam",
"(",
... | Update tracking interval for a given metrics | [
"Update",
"tracking",
"interval",
"for",
"a",
"given",
"metrics"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java#L259-L278 |
130,640 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/server/AzkabanServer.java | AzkabanServer.loadConfigurationFromAzkabanHome | private static Props loadConfigurationFromAzkabanHome() {
final String azkabanHome = System.getenv("AZKABAN_HOME");
if (azkabanHome == null) {
logger.error("AZKABAN_HOME not set. Will try default.");
return null;
}
if (!new File(azkabanHome).isDirectory() || !new File(azkabanHome).canRead()... | java | private static Props loadConfigurationFromAzkabanHome() {
final String azkabanHome = System.getenv("AZKABAN_HOME");
if (azkabanHome == null) {
logger.error("AZKABAN_HOME not set. Will try default.");
return null;
}
if (!new File(azkabanHome).isDirectory() || !new File(azkabanHome).canRead()... | [
"private",
"static",
"Props",
"loadConfigurationFromAzkabanHome",
"(",
")",
"{",
"final",
"String",
"azkabanHome",
"=",
"System",
".",
"getenv",
"(",
"\"AZKABAN_HOME\"",
")",
";",
"if",
"(",
"azkabanHome",
"==",
"null",
")",
"{",
"logger",
".",
"error",
"(",
... | Loads the Azkaban property file from the AZKABAN_HOME conf directory
@return Props instance | [
"Loads",
"the",
"Azkaban",
"property",
"file",
"from",
"the",
"AZKABAN_HOME",
"conf",
"directory"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/server/AzkabanServer.java#L126-L145 |
130,641 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/project/validator/ValidatorClassLoader.java | ValidatorClassLoader.closeClassLoader | public boolean closeClassLoader(final ClassLoader cl) throws ValidatorManagerException {
boolean res = false;
if (cl == null) {
return res;
}
final Class classURLClassLoader = URLClassLoader.class;
Field f = null;
try {
f = classURLClassLoader.getDeclaredField("ucp");
} catch (fi... | java | public boolean closeClassLoader(final ClassLoader cl) throws ValidatorManagerException {
boolean res = false;
if (cl == null) {
return res;
}
final Class classURLClassLoader = URLClassLoader.class;
Field f = null;
try {
f = classURLClassLoader.getDeclaredField("ucp");
} catch (fi... | [
"public",
"boolean",
"closeClassLoader",
"(",
"final",
"ClassLoader",
"cl",
")",
"throws",
"ValidatorManagerException",
"{",
"boolean",
"res",
"=",
"false",
";",
"if",
"(",
"cl",
"==",
"null",
")",
"{",
"return",
"res",
";",
"}",
"final",
"Class",
"classURLC... | close jar files of cl | [
"close",
"jar",
"files",
"of",
"cl"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/validator/ValidatorClassLoader.java#L139-L206 |
130,642 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/project/validator/ValidatorClassLoader.java | ValidatorClassLoader.finalizeNativeLibs | public boolean finalizeNativeLibs(final ClassLoader cl) throws ValidatorManagerException {
boolean res = false;
final Class classClassLoader = ClassLoader.class;
java.lang.reflect.Field nativeLibraries = null;
try {
nativeLibraries = classClassLoader.getDeclaredField("nativeLibraries");
} catc... | java | public boolean finalizeNativeLibs(final ClassLoader cl) throws ValidatorManagerException {
boolean res = false;
final Class classClassLoader = ClassLoader.class;
java.lang.reflect.Field nativeLibraries = null;
try {
nativeLibraries = classClassLoader.getDeclaredField("nativeLibraries");
} catc... | [
"public",
"boolean",
"finalizeNativeLibs",
"(",
"final",
"ClassLoader",
"cl",
")",
"throws",
"ValidatorManagerException",
"{",
"boolean",
"res",
"=",
"false",
";",
"final",
"Class",
"classClassLoader",
"=",
"ClassLoader",
".",
"class",
";",
"java",
".",
"lang",
... | finalize native libraries | [
"finalize",
"native",
"libraries"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/validator/ValidatorClassLoader.java#L211-L254 |
130,643 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/utils/Emailer.java | Emailer.sendEmail | public void sendEmail(final List<String> emailList, final String subject, final String body) {
if (emailList != null && !emailList.isEmpty()) {
final EmailMessage message = super.createEmailMessage(subject, "text/html", emailList);
message.setBody(body);
sendEmail(message, true, "email message " +... | java | public void sendEmail(final List<String> emailList, final String subject, final String body) {
if (emailList != null && !emailList.isEmpty()) {
final EmailMessage message = super.createEmailMessage(subject, "text/html", emailList);
message.setBody(body);
sendEmail(message, true, "email message " +... | [
"public",
"void",
"sendEmail",
"(",
"final",
"List",
"<",
"String",
">",
"emailList",
",",
"final",
"String",
"subject",
",",
"final",
"String",
"body",
")",
"{",
"if",
"(",
"emailList",
"!=",
"null",
"&&",
"!",
"emailList",
".",
"isEmpty",
"(",
")",
"... | Send an email to the specified email list | [
"Send",
"an",
"email",
"to",
"the",
"specified",
"email",
"list"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/Emailer.java#L98-L104 |
130,644 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/utils/Emailer.java | Emailer.sendFailedUpdateEmail | private void sendFailedUpdateEmail(final Executor executor,
final ExecutorManagerException exception, final MailCreator mailCreator,
final ImmutableList<ExecutableFlow> flows) {
final EmailMessage message = this.messageCreator.createMessage();
final boolean mailCreated = mailCreator
.createF... | java | private void sendFailedUpdateEmail(final Executor executor,
final ExecutorManagerException exception, final MailCreator mailCreator,
final ImmutableList<ExecutableFlow> flows) {
final EmailMessage message = this.messageCreator.createMessage();
final boolean mailCreated = mailCreator
.createF... | [
"private",
"void",
"sendFailedUpdateEmail",
"(",
"final",
"Executor",
"executor",
",",
"final",
"ExecutorManagerException",
"exception",
",",
"final",
"MailCreator",
"mailCreator",
",",
"final",
"ImmutableList",
"<",
"ExecutableFlow",
">",
"flows",
")",
"{",
"final",
... | Sends a single email about failed updates. | [
"Sends",
"a",
"single",
"email",
"about",
"failed",
"updates",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/Emailer.java#L194-L203 |
130,645 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunnerManager.java | FlowRunnerManager.waitUntilFlowPreparationFinish | private void waitUntilFlowPreparationFinish() throws InterruptedException {
final Duration SLEEP_INTERVAL = Duration.ofSeconds(5);
while (this.preparingFlowCount.intValue() != 0) {
logger.info(this.preparingFlowCount + " flow(s) is/are still being setup before complete "
+ "deactivation.");
... | java | private void waitUntilFlowPreparationFinish() throws InterruptedException {
final Duration SLEEP_INTERVAL = Duration.ofSeconds(5);
while (this.preparingFlowCount.intValue() != 0) {
logger.info(this.preparingFlowCount + " flow(s) is/are still being setup before complete "
+ "deactivation.");
... | [
"private",
"void",
"waitUntilFlowPreparationFinish",
"(",
")",
"throws",
"InterruptedException",
"{",
"final",
"Duration",
"SLEEP_INTERVAL",
"=",
"Duration",
".",
"ofSeconds",
"(",
"5",
")",
";",
"while",
"(",
"this",
".",
"preparingFlowCount",
".",
"intValue",
"(... | Wait until ongoing flow preparation work finishes. | [
"Wait",
"until",
"ongoing",
"flow",
"preparation",
"work",
"finishes",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunnerManager.java#L311-L318 |
130,646 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunnerManager.java | FlowRunnerManager.configureFlowLevelMetrics | private void configureFlowLevelMetrics(final FlowRunner flowRunner) {
logger.info("Configuring Azkaban metrics tracking for flow runner object");
if (MetricReportManager.isAvailable()) {
final MetricReportManager metricManager = MetricReportManager.getInstance();
// Adding NumFailedFlow Metric list... | java | private void configureFlowLevelMetrics(final FlowRunner flowRunner) {
logger.info("Configuring Azkaban metrics tracking for flow runner object");
if (MetricReportManager.isAvailable()) {
final MetricReportManager metricManager = MetricReportManager.getInstance();
// Adding NumFailedFlow Metric list... | [
"private",
"void",
"configureFlowLevelMetrics",
"(",
"final",
"FlowRunner",
"flowRunner",
")",
"{",
"logger",
".",
"info",
"(",
"\"Configuring Azkaban metrics tracking for flow runner object\"",
")",
";",
"if",
"(",
"MetricReportManager",
".",
"isAvailable",
"(",
")",
"... | Configure Azkaban metrics tracking for a new flowRunner instance | [
"Configure",
"Azkaban",
"metrics",
"tracking",
"for",
"a",
"new",
"flowRunner",
"instance"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunnerManager.java#L479-L489 |
130,647 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunnerManager.java | FlowRunnerManager.shutdown | public void shutdown() {
logger.warn("Shutting down FlowRunnerManager...");
if (this.azkabanProps.getBoolean(ConfigurationKeys.AZKABAN_POLL_MODEL, false)) {
this.pollingService.shutdown();
}
this.executorService.shutdown();
boolean result = false;
while (!result) {
logger.info("Await... | java | public void shutdown() {
logger.warn("Shutting down FlowRunnerManager...");
if (this.azkabanProps.getBoolean(ConfigurationKeys.AZKABAN_POLL_MODEL, false)) {
this.pollingService.shutdown();
}
this.executorService.shutdown();
boolean result = false;
while (!result) {
logger.info("Await... | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"logger",
".",
"warn",
"(",
"\"Shutting down FlowRunnerManager...\"",
")",
";",
"if",
"(",
"this",
".",
"azkabanProps",
".",
"getBoolean",
"(",
"ConfigurationKeys",
".",
"AZKABAN_POLL_MODEL",
",",
"false",
")",
")",
... | This shuts down the flow runner. The call is blocking and awaits execution of all jobs. | [
"This",
"shuts",
"down",
"the",
"flow",
"runner",
".",
"The",
"call",
"is",
"blocking",
"and",
"awaits",
"execution",
"of",
"all",
"jobs",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunnerManager.java#L810-L826 |
130,648 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunnerManager.java | FlowRunnerManager.deleteExecutionDirectory | public void deleteExecutionDirectory() {
logger.warn("Deleting execution dir: " + this.executionDirectory.getAbsolutePath());
try {
FileUtils.deleteDirectory(this.executionDirectory);
} catch (final IOException e) {
logger.error(e);
}
} | java | public void deleteExecutionDirectory() {
logger.warn("Deleting execution dir: " + this.executionDirectory.getAbsolutePath());
try {
FileUtils.deleteDirectory(this.executionDirectory);
} catch (final IOException e) {
logger.error(e);
}
} | [
"public",
"void",
"deleteExecutionDirectory",
"(",
")",
"{",
"logger",
".",
"warn",
"(",
"\"Deleting execution dir: \"",
"+",
"this",
".",
"executionDirectory",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"try",
"{",
"FileUtils",
".",
"deleteDirectory",
"(",
"th... | Deleting old execution directory to free disk space. | [
"Deleting",
"old",
"execution",
"directory",
"to",
"free",
"disk",
"space",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunnerManager.java#L844-L851 |
130,649 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.loadPluginProps | public static Props loadPluginProps(final File pluginDir) {
if (!pluginDir.exists()) {
logger.error("Error! Plugin path " + pluginDir.getPath() + " doesn't exist.");
return null;
}
if (!pluginDir.isDirectory()) {
logger.error("The plugin path " + pluginDir + " is not a directory.");
... | java | public static Props loadPluginProps(final File pluginDir) {
if (!pluginDir.exists()) {
logger.error("Error! Plugin path " + pluginDir.getPath() + " doesn't exist.");
return null;
}
if (!pluginDir.isDirectory()) {
logger.error("The plugin path " + pluginDir + " is not a directory.");
... | [
"public",
"static",
"Props",
"loadPluginProps",
"(",
"final",
"File",
"pluginDir",
")",
"{",
"if",
"(",
"!",
"pluginDir",
".",
"exists",
"(",
")",
")",
"{",
"logger",
".",
"error",
"(",
"\"Error! Plugin path \"",
"+",
"pluginDir",
".",
"getPath",
"(",
")",... | Load plugin properties
@param pluginDir plugin's Base Directory
@return The properties | [
"Load",
"plugin",
"properties"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L120-L151 |
130,650 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.loadPropsBySuffix | public static void loadPropsBySuffix(final File jobPath, final Props props,
final String... suffixes) {
try {
if (jobPath.isDirectory()) {
final File[] files = jobPath.listFiles();
if (files != null) {
for (final File file : files) {
loadPropsBySuffix(file, props, s... | java | public static void loadPropsBySuffix(final File jobPath, final Props props,
final String... suffixes) {
try {
if (jobPath.isDirectory()) {
final File[] files = jobPath.listFiles();
if (files != null) {
for (final File file : files) {
loadPropsBySuffix(file, props, s... | [
"public",
"static",
"void",
"loadPropsBySuffix",
"(",
"final",
"File",
"jobPath",
",",
"final",
"Props",
"props",
",",
"final",
"String",
"...",
"suffixes",
")",
"{",
"try",
"{",
"if",
"(",
"jobPath",
".",
"isDirectory",
"(",
")",
")",
"{",
"final",
"Fil... | Load properties from the given path
@param jobPath The path to load from
@param props The parent properties for loaded properties
@param suffixes The suffixes of files to load | [
"Load",
"properties",
"from",
"the",
"given",
"path"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L175-L191 |
130,651 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.isVariableReplacementPattern | public static boolean isVariableReplacementPattern(final String value) {
final Matcher matcher = VARIABLE_REPLACEMENT_PATTERN.matcher(value);
return matcher.matches();
} | java | public static boolean isVariableReplacementPattern(final String value) {
final Matcher matcher = VARIABLE_REPLACEMENT_PATTERN.matcher(value);
return matcher.matches();
} | [
"public",
"static",
"boolean",
"isVariableReplacementPattern",
"(",
"final",
"String",
"value",
")",
"{",
"final",
"Matcher",
"matcher",
"=",
"VARIABLE_REPLACEMENT_PATTERN",
".",
"matcher",
"(",
"value",
")",
";",
"return",
"matcher",
".",
"matches",
"(",
")",
"... | Check if the prop value is a variable replacement pattern | [
"Check",
"if",
"the",
"prop",
"value",
"is",
"a",
"variable",
"replacement",
"pattern"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L205-L208 |
130,652 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.resolveVariableExpression | private static String resolveVariableExpression(final String value, final int last,
final JexlEngine jexl) {
final int lastIndex = value.lastIndexOf("$(", last);
if (lastIndex == -1) {
return value;
}
// Want to check that everything is well formed, and that
// we properly capture $( ..... | java | private static String resolveVariableExpression(final String value, final int last,
final JexlEngine jexl) {
final int lastIndex = value.lastIndexOf("$(", last);
if (lastIndex == -1) {
return value;
}
// Want to check that everything is well formed, and that
// we properly capture $( ..... | [
"private",
"static",
"String",
"resolveVariableExpression",
"(",
"final",
"String",
"value",
",",
"final",
"int",
"last",
",",
"final",
"JexlEngine",
"jexl",
")",
"{",
"final",
"int",
"lastIndex",
"=",
"value",
".",
"lastIndexOf",
"(",
"\"$(\"",
",",
"last",
... | Function that looks for expressions to parse. It parses backwards to capture embedded
expressions | [
"Function",
"that",
"looks",
"for",
"expressions",
"to",
"parse",
".",
"It",
"parses",
"backwards",
"to",
"capture",
"embedded",
"expressions"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L301-L347 |
130,653 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.toJSONString | public static String toJSONString(final Props props, final boolean localOnly) {
final Map<String, String> map = toStringMap(props, localOnly);
return JSONUtils.toJSON(map);
} | java | public static String toJSONString(final Props props, final boolean localOnly) {
final Map<String, String> map = toStringMap(props, localOnly);
return JSONUtils.toJSON(map);
} | [
"public",
"static",
"String",
"toJSONString",
"(",
"final",
"Props",
"props",
",",
"final",
"boolean",
"localOnly",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"toStringMap",
"(",
"props",
",",
"localOnly",
")",
";",
"return",
... | Convert props to json string
@param props props
@param localOnly include local prop sets only or not
@return json string format of props | [
"Convert",
"props",
"to",
"json",
"string"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L356-L359 |
130,654 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.toStringMap | public static Map<String, String> toStringMap(final Props props, final boolean localOnly) {
final HashMap<String, String> map = new HashMap<>();
final Set<String> keyset = localOnly ? props.localKeySet() : props.getKeySet();
for (final String key : keyset) {
final String value = props.get(key);
... | java | public static Map<String, String> toStringMap(final Props props, final boolean localOnly) {
final HashMap<String, String> map = new HashMap<>();
final Set<String> keyset = localOnly ? props.localKeySet() : props.getKeySet();
for (final String key : keyset) {
final String value = props.get(key);
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"toStringMap",
"(",
"final",
"Props",
"props",
",",
"final",
"boolean",
"localOnly",
")",
"{",
"final",
"HashMap",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
... | Convert props to Map
@param props props
@param localOnly include local prop sets only or not
@return String Map of props | [
"Convert",
"props",
"to",
"Map"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L368-L378 |
130,655 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.fromJSONString | public static Props fromJSONString(final String json) throws IOException {
final Map<String, String> obj = (Map<String, String>) JSONUtils.parseJSONFromString(json);
final Props props = new Props(null, obj);
return props;
} | java | public static Props fromJSONString(final String json) throws IOException {
final Map<String, String> obj = (Map<String, String>) JSONUtils.parseJSONFromString(json);
final Props props = new Props(null, obj);
return props;
} | [
"public",
"static",
"Props",
"fromJSONString",
"(",
"final",
"String",
"json",
")",
"throws",
"IOException",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"obj",
"=",
"(",
"Map",
"<",
"String",
",",
"String",
">",
")",
"JSONUtils",
".",
"parseJ... | Convert json String to Prop Object
@param json json formatted string
@return a new constructed Prop Object
@throws IOException exception on parsing json string to prop object | [
"Convert",
"json",
"String",
"to",
"Prop",
"Object"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L387-L391 |
130,656 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.fromHierarchicalMap | public static Props fromHierarchicalMap(final Map<String, Object> propsMap) {
if (propsMap == null) {
return null;
}
final String source = (String) propsMap.get("source");
final Map<String, String> propsParams =
(Map<String, String>) propsMap.get("props");
final Map<String, Object> p... | java | public static Props fromHierarchicalMap(final Map<String, Object> propsMap) {
if (propsMap == null) {
return null;
}
final String source = (String) propsMap.get("source");
final Map<String, String> propsParams =
(Map<String, String>) propsMap.get("props");
final Map<String, Object> p... | [
"public",
"static",
"Props",
"fromHierarchicalMap",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"propsMap",
")",
"{",
"if",
"(",
"propsMap",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"String",
"source",
"=",
"(",
"String",
... | Convert a hierarchical Map to Prop Object
@param propsMap a hierarchical Map
@return a new constructed Props Object | [
"Convert",
"a",
"hierarchical",
"Map",
"to",
"Prop",
"Object"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L399-L414 |
130,657 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.toHierarchicalMap | public static Map<String, Object> toHierarchicalMap(final Props props) {
final Map<String, Object> propsMap = new HashMap<>();
propsMap.put("source", props.getSource());
propsMap.put("props", toStringMap(props, true));
if (props.getParent() != null) {
propsMap.put("parent", toHierarchicalMap(prop... | java | public static Map<String, Object> toHierarchicalMap(final Props props) {
final Map<String, Object> propsMap = new HashMap<>();
propsMap.put("source", props.getSource());
propsMap.put("props", toStringMap(props, true));
if (props.getParent() != null) {
propsMap.put("parent", toHierarchicalMap(prop... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"toHierarchicalMap",
"(",
"final",
"Props",
"props",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"propsMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"propsMap",
".",
"pu... | Convert a Props object to a hierarchical Map
@param props props object
@return a hierarchical Map presented Props object | [
"Convert",
"a",
"Props",
"object",
"to",
"a",
"hierarchical",
"Map"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L422-L432 |
130,658 | azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.getPropertyDiff | public static String getPropertyDiff(Props oldProps, Props newProps) {
final StringBuilder builder = new StringBuilder("");
// oldProps can not be null during the below comparison process.
if (oldProps == null) {
oldProps = new Props();
}
if (newProps == null) {
newProps = new Props()... | java | public static String getPropertyDiff(Props oldProps, Props newProps) {
final StringBuilder builder = new StringBuilder("");
// oldProps can not be null during the below comparison process.
if (oldProps == null) {
oldProps = new Props();
}
if (newProps == null) {
newProps = new Props()... | [
"public",
"static",
"String",
"getPropertyDiff",
"(",
"Props",
"oldProps",
",",
"Props",
"newProps",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"\"\"",
")",
";",
"// oldProps can not be null during the below comparison process.",
"i... | The difference between old and new Props
@param oldProps old Props
@param newProps new Props
@return string formatted difference | [
"The",
"difference",
"between",
"old",
"and",
"new",
"Props"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L441-L483 |
130,659 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/selector/ExecutorComparator.java | ExecutorComparator.getNumberOfAssignedFlowComparator | private static FactorComparator<Executor> getNumberOfAssignedFlowComparator(final int weight) {
return FactorComparator
.create(NUMOFASSIGNEDFLOW_COMPARATOR_NAME, weight, new Comparator<Executor>() {
@Override
public int compare(final Executor o1, final Executor o2) {
final ... | java | private static FactorComparator<Executor> getNumberOfAssignedFlowComparator(final int weight) {
return FactorComparator
.create(NUMOFASSIGNEDFLOW_COMPARATOR_NAME, weight, new Comparator<Executor>() {
@Override
public int compare(final Executor o1, final Executor o2) {
final ... | [
"private",
"static",
"FactorComparator",
"<",
"Executor",
">",
"getNumberOfAssignedFlowComparator",
"(",
"final",
"int",
"weight",
")",
"{",
"return",
"FactorComparator",
".",
"create",
"(",
"NUMOFASSIGNEDFLOW_COMPARATOR_NAME",
",",
"weight",
",",
"new",
"Comparator",
... | function defines the number of assigned flow comparator.
@param weight weight of the comparator. | [
"function",
"defines",
"the",
"number",
"of",
"assigned",
"flow",
"comparator",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/selector/ExecutorComparator.java#L149-L166 |
130,660 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/selector/ExecutorComparator.java | ExecutorComparator.getCpuUsageComparator | private static FactorComparator<Executor> getCpuUsageComparator(final int weight) {
return FactorComparator.create(CPUUSAGE_COMPARATOR_NAME, weight, new Comparator<Executor>() {
@Override
public int compare(final Executor o1, final Executor o2) {
final ExecutorInfo stat1 = o1.getExecutorInfo();... | java | private static FactorComparator<Executor> getCpuUsageComparator(final int weight) {
return FactorComparator.create(CPUUSAGE_COMPARATOR_NAME, weight, new Comparator<Executor>() {
@Override
public int compare(final Executor o1, final Executor o2) {
final ExecutorInfo stat1 = o1.getExecutorInfo();... | [
"private",
"static",
"FactorComparator",
"<",
"Executor",
">",
"getCpuUsageComparator",
"(",
"final",
"int",
"weight",
")",
"{",
"return",
"FactorComparator",
".",
"create",
"(",
"CPUUSAGE_COMPARATOR_NAME",
",",
"weight",
",",
"new",
"Comparator",
"<",
"Executor",
... | function defines the cpuUsage comparator.
@param weight weight of the comparator. | [
"function",
"defines",
"the",
"cpuUsage",
"comparator",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/selector/ExecutorComparator.java#L173-L190 |
130,661 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/selector/ExecutorComparator.java | ExecutorComparator.getLstDispatchedTimeComparator | private static FactorComparator<Executor> getLstDispatchedTimeComparator(final int weight) {
return FactorComparator
.create(LSTDISPATCHED_COMPARATOR_NAME, weight, new Comparator<Executor>() {
@Override
public int compare(final Executor o1, final Executor o2) {
final Executo... | java | private static FactorComparator<Executor> getLstDispatchedTimeComparator(final int weight) {
return FactorComparator
.create(LSTDISPATCHED_COMPARATOR_NAME, weight, new Comparator<Executor>() {
@Override
public int compare(final Executor o1, final Executor o2) {
final Executo... | [
"private",
"static",
"FactorComparator",
"<",
"Executor",
">",
"getLstDispatchedTimeComparator",
"(",
"final",
"int",
"weight",
")",
"{",
"return",
"FactorComparator",
".",
"create",
"(",
"LSTDISPATCHED_COMPARATOR_NAME",
",",
"weight",
",",
"new",
"Comparator",
"<",
... | function defines the last dispatched time comparator.
@param weight weight of the comparator. | [
"function",
"defines",
"the",
"last",
"dispatched",
"time",
"comparator",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/selector/ExecutorComparator.java#L197-L214 |
130,662 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutorApiClient.java | ExecutorApiClient.parseResponse | @Override
protected String parseResponse(final HttpResponse response)
throws HttpResponseException, IOException {
final StatusLine statusLine = response.getStatusLine();
final String responseBody = response.getEntity() != null ?
EntityUtils.toString(response.getEntity()) : "";
if (statusLin... | java | @Override
protected String parseResponse(final HttpResponse response)
throws HttpResponseException, IOException {
final StatusLine statusLine = response.getStatusLine();
final String responseBody = response.getEntity() != null ?
EntityUtils.toString(response.getEntity()) : "";
if (statusLin... | [
"@",
"Override",
"protected",
"String",
"parseResponse",
"(",
"final",
"HttpResponse",
"response",
")",
"throws",
"HttpResponseException",
",",
"IOException",
"{",
"final",
"StatusLine",
"statusLine",
"=",
"response",
".",
"getStatusLine",
"(",
")",
";",
"final",
... | Implementing the parseResponse function to return de-serialized Json object.
@param response the returned response from the HttpClient.
@return de-serialized object from Json or null if the response doesn't have a body. | [
"Implementing",
"the",
"parseResponse",
"function",
"to",
"return",
"de",
"-",
"serialized",
"Json",
"object",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutorApiClient.java#L40-L56 |
130,663 | azkaban/azkaban | azkaban-hadoop-security-plugin/src/main/java/azkaban/security/HadoopSecurityManager_H_2_0.java | HadoopSecurityManager_H_2_0.prepareTokenFile | private void prepareTokenFile(final String user,
final Credentials credentials,
final File tokenFile,
final Logger logger) throws IOException {
writeCredentialsToFile(credentials, tokenFile, logger);
try {
assignPermissions(user, tokenFile, logger);
} catch (final IOException e) {
... | java | private void prepareTokenFile(final String user,
final Credentials credentials,
final File tokenFile,
final Logger logger) throws IOException {
writeCredentialsToFile(credentials, tokenFile, logger);
try {
assignPermissions(user, tokenFile, logger);
} catch (final IOException e) {
... | [
"private",
"void",
"prepareTokenFile",
"(",
"final",
"String",
"user",
",",
"final",
"Credentials",
"credentials",
",",
"final",
"File",
"tokenFile",
",",
"final",
"Logger",
"logger",
")",
"throws",
"IOException",
"{",
"writeCredentialsToFile",
"(",
"credentials",
... | Prepare token file. Writes credentials to a token file and sets appropriate permissions to keep
the file secure
@param user user to be proxied
@param credentials Credentials to be written to file
@param tokenFile file to be written
@param logger logger to use
@throws IOException If there are issues in reading / updati... | [
"Prepare",
"token",
"file",
".",
"Writes",
"credentials",
"to",
"a",
"token",
"file",
"and",
"sets",
"appropriate",
"permissions",
"to",
"keep",
"the",
"file",
"secure"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-hadoop-security-plugin/src/main/java/azkaban/security/HadoopSecurityManager_H_2_0.java#L693-L705 |
130,664 | azkaban/azkaban | azkaban-hadoop-security-plugin/src/main/java/azkaban/security/HadoopSecurityManager_H_2_0.java | HadoopSecurityManager_H_2_0.assignPermissions | private void assignPermissions(final String user, final File tokenFile, final Logger logger)
throws IOException {
final List<String> changePermissionsCommand = Arrays.asList(
CHMOD, TOKEN_FILE_PERMISSIONS, tokenFile.getAbsolutePath()
);
int result = this.executeAsUser
.execute(System.g... | java | private void assignPermissions(final String user, final File tokenFile, final Logger logger)
throws IOException {
final List<String> changePermissionsCommand = Arrays.asList(
CHMOD, TOKEN_FILE_PERMISSIONS, tokenFile.getAbsolutePath()
);
int result = this.executeAsUser
.execute(System.g... | [
"private",
"void",
"assignPermissions",
"(",
"final",
"String",
"user",
",",
"final",
"File",
"tokenFile",
",",
"final",
"Logger",
"logger",
")",
"throws",
"IOException",
"{",
"final",
"List",
"<",
"String",
">",
"changePermissionsCommand",
"=",
"Arrays",
".",
... | Uses execute-as-user binary to reassign file permissions to be readable only by that user.
Step 1. Set file permissions to 460. Readable to self and readable / writable azkaban group
Step 2. Set user as owner of file.
@param user user to be proxied
@param tokenFile file to be written
@param logger logger to use | [
"Uses",
"execute",
"-",
"as",
"-",
"user",
"binary",
"to",
"reassign",
"file",
"permissions",
"to",
"be",
"readable",
"only",
"by",
"that",
"user",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-hadoop-security-plugin/src/main/java/azkaban/security/HadoopSecurityManager_H_2_0.java#L741-L759 |
130,665 | azkaban/azkaban | azkaban-hadoop-security-plugin/src/main/java/azkaban/security/HadoopSecurityManager_H_2_0.java | HadoopSecurityManager_H_2_0.createRetryingMetaStoreClient | private IMetaStoreClient createRetryingMetaStoreClient(final HiveConf hiveConf)
throws MetaException {
// Custom hook-loader to return a HiveMetaHook if the table is configured with a custom storage handler
final HiveMetaHookLoader hookLoader = new HiveMetaHookLoader() {
@Override
public HiveM... | java | private IMetaStoreClient createRetryingMetaStoreClient(final HiveConf hiveConf)
throws MetaException {
// Custom hook-loader to return a HiveMetaHook if the table is configured with a custom storage handler
final HiveMetaHookLoader hookLoader = new HiveMetaHookLoader() {
@Override
public HiveM... | [
"private",
"IMetaStoreClient",
"createRetryingMetaStoreClient",
"(",
"final",
"HiveConf",
"hiveConf",
")",
"throws",
"MetaException",
"{",
"// Custom hook-loader to return a HiveMetaHook if the table is configured with a custom storage handler",
"final",
"HiveMetaHookLoader",
"hookLoader... | Method to create a metastore client that retries on failures | [
"Method",
"to",
"create",
"a",
"metastore",
"client",
"that",
"retries",
"on",
"failures"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-hadoop-security-plugin/src/main/java/azkaban/security/HadoopSecurityManager_H_2_0.java#L803-L826 |
130,666 | azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/hiveutils/HiveModule.java | HiveModule.provideHiveDriver | Driver provideHiveDriver() {
HiveConf hiveConf = provideHiveConf();
SessionState.start(hiveConf);
return new Driver(hiveConf);
} | java | Driver provideHiveDriver() {
HiveConf hiveConf = provideHiveConf();
SessionState.start(hiveConf);
return new Driver(hiveConf);
} | [
"Driver",
"provideHiveDriver",
"(",
")",
"{",
"HiveConf",
"hiveConf",
"=",
"provideHiveConf",
"(",
")",
";",
"SessionState",
".",
"start",
"(",
"hiveConf",
")",
";",
"return",
"new",
"Driver",
"(",
"hiveConf",
")",
";",
"}"
] | Return a Driver that's connected to the real, honest-to-goodness Hive
@TODO: Better error checking
@return Driver that's connected to Hive | [
"Return",
"a",
"Driver",
"that",
"s",
"connected",
"to",
"the",
"real",
"honest",
"-",
"to",
"-",
"goodness",
"Hive"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/hiveutils/HiveModule.java#L34-L39 |
130,667 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/ExecutorServlet.java | ExecutorServlet.shutdown | private void shutdown(final Map<String, Object> respMap) {
try {
logger.warn("Shutting down executor...");
// Set the executor to inactive. Will receive no new flows.
setActiveInternal(false);
this.application.shutdown();
respMap.put(ConnectorParams.STATUS_PARAM, ConnectorParams.RESPO... | java | private void shutdown(final Map<String, Object> respMap) {
try {
logger.warn("Shutting down executor...");
// Set the executor to inactive. Will receive no new flows.
setActiveInternal(false);
this.application.shutdown();
respMap.put(ConnectorParams.STATUS_PARAM, ConnectorParams.RESPO... | [
"private",
"void",
"shutdown",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"respMap",
")",
"{",
"try",
"{",
"logger",
".",
"warn",
"(",
"\"Shutting down executor...\"",
")",
";",
"// Set the executor to inactive. Will receive no new flows.",
"setActiveInte... | Prepare the executor for shutdown.
@param respMap json response object | [
"Prepare",
"the",
"executor",
"for",
"shutdown",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/ExecutorServlet.java#L384-L396 |
130,668 | azkaban/azkaban | azkaban-db/src/main/java/azkaban/db/DatabaseTransOperator.java | DatabaseTransOperator.getLastInsertId | public long getLastInsertId() throws SQLException {
// A default connection: autocommit = true.
long num = -1;
try {
num = ((Number) this.queryRunner
.query(this.conn, "SELECT LAST_INSERT_ID();", new ScalarHandler<>(1)))
.longValue();
} catch (final SQLException ex) {
log... | java | public long getLastInsertId() throws SQLException {
// A default connection: autocommit = true.
long num = -1;
try {
num = ((Number) this.queryRunner
.query(this.conn, "SELECT LAST_INSERT_ID();", new ScalarHandler<>(1)))
.longValue();
} catch (final SQLException ex) {
log... | [
"public",
"long",
"getLastInsertId",
"(",
")",
"throws",
"SQLException",
"{",
"// A default connection: autocommit = true.",
"long",
"num",
"=",
"-",
"1",
";",
"try",
"{",
"num",
"=",
"(",
"(",
"Number",
")",
"this",
".",
"queryRunner",
".",
"query",
"(",
"t... | returns the last id from a previous insert statement. Note that last insert and this operation
should use the same connection.
@return the last inserted id in mysql per connection. | [
"returns",
"the",
"last",
"id",
"from",
"a",
"previous",
"insert",
"statement",
".",
"Note",
"that",
"last",
"insert",
"and",
"this",
"operation",
"should",
"use",
"the",
"same",
"connection",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-db/src/main/java/azkaban/db/DatabaseTransOperator.java#L56-L68 |
130,669 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/jobExecutor/AbstractProcessJob.java | AbstractProcessJob.logJobProperties | protected void logJobProperties() {
if (this.jobProps != null &&
this.jobProps.getBoolean(JOB_DUMP_PROPERTIES_IN_LOG, false)) {
try {
final Map<String, String> flattenedProps = this.jobProps.getFlattened();
this.info("****** Job properties ******");
this.info(String.format(... | java | protected void logJobProperties() {
if (this.jobProps != null &&
this.jobProps.getBoolean(JOB_DUMP_PROPERTIES_IN_LOG, false)) {
try {
final Map<String, String> flattenedProps = this.jobProps.getFlattened();
this.info("****** Job properties ******");
this.info(String.format(... | [
"protected",
"void",
"logJobProperties",
"(",
")",
"{",
"if",
"(",
"this",
".",
"jobProps",
"!=",
"null",
"&&",
"this",
".",
"jobProps",
".",
"getBoolean",
"(",
"JOB_DUMP_PROPERTIES_IN_LOG",
",",
"false",
")",
")",
"{",
"try",
"{",
"final",
"Map",
"<",
"... | prints the current Job props to the Job log. | [
"prints",
"the",
"current",
"Job",
"props",
"to",
"the",
"Job",
"log",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobExecutor/AbstractProcessJob.java#L107-L127 |
130,670 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/jobExecutor/AbstractProcessJob.java | AbstractProcessJob.initPropsFiles | public File[] initPropsFiles() {
// Create properties file with additionally all input generated properties.
final File[] files = new File[2];
files[0] = createFlattenedPropsFile(this.cwd);
this.jobProps.put(ENV_PREFIX + JOB_PROP_ENV, files[0].getAbsolutePath());
this.jobProps.put(ENV_PREFIX + JOB_... | java | public File[] initPropsFiles() {
// Create properties file with additionally all input generated properties.
final File[] files = new File[2];
files[0] = createFlattenedPropsFile(this.cwd);
this.jobProps.put(ENV_PREFIX + JOB_PROP_ENV, files[0].getAbsolutePath());
this.jobProps.put(ENV_PREFIX + JOB_... | [
"public",
"File",
"[",
"]",
"initPropsFiles",
"(",
")",
"{",
"// Create properties file with additionally all input generated properties.",
"final",
"File",
"[",
"]",
"files",
"=",
"new",
"File",
"[",
"2",
"]",
";",
"files",
"[",
"0",
"]",
"=",
"createFlattenedPro... | initialize temporary and final property file
@return {tmpPropFile, outputPropFile} | [
"initialize",
"temporary",
"and",
"final",
"property",
"file"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobExecutor/AbstractProcessJob.java#L139-L150 |
130,671 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/jobExecutor/AbstractProcessJob.java | AbstractProcessJob.getEnvironmentVariables | public Map<String, String> getEnvironmentVariables() {
final Props props = getJobProps();
final Map<String, String> envMap = props.getMapByPrefix(ENV_PREFIX);
return envMap;
} | java | public Map<String, String> getEnvironmentVariables() {
final Props props = getJobProps();
final Map<String, String> envMap = props.getMapByPrefix(ENV_PREFIX);
return envMap;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getEnvironmentVariables",
"(",
")",
"{",
"final",
"Props",
"props",
"=",
"getJobProps",
"(",
")",
";",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"envMap",
"=",
"props",
".",
"getMapByPrefix",
... | Get Environment Variables from the Job Properties Table
@return All Job Properties with "env." prefix | [
"Get",
"Environment",
"Variables",
"from",
"the",
"Job",
"Properties",
"Table"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobExecutor/AbstractProcessJob.java#L161-L165 |
130,672 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/jobExecutor/AbstractProcessJob.java | AbstractProcessJob.getWorkingDirectory | public String getWorkingDirectory() {
final String workingDir = getJobProps().getString(WORKING_DIR, this.jobPath);
return Utils.ifNull(workingDir, "");
} | java | public String getWorkingDirectory() {
final String workingDir = getJobProps().getString(WORKING_DIR, this.jobPath);
return Utils.ifNull(workingDir, "");
} | [
"public",
"String",
"getWorkingDirectory",
"(",
")",
"{",
"final",
"String",
"workingDir",
"=",
"getJobProps",
"(",
")",
".",
"getString",
"(",
"WORKING_DIR",
",",
"this",
".",
"jobPath",
")",
";",
"return",
"Utils",
".",
"ifNull",
"(",
"workingDir",
",",
... | Get Working Directory from Job Properties when it is presented. Otherwise, the working
directory is the jobPath
@return working directory property | [
"Get",
"Working",
"Directory",
"from",
"Job",
"Properties",
"when",
"it",
"is",
"presented",
".",
"Otherwise",
"the",
"working",
"directory",
"is",
"the",
"jobPath"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/jobExecutor/AbstractProcessJob.java#L173-L176 |
130,673 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutorApiGateway.java | ExecutorApiGateway.callForJsonType | <T> T callForJsonType(final String host, final int port, final String path,
final List<Pair<String, String>> paramList, final Class<T> valueType) throws IOException {
final String responseString = callForJsonString(host, port, path, paramList);
if (null == responseString || responseString.length() == 0) {... | java | <T> T callForJsonType(final String host, final int port, final String path,
final List<Pair<String, String>> paramList, final Class<T> valueType) throws IOException {
final String responseString = callForJsonString(host, port, path, paramList);
if (null == responseString || responseString.length() == 0) {... | [
"<",
"T",
">",
"T",
"callForJsonType",
"(",
"final",
"String",
"host",
",",
"final",
"int",
"port",
",",
"final",
"String",
"path",
",",
"final",
"List",
"<",
"Pair",
"<",
"String",
",",
"String",
">",
">",
"paramList",
",",
"final",
"Class",
"<",
"T... | Call executor and parse the JSON response as an instance of the class given as an argument. | [
"Call",
"executor",
"and",
"parse",
"the",
"JSON",
"response",
"as",
"an",
"instance",
"of",
"the",
"class",
"given",
"as",
"an",
"argument",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutorApiGateway.java#L87-L94 |
130,674 | azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/webapp/servlet/PageUtils.java | PageUtils.hideUploadButtonWhenNeeded | public static void hideUploadButtonWhenNeeded(final Page page, final Session session,
final UserManager userManager,
final Boolean lockdownUploadProjects) {
final User user = session.getUser();
if (lockdownUploadProjects && !UserUtils.hasPermissionforAction(userManager, user,
Permission.Typ... | java | public static void hideUploadButtonWhenNeeded(final Page page, final Session session,
final UserManager userManager,
final Boolean lockdownUploadProjects) {
final User user = session.getUser();
if (lockdownUploadProjects && !UserUtils.hasPermissionforAction(userManager, user,
Permission.Typ... | [
"public",
"static",
"void",
"hideUploadButtonWhenNeeded",
"(",
"final",
"Page",
"page",
",",
"final",
"Session",
"session",
",",
"final",
"UserManager",
"userManager",
",",
"final",
"Boolean",
"lockdownUploadProjects",
")",
"{",
"final",
"User",
"user",
"=",
"sess... | Method hides the upload button for regular users from relevant pages when the property
"lockdown.upload.projects" is set. The button is displayed for admin users and users with
upload permissions. | [
"Method",
"hides",
"the",
"upload",
"button",
"for",
"regular",
"users",
"from",
"relevant",
"pages",
"when",
"the",
"property",
"lockdown",
".",
"upload",
".",
"projects",
"is",
"set",
".",
"The",
"button",
"is",
"displayed",
"for",
"admin",
"users",
"and",... | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/PageUtils.java#L21-L30 |
130,675 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/sla/SlaOption.java | SlaOption.createSlaMessage | public String createSlaMessage(final ExecutableFlow flow) {
final int execId = flow.getExecutionId();
final String durationStr = durationToString(this.duration);
switch (this.type.getComponent()) {
case FLOW:
final String basicinfo =
"SLA Alert: Your flow " + this.flowName + " fail... | java | public String createSlaMessage(final ExecutableFlow flow) {
final int execId = flow.getExecutionId();
final String durationStr = durationToString(this.duration);
switch (this.type.getComponent()) {
case FLOW:
final String basicinfo =
"SLA Alert: Your flow " + this.flowName + " fail... | [
"public",
"String",
"createSlaMessage",
"(",
"final",
"ExecutableFlow",
"flow",
")",
"{",
"final",
"int",
"execId",
"=",
"flow",
".",
"getExecutionId",
"(",
")",
";",
"final",
"String",
"durationStr",
"=",
"durationToString",
"(",
"this",
".",
"duration",
")",... | Construct the message for the SLA.
@param flow the executable flow.
@return the SLA message. | [
"Construct",
"the",
"message",
"for",
"the",
"SLA",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/sla/SlaOption.java#L300-L320 |
130,676 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/storage/StorageCleaner.java | StorageCleaner.cleanupProjectArtifacts | public void cleanupProjectArtifacts(final int projectId) {
if (!isCleanupPermitted()) {
return;
}
final Set<String> allResourceIds = findResourceIdsToDelete(projectId);
if (allResourceIds.size() == 0) {
return;
}
log.warn(String.format("Deleting project artifacts [id: %d]: %s", proj... | java | public void cleanupProjectArtifacts(final int projectId) {
if (!isCleanupPermitted()) {
return;
}
final Set<String> allResourceIds = findResourceIdsToDelete(projectId);
if (allResourceIds.size() == 0) {
return;
}
log.warn(String.format("Deleting project artifacts [id: %d]: %s", proj... | [
"public",
"void",
"cleanupProjectArtifacts",
"(",
"final",
"int",
"projectId",
")",
"{",
"if",
"(",
"!",
"isCleanupPermitted",
"(",
")",
")",
"{",
"return",
";",
"}",
"final",
"Set",
"<",
"String",
">",
"allResourceIds",
"=",
"findResourceIdsToDelete",
"(",
... | Remove all but last N artifacts as configured by AZKABAN_STORAGE_ARTIFACT_MAX_RETENTION
Since multiple versions can share the same filename, the algo is to collect all filenames and
from them, remove the latest ones. The remaining ones are deleted by the respective storage.
From the storage perspective, cleanup just ... | [
"Remove",
"all",
"but",
"last",
"N",
"artifacts",
"as",
"configured",
"by",
"AZKABAN_STORAGE_ARTIFACT_MAX_RETENTION"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/storage/StorageCleaner.java#L96-L107 |
130,677 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/storage/StorageCleaner.java | StorageCleaner.delete | private boolean delete(final String resourceId) {
final boolean isDeleted = this.storage.delete(resourceId) && removeDbEntry(resourceId);
if (!isDeleted) {
log.info("Failed to delete resourceId: " + resourceId);
}
return isDeleted;
} | java | private boolean delete(final String resourceId) {
final boolean isDeleted = this.storage.delete(resourceId) && removeDbEntry(resourceId);
if (!isDeleted) {
log.info("Failed to delete resourceId: " + resourceId);
}
return isDeleted;
} | [
"private",
"boolean",
"delete",
"(",
"final",
"String",
"resourceId",
")",
"{",
"final",
"boolean",
"isDeleted",
"=",
"this",
".",
"storage",
".",
"delete",
"(",
"resourceId",
")",
"&&",
"removeDbEntry",
"(",
"resourceId",
")",
";",
"if",
"(",
"!",
"isDele... | Main Delete Utility.
Delete the storage first. Then remove metadata from DB. Warning! This order cannot be reversed
since if the metadata is lost, there is no reference of the storage blob.
@param resourceId the storage key to be deleted.
@return true if deletion was successful. false otherwise | [
"Main",
"Delete",
"Utility",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/storage/StorageCleaner.java#L131-L137 |
130,678 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/selector/CandidateComparator.java | CandidateComparator.tieBreak | protected boolean tieBreak(final T object1, final T object2) {
if (null == object2) {
return true;
}
if (null == object1) {
return false;
}
return object1.hashCode() >= object2.hashCode();
} | java | protected boolean tieBreak(final T object1, final T object2) {
if (null == object2) {
return true;
}
if (null == object1) {
return false;
}
return object1.hashCode() >= object2.hashCode();
} | [
"protected",
"boolean",
"tieBreak",
"(",
"final",
"T",
"object1",
",",
"final",
"T",
"object2",
")",
"{",
"if",
"(",
"null",
"==",
"object2",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"null",
"==",
"object1",
")",
"{",
"return",
"false",
";",
... | tieBreak method which will kick in when the comparator list generated an equality result for
both sides. the tieBreak method will try best to make sure a stable result is returned. | [
"tieBreak",
"method",
"which",
"will",
"kick",
"in",
"when",
"the",
"comparator",
"list",
"generated",
"an",
"equality",
"result",
"for",
"both",
"sides",
".",
"the",
"tieBreak",
"method",
"will",
"try",
"best",
"to",
"make",
"sure",
"a",
"stable",
"result",... | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/selector/CandidateComparator.java#L54-L62 |
130,679 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/selector/CandidateComparator.java | CandidateComparator.registerFactorComparator | protected void registerFactorComparator(final FactorComparator<T> comparator) {
if (null == comparator ||
Integer.MAX_VALUE - this.getTotalWeight() < comparator.getWeight()) {
throw new IllegalArgumentException("unable to register comparator." +
" The passed comparator is null or has an inva... | java | protected void registerFactorComparator(final FactorComparator<T> comparator) {
if (null == comparator ||
Integer.MAX_VALUE - this.getTotalWeight() < comparator.getWeight()) {
throw new IllegalArgumentException("unable to register comparator." +
" The passed comparator is null or has an inva... | [
"protected",
"void",
"registerFactorComparator",
"(",
"final",
"FactorComparator",
"<",
"T",
">",
"comparator",
")",
"{",
"if",
"(",
"null",
"==",
"comparator",
"||",
"Integer",
".",
"MAX_VALUE",
"-",
"this",
".",
"getTotalWeight",
"(",
")",
"<",
"comparator",... | function to register a factorComparator to the internal Map for future reference.
@param factorComparator : the comparator object to be registered. | [
"function",
"to",
"register",
"a",
"factorComparator",
"to",
"the",
"internal",
"Map",
"for",
"future",
"reference",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/selector/CandidateComparator.java#L69-L80 |
130,680 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/selector/CandidateComparator.java | CandidateComparator.getTotalWeight | public int getTotalWeight() {
int totalWeight = 0;
// save out a copy of the values as HashMap.values() takes o(n) to return the value.
final Collection<FactorComparator<T>> allValues = this.factorComparatorList.values();
for (final FactorComparator<T> item : allValues) {
if (item != null) {
... | java | public int getTotalWeight() {
int totalWeight = 0;
// save out a copy of the values as HashMap.values() takes o(n) to return the value.
final Collection<FactorComparator<T>> allValues = this.factorComparatorList.values();
for (final FactorComparator<T> item : allValues) {
if (item != null) {
... | [
"public",
"int",
"getTotalWeight",
"(",
")",
"{",
"int",
"totalWeight",
"=",
"0",
";",
"// save out a copy of the values as HashMap.values() takes o(n) to return the value.",
"final",
"Collection",
"<",
"FactorComparator",
"<",
"T",
">",
">",
"allValues",
"=",
"this",
"... | function returns the total weight of the registered comparators.
@return the value of total weight. | [
"function",
"returns",
"the",
"total",
"weight",
"of",
"the",
"registered",
"comparators",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/selector/CandidateComparator.java#L87-L99 |
130,681 | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | ReportalServlet.getFilePreviews | private List<Object> getFilePreviews(final String[] fileList, final String locationFull,
final IStreamProvider streamProvider, final boolean renderResultsAsHtml) {
final List<Object> files = new ArrayList<>();
InputStream csvInputStream = null;
try {
for (final String fileName : fileList) {
... | java | private List<Object> getFilePreviews(final String[] fileList, final String locationFull,
final IStreamProvider streamProvider, final boolean renderResultsAsHtml) {
final List<Object> files = new ArrayList<>();
InputStream csvInputStream = null;
try {
for (final String fileName : fileList) {
... | [
"private",
"List",
"<",
"Object",
">",
"getFilePreviews",
"(",
"final",
"String",
"[",
"]",
"fileList",
",",
"final",
"String",
"locationFull",
",",
"final",
"IStreamProvider",
"streamProvider",
",",
"final",
"boolean",
"renderResultsAsHtml",
")",
"{",
"final",
... | Returns a list of file Objects that contain a "name" property with the file
name, a "content" property with the lines in the file, and a "hasMore"
property if the file contains more than NUM_PREVIEW_ROWS lines. | [
"Returns",
"a",
"list",
"of",
"file",
"Objects",
"that",
"contain",
"a",
"name",
"property",
"with",
"the",
"file",
"name",
"a",
"content",
"property",
"with",
"the",
"lines",
"in",
"the",
"file",
"and",
"a",
"hasMore",
"property",
"if",
"the",
"file",
"... | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java#L545-L594 |
130,682 | azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java | QuartzScheduler.pauseJobIfPresent | public synchronized boolean pauseJobIfPresent(final String jobName, final String groupName)
throws SchedulerException {
if (ifJobExist(jobName, groupName)) {
this.scheduler.pauseJob(new JobKey(jobName, groupName));
return true;
} else {
return false;
}
} | java | public synchronized boolean pauseJobIfPresent(final String jobName, final String groupName)
throws SchedulerException {
if (ifJobExist(jobName, groupName)) {
this.scheduler.pauseJob(new JobKey(jobName, groupName));
return true;
} else {
return false;
}
} | [
"public",
"synchronized",
"boolean",
"pauseJobIfPresent",
"(",
"final",
"String",
"jobName",
",",
"final",
"String",
"groupName",
")",
"throws",
"SchedulerException",
"{",
"if",
"(",
"ifJobExist",
"(",
"jobName",
",",
"groupName",
")",
")",
"{",
"this",
".",
"... | Pause a job if it's present.
@param jobName
@param groupName
@return true if job has been paused, no if job doesn't exist.
@throws SchedulerException | [
"Pause",
"a",
"job",
"if",
"it",
"s",
"present",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java#L95-L103 |
130,683 | azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java | QuartzScheduler.isJobPaused | public synchronized boolean isJobPaused(final String jobName, final String groupName)
throws SchedulerException {
if (!ifJobExist(jobName, groupName)) {
throw new SchedulerException(String.format("Job (job name %s, group name %s) doesn't "
+ "exist'", jobName, groupName));
}
final JobK... | java | public synchronized boolean isJobPaused(final String jobName, final String groupName)
throws SchedulerException {
if (!ifJobExist(jobName, groupName)) {
throw new SchedulerException(String.format("Job (job name %s, group name %s) doesn't "
+ "exist'", jobName, groupName));
}
final JobK... | [
"public",
"synchronized",
"boolean",
"isJobPaused",
"(",
"final",
"String",
"jobName",
",",
"final",
"String",
"groupName",
")",
"throws",
"SchedulerException",
"{",
"if",
"(",
"!",
"ifJobExist",
"(",
"jobName",
",",
"groupName",
")",
")",
"{",
"throw",
"new",... | Check if job is paused.
@return true if job is paused, false otherwise. | [
"Check",
"if",
"job",
"is",
"paused",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java#L110-L126 |
130,684 | azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java | QuartzScheduler.unscheduleJob | public synchronized boolean unscheduleJob(final String jobName, final String groupName) throws
SchedulerException {
return this.scheduler.deleteJob(new JobKey(jobName, groupName));
} | java | public synchronized boolean unscheduleJob(final String jobName, final String groupName) throws
SchedulerException {
return this.scheduler.deleteJob(new JobKey(jobName, groupName));
} | [
"public",
"synchronized",
"boolean",
"unscheduleJob",
"(",
"final",
"String",
"jobName",
",",
"final",
"String",
"groupName",
")",
"throws",
"SchedulerException",
"{",
"return",
"this",
".",
"scheduler",
".",
"deleteJob",
"(",
"new",
"JobKey",
"(",
"jobName",
",... | Unschedule a job.
@param jobName
@param groupName
@return true if job is found and unscheduled.
@throws SchedulerException | [
"Unschedule",
"a",
"job",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java#L152-L155 |
130,685 | azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java | QuartzScheduler.scheduleJobIfAbsent | public synchronized boolean scheduleJobIfAbsent(final String cronExpression, final QuartzJobDescription
jobDescription) throws SchedulerException {
requireNonNull(jobDescription, "jobDescription is null");
if (ifJobExist(jobDescription.getJobName(), jobDescription.getGroupName())) {
logger.warn(St... | java | public synchronized boolean scheduleJobIfAbsent(final String cronExpression, final QuartzJobDescription
jobDescription) throws SchedulerException {
requireNonNull(jobDescription, "jobDescription is null");
if (ifJobExist(jobDescription.getJobName(), jobDescription.getGroupName())) {
logger.warn(St... | [
"public",
"synchronized",
"boolean",
"scheduleJobIfAbsent",
"(",
"final",
"String",
"cronExpression",
",",
"final",
"QuartzJobDescription",
"jobDescription",
")",
"throws",
"SchedulerException",
"{",
"requireNonNull",
"(",
"jobDescription",
",",
"\"jobDescription is null\"",
... | Only cron schedule register is supported. Since register might be called when
concurrently uploading projects, so synchronized is added to ensure thread safety.
@param cronExpression the cron schedule for this job
@param jobDescription Regarding QuartzJobDescription#groupName, in order to guarantee no
duplicate quartz... | [
"Only",
"cron",
"schedule",
"register",
"is",
"supported",
".",
"Since",
"register",
"might",
"be",
"called",
"when",
"concurrently",
"uploading",
"projects",
"so",
"synchronized",
"is",
"added",
"to",
"ensure",
"thread",
"safety",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java#L172-L209 |
130,686 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutionController.java | ExecutionController.getFlowsHelper | private void getFlowsHelper(final ArrayList<ExecutableFlow> flows,
final Collection<Pair<ExecutionReference, ExecutableFlow>> collection) {
collection.stream().forEach(ref -> flows.add(ref.getSecond()));
} | java | private void getFlowsHelper(final ArrayList<ExecutableFlow> flows,
final Collection<Pair<ExecutionReference, ExecutableFlow>> collection) {
collection.stream().forEach(ref -> flows.add(ref.getSecond()));
} | [
"private",
"void",
"getFlowsHelper",
"(",
"final",
"ArrayList",
"<",
"ExecutableFlow",
">",
"flows",
",",
"final",
"Collection",
"<",
"Pair",
"<",
"ExecutionReference",
",",
"ExecutableFlow",
">",
">",
"collection",
")",
"{",
"collection",
".",
"stream",
"(",
... | Helper method to get all flows from collection. | [
"Helper",
"method",
"to",
"get",
"all",
"flows",
"from",
"collection",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionController.java#L269-L272 |
130,687 | azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutionController.java | ExecutionController.getQueuedFlowIds | public List<Integer> getQueuedFlowIds() {
final List<Integer> allIds = new ArrayList<>();
try {
getExecutionIdsHelper(allIds, this.executorLoader.fetchQueuedFlows());
} catch (final ExecutorManagerException e) {
this.logger.error("Failed to get queued flow ids.", e);
}
return allIds;
} | java | public List<Integer> getQueuedFlowIds() {
final List<Integer> allIds = new ArrayList<>();
try {
getExecutionIdsHelper(allIds, this.executorLoader.fetchQueuedFlows());
} catch (final ExecutorManagerException e) {
this.logger.error("Failed to get queued flow ids.", e);
}
return allIds;
} | [
"public",
"List",
"<",
"Integer",
">",
"getQueuedFlowIds",
"(",
")",
"{",
"final",
"List",
"<",
"Integer",
">",
"allIds",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"getExecutionIdsHelper",
"(",
"allIds",
",",
"this",
".",
"executorLoader",
... | Get execution ids of all non-dispatched flows from database. | [
"Get",
"execution",
"ids",
"of",
"all",
"non",
"-",
"dispatched",
"flows",
"from",
"database",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionController.java#L290-L298 |
130,688 | azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/flowtrigger/database/JdbcFlowTriggerInstanceLoaderImpl.java | JdbcFlowTriggerInstanceLoaderImpl.getRecentlyFinished | @Override
public Collection<TriggerInstance> getRecentlyFinished(final int limit) {
final String query = String.format(SELECT_RECENTLY_FINISHED, limit);
try {
return this.dbOperator
.query(query, new TriggerInstanceHandler(SORT_MODE.SORT_ON_START_TIME_ASC));
} catch (final SQLException ex)... | java | @Override
public Collection<TriggerInstance> getRecentlyFinished(final int limit) {
final String query = String.format(SELECT_RECENTLY_FINISHED, limit);
try {
return this.dbOperator
.query(query, new TriggerInstanceHandler(SORT_MODE.SORT_ON_START_TIME_ASC));
} catch (final SQLException ex)... | [
"@",
"Override",
"public",
"Collection",
"<",
"TriggerInstance",
">",
"getRecentlyFinished",
"(",
"final",
"int",
"limit",
")",
"{",
"final",
"String",
"query",
"=",
"String",
".",
"format",
"(",
"SELECT_RECENTLY_FINISHED",
",",
"limit",
")",
";",
"try",
"{",
... | Retrieve recently finished trigger instances, but flow trigger properties are not populated
into the returned trigger instances for efficiency. Flow trigger properties will be
retrieved only on request time. | [
"Retrieve",
"recently",
"finished",
"trigger",
"instances",
"but",
"flow",
"trigger",
"properties",
"are",
"not",
"populated",
"into",
"the",
"returned",
"trigger",
"instances",
"for",
"efficiency",
".",
"Flow",
"trigger",
"properties",
"will",
"be",
"retrieved",
... | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/database/JdbcFlowTriggerInstanceLoaderImpl.java#L291-L301 |
130,689 | azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/flowtrigger/database/JdbcFlowTriggerInstanceLoaderImpl.java | JdbcFlowTriggerInstanceLoaderImpl.getTriggerInstanceByFlowExecId | @Override
public TriggerInstance getTriggerInstanceByFlowExecId(final int flowExecId) {
if (flowExecId == Constants.FAILED_EXEC_ID || flowExecId == Constants.UNASSIGNED_EXEC_ID) {
return null;
}
TriggerInstance triggerInstance = null;
try {
final Collection<TriggerInstance> res = this.dbOp... | java | @Override
public TriggerInstance getTriggerInstanceByFlowExecId(final int flowExecId) {
if (flowExecId == Constants.FAILED_EXEC_ID || flowExecId == Constants.UNASSIGNED_EXEC_ID) {
return null;
}
TriggerInstance triggerInstance = null;
try {
final Collection<TriggerInstance> res = this.dbOp... | [
"@",
"Override",
"public",
"TriggerInstance",
"getTriggerInstanceByFlowExecId",
"(",
"final",
"int",
"flowExecId",
")",
"{",
"if",
"(",
"flowExecId",
"==",
"Constants",
".",
"FAILED_EXEC_ID",
"||",
"flowExecId",
"==",
"Constants",
".",
"UNASSIGNED_EXEC_ID",
")",
"{"... | Retrieve a trigger instance given a flow execution id. Flow trigger properties will
also be populated into the returned trigger instance. If flow exec id is -1 or -2, then
null will be returned. | [
"Retrieve",
"a",
"trigger",
"instance",
"given",
"a",
"flow",
"execution",
"id",
".",
"Flow",
"trigger",
"properties",
"will",
"also",
"be",
"populated",
"into",
"the",
"returned",
"trigger",
"instance",
".",
"If",
"flow",
"exec",
"id",
"is",
"-",
"1",
"or... | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/database/JdbcFlowTriggerInstanceLoaderImpl.java#L348-L364 |
130,690 | azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/flowtrigger/database/JdbcFlowTriggerInstanceLoaderImpl.java | JdbcFlowTriggerInstanceLoaderImpl.getTriggerInstanceById | @Override
public TriggerInstance getTriggerInstanceById(final String triggerInstanceId) {
TriggerInstance triggerInstance = null;
try {
final Collection<TriggerInstance> res = this.dbOperator
.query(SELECT_EXECUTIONS_BY_INSTANCE_ID,
new TriggerInstanceHandler(SORT_MODE.SORT_ON_ST... | java | @Override
public TriggerInstance getTriggerInstanceById(final String triggerInstanceId) {
TriggerInstance triggerInstance = null;
try {
final Collection<TriggerInstance> res = this.dbOperator
.query(SELECT_EXECUTIONS_BY_INSTANCE_ID,
new TriggerInstanceHandler(SORT_MODE.SORT_ON_ST... | [
"@",
"Override",
"public",
"TriggerInstance",
"getTriggerInstanceById",
"(",
"final",
"String",
"triggerInstanceId",
")",
"{",
"TriggerInstance",
"triggerInstance",
"=",
"null",
";",
"try",
"{",
"final",
"Collection",
"<",
"TriggerInstance",
">",
"res",
"=",
"this",... | Retrieve a trigger instance given an instance id. Flow trigger properties will also be
populated into the returned trigger instance. | [
"Retrieve",
"a",
"trigger",
"instance",
"given",
"an",
"instance",
"id",
".",
"Flow",
"trigger",
"properties",
"will",
"also",
"be",
"populated",
"into",
"the",
"returned",
"trigger",
"instance",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/database/JdbcFlowTriggerInstanceLoaderImpl.java#L422-L436 |
130,691 | azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/connectors/gobblin/GobblinHadoopJob.java | GobblinHadoopJob.getValidator | private static IPropertiesValidator getValidator(GobblinPresets preset) {
Objects.requireNonNull(preset);
switch (preset) {
case MYSQL_TO_HDFS:
return new MySqlToHdfsValidator();
case HDFS_TO_MYSQL:
return new HdfsToMySqlValidator();
default:
throw new UnsupportedOperat... | java | private static IPropertiesValidator getValidator(GobblinPresets preset) {
Objects.requireNonNull(preset);
switch (preset) {
case MYSQL_TO_HDFS:
return new MySqlToHdfsValidator();
case HDFS_TO_MYSQL:
return new HdfsToMySqlValidator();
default:
throw new UnsupportedOperat... | [
"private",
"static",
"IPropertiesValidator",
"getValidator",
"(",
"GobblinPresets",
"preset",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"preset",
")",
";",
"switch",
"(",
"preset",
")",
"{",
"case",
"MYSQL_TO_HDFS",
":",
"return",
"new",
"MySqlToHdfsValidat... | Factory method that provides IPropertiesValidator based on preset in runtime.
Using factory method pattern as it is expected to grow.
@return IPropertiesValidator | [
"Factory",
"method",
"that",
"provides",
"IPropertiesValidator",
"based",
"on",
"preset",
"in",
"runtime",
".",
"Using",
"factory",
"method",
"pattern",
"as",
"it",
"is",
"expected",
"to",
"grow",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/connectors/gobblin/GobblinHadoopJob.java#L76-L86 |
130,692 | azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/connectors/gobblin/GobblinHadoopJob.java | GobblinHadoopJob.initializePresets | private void initializePresets() {
if (gobblinPresets == null) {
synchronized (GobblinHadoopJob.class) {
if (gobblinPresets == null) {
gobblinPresets = Maps.newHashMap();
String gobblinPresetDirName = getSysProps()
.getString(GobblinConstants.GOBBLIN_PRESET_DIR_KEY);
... | java | private void initializePresets() {
if (gobblinPresets == null) {
synchronized (GobblinHadoopJob.class) {
if (gobblinPresets == null) {
gobblinPresets = Maps.newHashMap();
String gobblinPresetDirName = getSysProps()
.getString(GobblinConstants.GOBBLIN_PRESET_DIR_KEY);
... | [
"private",
"void",
"initializePresets",
"(",
")",
"{",
"if",
"(",
"gobblinPresets",
"==",
"null",
")",
"{",
"synchronized",
"(",
"GobblinHadoopJob",
".",
"class",
")",
"{",
"if",
"(",
"gobblinPresets",
"==",
"null",
")",
"{",
"gobblinPresets",
"=",
"Maps",
... | Initializes presets and cache it into preset map. As presets do not change while server is up,
this initialization happens only once per JVM. | [
"Initializes",
"presets",
"and",
"cache",
"it",
"into",
"preset",
"map",
".",
"As",
"presets",
"do",
"not",
"change",
"while",
"server",
"is",
"up",
"this",
"initialization",
"happens",
"only",
"once",
"per",
"JVM",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/connectors/gobblin/GobblinHadoopJob.java#L112-L157 |
130,693 | azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/connectors/gobblin/GobblinHadoopJob.java | GobblinHadoopJob.transformProperties | private void transformProperties() {
//Gobblin does not accept the SQL query ends with semi-colon
String query = getJobProps().getString(GOBBLIN_QUERY_KEY, null);
if (query == null) {
return;
}
query = query.trim();
int idx = -1;
if ((idx = query.indexOf(';')) >= 0) {
if (idx < ... | java | private void transformProperties() {
//Gobblin does not accept the SQL query ends with semi-colon
String query = getJobProps().getString(GOBBLIN_QUERY_KEY, null);
if (query == null) {
return;
}
query = query.trim();
int idx = -1;
if ((idx = query.indexOf(';')) >= 0) {
if (idx < ... | [
"private",
"void",
"transformProperties",
"(",
")",
"{",
"//Gobblin does not accept the SQL query ends with semi-colon",
"String",
"query",
"=",
"getJobProps",
"(",
")",
".",
"getString",
"(",
"GOBBLIN_QUERY_KEY",
",",
"null",
")",
";",
"if",
"(",
"query",
"==",
"nu... | Transform property to make it work for Gobblin.
e.g: Gobblin fails when there's semicolon in SQL query as it just appends " and 1=1;" into the
query,
making the syntax incorrect and fails. As having semicolon is a correct syntax, instead of
expecting user to remove it,
Azkaban will remove it for user to make it work w... | [
"Transform",
"property",
"to",
"make",
"it",
"work",
"for",
"Gobblin",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/connectors/gobblin/GobblinHadoopJob.java#L210-L229 |
130,694 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java | ProjectCacheCleaner.deleteProjectDirsInParallel | @SuppressWarnings("FutureReturnValueIgnored")
private void deleteProjectDirsInParallel(final ImmutableSet<File> projectDirsToDelete) {
final int CLEANING_SERVICE_THREAD_NUM = 8;
final ExecutorService deletionService = Executors
.newFixedThreadPool(CLEANING_SERVICE_THREAD_NUM);
for (final File toD... | java | @SuppressWarnings("FutureReturnValueIgnored")
private void deleteProjectDirsInParallel(final ImmutableSet<File> projectDirsToDelete) {
final int CLEANING_SERVICE_THREAD_NUM = 8;
final ExecutorService deletionService = Executors
.newFixedThreadPool(CLEANING_SERVICE_THREAD_NUM);
for (final File toD... | [
"@",
"SuppressWarnings",
"(",
"\"FutureReturnValueIgnored\"",
")",
"private",
"void",
"deleteProjectDirsInParallel",
"(",
"final",
"ImmutableSet",
"<",
"File",
">",
"projectDirsToDelete",
")",
"{",
"final",
"int",
"CLEANING_SERVICE_THREAD_NUM",
"=",
"8",
";",
"final",
... | Delete all the files in parallel
@param projectDirsToDelete a set of project dirs to delete | [
"Delete",
"all",
"the",
"files",
"in",
"parallel"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java#L125-L143 |
130,695 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java | ProjectCacheCleaner.deleteLeastRecentlyUsedProjects | private void deleteLeastRecentlyUsedProjects(long sizeToFreeInBytes,
final List<ProjectDirectoryMetadata> projectDirMetadataList) {
// Sort projects by last reference time in ascending order
projectDirMetadataList.sort(Comparator.comparing(ProjectDirectoryMetadata::getLastAccessTime));
final Set<File>... | java | private void deleteLeastRecentlyUsedProjects(long sizeToFreeInBytes,
final List<ProjectDirectoryMetadata> projectDirMetadataList) {
// Sort projects by last reference time in ascending order
projectDirMetadataList.sort(Comparator.comparing(ProjectDirectoryMetadata::getLastAccessTime));
final Set<File>... | [
"private",
"void",
"deleteLeastRecentlyUsedProjects",
"(",
"long",
"sizeToFreeInBytes",
",",
"final",
"List",
"<",
"ProjectDirectoryMetadata",
">",
"projectDirMetadataList",
")",
"{",
"// Sort projects by last reference time in ascending order",
"projectDirMetadataList",
".",
"so... | Delete least recently used projects to free up space
@param sizeToFreeInBytes space to free up
@param projectDirMetadataList a list of candidate files to delete | [
"Delete",
"least",
"recently",
"used",
"projects",
"to",
"free",
"up",
"space"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java#L151-L177 |
130,696 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java | ProjectCacheCleaner.deleteProjectDirsIfNecessary | void deleteProjectDirsIfNecessary(final long newProjectSizeInBytes) {
final long projectCacheMaxSizeInByte =
(long) (this.projectCacheDir.getTotalSpace() * this.percentageOfDisk);
final long start = System.currentTimeMillis();
final List<ProjectDirectoryMetadata> allProjects = loadAllProjects();
... | java | void deleteProjectDirsIfNecessary(final long newProjectSizeInBytes) {
final long projectCacheMaxSizeInByte =
(long) (this.projectCacheDir.getTotalSpace() * this.percentageOfDisk);
final long start = System.currentTimeMillis();
final List<ProjectDirectoryMetadata> allProjects = loadAllProjects();
... | [
"void",
"deleteProjectDirsIfNecessary",
"(",
"final",
"long",
"newProjectSizeInBytes",
")",
"{",
"final",
"long",
"projectCacheMaxSizeInByte",
"=",
"(",
"long",
")",
"(",
"this",
".",
"projectCacheDir",
".",
"getTotalSpace",
"(",
")",
"*",
"this",
".",
"percentage... | Deleting least recently accessed project dirs when there's no room to accommodate new project | [
"Deleting",
"least",
"recently",
"accessed",
"project",
"dirs",
"when",
"there",
"s",
"no",
"room",
"to",
"accommodate",
"new",
"project"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/ProjectCacheCleaner.java#L182-L202 |
130,697 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java | FlowRunner.createLogger | private void createLogger(final String flowId) {
// Create logger
final String loggerName = this.execId + "." + flowId;
this.logger = Logger.getLogger(loggerName);
// Create file appender
final String logName = "_flow." + loggerName + ".log";
this.logFile = new File(this.execDir, logName);
... | java | private void createLogger(final String flowId) {
// Create logger
final String loggerName = this.execId + "." + flowId;
this.logger = Logger.getLogger(loggerName);
// Create file appender
final String logName = "_flow." + loggerName + ".log";
this.logFile = new File(this.execDir, logName);
... | [
"private",
"void",
"createLogger",
"(",
"final",
"String",
"flowId",
")",
"{",
"// Create logger",
"final",
"String",
"loggerName",
"=",
"this",
".",
"execId",
"+",
"\".\"",
"+",
"flowId",
";",
"this",
".",
"logger",
"=",
"Logger",
".",
"getLogger",
"(",
"... | setup logger and execution dir for the flowId | [
"setup",
"logger",
"and",
"execution",
"dir",
"for",
"the",
"flowId"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java#L359-L376 |
130,698 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java | FlowRunner.runFlow | private void runFlow() throws Exception {
this.logger.info("Starting flows");
runReadyJob(this.flow);
updateFlow();
while (!this.flowFinished) {
synchronized (this.mainSyncObj) {
if (this.flowPaused) {
try {
this.mainSyncObj.wait(CHECK_WAIT_MS);
} catch (fi... | java | private void runFlow() throws Exception {
this.logger.info("Starting flows");
runReadyJob(this.flow);
updateFlow();
while (!this.flowFinished) {
synchronized (this.mainSyncObj) {
if (this.flowPaused) {
try {
this.mainSyncObj.wait(CHECK_WAIT_MS);
} catch (fi... | [
"private",
"void",
"runFlow",
"(",
")",
"throws",
"Exception",
"{",
"this",
".",
"logger",
".",
"info",
"(",
"\"Starting flows\"",
")",
";",
"runReadyJob",
"(",
"this",
".",
"flow",
")",
";",
"updateFlow",
"(",
")",
";",
"while",
"(",
"!",
"this",
".",... | Main method that executes the jobs. | [
"Main",
"method",
"that",
"executes",
"the",
"jobs",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java#L417-L449 |
130,699 | azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java | FlowRunner.propagateStatusAndAlert | private void propagateStatusAndAlert(final ExecutableFlowBase base, final Status status) {
if (!Status.isStatusFinished(base.getStatus()) && base.getStatus() != Status.KILLING) {
this.logger.info("Setting " + base.getNestedId() + " to " + status);
boolean shouldAlert = false;
if (base.getStatus() ... | java | private void propagateStatusAndAlert(final ExecutableFlowBase base, final Status status) {
if (!Status.isStatusFinished(base.getStatus()) && base.getStatus() != Status.KILLING) {
this.logger.info("Setting " + base.getNestedId() + " to " + status);
boolean shouldAlert = false;
if (base.getStatus() ... | [
"private",
"void",
"propagateStatusAndAlert",
"(",
"final",
"ExecutableFlowBase",
"base",
",",
"final",
"Status",
"status",
")",
"{",
"if",
"(",
"!",
"Status",
".",
"isStatusFinished",
"(",
"base",
".",
"getStatus",
"(",
")",
")",
"&&",
"base",
".",
"getStat... | Recursively propagate status to parent flow. Alert on first error of the flow in new AZ
dispatching design.
@param base the base flow
@param status the status to be propagated | [
"Recursively",
"propagate",
"status",
"to",
"parent",
"flow",
".",
"Alert",
"on",
"first",
"error",
"of",
"the",
"flow",
"in",
"new",
"AZ",
"dispatching",
"design",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java#L646-L664 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.