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,800
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.get
public String get(final Object key) { if (this._current.containsKey(key)) { return this._current.get(key); } else if (this._parent != null) { return this._parent.get(key); } else { return null; } }
java
public String get(final Object key) { if (this._current.containsKey(key)) { return this._current.get(key); } else if (this._parent != null) { return this._parent.get(key); } else { return null; } }
[ "public", "String", "get", "(", "final", "Object", "key", ")", "{", "if", "(", "this", ".", "_current", ".", "containsKey", "(", "key", ")", ")", "{", "return", "this", ".", "_current", ".", "get", "(", "key", ")", ";", "}", "else", "if", "(", "t...
Return value if available in current Props otherwise return from parent
[ "Return", "value", "if", "available", "in", "current", "Props", "otherwise", "return", "from", "parent" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L240-L248
130,801
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.put
public String put(final String key, final Long value) { return this._current.put(key, value.toString()); }
java
public String put(final String key, final Long value) { return this._current.put(key, value.toString()); }
[ "public", "String", "put", "(", "final", "String", "key", ",", "final", "Long", "value", ")", "{", "return", "this", ".", "_current", ".", "put", "(", "key", ",", "value", ".", "toString", "(", ")", ")", ";", "}" ]
Put Long. Stores as String.
[ "Put", "Long", ".", "Stores", "as", "String", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L306-L308
130,802
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.put
public String put(final String key, final Double value) { return this._current.put(key, value.toString()); }
java
public String put(final String key, final Double value) { return this._current.put(key, value.toString()); }
[ "public", "String", "put", "(", "final", "String", "key", ",", "final", "Double", "value", ")", "{", "return", "this", ".", "_current", ".", "put", "(", "key", ",", "value", ".", "toString", "(", ")", ")", ";", "}" ]
Put Double. Stores as String.
[ "Put", "Double", ".", "Stores", "as", "String", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L313-L315
130,803
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.putAll
public void putAll(final Props p) { if (p == null) { return; } for (final String key : p.getKeySet()) { this.put(key, p.get(key)); } }
java
public void putAll(final Props p) { if (p == null) { return; } for (final String key : p.getKeySet()) { this.put(key, p.get(key)); } }
[ "public", "void", "putAll", "(", "final", "Props", "p", ")", "{", "if", "(", "p", "==", "null", ")", "{", "return", ";", "}", "for", "(", "final", "String", "key", ":", "p", ".", "getKeySet", "(", ")", ")", "{", "this", ".", "put", "(", "key", ...
Put all properties in the props into the current props. Will handle null p.
[ "Put", "all", "properties", "in", "the", "props", "into", "the", "current", "props", ".", "Will", "handle", "null", "p", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L333-L341
130,804
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.putLocal
public void putLocal(final Props p) { for (final String key : p.localKeySet()) { this.put(key, p.get(key)); } }
java
public void putLocal(final Props p) { for (final String key : p.localKeySet()) { this.put(key, p.get(key)); } }
[ "public", "void", "putLocal", "(", "final", "Props", "p", ")", "{", "for", "(", "final", "String", "key", ":", "p", ".", "localKeySet", "(", ")", ")", "{", "this", ".", "put", "(", "key", ",", "p", ".", "get", "(", "key", ")", ")", ";", "}", ...
Puts only the local props from p into the current properties
[ "Puts", "only", "the", "local", "props", "from", "p", "into", "the", "current", "properties" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L346-L350
130,805
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getClass
public Class<?> getClass(final String key) { try { if (containsKey(key)) { return Class.forName(get(key)); } else { throw new UndefinedPropertyException("Missing required property '" + key + "'"); } } catch (final ClassNotFoundException e) { throw new IllegalA...
java
public Class<?> getClass(final String key) { try { if (containsKey(key)) { return Class.forName(get(key)); } else { throw new UndefinedPropertyException("Missing required property '" + key + "'"); } } catch (final ClassNotFoundException e) { throw new IllegalA...
[ "public", "Class", "<", "?", ">", "getClass", "(", "final", "String", "key", ")", "{", "try", "{", "if", "(", "containsKey", "(", "key", ")", ")", "{", "return", "Class", ".", "forName", "(", "get", "(", "key", ")", ")", ";", "}", "else", "{", ...
Attempts to return the Class that corresponds to the Props value. If the class doesn't exit, an IllegalArgumentException will be thrown.
[ "Attempts", "to", "return", "the", "Class", "that", "corresponds", "to", "the", "Props", "value", ".", "If", "the", "class", "doesn", "t", "exit", "an", "IllegalArgumentException", "will", "be", "thrown", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L378-L389
130,806
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getClass
public Class<?> getClass(final String key, final Class<?> defaultClass) { if (containsKey(key)) { return getClass(key); } else { return defaultClass; } }
java
public Class<?> getClass(final String key, final Class<?> defaultClass) { if (containsKey(key)) { return getClass(key); } else { return defaultClass; } }
[ "public", "Class", "<", "?", ">", "getClass", "(", "final", "String", "key", ",", "final", "Class", "<", "?", ">", "defaultClass", ")", "{", "if", "(", "containsKey", "(", "key", ")", ")", "{", "return", "getClass", "(", "key", ")", ";", "}", "else...
Gets the class from the Props. If it doesn't exist, it will return the defaultClass
[ "Gets", "the", "class", "from", "the", "Props", ".", "If", "it", "doesn", "t", "exist", "it", "will", "return", "the", "defaultClass" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L407-L413
130,807
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getString
public String getString(final String key) { if (containsKey(key)) { return get(key); } else { throw new UndefinedPropertyException("Missing required property '" + key + "'"); } }
java
public String getString(final String key) { if (containsKey(key)) { return get(key); } else { throw new UndefinedPropertyException("Missing required property '" + key + "'"); } }
[ "public", "String", "getString", "(", "final", "String", "key", ")", "{", "if", "(", "containsKey", "(", "key", ")", ")", "{", "return", "get", "(", "key", ")", ";", "}", "else", "{", "throw", "new", "UndefinedPropertyException", "(", "\"Missing required p...
Gets the string from the Props. If it doesn't exist, throw and UndefinedPropertiesException
[ "Gets", "the", "string", "from", "the", "Props", ".", "If", "it", "doesn", "t", "exist", "throw", "and", "UndefinedPropertiesException" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L429-L436
130,808
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getStringList
public List<String> getStringList(final String key, final String sep) { final String val = get(key); if (val == null || val.trim().length() == 0) { return Collections.emptyList(); } if (containsKey(key)) { return Arrays.asList(val.split(sep)); } else { throw new UndefinedPropertyE...
java
public List<String> getStringList(final String key, final String sep) { final String val = get(key); if (val == null || val.trim().length() == 0) { return Collections.emptyList(); } if (containsKey(key)) { return Arrays.asList(val.split(sep)); } else { throw new UndefinedPropertyE...
[ "public", "List", "<", "String", ">", "getStringList", "(", "final", "String", "key", ",", "final", "String", "sep", ")", "{", "final", "String", "val", "=", "get", "(", "key", ")", ";", "if", "(", "val", "==", "null", "||", "val", ".", "trim", "("...
Returns a list of strings with the sep as the separator of the value
[ "Returns", "a", "list", "of", "strings", "with", "the", "sep", "as", "the", "separator", "of", "the", "value" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L466-L478
130,809
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getStringList
public List<String> getStringList(final String key, final List<String> defaultValue) { if (containsKey(key)) { return getStringList(key); } else { return defaultValue; } }
java
public List<String> getStringList(final String key, final List<String> defaultValue) { if (containsKey(key)) { return getStringList(key); } else { return defaultValue; } }
[ "public", "List", "<", "String", ">", "getStringList", "(", "final", "String", "key", ",", "final", "List", "<", "String", ">", "defaultValue", ")", "{", "if", "(", "containsKey", "(", "key", ")", ")", "{", "return", "getStringList", "(", "key", ")", "...
Returns a list of strings with the comma as the separator of the value. If the value is null, it'll return the defaultValue.
[ "Returns", "a", "list", "of", "strings", "with", "the", "comma", "as", "the", "separator", "of", "the", "value", ".", "If", "the", "value", "is", "null", "it", "ll", "return", "the", "defaultValue", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L484-L490
130,810
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getLong
public long getLong(final String name, final long defaultValue) { if (containsKey(name)) { return Long.parseLong(get(name)); } else { return defaultValue; } }
java
public long getLong(final String name, final long defaultValue) { if (containsKey(name)) { return Long.parseLong(get(name)); } else { return defaultValue; } }
[ "public", "long", "getLong", "(", "final", "String", "name", ",", "final", "long", "defaultValue", ")", "{", "if", "(", "containsKey", "(", "name", ")", ")", "{", "return", "Long", ".", "parseLong", "(", "get", "(", "name", ")", ")", ";", "}", "else"...
Returns the long representation of the value. If the value is null, then the default value is returned. If the value isn't a long, then a parse exception will be thrown.
[ "Returns", "the", "long", "representation", "of", "the", "value", ".", "If", "the", "value", "is", "null", "then", "the", "default", "value", "is", "returned", ".", "If", "the", "value", "isn", "t", "a", "long", "then", "a", "parse", "exception", "will",...
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L534-L540
130,811
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getLong
public long getLong(final String name) { if (containsKey(name)) { return Long.parseLong(get(name)); } else { throw new UndefinedPropertyException("Missing required property '" + name + "'"); } }
java
public long getLong(final String name) { if (containsKey(name)) { return Long.parseLong(get(name)); } else { throw new UndefinedPropertyException("Missing required property '" + name + "'"); } }
[ "public", "long", "getLong", "(", "final", "String", "name", ")", "{", "if", "(", "containsKey", "(", "name", ")", ")", "{", "return", "Long", ".", "parseLong", "(", "get", "(", "name", ")", ")", ";", "}", "else", "{", "throw", "new", "UndefinedPrope...
Returns the long representation of the value. If the value is null, then a UndefinedPropertyException will be thrown. If the value isn't a long, then a parse exception will be thrown.
[ "Returns", "the", "long", "representation", "of", "the", "value", ".", "If", "the", "value", "is", "null", "then", "a", "UndefinedPropertyException", "will", "be", "thrown", ".", "If", "the", "value", "isn", "t", "a", "long", "then", "a", "parse", "excepti...
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L547-L554
130,812
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getUri
public URI getUri(final String name) { if (containsKey(name)) { try { return new URI(get(name)); } catch (final URISyntaxException e) { throw new IllegalArgumentException(e.getMessage()); } } else { throw new UndefinedPropertyException("Missing required property '" + name...
java
public URI getUri(final String name) { if (containsKey(name)) { try { return new URI(get(name)); } catch (final URISyntaxException e) { throw new IllegalArgumentException(e.getMessage()); } } else { throw new UndefinedPropertyException("Missing required property '" + name...
[ "public", "URI", "getUri", "(", "final", "String", "name", ")", "{", "if", "(", "containsKey", "(", "name", ")", ")", "{", "try", "{", "return", "new", "URI", "(", "get", "(", "name", ")", ")", ";", "}", "catch", "(", "final", "URISyntaxException", ...
Returns the uri representation of the value. If the value is null, then the default value is returned. If the value isn't a uri, then a IllegalArgumentException will be thrown.
[ "Returns", "the", "uri", "representation", "of", "the", "value", ".", "If", "the", "value", "is", "null", "then", "the", "default", "value", "is", "returned", ".", "If", "the", "value", "isn", "t", "a", "uri", "then", "a", "IllegalArgumentException", "will...
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L612-L623
130,813
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getUri
public URI getUri(final String name, final URI defaultValue) { if (containsKey(name)) { return getUri(name); } else { return defaultValue; } }
java
public URI getUri(final String name, final URI defaultValue) { if (containsKey(name)) { return getUri(name); } else { return defaultValue; } }
[ "public", "URI", "getUri", "(", "final", "String", "name", ",", "final", "URI", "defaultValue", ")", "{", "if", "(", "containsKey", "(", "name", ")", ")", "{", "return", "getUri", "(", "name", ")", ";", "}", "else", "{", "return", "defaultValue", ";", ...
Returns the double representation of the value. If the value is null, then the default value is returned. If the value isn't a uri, then a IllegalArgumentException will be thrown.
[ "Returns", "the", "double", "representation", "of", "the", "value", ".", "If", "the", "value", "is", "null", "then", "the", "default", "value", "is", "returned", ".", "If", "the", "value", "isn", "t", "a", "uri", "then", "a", "IllegalArgumentException", "w...
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L629-L635
130,814
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getUri
public URI getUri(final String name, final String defaultValue) { try { return getUri(name, new URI(defaultValue)); } catch (final URISyntaxException e) { throw new IllegalArgumentException(e.getMessage()); } }
java
public URI getUri(final String name, final String defaultValue) { try { return getUri(name, new URI(defaultValue)); } catch (final URISyntaxException e) { throw new IllegalArgumentException(e.getMessage()); } }
[ "public", "URI", "getUri", "(", "final", "String", "name", ",", "final", "String", "defaultValue", ")", "{", "try", "{", "return", "getUri", "(", "name", ",", "new", "URI", "(", "defaultValue", ")", ")", ";", "}", "catch", "(", "final", "URISyntaxExcepti...
Convert a URI-formatted string value to URI object
[ "Convert", "a", "URI", "-", "formatted", "string", "value", "to", "URI", "object" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L640-L646
130,815
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.toAllProperties
public Properties toAllProperties() { Properties allProp = new Properties(); // import local properties allProp.putAll(toProperties()); // import parent properties if (_parent != null) { allProp.putAll(_parent.toProperties()); } return allProp; }
java
public Properties toAllProperties() { Properties allProp = new Properties(); // import local properties allProp.putAll(toProperties()); // import parent properties if (_parent != null) { allProp.putAll(_parent.toProperties()); } return allProp; }
[ "public", "Properties", "toAllProperties", "(", ")", "{", "Properties", "allProp", "=", "new", "Properties", "(", ")", ";", "// import local properties", "allProp", ".", "putAll", "(", "toProperties", "(", ")", ")", ";", "// import parent properties", "if", "(", ...
Returns a java.util.Properties file populated with both current and parent properties.
[ "Returns", "a", "java", ".", "util", ".", "Properties", "file", "populated", "with", "both", "current", "and", "parent", "properties", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L702-L713
130,816
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getFlattened
public Map<String, String> getFlattened() { final TreeMap<String, String> returnVal = new TreeMap<>(); returnVal.putAll(getMapByPrefix("")); return returnVal; }
java
public Map<String, String> getFlattened() { final TreeMap<String, String> returnVal = new TreeMap<>(); returnVal.putAll(getMapByPrefix("")); return returnVal; }
[ "public", "Map", "<", "String", ",", "String", ">", "getFlattened", "(", ")", "{", "final", "TreeMap", "<", "String", ",", "String", ">", "returnVal", "=", "new", "TreeMap", "<>", "(", ")", ";", "returnVal", ".", "putAll", "(", "getMapByPrefix", "(", "...
Returns a new constructed map of all the flattened properties, the item in the returned map is sorted alphabetically by the key value. @Return a new constructed TreeMap (sorted map) of all properties (including parents' properties)
[ "Returns", "a", "new", "constructed", "map", "of", "all", "the", "flattened", "properties", "the", "item", "in", "the", "returned", "map", "is", "sorted", "alphabetically", "by", "the", "key", "value", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L757-L761
130,817
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getMapByPrefix
public Map<String, String> getMapByPrefix(final String prefix) { final Map<String, String> values = (this._parent == null) ? new HashMap<>() : this._parent.getMapByPrefix(prefix); // when there is a conflict, value from the child takes the priority. if (prefix == null) { // when prefix is n...
java
public Map<String, String> getMapByPrefix(final String prefix) { final Map<String, String> values = (this._parent == null) ? new HashMap<>() : this._parent.getMapByPrefix(prefix); // when there is a conflict, value from the child takes the priority. if (prefix == null) { // when prefix is n...
[ "public", "Map", "<", "String", ",", "String", ">", "getMapByPrefix", "(", "final", "String", "prefix", ")", "{", "final", "Map", "<", "String", ",", "String", ">", "values", "=", "(", "this", ".", "_parent", "==", "null", ")", "?", "new", "HashMap", ...
Get a new de-duplicated map of all the flattened properties by given prefix. The prefix will be removed in the return map's keySet. @param prefix the prefix string @return a new constructed de-duplicated HashMap of all properties (including parents' properties) with the give prefix
[ "Get", "a", "new", "de", "-", "duplicated", "map", "of", "all", "the", "flattened", "properties", "by", "given", "prefix", ".", "The", "prefix", "will", "be", "removed", "in", "the", "return", "map", "s", "keySet", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L771-L789
130,818
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.getKeySet
public Set<String> getKeySet() { final HashSet<String> keySet = new HashSet<>(); keySet.addAll(localKeySet()); if (this._parent != null) { keySet.addAll(this._parent.getKeySet()); } return keySet; }
java
public Set<String> getKeySet() { final HashSet<String> keySet = new HashSet<>(); keySet.addAll(localKeySet()); if (this._parent != null) { keySet.addAll(this._parent.getKeySet()); } return keySet; }
[ "public", "Set", "<", "String", ">", "getKeySet", "(", ")", "{", "final", "HashSet", "<", "String", ">", "keySet", "=", "new", "HashSet", "<>", "(", ")", ";", "keySet", ".", "addAll", "(", "localKeySet", "(", ")", ")", ";", "if", "(", "this", ".", ...
Returns a set of all keys, including the parents
[ "Returns", "a", "set", "of", "all", "keys", "including", "the", "parents" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L794-L804
130,819
azkaban/azkaban
az-core/src/main/java/azkaban/utils/Props.java
Props.logProperties
public void logProperties(final Logger logger, final String comment) { logger.info(comment); for (final String key : getKeySet()) { logger.info(" key=" + key + " value=" + get(key)); } }
java
public void logProperties(final Logger logger, final String comment) { logger.info(comment); for (final String key : getKeySet()) { logger.info(" key=" + key + " value=" + get(key)); } }
[ "public", "void", "logProperties", "(", "final", "Logger", "logger", ",", "final", "String", "comment", ")", "{", "logger", ".", "info", "(", "comment", ")", ";", "for", "(", "final", "String", "key", ":", "getKeySet", "(", ")", ")", "{", "logger", "."...
Logs the property in the given logger
[ "Logs", "the", "property", "in", "the", "given", "logger" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L809-L815
130,820
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java
FlowWatcher.handleJobStatusChange
protected synchronized void handleJobStatusChange(final String jobId, final Status status) { final BlockingStatus block = this.map.get(jobId); if (block != null) { block.changeStatus(status); } }
java
protected synchronized void handleJobStatusChange(final String jobId, final Status status) { final BlockingStatus block = this.map.get(jobId); if (block != null) { block.changeStatus(status); } }
[ "protected", "synchronized", "void", "handleJobStatusChange", "(", "final", "String", "jobId", ",", "final", "Status", "status", ")", "{", "final", "BlockingStatus", "block", "=", "this", ".", "map", ".", "get", "(", "jobId", ")", ";", "if", "(", "block", ...
Called to fire events to the JobRunner listeners
[ "Called", "to", "fire", "events", "to", "the", "JobRunner", "listeners" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/event/FlowWatcher.java#L55-L60
130,821
azkaban/azkaban
azkaban-common/src/main/java/azkaban/metric/MetricReportManager.java
MetricReportManager.getInstance
public static MetricReportManager getInstance() { if (instance == null) { synchronized (MetricReportManager.class) { if (instance == null) { logger.info("Instantiating MetricReportManager"); instance = new MetricReportManager(); } } } return instance; }
java
public static MetricReportManager getInstance() { if (instance == null) { synchronized (MetricReportManager.class) { if (instance == null) { logger.info("Instantiating MetricReportManager"); instance = new MetricReportManager(); } } } return instance; }
[ "public", "static", "MetricReportManager", "getInstance", "(", ")", "{", "if", "(", "instance", "==", "null", ")", "{", "synchronized", "(", "MetricReportManager", ".", "class", ")", "{", "if", "(", "instance", "==", "null", ")", "{", "logger", ".", "info"...
Get a singleton object for Metric Manager
[ "Get", "a", "singleton", "object", "for", "Metric", "Manager" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/metric/MetricReportManager.java#L81-L91
130,822
azkaban/azkaban
azkaban-common/src/main/java/azkaban/metric/MetricReportManager.java
MetricReportManager.addMetric
public void addMetric(final IMetric<?> metric) { // metric null or already present if (metric == null) { throw new IllegalArgumentException("Cannot add a null metric"); } if (getMetricFromName(metric.getName()) == null) { logger.debug(String.format("Adding %s metric in Metric Manager", metr...
java
public void addMetric(final IMetric<?> metric) { // metric null or already present if (metric == null) { throw new IllegalArgumentException("Cannot add a null metric"); } if (getMetricFromName(metric.getName()) == null) { logger.debug(String.format("Adding %s metric in Metric Manager", metr...
[ "public", "void", "addMetric", "(", "final", "IMetric", "<", "?", ">", "metric", ")", "{", "// metric null or already present", "if", "(", "metric", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Cannot add a null metric\"", ")", ";", ...
Add a metric to be managed by Metric Manager
[ "Add", "a", "metric", "to", "be", "managed", "by", "Metric", "Manager" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/metric/MetricReportManager.java#L152-L165
130,823
azkaban/azkaban
azkaban-common/src/main/java/azkaban/metric/MetricReportManager.java
MetricReportManager.getMetricFromName
public IMetric<?> getMetricFromName(final String name) { IMetric<?> metric = null; if (name != null) { for (final IMetric<?> currentMetric : this.metrics) { if (currentMetric.getName().equals(name)) { metric = currentMetric; break; } } } return metric; }
java
public IMetric<?> getMetricFromName(final String name) { IMetric<?> metric = null; if (name != null) { for (final IMetric<?> currentMetric : this.metrics) { if (currentMetric.getName().equals(name)) { metric = currentMetric; break; } } } return metric; }
[ "public", "IMetric", "<", "?", ">", "getMetricFromName", "(", "final", "String", "name", ")", "{", "IMetric", "<", "?", ">", "metric", "=", "null", ";", "if", "(", "name", "!=", "null", ")", "{", "for", "(", "final", "IMetric", "<", "?", ">", "curr...
Get metric object for a given metric name @param name metricName @return metric Object, if found. Otherwise null.
[ "Get", "metric", "object", "for", "a", "given", "metric", "name" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/metric/MetricReportManager.java#L173-L184
130,824
azkaban/azkaban
azkaban-common/src/main/java/azkaban/metric/MetricReportManager.java
MetricReportManager.disableManager
public void disableManager() { logger.info("Disabling Metric Manager"); if (isManagerEnabled) { isManagerEnabled = false; for (final IMetricEmitter emitter : this.metricEmitters) { try { emitter.purgeAllData(); } catch (final MetricException ex) { logger.error("Fa...
java
public void disableManager() { logger.info("Disabling Metric Manager"); if (isManagerEnabled) { isManagerEnabled = false; for (final IMetricEmitter emitter : this.metricEmitters) { try { emitter.purgeAllData(); } catch (final MetricException ex) { logger.error("Fa...
[ "public", "void", "disableManager", "(", ")", "{", "logger", ".", "info", "(", "\"Disabling Metric Manager\"", ")", ";", "if", "(", "isManagerEnabled", ")", "{", "isManagerEnabled", "=", "false", ";", "for", "(", "final", "IMetricEmitter", "emitter", ":", "thi...
Disable Metric Manager and ask all emitters to purge all available data.
[ "Disable", "Metric", "Manager", "and", "ask", "all", "emitters", "to", "purge", "all", "available", "data", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/metric/MetricReportManager.java#L201-L213
130,825
azkaban/azkaban
azkaban-common/src/main/java/azkaban/metric/inmemoryemitter/InMemoryMetricEmitter.java
InMemoryMetricEmitter.getMetrics
public List<InMemoryHistoryNode> getMetrics(final String metricName, final Date from, final Date to, final Boolean useStats) throws ClassCastException { final LinkedList<InMemoryHistoryNode> selectedLists = new LinkedList<>(); if (this.historyListMapping.containsKey(metricName)) { logger.debu...
java
public List<InMemoryHistoryNode> getMetrics(final String metricName, final Date from, final Date to, final Boolean useStats) throws ClassCastException { final LinkedList<InMemoryHistoryNode> selectedLists = new LinkedList<>(); if (this.historyListMapping.containsKey(metricName)) { logger.debu...
[ "public", "List", "<", "InMemoryHistoryNode", ">", "getMetrics", "(", "final", "String", "metricName", ",", "final", "Date", "from", ",", "final", "Date", "to", ",", "final", "Boolean", "useStats", ")", "throws", "ClassCastException", "{", "final", "LinkedList",...
Get snapshots for a given metric at a given time @param metricName name of the metric @param from Start date @param to end date @param useStats get statistically significant points only @return List of snapshots
[ "Get", "snapshots", "for", "a", "given", "metric", "at", "a", "given", "time" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/metric/inmemoryemitter/InMemoryMetricEmitter.java#L114-L141
130,826
azkaban/azkaban
azkaban-common/src/main/java/azkaban/metric/inmemoryemitter/InMemoryMetricEmitter.java
InMemoryMetricEmitter.statBasedSelectMetricHistory
private void statBasedSelectMetricHistory(final LinkedList<InMemoryHistoryNode> selectedLists) throws ClassCastException { logger.debug("selecting snapshots which are far away from mean value"); final DescriptiveStatistics descStats = getDescriptiveStatistics(selectedLists); final Double mean = descSt...
java
private void statBasedSelectMetricHistory(final LinkedList<InMemoryHistoryNode> selectedLists) throws ClassCastException { logger.debug("selecting snapshots which are far away from mean value"); final DescriptiveStatistics descStats = getDescriptiveStatistics(selectedLists); final Double mean = descSt...
[ "private", "void", "statBasedSelectMetricHistory", "(", "final", "LinkedList", "<", "InMemoryHistoryNode", ">", "selectedLists", ")", "throws", "ClassCastException", "{", "logger", ".", "debug", "(", "\"selecting snapshots which are far away from mean value\"", ")", ";", "f...
filter snapshots using statistically significant points only @param selectedLists list of snapshots
[ "filter", "snapshots", "using", "statistically", "significant", "points", "only" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/metric/inmemoryemitter/InMemoryMetricEmitter.java#L148-L165
130,827
azkaban/azkaban
azkaban-common/src/main/java/azkaban/metric/inmemoryemitter/InMemoryMetricEmitter.java
InMemoryMetricEmitter.generalSelectMetricHistory
private void generalSelectMetricHistory(final LinkedList<InMemoryHistoryNode> selectedLists) { logger.debug("selecting snapshots evenly from across the time interval"); if (selectedLists.size() > this.numInstances) { final double step = (double) selectedLists.size() / this.numInstances; long nextInd...
java
private void generalSelectMetricHistory(final LinkedList<InMemoryHistoryNode> selectedLists) { logger.debug("selecting snapshots evenly from across the time interval"); if (selectedLists.size() > this.numInstances) { final double step = (double) selectedLists.size() / this.numInstances; long nextInd...
[ "private", "void", "generalSelectMetricHistory", "(", "final", "LinkedList", "<", "InMemoryHistoryNode", ">", "selectedLists", ")", "{", "logger", ".", "debug", "(", "\"selecting snapshots evenly from across the time interval\"", ")", ";", "if", "(", "selectedLists", ".",...
filter snapshots by evenly selecting points across the interval @param selectedLists list of snapshots
[ "filter", "snapshots", "by", "evenly", "selecting", "points", "across", "the", "interval" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/metric/inmemoryemitter/InMemoryMetricEmitter.java#L182-L199
130,828
azkaban/azkaban
azkaban-common/src/main/java/azkaban/metric/inmemoryemitter/InMemoryMetricEmitter.java
InMemoryMetricEmitter.cleanUsingTime
private void cleanUsingTime(final String metricName, final Date firstAllowedDate) { if (this.historyListMapping.containsKey(metricName) && this.historyListMapping.get(metricName) != null) { synchronized (this.historyListMapping.get(metricName)) { InMemoryHistoryNode firstNode = this.historyLi...
java
private void cleanUsingTime(final String metricName, final Date firstAllowedDate) { if (this.historyListMapping.containsKey(metricName) && this.historyListMapping.get(metricName) != null) { synchronized (this.historyListMapping.get(metricName)) { InMemoryHistoryNode firstNode = this.historyLi...
[ "private", "void", "cleanUsingTime", "(", "final", "String", "metricName", ",", "final", "Date", "firstAllowedDate", ")", "{", "if", "(", "this", ".", "historyListMapping", ".", "containsKey", "(", "metricName", ")", "&&", "this", ".", "historyListMapping", ".",...
Remove snapshots to maintain reporting interval @param metricName Name of the metric @param firstAllowedDate End date of the interval
[ "Remove", "snapshots", "to", "maintain", "reporting", "interval" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/metric/inmemoryemitter/InMemoryMetricEmitter.java#L207-L231
130,829
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/RunningExecutionsUpdater.java
RunningExecutionsUpdater.updateExecutions
@SuppressWarnings("unchecked") public void updateExecutions() { this.updaterStage.set("Starting update all flows."); final Map<Optional<Executor>, List<ExecutableFlow>> exFlowMap = getFlowToExecutorMap(); final ArrayList<ExecutableFlow> finalizeFlows = new ArrayList<>(); for (final Map.Entry<...
java
@SuppressWarnings("unchecked") public void updateExecutions() { this.updaterStage.set("Starting update all flows."); final Map<Optional<Executor>, List<ExecutableFlow>> exFlowMap = getFlowToExecutorMap(); final ArrayList<ExecutableFlow> finalizeFlows = new ArrayList<>(); for (final Map.Entry<...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "updateExecutions", "(", ")", "{", "this", ".", "updaterStage", ".", "set", "(", "\"Starting update all flows.\"", ")", ";", "final", "Map", "<", "Optional", "<", "Executor", ">", ",", "List...
Updates running executions.
[ "Updates", "running", "executions", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/RunningExecutionsUpdater.java#L69-L134
130,830
azkaban/azkaban
az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaDepInstanceCollection.java
KafkaDepInstanceCollection.getTopicList
public synchronized List<String> getTopicList() { final List<String> res = new ArrayList<>(this.topicEventMap.keySet()); return res; }
java
public synchronized List<String> getTopicList() { final List<String> res = new ArrayList<>(this.topicEventMap.keySet()); return res; }
[ "public", "synchronized", "List", "<", "String", ">", "getTopicList", "(", ")", "{", "final", "List", "<", "String", ">", "res", "=", "new", "ArrayList", "<>", "(", "this", ".", "topicEventMap", ".", "keySet", "(", ")", ")", ";", "return", "res", ";", ...
Get a list of topics. @return List of String of topics
[ "Get", "a", "list", "of", "topics", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaDepInstanceCollection.java#L85-L88
130,831
azkaban/azkaban
az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaDepInstanceCollection.java
KafkaDepInstanceCollection.regexInTopic
public synchronized Set<String> regexInTopic(final String topic, final String payload) { final Set<String> res = new HashSet<>(); final Map<String, List<KafkaDependencyInstanceContext>> eventMap = this.topicEventMap.get(topic); if (eventMap == null) { return Collections.emptySet(); } for (fin...
java
public synchronized Set<String> regexInTopic(final String topic, final String payload) { final Set<String> res = new HashSet<>(); final Map<String, List<KafkaDependencyInstanceContext>> eventMap = this.topicEventMap.get(topic); if (eventMap == null) { return Collections.emptySet(); } for (fin...
[ "public", "synchronized", "Set", "<", "String", ">", "regexInTopic", "(", "final", "String", "topic", ",", "final", "String", "payload", ")", "{", "final", "Set", "<", "String", ">", "res", "=", "new", "HashSet", "<>", "(", ")", ";", "final", "Map", "<...
Return a set of pattern that matches with the payload. @param payload and topic @return regexs that meet the customized requirement
[ "Return", "a", "set", "of", "pattern", "that", "matches", "with", "the", "payload", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaDepInstanceCollection.java#L95-L109
130,832
azkaban/azkaban
az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaDepInstanceCollection.java
KafkaDepInstanceCollection.getDepsByTopicAndEvent
public synchronized List<KafkaDependencyInstanceContext> getDepsByTopicAndEvent(final String topic, final String regex) { final Map<String, List<KafkaDependencyInstanceContext>> regexMap = this.topicEventMap.get(topic); if (regexMap != null) { return regexMap.get(regex); } return Collections...
java
public synchronized List<KafkaDependencyInstanceContext> getDepsByTopicAndEvent(final String topic, final String regex) { final Map<String, List<KafkaDependencyInstanceContext>> regexMap = this.topicEventMap.get(topic); if (regexMap != null) { return regexMap.get(regex); } return Collections...
[ "public", "synchronized", "List", "<", "KafkaDependencyInstanceContext", ">", "getDepsByTopicAndEvent", "(", "final", "String", "topic", ",", "final", "String", "regex", ")", "{", "final", "Map", "<", "String", ",", "List", "<", "KafkaDependencyInstanceContext", ">"...
Returns dependencies with topic and dependency's event regular expression match
[ "Returns", "dependencies", "with", "topic", "and", "dependency", "s", "event", "regular", "expression", "match" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaDepInstanceCollection.java#L114-L121
130,833
azkaban/azkaban
azkaban-common/src/main/java/azkaban/event/Event.java
Event.create
public static Event create(final Object runner, final EventType type, final EventData eventData) throws NullPointerException { Preconditions.checkNotNull(eventData, "EventData was null"); return new Event(runner, type, eventData); }
java
public static Event create(final Object runner, final EventType type, final EventData eventData) throws NullPointerException { Preconditions.checkNotNull(eventData, "EventData was null"); return new Event(runner, type, eventData); }
[ "public", "static", "Event", "create", "(", "final", "Object", "runner", ",", "final", "EventType", "type", ",", "final", "EventData", "eventData", ")", "throws", "NullPointerException", "{", "Preconditions", ".", "checkNotNull", "(", "eventData", ",", "\"EventDat...
Creates a new event. @param runner runner. @param type type. @param eventData EventData, null is not allowed. @return New Event instance. @throws NullPointerException if EventData is null.
[ "Creates", "a", "new", "event", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/event/Event.java#L45-L49
130,834
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/WebUtils.java
WebUtils.getRealClientIpAddr
public static String getRealClientIpAddr(final Map<String, String> httpHeaders, final String remoteAddr) { // If some upstream device added an X-Forwarded-For header // use it for the client ip // This will support scenarios where load balancers or gateways // front the Azkaban web server and a c...
java
public static String getRealClientIpAddr(final Map<String, String> httpHeaders, final String remoteAddr) { // If some upstream device added an X-Forwarded-For header // use it for the client ip // This will support scenarios where load balancers or gateways // front the Azkaban web server and a c...
[ "public", "static", "String", "getRealClientIpAddr", "(", "final", "Map", "<", "String", ",", "String", ">", "httpHeaders", ",", "final", "String", "remoteAddr", ")", "{", "// If some upstream device added an X-Forwarded-For header", "// use it for the client ip", "// This ...
Gets the actual client IP address inspecting the X-Forwarded-For HTTP header or using the provided 'remote IP address' from the low level TCP connection from the client. If multiple IP addresses are provided in the X-Forwarded-For header then the first one (first hop) is used @param httpHeaders List of HTTP headers f...
[ "Gets", "the", "actual", "client", "IP", "address", "inspecting", "the", "X", "-", "Forwarded", "-", "For", "HTTP", "header", "or", "using", "the", "provided", "remote", "IP", "address", "from", "the", "low", "level", "TCP", "connection", "from", "the", "c...
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/WebUtils.java#L87-L109
130,835
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java
FlowLoaderUtils.setPropsInYamlFile
public static void setPropsInYamlFile(final String path, final File flowFile, final Props prop) { final DumperOptions options = new DumperOptions(); options.setDefaultFlowStyle(FlowStyle.BLOCK); final NodeBean nodeBean = FlowLoaderUtils.setPropsInNodeBean(path, flowFile, prop); try (final BufferedWriter...
java
public static void setPropsInYamlFile(final String path, final File flowFile, final Props prop) { final DumperOptions options = new DumperOptions(); options.setDefaultFlowStyle(FlowStyle.BLOCK); final NodeBean nodeBean = FlowLoaderUtils.setPropsInNodeBean(path, flowFile, prop); try (final BufferedWriter...
[ "public", "static", "void", "setPropsInYamlFile", "(", "final", "String", "path", ",", "final", "File", "flowFile", ",", "final", "Props", "prop", ")", "{", "final", "DumperOptions", "options", "=", "new", "DumperOptions", "(", ")", ";", "options", ".", "set...
Sets props in flow yaml file. @param path the flow or job path delimited by ":", e.g. "flow:subflow1:subflow2:job3" @param flowFile the flow yaml file @param prop the props to set
[ "Sets", "props", "in", "flow", "yaml", "file", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java#L61-L72
130,836
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java
FlowLoaderUtils.setPropsInNodeBean
public static NodeBean setPropsInNodeBean(final String path, final File flowFile, final Props prop) { final NodeBeanLoader loader = new NodeBeanLoader(); try { final NodeBean nodeBean = loader.load(flowFile); final String[] pathList = path.split(Constants.PATH_DELIMITER); if (overridePro...
java
public static NodeBean setPropsInNodeBean(final String path, final File flowFile, final Props prop) { final NodeBeanLoader loader = new NodeBeanLoader(); try { final NodeBean nodeBean = loader.load(flowFile); final String[] pathList = path.split(Constants.PATH_DELIMITER); if (overridePro...
[ "public", "static", "NodeBean", "setPropsInNodeBean", "(", "final", "String", "path", ",", "final", "File", "flowFile", ",", "final", "Props", "prop", ")", "{", "final", "NodeBeanLoader", "loader", "=", "new", "NodeBeanLoader", "(", ")", ";", "try", "{", "fi...
Sets props in node bean. @param path the flow or job path delimited by ":", e.g. "flow:subflow1:subflow2:job3" @param flowFile the flow yaml file @param prop the props to set @return the node bean
[ "Sets", "props", "in", "node", "bean", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java#L82-L97
130,837
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java
FlowLoaderUtils.overridePropsInNodeBean
private static boolean overridePropsInNodeBean(final NodeBean nodeBean, final String[] pathList, final int idx, final Props prop) { if (idx < pathList.length && nodeBean.getName().equals(pathList[idx])) { if (idx == pathList.length - 1) { if (prop.containsKey(Constants.NODE_TYPE)) { no...
java
private static boolean overridePropsInNodeBean(final NodeBean nodeBean, final String[] pathList, final int idx, final Props prop) { if (idx < pathList.length && nodeBean.getName().equals(pathList[idx])) { if (idx == pathList.length - 1) { if (prop.containsKey(Constants.NODE_TYPE)) { no...
[ "private", "static", "boolean", "overridePropsInNodeBean", "(", "final", "NodeBean", "nodeBean", ",", "final", "String", "[", "]", "pathList", ",", "final", "int", "idx", ",", "final", "Props", "prop", ")", "{", "if", "(", "idx", "<", "pathList", ".", "len...
Helper method to recursively find the node to override props. @param nodeBean the node bean @param pathList the path list @param idx the idx @param prop the props to override @return the boolean
[ "Helper", "method", "to", "recursively", "find", "the", "node", "to", "override", "props", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java#L108-L127
130,838
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java
FlowLoaderUtils.getPropsFromYamlFile
public static Props getPropsFromYamlFile(final String path, final File flowFile) { final List<Props> propsList = new ArrayList<>(); final NodeBeanLoader loader = new NodeBeanLoader(); try { final NodeBean nodeBean = loader.load(flowFile); final String[] pathList = path.split(Constants.PATH_DELI...
java
public static Props getPropsFromYamlFile(final String path, final File flowFile) { final List<Props> propsList = new ArrayList<>(); final NodeBeanLoader loader = new NodeBeanLoader(); try { final NodeBean nodeBean = loader.load(flowFile); final String[] pathList = path.split(Constants.PATH_DELI...
[ "public", "static", "Props", "getPropsFromYamlFile", "(", "final", "String", "path", ",", "final", "File", "flowFile", ")", "{", "final", "List", "<", "Props", ">", "propsList", "=", "new", "ArrayList", "<>", "(", ")", ";", "final", "NodeBeanLoader", "loader...
Gets flow or job props from flow yaml file. @param path the flow or job path delimited by ":", e.g. "flow:subflow1:subflow2:job3" @param flowFile the flow yaml file @return the props from yaml file
[ "Gets", "flow", "or", "job", "props", "from", "flow", "yaml", "file", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java#L136-L154
130,839
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java
FlowLoaderUtils.findPropsFromNodeBean
private static boolean findPropsFromNodeBean(final NodeBean nodeBean, final String[] pathList, final int idx, final List<Props> propsList) { if (idx < pathList.length && nodeBean.getName().equals(pathList[idx])) { if (idx == pathList.length - 1) { propsList.add(nodeBean.getProps()); retu...
java
private static boolean findPropsFromNodeBean(final NodeBean nodeBean, final String[] pathList, final int idx, final List<Props> propsList) { if (idx < pathList.length && nodeBean.getName().equals(pathList[idx])) { if (idx == pathList.length - 1) { propsList.add(nodeBean.getProps()); retu...
[ "private", "static", "boolean", "findPropsFromNodeBean", "(", "final", "NodeBean", "nodeBean", ",", "final", "String", "[", "]", "pathList", ",", "final", "int", "idx", ",", "final", "List", "<", "Props", ">", "propsList", ")", "{", "if", "(", "idx", "<", ...
Helper method to recursively find props from node bean. @param nodeBean the node bean @param pathList the path list @param idx the idx @param propsList the props list @return the boolean
[ "Helper", "method", "to", "recursively", "find", "props", "from", "node", "bean", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java#L165-L179
130,840
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java
FlowLoaderUtils.addEmailPropsToFlow
public static void addEmailPropsToFlow(final Flow flow, final Props prop) { final List<String> successEmailList = prop.getStringList(CommonJobProperties.SUCCESS_EMAILS, Collections.EMPTY_LIST); final Set<String> successEmail = new HashSet<>(); for (final String email : successEmailList) ...
java
public static void addEmailPropsToFlow(final Flow flow, final Props prop) { final List<String> successEmailList = prop.getStringList(CommonJobProperties.SUCCESS_EMAILS, Collections.EMPTY_LIST); final Set<String> successEmail = new HashSet<>(); for (final String email : successEmailList) ...
[ "public", "static", "void", "addEmailPropsToFlow", "(", "final", "Flow", "flow", ",", "final", "Props", "prop", ")", "{", "final", "List", "<", "String", ">", "successEmailList", "=", "prop", ".", "getStringList", "(", "CommonJobProperties", ".", "SUCCESS_EMAILS...
Adds email properties to a flow. @param flow the flow @param prop the prop
[ "Adds", "email", "properties", "to", "a", "flow", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java#L198-L226
130,841
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java
FlowLoaderUtils.generateFlowLoaderReport
public static ValidationReport generateFlowLoaderReport(final Set<String> errors) { final ValidationReport report = new ValidationReport(); report.addErrorMsgs(errors); return report; }
java
public static ValidationReport generateFlowLoaderReport(final Set<String> errors) { final ValidationReport report = new ValidationReport(); report.addErrorMsgs(errors); return report; }
[ "public", "static", "ValidationReport", "generateFlowLoaderReport", "(", "final", "Set", "<", "String", ">", "errors", ")", "{", "final", "ValidationReport", "report", "=", "new", "ValidationReport", "(", ")", ";", "report", ".", "addErrorMsgs", "(", "errors", "...
Generate flow loader report validation report. @param errors the errors @return the validation report
[ "Generate", "flow", "loader", "report", "validation", "report", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java#L234-L238
130,842
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java
FlowLoaderUtils.checkJobProperties
public static void checkJobProperties(final int projectId, final Props props, final Map<String, Props> jobPropsMap, final Set<String> errors) { // if project is in the memory check whitelist, then we don't need to check // its memory settings if (ProjectWhitelist.isProjectWhitelisted(projectId, ...
java
public static void checkJobProperties(final int projectId, final Props props, final Map<String, Props> jobPropsMap, final Set<String> errors) { // if project is in the memory check whitelist, then we don't need to check // its memory settings if (ProjectWhitelist.isProjectWhitelisted(projectId, ...
[ "public", "static", "void", "checkJobProperties", "(", "final", "int", "projectId", ",", "final", "Props", "props", ",", "final", "Map", "<", "String", ",", "Props", ">", "jobPropsMap", ",", "final", "Set", "<", "String", ">", "errors", ")", "{", "// if pr...
Check job properties. @param projectId the project id @param props the server props @param jobPropsMap the job props map @param errors the errors
[ "Check", "job", "properties", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java#L248-L280
130,843
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java
FlowLoaderUtils.cleanUpDir
public static void cleanUpDir(final File dir) { try { if (dir != null && dir.exists()) { FileUtils.deleteDirectory(dir); } } catch (final IOException e) { logger.error("Failed to delete the directory", e); dir.deleteOnExit(); } }
java
public static void cleanUpDir(final File dir) { try { if (dir != null && dir.exists()) { FileUtils.deleteDirectory(dir); } } catch (final IOException e) { logger.error("Failed to delete the directory", e); dir.deleteOnExit(); } }
[ "public", "static", "void", "cleanUpDir", "(", "final", "File", "dir", ")", "{", "try", "{", "if", "(", "dir", "!=", "null", "&&", "dir", ".", "exists", "(", ")", ")", "{", "FileUtils", ".", "deleteDirectory", "(", "dir", ")", ";", "}", "}", "catch...
Clean up the directory. @param dir the directory to be deleted
[ "Clean", "up", "the", "directory", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java#L287-L296
130,844
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/ProjectManager.java
ProjectManager.getProject
public Project getProject(final String name) { Project fetchedProject = this.projectsByName.get(name); if (fetchedProject == null) { try { fetchedProject = this.projectLoader.fetchProjectByName(name); if (fetchedProject != null) { logger.info("Project " + name + " not found in ca...
java
public Project getProject(final String name) { Project fetchedProject = this.projectsByName.get(name); if (fetchedProject == null) { try { fetchedProject = this.projectLoader.fetchProjectByName(name); if (fetchedProject != null) { logger.info("Project " + name + " not found in ca...
[ "public", "Project", "getProject", "(", "final", "String", "name", ")", "{", "Project", "fetchedProject", "=", "this", ".", "projectsByName", ".", "get", "(", "name", ")", ";", "if", "(", "fetchedProject", "==", "null", ")", "{", "try", "{", "fetchedProjec...
fetch active project by project name. Queries the cache first then db if not found
[ "fetch", "active", "project", "by", "project", "name", ".", "Queries", "the", "cache", "first", "then", "db", "if", "not", "found" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/ProjectManager.java#L232-L247
130,845
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/ProjectManager.java
ProjectManager.getProject
public Project getProject(final int id) { Project fetchedProject = this.projectsById.get(id); if (fetchedProject == null) { try { fetchedProject = this.projectLoader.fetchProjectById(id); } catch (final ProjectManagerException e) { logger.error("Could not load project from store.", e...
java
public Project getProject(final int id) { Project fetchedProject = this.projectsById.get(id); if (fetchedProject == null) { try { fetchedProject = this.projectLoader.fetchProjectById(id); } catch (final ProjectManagerException e) { logger.error("Could not load project from store.", e...
[ "public", "Project", "getProject", "(", "final", "int", "id", ")", "{", "Project", "fetchedProject", "=", "this", ".", "projectsById", ".", "get", "(", "id", ")", ";", "if", "(", "fetchedProject", "==", "null", ")", "{", "try", "{", "fetchedProject", "="...
fetch active project from cache and inactive projects from db by project_id
[ "fetch", "active", "project", "from", "cache", "and", "inactive", "projects", "from", "db", "by", "project_id" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/ProjectManager.java#L252-L262
130,846
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/ProjectManager.java
ProjectManager.purgeProject
public synchronized Project purgeProject(final Project project, final User deleter) throws ProjectManagerException { this.projectLoader.cleanOlderProjectVersion(project.getId(), project.getVersion() + 1, Collections.emptyList()); this.projectLoader .postEvent(project, EventType.PURGE, dele...
java
public synchronized Project purgeProject(final Project project, final User deleter) throws ProjectManagerException { this.projectLoader.cleanOlderProjectVersion(project.getId(), project.getVersion() + 1, Collections.emptyList()); this.projectLoader .postEvent(project, EventType.PURGE, dele...
[ "public", "synchronized", "Project", "purgeProject", "(", "final", "Project", "project", ",", "final", "User", "deleter", ")", "throws", "ProjectManagerException", "{", "this", ".", "projectLoader", ".", "cleanOlderProjectVersion", "(", "project", ".", "getId", "(",...
Permanently delete all project files and properties data for all versions of a project and log event in project_events table
[ "Permanently", "delete", "all", "project", "files", "and", "properties", "data", "for", "all", "versions", "of", "a", "project", "and", "log", "event", "in", "project_events", "table" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/ProjectManager.java#L315-L323
130,847
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/StringUtils.java
StringUtils.join
public static String join(final Collection<String> list, final String delimiter) { final StringBuffer buffer = new StringBuffer(); for (final String str : list) { buffer.append(str); buffer.append(delimiter); } return buffer.toString(); }
java
public static String join(final Collection<String> list, final String delimiter) { final StringBuffer buffer = new StringBuffer(); for (final String str : list) { buffer.append(str); buffer.append(delimiter); } return buffer.toString(); }
[ "public", "static", "String", "join", "(", "final", "Collection", "<", "String", ">", "list", ",", "final", "String", "delimiter", ")", "{", "final", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "final", "String", "str",...
Use this when you don't want to include Apache Common's string for plugins.
[ "Use", "this", "when", "you", "don", "t", "want", "to", "include", "Apache", "Common", "s", "string", "for", "plugins", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/StringUtils.java#L60-L68
130,848
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/StringUtils.java
StringUtils.join2
public static String join2(final Collection<String> list, final String delimiter) { final StringBuffer buffer = new StringBuffer(); boolean first = true; for (final String str : list) { if (!first) { buffer.append(delimiter); } buffer.append(str); first = false; } r...
java
public static String join2(final Collection<String> list, final String delimiter) { final StringBuffer buffer = new StringBuffer(); boolean first = true; for (final String str : list) { if (!first) { buffer.append(delimiter); } buffer.append(str); first = false; } r...
[ "public", "static", "String", "join2", "(", "final", "Collection", "<", "String", ">", "list", ",", "final", "String", "delimiter", ")", "{", "final", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "boolean", "first", "=", "true", ";"...
Don't bother to add delimiter for last element @return String - elements in the list separated by delimiter
[ "Don", "t", "bother", "to", "add", "delimiter", "for", "last", "element" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/StringUtils.java#L75-L88
130,849
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectServlet.java
ProjectServlet.handleAjaxAction
private void handleAjaxAction(final HttpServletRequest req, final HttpServletResponse resp, final Session session, final ProjectManager manager) throws ServletException, IOException { final String ajaxName = getParam(req, "ajax"); final HashMap<String, Object> ret = new HashMap<>(); if (ajaxNa...
java
private void handleAjaxAction(final HttpServletRequest req, final HttpServletResponse resp, final Session session, final ProjectManager manager) throws ServletException, IOException { final String ajaxName = getParam(req, "ajax"); final HashMap<String, Object> ret = new HashMap<>(); if (ajaxNa...
[ "private", "void", "handleAjaxAction", "(", "final", "HttpServletRequest", "req", ",", "final", "HttpServletResponse", "resp", ",", "final", "Session", "session", ",", "final", "ProjectManager", "manager", ")", "throws", "ServletException", ",", "IOException", "{", ...
ProjectServlet class now handles ajax requests. It returns a @SimplifiedProject object: information regarding projects, and information regarding user and project association
[ "ProjectServlet", "class", "now", "handles", "ajax", "requests", ".", "It", "returns", "a" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectServlet.java#L88-L105
130,850
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectServlet.java
ProjectServlet.handlePageRender
private void handlePageRender(final HttpServletRequest req, final HttpServletResponse resp, final Session session, final ProjectManager manager) { final User user = session.getUser(); final Page page = newPage(req, resp, session, "azkaban/webapp/servlet/velocity/index.vm"); if (this.lockdown...
java
private void handlePageRender(final HttpServletRequest req, final HttpServletResponse resp, final Session session, final ProjectManager manager) { final User user = session.getUser(); final Page page = newPage(req, resp, session, "azkaban/webapp/servlet/velocity/index.vm"); if (this.lockdown...
[ "private", "void", "handlePageRender", "(", "final", "HttpServletRequest", "req", ",", "final", "HttpServletResponse", "resp", ",", "final", "Session", "session", ",", "final", "ProjectManager", "manager", ")", "{", "final", "User", "user", "=", "session", ".", ...
Renders the user homepage that users see when they log in
[ "Renders", "the", "user", "homepage", "that", "users", "see", "when", "they", "log", "in" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectServlet.java#L154-L181
130,851
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/flowtrigger/quartz/FlowTriggerScheduler.java
FlowTriggerScheduler.schedule
public void schedule(final Project project, final String submitUser) throws ProjectManagerException, IOException, SchedulerException { for (final Flow flow : project.getFlows()) { //todo chengren311: we should validate embedded flow shouldn't have flow trigger defined. if (flow.isEmbeddedFlow()) ...
java
public void schedule(final Project project, final String submitUser) throws ProjectManagerException, IOException, SchedulerException { for (final Flow flow : project.getFlows()) { //todo chengren311: we should validate embedded flow shouldn't have flow trigger defined. if (flow.isEmbeddedFlow()) ...
[ "public", "void", "schedule", "(", "final", "Project", "project", ",", "final", "String", "submitUser", ")", "throws", "ProjectManagerException", ",", "IOException", ",", "SchedulerException", "{", "for", "(", "final", "Flow", "flow", ":", "project", ".", "getFl...
Schedule flows containing flow triggers for this project.
[ "Schedule", "flows", "containing", "flow", "triggers", "for", "this", "project", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/quartz/FlowTriggerScheduler.java#L68-L119
130,852
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/flowtrigger/quartz/FlowTriggerScheduler.java
FlowTriggerScheduler.getScheduledFlowTriggerJobs
public List<ScheduledFlowTrigger> getScheduledFlowTriggerJobs() { try { final Scheduler quartzScheduler = this.scheduler.getScheduler(); final List<String> groupNames = quartzScheduler.getJobGroupNames(); final List<ScheduledFlowTrigger> flowTriggerJobDetails = new ArrayList<>(); for (final...
java
public List<ScheduledFlowTrigger> getScheduledFlowTriggerJobs() { try { final Scheduler quartzScheduler = this.scheduler.getScheduler(); final List<String> groupNames = quartzScheduler.getJobGroupNames(); final List<ScheduledFlowTrigger> flowTriggerJobDetails = new ArrayList<>(); for (final...
[ "public", "List", "<", "ScheduledFlowTrigger", ">", "getScheduledFlowTriggerJobs", "(", ")", "{", "try", "{", "final", "Scheduler", "quartzScheduler", "=", "this", ".", "scheduler", ".", "getScheduler", "(", ")", ";", "final", "List", "<", "String", ">", "grou...
Retrieve the list of scheduled flow triggers from quartz database
[ "Retrieve", "the", "list", "of", "scheduled", "flow", "triggers", "from", "quartz", "database" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/quartz/FlowTriggerScheduler.java#L136-L175
130,853
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/flowtrigger/quartz/FlowTriggerScheduler.java
FlowTriggerScheduler.unschedule
public void unschedule(final Project project) throws SchedulerException { for (final Flow flow : project.getFlows()) { if (!flow.isEmbeddedFlow()) { try { if (this.scheduler .unscheduleJob(FlowTriggerQuartzJob.JOB_NAME, generateGroupName(flow))) { logger.info("Flow ...
java
public void unschedule(final Project project) throws SchedulerException { for (final Flow flow : project.getFlows()) { if (!flow.isEmbeddedFlow()) { try { if (this.scheduler .unscheduleJob(FlowTriggerQuartzJob.JOB_NAME, generateGroupName(flow))) { logger.info("Flow ...
[ "public", "void", "unschedule", "(", "final", "Project", "project", ")", "throws", "SchedulerException", "{", "for", "(", "final", "Flow", "flow", ":", "project", ".", "getFlows", "(", ")", ")", "{", "if", "(", "!", "flow", ".", "isEmbeddedFlow", "(", ")...
Unschedule all possible flows in a project
[ "Unschedule", "all", "possible", "flows", "in", "a", "project" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/quartz/FlowTriggerScheduler.java#L180-L195
130,854
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/StatsServlet.java
StatsServlet.handleGetAllMetricName
private void handleGetAllMetricName(final int executorId, final HttpServletRequest req, final HashMap<String, Object> ret) throws IOException { final Map<String, Object> result; try { result = this.execManagerAdapter.callExecutorStats(executorId, ConnectorParams.STATS_GET_ALL...
java
private void handleGetAllMetricName(final int executorId, final HttpServletRequest req, final HashMap<String, Object> ret) throws IOException { final Map<String, Object> result; try { result = this.execManagerAdapter.callExecutorStats(executorId, ConnectorParams.STATS_GET_ALL...
[ "private", "void", "handleGetAllMetricName", "(", "final", "int", "executorId", ",", "final", "HttpServletRequest", "req", ",", "final", "HashMap", "<", "String", ",", "Object", ">", "ret", ")", "throws", "IOException", "{", "final", "Map", "<", "String", ",",...
Get all metrics tracked by the given executor
[ "Get", "all", "metrics", "tracked", "by", "the", "given", "executor" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/StatsServlet.java#L106-L125
130,855
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/StatsServlet.java
StatsServlet.handleChangeConfigurationRequest
private void handleChangeConfigurationRequest(final int executorId, final String actionName, final HttpServletRequest req, final HashMap<String, Object> ret) throws ServletException, IOException { try { final Map<String, Object> result = this.execManagerAdapter .callExecuto...
java
private void handleChangeConfigurationRequest(final int executorId, final String actionName, final HttpServletRequest req, final HashMap<String, Object> ret) throws ServletException, IOException { try { final Map<String, Object> result = this.execManagerAdapter .callExecuto...
[ "private", "void", "handleChangeConfigurationRequest", "(", "final", "int", "executorId", ",", "final", "String", "actionName", ",", "final", "HttpServletRequest", "req", ",", "final", "HashMap", "<", "String", ",", "Object", ">", "ret", ")", "throws", "ServletExc...
Generic method to facilitate actionName action using Azkaban exec server @param actionName Name of the action
[ "Generic", "method", "to", "facilitate", "actionName", "action", "using", "Azkaban", "exec", "server" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/StatsServlet.java#L132-L150
130,856
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/StatsServlet.java
StatsServlet.getAllParams
private Pair<String, String>[] getAllParams(final HttpServletRequest req) { final List<Pair<String, String>> allParams = new LinkedList<>(); final Iterator it = req.getParameterMap().entrySet().iterator(); while (it.hasNext()) { final Map.Entry pairs = (Map.Entry) it.next(); for (final Object v...
java
private Pair<String, String>[] getAllParams(final HttpServletRequest req) { final List<Pair<String, String>> allParams = new LinkedList<>(); final Iterator it = req.getParameterMap().entrySet().iterator(); while (it.hasNext()) { final Map.Entry pairs = (Map.Entry) it.next(); for (final Object v...
[ "private", "Pair", "<", "String", ",", "String", ">", "[", "]", "getAllParams", "(", "final", "HttpServletRequest", "req", ")", "{", "final", "List", "<", "Pair", "<", "String", ",", "String", ">", ">", "allParams", "=", "new", "LinkedList", "<>", "(", ...
Parse all Http request params
[ "Parse", "all", "Http", "request", "params" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/StatsServlet.java#L219-L231
130,857
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/dag/DagBuilder.java
DagBuilder.createNode
public Node createNode(final String name, final NodeProcessor nodeProcessor) { checkIsBuilt(); if (this.nameToNodeMap.get(name) != null) { throw new DagException(String.format("Node names in %s need to be unique. The name " + "(%s) already exists.", this, name)); } final Node node = new...
java
public Node createNode(final String name, final NodeProcessor nodeProcessor) { checkIsBuilt(); if (this.nameToNodeMap.get(name) != null) { throw new DagException(String.format("Node names in %s need to be unique. The name " + "(%s) already exists.", this, name)); } final Node node = new...
[ "public", "Node", "createNode", "(", "final", "String", "name", ",", "final", "NodeProcessor", "nodeProcessor", ")", "{", "checkIsBuilt", "(", ")", ";", "if", "(", "this", ".", "nameToNodeMap", ".", "get", "(", "name", ")", "!=", "null", ")", "{", "throw...
Creates a new node and adds it to the DagBuilder. @param name name of the node @param nodeProcessor node processor associated with this node @return a new node @throws DagException if the name is not unique in the DAG.
[ "Creates", "a", "new", "node", "and", "adds", "it", "to", "the", "DagBuilder", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/dag/DagBuilder.java#L65-L76
130,858
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/dag/DagBuilder.java
DagBuilder.checkCircularDependencies
private void checkCircularDependencies() { class CircularDependencyChecker { // The nodes that need to be visited private final Set<Node> toVisit = new HashSet<>(DagBuilder.this.nameToNodeMap.values()); // The nodes that have finished traversing all their parent nodes private final Set<Nod...
java
private void checkCircularDependencies() { class CircularDependencyChecker { // The nodes that need to be visited private final Set<Node> toVisit = new HashSet<>(DagBuilder.this.nameToNodeMap.values()); // The nodes that have finished traversing all their parent nodes private final Set<Nod...
[ "private", "void", "checkCircularDependencies", "(", ")", "{", "class", "CircularDependencyChecker", "{", "// The nodes that need to be visited", "private", "final", "Set", "<", "Node", ">", "toVisit", "=", "new", "HashSet", "<>", "(", "DagBuilder", ".", "this", "."...
Checks if the builder contains nodes that form a circular dependency ring. <p>The depth first algorithm is described in this article <a href="https://en.wikipedia.org/wiki/Topological_sorting">https://en.wikipedia.org/wiki/Topological_sorting</a> </p> @throws DagException if true
[ "Checks", "if", "the", "builder", "contains", "nodes", "that", "form", "a", "circular", "dependency", "ring", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/dag/DagBuilder.java#L140-L215
130,859
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java
ExecutionControllerUtils.finalizeFlow
public static void finalizeFlow(final ExecutorLoader executorLoader, final AlerterHolder alerterHolder, final ExecutableFlow flow, final String reason, @Nullable final Throwable originalError) { boolean alertUser = true; // First check if the execution in the datastore is finished. try { ...
java
public static void finalizeFlow(final ExecutorLoader executorLoader, final AlerterHolder alerterHolder, final ExecutableFlow flow, final String reason, @Nullable final Throwable originalError) { boolean alertUser = true; // First check if the execution in the datastore is finished. try { ...
[ "public", "static", "void", "finalizeFlow", "(", "final", "ExecutorLoader", "executorLoader", ",", "final", "AlerterHolder", "alerterHolder", ",", "final", "ExecutableFlow", "flow", ",", "final", "String", "reason", ",", "@", "Nullable", "final", "Throwable", "origi...
If the current status of the execution is not one of the finished statuses, mark the execution as failed in the DB. @param executorLoader the executor loader @param alerterHolder the alerter holder @param flow the execution @param reason reason for finalizing the execution @param originalError the cause, if execution ...
[ "If", "the", "current", "status", "of", "the", "execution", "is", "not", "one", "of", "the", "finished", "statuses", "mark", "the", "execution", "as", "failed", "in", "the", "DB", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java#L45-L79
130,860
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java
ExecutionControllerUtils.alertUserOnFlowFinished
public static void alertUserOnFlowFinished(final ExecutableFlow flow, final AlerterHolder alerterHolder, final String[] extraReasons) { final ExecutionOptions options = flow.getExecutionOptions(); final Alerter mailAlerter = alerterHolder.get("email"); if (flow.getStatus() != Status.SUCCEEDED) { ...
java
public static void alertUserOnFlowFinished(final ExecutableFlow flow, final AlerterHolder alerterHolder, final String[] extraReasons) { final ExecutionOptions options = flow.getExecutionOptions(); final Alerter mailAlerter = alerterHolder.get("email"); if (flow.getStatus() != Status.SUCCEEDED) { ...
[ "public", "static", "void", "alertUserOnFlowFinished", "(", "final", "ExecutableFlow", "flow", ",", "final", "AlerterHolder", "alerterHolder", ",", "final", "String", "[", "]", "extraReasons", ")", "{", "final", "ExecutionOptions", "options", "=", "flow", ".", "ge...
When a flow is finished, alert the user as is configured in the execution options. @param flow the execution @param alerterHolder the alerter holder @param extraReasons the extra reasons for alerting
[ "When", "a", "flow", "is", "finished", "alert", "the", "user", "as", "is", "configured", "in", "the", "execution", "options", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java#L88-L137
130,861
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java
ExecutionControllerUtils.alertUserOnFirstError
public static void alertUserOnFirstError(final ExecutableFlow flow, final AlerterHolder alerterHolder) { final ExecutionOptions options = flow.getExecutionOptions(); if (options.getNotifyOnFirstFailure()) { logger.info("Alert on first error of execution " + flow.getExecutionId()); final Alerte...
java
public static void alertUserOnFirstError(final ExecutableFlow flow, final AlerterHolder alerterHolder) { final ExecutionOptions options = flow.getExecutionOptions(); if (options.getNotifyOnFirstFailure()) { logger.info("Alert on first error of execution " + flow.getExecutionId()); final Alerte...
[ "public", "static", "void", "alertUserOnFirstError", "(", "final", "ExecutableFlow", "flow", ",", "final", "AlerterHolder", "alerterHolder", ")", "{", "final", "ExecutionOptions", "options", "=", "flow", ".", "getExecutionOptions", "(", ")", ";", "if", "(", "optio...
Alert the user when the flow has encountered the first error. @param flow the execution @param alerterHolder the alerter holder
[ "Alert", "the", "user", "when", "the", "flow", "has", "encountered", "the", "first", "error", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java#L145-L171
130,862
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java
ExecutionControllerUtils.getFinalizeFlowReasons
public static String[] getFinalizeFlowReasons(final String reason, final Throwable originalError) { final List<String> reasons = new LinkedList<>(); reasons.add(reason); if (originalError != null) { reasons.add(ExceptionUtils.getStackTrace(originalError)); } return reasons.toArray(new St...
java
public static String[] getFinalizeFlowReasons(final String reason, final Throwable originalError) { final List<String> reasons = new LinkedList<>(); reasons.add(reason); if (originalError != null) { reasons.add(ExceptionUtils.getStackTrace(originalError)); } return reasons.toArray(new St...
[ "public", "static", "String", "[", "]", "getFinalizeFlowReasons", "(", "final", "String", "reason", ",", "final", "Throwable", "originalError", ")", "{", "final", "List", "<", "String", ">", "reasons", "=", "new", "LinkedList", "<>", "(", ")", ";", "reasons"...
Get the reasons to finalize the flow. @param reason the reason @param originalError the original error @return the reasons to finalize the flow
[ "Get", "the", "reasons", "to", "finalize", "the", "flow", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java#L180-L188
130,863
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java
ExecutionControllerUtils.failEverything
public static void failEverything(final ExecutableFlow exFlow) { final long time = System.currentTimeMillis(); for (final ExecutableNode node : exFlow.getExecutableNodes()) { switch (node.getStatus()) { case SUCCEEDED: case FAILED: case KILLED: case SKIPPED: case DI...
java
public static void failEverything(final ExecutableFlow exFlow) { final long time = System.currentTimeMillis(); for (final ExecutableNode node : exFlow.getExecutableNodes()) { switch (node.getStatus()) { case SUCCEEDED: case FAILED: case KILLED: case SKIPPED: case DI...
[ "public", "static", "void", "failEverything", "(", "final", "ExecutableFlow", "exFlow", ")", "{", "final", "long", "time", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "for", "(", "final", "ExecutableNode", "node", ":", "exFlow", ".", "getExecutable...
Set the flow status to failed and fail every node inside the flow. @param exFlow the executable flow
[ "Set", "the", "flow", "status", "to", "failed", "and", "fail", "every", "node", "inside", "the", "flow", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java#L195-L227
130,864
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java
ExecutionControllerUtils.isFinished
public static boolean isFinished(final ExecutableFlow flow) { switch (flow.getStatus()) { case SUCCEEDED: case FAILED: case KILLED: return true; default: return false; } }
java
public static boolean isFinished(final ExecutableFlow flow) { switch (flow.getStatus()) { case SUCCEEDED: case FAILED: case KILLED: return true; default: return false; } }
[ "public", "static", "boolean", "isFinished", "(", "final", "ExecutableFlow", "flow", ")", "{", "switch", "(", "flow", ".", "getStatus", "(", ")", ")", "{", "case", "SUCCEEDED", ":", "case", "FAILED", ":", "case", "KILLED", ":", "return", "true", ";", "de...
Check if the flow status is finished. @param flow the executable flow @return the boolean
[ "Check", "if", "the", "flow", "status", "is", "finished", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionControllerUtils.java#L235-L244
130,865
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java
AzkabanExecutorServer.main
public static void main(final String[] args) throws Exception { // Redirect all std out and err messages into log4j StdOutErrRedirect.redirectOutAndErrToLog(); logger.info("Starting Jetty Azkaban Executor..."); if (System.getSecurityManager() == null) { Policy.setPolicy(new Policy() { @O...
java
public static void main(final String[] args) throws Exception { // Redirect all std out and err messages into log4j StdOutErrRedirect.redirectOutAndErrToLog(); logger.info("Starting Jetty Azkaban Executor..."); if (System.getSecurityManager() == null) { Policy.setPolicy(new Policy() { @O...
[ "public", "static", "void", "main", "(", "final", "String", "[", "]", "args", ")", "throws", "Exception", "{", "// Redirect all std out and err messages into log4j", "StdOutErrRedirect", ".", "redirectOutAndErrToLog", "(", ")", ";", "logger", ".", "info", "(", "\"St...
Azkaban using Jetty
[ "Azkaban", "using", "Jetty" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java#L121-L153
130,866
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java
AzkabanExecutorServer.configureMetricReports
private void configureMetricReports() throws MetricException { final Props props = getAzkabanProps(); if (props != null && props.getBoolean("executor.metric.reports", false)) { logger.info("Starting to configure Metric Reports"); final MetricReportManager metricManager = MetricReportManager.getInsta...
java
private void configureMetricReports() throws MetricException { final Props props = getAzkabanProps(); if (props != null && props.getBoolean("executor.metric.reports", false)) { logger.info("Starting to configure Metric Reports"); final MetricReportManager metricManager = MetricReportManager.getInsta...
[ "private", "void", "configureMetricReports", "(", ")", "throws", "MetricException", "{", "final", "Props", "props", "=", "getAzkabanProps", "(", ")", ";", "if", "(", "props", "!=", "null", "&&", "props", ".", "getBoolean", "(", "\"executor.metric.reports\"", ","...
Configure Metric Reporting as per azkaban.properties settings
[ "Configure", "Metric", "Reporting", "as", "per", "azkaban", ".", "properties", "settings" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java#L301-L342
130,867
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java
AzkabanExecutorServer.loadCustomJMXAttributeProcessor
private void loadCustomJMXAttributeProcessor(final Props props) { final String jmxAttributeEmitter = props.get(CUSTOM_JMX_ATTRIBUTE_PROCESSOR_PROPERTY); if (jmxAttributeEmitter != null) { try { logger.info("jmxAttributeEmitter: " + jmxAttributeEmitter); final Constructor<Props>[] c...
java
private void loadCustomJMXAttributeProcessor(final Props props) { final String jmxAttributeEmitter = props.get(CUSTOM_JMX_ATTRIBUTE_PROCESSOR_PROPERTY); if (jmxAttributeEmitter != null) { try { logger.info("jmxAttributeEmitter: " + jmxAttributeEmitter); final Constructor<Props>[] c...
[ "private", "void", "loadCustomJMXAttributeProcessor", "(", "final", "Props", "props", ")", "{", "final", "String", "jmxAttributeEmitter", "=", "props", ".", "get", "(", "CUSTOM_JMX_ATTRIBUTE_PROCESSOR_PROPERTY", ")", ";", "if", "(", "jmxAttributeEmitter", "!=", "null"...
Load a custom class, which is provided by a configuration CUSTOM_JMX_ATTRIBUTE_PROCESSOR_PROPERTY. This method will try to instantiate an instance of this custom class and with given properties as the argument in the constructor. Basically the custom class must have a constructor that takes an argument with type Prop...
[ "Load", "a", "custom", "class", "which", "is", "provided", "by", "a", "configuration", "CUSTOM_JMX_ATTRIBUTE_PROCESSOR_PROPERTY", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java#L353-L374
130,868
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java
AzkabanExecutorServer.getHost
public String getHost() { if (this.props.containsKey(ConfigurationKeys.AZKABAN_SERVER_HOST_NAME)) { final String hostName = this.props .getString(Constants.ConfigurationKeys.AZKABAN_SERVER_HOST_NAME); if (!StringUtils.isEmpty(hostName)) { return hostName; } } String host...
java
public String getHost() { if (this.props.containsKey(ConfigurationKeys.AZKABAN_SERVER_HOST_NAME)) { final String hostName = this.props .getString(Constants.ConfigurationKeys.AZKABAN_SERVER_HOST_NAME); if (!StringUtils.isEmpty(hostName)) { return hostName; } } String host...
[ "public", "String", "getHost", "(", ")", "{", "if", "(", "this", ".", "props", ".", "containsKey", "(", "ConfigurationKeys", ".", "AZKABAN_SERVER_HOST_NAME", ")", ")", "{", "final", "String", "hostName", "=", "this", ".", "props", ".", "getString", "(", "C...
Get the hostname @return hostname
[ "Get", "the", "hostname" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java#L396-L412
130,869
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java
AzkabanExecutorServer.getPort
public int getPort() { final Connector[] connectors = this.server.getConnectors(); checkState(connectors.length >= 1, "Server must have at least 1 connector"); // The first connector is created upon initializing the server. That's the one that has the port. return connectors[0].getLocalPort(); }
java
public int getPort() { final Connector[] connectors = this.server.getConnectors(); checkState(connectors.length >= 1, "Server must have at least 1 connector"); // The first connector is created upon initializing the server. That's the one that has the port. return connectors[0].getLocalPort(); }
[ "public", "int", "getPort", "(", ")", "{", "final", "Connector", "[", "]", "connectors", "=", "this", ".", "server", ".", "getConnectors", "(", ")", ";", "checkState", "(", "connectors", ".", "length", ">=", "1", ",", "\"Server must have at least 1 connector\"...
Get the current server port @return the port at which the executor server is running
[ "Get", "the", "current", "server", "port" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java#L419-L425
130,870
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/Trigger.java
Trigger.run
@Override public void run() { if (isTriggerExpired()) { logger.info(this + " expired"); return; } final boolean isTriggerConditionMet = this.triggerCondition.isMet(); if (isTriggerConditionMet) { logger.info("Condition " + this.triggerCondition.getExpression() + " met"); for (...
java
@Override public void run() { if (isTriggerExpired()) { logger.info(this + " expired"); return; } final boolean isTriggerConditionMet = this.triggerCondition.isMet(); if (isTriggerConditionMet) { logger.info("Condition " + this.triggerCondition.getExpression() + " met"); for (...
[ "@", "Override", "public", "void", "run", "(", ")", "{", "if", "(", "isTriggerExpired", "(", ")", ")", "{", "logger", ".", "info", "(", "this", "+", "\" expired\"", ")", ";", "return", ";", "}", "final", "boolean", "isTriggerConditionMet", "=", "this", ...
Perform the action if trigger condition is met
[ "Perform", "the", "action", "if", "trigger", "condition", "is", "met" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/Trigger.java#L51-L70
130,871
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
ServerStatisticsServlet.fillRemainingMemoryPercent
protected void fillRemainingMemoryPercent(final ExecutorInfo stats) { if (exists_Bash && exists_Cat && exists_Grep && exists_Meminfo) { try { final ArrayList<String> output = Utils.runProcess("/bin/bash", "-c", "/bin/cat /proc/meminfo | grep -E \"^MemTotal:|^MemFree:|^Buffers:|^Cached:|^Sw...
java
protected void fillRemainingMemoryPercent(final ExecutorInfo stats) { if (exists_Bash && exists_Cat && exists_Grep && exists_Meminfo) { try { final ArrayList<String> output = Utils.runProcess("/bin/bash", "-c", "/bin/cat /proc/meminfo | grep -E \"^MemTotal:|^MemFree:|^Buffers:|^Cached:|^Sw...
[ "protected", "void", "fillRemainingMemoryPercent", "(", "final", "ExecutorInfo", "stats", ")", "{", "if", "(", "exists_Bash", "&&", "exists_Cat", "&&", "exists_Grep", "&&", "exists_Meminfo", ")", "{", "try", "{", "final", "ArrayList", "<", "String", ">", "output...
fill the result set with the percent of the remaining system memory on the server. @param stats reference to the result container which contains all the results, this specific method will only work work on the property "remainingMemory" and "remainingMemoryPercent". NOTE: a double value will be used to present the re...
[ "fill", "the", "result", "set", "with", "the", "percent", "of", "the", "remaining", "system", "memory", "on", "the", "server", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java#L81-L157
130,872
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
ServerStatisticsServlet.populateStatistics
protected synchronized void populateStatistics(final boolean noCache) { //check again before starting the work. if (noCache || System.currentTimeMillis() - lastRefreshedTime > cacheTimeInMilliseconds) { final ExecutorInfo stats = new ExecutorInfo(); fillRemainingMemoryPercent(stats); fillRema...
java
protected synchronized void populateStatistics(final boolean noCache) { //check again before starting the work. if (noCache || System.currentTimeMillis() - lastRefreshedTime > cacheTimeInMilliseconds) { final ExecutorInfo stats = new ExecutorInfo(); fillRemainingMemoryPercent(stats); fillRema...
[ "protected", "synchronized", "void", "populateStatistics", "(", "final", "boolean", "noCache", ")", "{", "//check again before starting the work.", "if", "(", "noCache", "||", "System", ".", "currentTimeMillis", "(", ")", "-", "lastRefreshedTime", ">", "cacheTimeInMilli...
call the data providers to fill the returning data container for statistics data. This function refreshes the static cached copy of data in case if necessary.
[ "call", "the", "data", "providers", "to", "fill", "the", "returning", "data", "container", "for", "statistics", "data", ".", "This", "function", "refreshes", "the", "static", "cached", "copy", "of", "data", "in", "case", "if", "necessary", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java#L178-L190
130,873
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java
ServerStatisticsServlet.fillRemainingFlowCapacityAndLastDispatchedTime
protected void fillRemainingFlowCapacityAndLastDispatchedTime(final ExecutorInfo stats) { final AzkabanExecutorServer server = AzkabanExecutorServer.getApp(); if (server != null) { final FlowRunnerManager runnerMgr = AzkabanExecutorServer.getApp().getFlowRunnerManager(); final int assignedFlows = r...
java
protected void fillRemainingFlowCapacityAndLastDispatchedTime(final ExecutorInfo stats) { final AzkabanExecutorServer server = AzkabanExecutorServer.getApp(); if (server != null) { final FlowRunnerManager runnerMgr = AzkabanExecutorServer.getApp().getFlowRunnerManager(); final int assignedFlows = r...
[ "protected", "void", "fillRemainingFlowCapacityAndLastDispatchedTime", "(", "final", "ExecutorInfo", "stats", ")", "{", "final", "AzkabanExecutorServer", "server", "=", "AzkabanExecutorServer", ".", "getApp", "(", ")", ";", "if", "(", "server", "!=", "null", ")", "{...
fill the result set with the remaining flow capacity . @param stats reference to the result container which contains all the results, this specific method will only work on the property "remainingFlowCapacity".
[ "fill", "the", "result", "set", "with", "the", "remaining", "flow", "capacity", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/ServerStatisticsServlet.java#L198-L211
130,874
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopProxy.java
HadoopProxy.init
public void init(Props sysProps, Props jobProps, final Logger logger) { shouldProxy = sysProps.getBoolean(HadoopSecurityManager.ENABLE_PROXYING, false); jobProps.put(HadoopSecurityManager.ENABLE_PROXYING, Boolean.toString(shouldProxy)); obtainTokens = sysProps.getBoolean(HadoopSecurityManager.OBTAIN_BINARY_...
java
public void init(Props sysProps, Props jobProps, final Logger logger) { shouldProxy = sysProps.getBoolean(HadoopSecurityManager.ENABLE_PROXYING, false); jobProps.put(HadoopSecurityManager.ENABLE_PROXYING, Boolean.toString(shouldProxy)); obtainTokens = sysProps.getBoolean(HadoopSecurityManager.OBTAIN_BINARY_...
[ "public", "void", "init", "(", "Props", "sysProps", ",", "Props", "jobProps", ",", "final", "Logger", "logger", ")", "{", "shouldProxy", "=", "sysProps", ".", "getBoolean", "(", "HadoopSecurityManager", ".", "ENABLE_PROXYING", ",", "false", ")", ";", "jobProps...
Initialize the Hadoop Proxy Object @param sysProps system properties @param jobProps job properties @param logger logger handler
[ "Initialize", "the", "Hadoop", "Proxy", "Object" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopProxy.java#L53-L67
130,875
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopProxy.java
HadoopProxy.setupPropsForProxy
public void setupPropsForProxy(Props props, Props jobProps, final Logger logger) throws Exception { if (isProxyEnabled()) { userToProxy = jobProps.getString(HadoopSecurityManager.USER_TO_PROXY); logger.info("Need to proxy. Getting tokens."); // get tokens in to a file, and put the location i...
java
public void setupPropsForProxy(Props props, Props jobProps, final Logger logger) throws Exception { if (isProxyEnabled()) { userToProxy = jobProps.getString(HadoopSecurityManager.USER_TO_PROXY); logger.info("Need to proxy. Getting tokens."); // get tokens in to a file, and put the location i...
[ "public", "void", "setupPropsForProxy", "(", "Props", "props", ",", "Props", "jobProps", ",", "final", "Logger", "logger", ")", "throws", "Exception", "{", "if", "(", "isProxyEnabled", "(", ")", ")", "{", "userToProxy", "=", "jobProps", ".", "getString", "("...
Setup Job Properties when the proxy is enabled @param props all properties @param jobProps job properties @param logger logger handler
[ "Setup", "Job", "Properties", "when", "the", "proxy", "is", "enabled" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopProxy.java#L76-L85
130,876
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopProxy.java
HadoopProxy.getJVMArgument
public String getJVMArgument(Props sysProps, Props jobProps, final Logger logger) { String secure = ""; if (shouldProxy) { logger.info("Setting up secure proxy info for child process"); secure = " -D" + HadoopSecurityManager.USER_TO_PROXY + "=" + jobProps.getString(HadoopSecurityManager.U...
java
public String getJVMArgument(Props sysProps, Props jobProps, final Logger logger) { String secure = ""; if (shouldProxy) { logger.info("Setting up secure proxy info for child process"); secure = " -D" + HadoopSecurityManager.USER_TO_PROXY + "=" + jobProps.getString(HadoopSecurityManager.U...
[ "public", "String", "getJVMArgument", "(", "Props", "sysProps", ",", "Props", "jobProps", ",", "final", "Logger", "logger", ")", "{", "String", "secure", "=", "\"\"", ";", "if", "(", "shouldProxy", ")", "{", "logger", ".", "info", "(", "\"Setting up secure p...
Generate JVM Proxy Secure Argument @param sysProps system properties @param jobProps job properties @param logger logger handler @return proxy secure JVM argument string
[ "Generate", "JVM", "Proxy", "Secure", "Argument" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopProxy.java#L95-L113
130,877
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopProxy.java
HadoopProxy.cancelHadoopTokens
public void cancelHadoopTokens(final Logger logger) { if (tokenFile == null) { return; } try { hadoopSecurityManager.cancelTokens(tokenFile, userToProxy, logger); } catch (HadoopSecurityManagerException e) { logger.error(e.getCause() + e.getMessage()); } catch (Exception e) { ...
java
public void cancelHadoopTokens(final Logger logger) { if (tokenFile == null) { return; } try { hadoopSecurityManager.cancelTokens(tokenFile, userToProxy, logger); } catch (HadoopSecurityManagerException e) { logger.error(e.getCause() + e.getMessage()); } catch (Exception e) { ...
[ "public", "void", "cancelHadoopTokens", "(", "final", "Logger", "logger", ")", "{", "if", "(", "tokenFile", "==", "null", ")", "{", "return", ";", "}", "try", "{", "hadoopSecurityManager", ".", "cancelTokens", "(", "tokenFile", ",", "userToProxy", ",", "logg...
Cancel Hadoop Tokens @param logger logger handler
[ "Cancel", "Hadoop", "Tokens" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopProxy.java#L120-L134
130,878
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopProxy.java
HadoopProxy.killAllSpawnedHadoopJobs
public void killAllSpawnedHadoopJobs(Props jobProps, final Logger logger) { if (tokenFile == null) { return; // do null check for tokenFile } final String logFilePath = jobProps.getString(CommonJobProperties.JOB_LOG_FILE); logger.info("Log file path is: " + logFilePath); HadoopJobUtils.proxy...
java
public void killAllSpawnedHadoopJobs(Props jobProps, final Logger logger) { if (tokenFile == null) { return; // do null check for tokenFile } final String logFilePath = jobProps.getString(CommonJobProperties.JOB_LOG_FILE); logger.info("Log file path is: " + logFilePath); HadoopJobUtils.proxy...
[ "public", "void", "killAllSpawnedHadoopJobs", "(", "Props", "jobProps", ",", "final", "Logger", "logger", ")", "{", "if", "(", "tokenFile", "==", "null", ")", "{", "return", ";", "// do null check for tokenFile", "}", "final", "String", "logFilePath", "=", "jobP...
Kill all Spawned Hadoop Jobs @param jobProps job properties @param logger logger handler
[ "Kill", "all", "Spawned", "Hadoop", "Jobs" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopProxy.java#L142-L151
130,879
azkaban/azkaban
az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java
ReportalHelper.updateProjectNotifications
public static void updateProjectNotifications(final Project project, final ProjectManager pm) throws ProjectManagerException { final Flow flow = project.getFlows().get(0); // Get all success emails. final ArrayList<String> successEmails = new ArrayList<>(); final String successNotifications = ...
java
public static void updateProjectNotifications(final Project project, final ProjectManager pm) throws ProjectManagerException { final Flow flow = project.getFlows().get(0); // Get all success emails. final ArrayList<String> successEmails = new ArrayList<>(); final String successNotifications = ...
[ "public", "static", "void", "updateProjectNotifications", "(", "final", "Project", "project", ",", "final", "ProjectManager", "pm", ")", "throws", "ProjectManagerException", "{", "final", "Flow", "flow", "=", "project", ".", "getFlows", "(", ")", ".", "get", "("...
Updates the email notifications saved in the project's flow.
[ "Updates", "the", "email", "notifications", "saved", "in", "the", "project", "s", "flow", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java#L112-L159
130,880
azkaban/azkaban
az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java
ReportalHelper.parseUniqueEmails
public static Set<String> parseUniqueEmails(final String emailList, final String splitRegex) { final Set<String> uniqueEmails = new HashSet<>(); if (emailList == null) { return uniqueEmails; } final String[] emails = emailList.trim().split(splitRegex); for (final String email : emails)...
java
public static Set<String> parseUniqueEmails(final String emailList, final String splitRegex) { final Set<String> uniqueEmails = new HashSet<>(); if (emailList == null) { return uniqueEmails; } final String[] emails = emailList.trim().split(splitRegex); for (final String email : emails)...
[ "public", "static", "Set", "<", "String", ">", "parseUniqueEmails", "(", "final", "String", "emailList", ",", "final", "String", "splitRegex", ")", "{", "final", "Set", "<", "String", ">", "uniqueEmails", "=", "new", "HashSet", "<>", "(", ")", ";", "if", ...
Given a string containing multiple emails, splits it based on the given regular expression, and returns a set containing the unique, non-empty emails.
[ "Given", "a", "string", "containing", "multiple", "emails", "splits", "it", "based", "on", "the", "given", "regular", "expression", "and", "returns", "a", "set", "containing", "the", "unique", "non", "-", "empty", "emails", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java#L244-L260
130,881
azkaban/azkaban
az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java
ReportalHelper.isValidEmailAddress
public static boolean isValidEmailAddress(final String email) { if (email == null) { return false; } boolean result = true; try { final InternetAddress emailAddr = new InternetAddress(email); emailAddr.validate(); } catch (final AddressException ex) { result = false; } ...
java
public static boolean isValidEmailAddress(final String email) { if (email == null) { return false; } boolean result = true; try { final InternetAddress emailAddr = new InternetAddress(email); emailAddr.validate(); } catch (final AddressException ex) { result = false; } ...
[ "public", "static", "boolean", "isValidEmailAddress", "(", "final", "String", "email", ")", "{", "if", "(", "email", "==", "null", ")", "{", "return", "false", ";", "}", "boolean", "result", "=", "true", ";", "try", "{", "final", "InternetAddress", "emailA...
Returns true if the given email is valid and false otherwise.
[ "Returns", "true", "if", "the", "given", "email", "is", "valid", "and", "false", "otherwise", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java#L265-L278
130,882
azkaban/azkaban
az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java
ReportalHelper.getEmailDomain
public static String getEmailDomain(final String email) { if (email == null || email.isEmpty()) { return null; } final int atSignIndex = email.indexOf('@'); if (atSignIndex != -1) { return email.substring(atSignIndex + 1); } return null; }
java
public static String getEmailDomain(final String email) { if (email == null || email.isEmpty()) { return null; } final int atSignIndex = email.indexOf('@'); if (atSignIndex != -1) { return email.substring(atSignIndex + 1); } return null; }
[ "public", "static", "String", "getEmailDomain", "(", "final", "String", "email", ")", "{", "if", "(", "email", "==", "null", "||", "email", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ";", "}", "final", "int", "atSignIndex", "=", "email", "."...
Given an email string, returns the domain part if it exists, and null otherwise.
[ "Given", "an", "email", "string", "returns", "the", "domain", "part", "if", "it", "exists", "and", "null", "otherwise", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java#L284-L295
130,883
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/ExecutionFinalizer.java
ExecutionFinalizer.finalizeFlow
public void finalizeFlow(final ExecutableFlow flow, final String reason, @Nullable final Throwable originalError) { final int execId = flow.getExecutionId(); boolean alertUser = true; this.updaterStage.set("finalizing flow " + execId); // First we check if the execution in the datastore is comple...
java
public void finalizeFlow(final ExecutableFlow flow, final String reason, @Nullable final Throwable originalError) { final int execId = flow.getExecutionId(); boolean alertUser = true; this.updaterStage.set("finalizing flow " + execId); // First we check if the execution in the datastore is comple...
[ "public", "void", "finalizeFlow", "(", "final", "ExecutableFlow", "flow", ",", "final", "String", "reason", ",", "@", "Nullable", "final", "Throwable", "originalError", ")", "{", "final", "int", "execId", "=", "flow", ".", "getExecutionId", "(", ")", ";", "b...
If the current status of the execution is not one of the finished statuses, marks the execution as failed in the DB. Removes the execution from the running executions cache. @param flow the execution @param reason reason for finalizing the execution @param originalError the cause, if execution is being finalized becau...
[ "If", "the", "current", "status", "of", "the", "execution", "is", "not", "one", "of", "the", "finished", "statuses", "marks", "the", "execution", "as", "failed", "in", "the", "DB", ".", "Removes", "the", "execution", "from", "the", "running", "executions", ...
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionFinalizer.java#L53-L101
130,884
azkaban/azkaban
az-core/src/main/java/azkaban/utils/PluginUtils.java
PluginUtils.getUrls
private static ArrayList<URL> getUrls(File[] files) { final ArrayList<URL> urls = new ArrayList<>(); for (File file : files) { try { final URL url = file.toURI().toURL(); urls.add(url); } catch (final MalformedURLException e) { logger.error("File is not convertible to URL.", ...
java
private static ArrayList<URL> getUrls(File[] files) { final ArrayList<URL> urls = new ArrayList<>(); for (File file : files) { try { final URL url = file.toURI().toURL(); urls.add(url); } catch (final MalformedURLException e) { logger.error("File is not convertible to URL.", ...
[ "private", "static", "ArrayList", "<", "URL", ">", "getUrls", "(", "File", "[", "]", "files", ")", "{", "final", "ArrayList", "<", "URL", ">", "urls", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "File", "file", ":", "files", ")", "{",...
Convert a list of files to a list of files' URLs @param files list of file handles @return an arrayList of the corresponding files' URLs
[ "Convert", "a", "list", "of", "files", "to", "a", "list", "of", "files", "URLs" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PluginUtils.java#L45-L56
130,885
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/FlowLoaderFactory.java
FlowLoaderFactory.createFlowLoader
public FlowLoader createFlowLoader(final File projectDir) throws ProjectManagerException { if (checkForValidProjectYamlFile(projectDir)) { return new DirectoryYamlFlowLoader(this.props); } else { return new DirectoryFlowLoader(this.props); } }
java
public FlowLoader createFlowLoader(final File projectDir) throws ProjectManagerException { if (checkForValidProjectYamlFile(projectDir)) { return new DirectoryYamlFlowLoader(this.props); } else { return new DirectoryFlowLoader(this.props); } }
[ "public", "FlowLoader", "createFlowLoader", "(", "final", "File", "projectDir", ")", "throws", "ProjectManagerException", "{", "if", "(", "checkForValidProjectYamlFile", "(", "projectDir", ")", ")", "{", "return", "new", "DirectoryYamlFlowLoader", "(", "this", ".", ...
Creates flow loader based on project YAML file inside project directory. @param projectDir the project directory @return the flow loader
[ "Creates", "flow", "loader", "based", "on", "project", "YAML", "file", "inside", "project", "directory", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/FlowLoaderFactory.java#L56-L62
130,886
azkaban/azkaban
azkaban-common/src/main/java/azkaban/project/validator/XmlValidatorManager.java
XmlValidatorManager.loadValidators
@Override public void loadValidators(final Props props, final Logger log) { this.validators = new LinkedHashMap<>(); if (!props.containsKey(ValidatorConfigs.XML_FILE_PARAM)) { logger.warn( "Azkaban properties file does not contain the key " + ValidatorConfigs.XML_FILE_PARAM); return; ...
java
@Override public void loadValidators(final Props props, final Logger log) { this.validators = new LinkedHashMap<>(); if (!props.containsKey(ValidatorConfigs.XML_FILE_PARAM)) { logger.warn( "Azkaban properties file does not contain the key " + ValidatorConfigs.XML_FILE_PARAM); return; ...
[ "@", "Override", "public", "void", "loadValidators", "(", "final", "Props", "props", ",", "final", "Logger", "log", ")", "{", "this", ".", "validators", "=", "new", "LinkedHashMap", "<>", "(", ")", ";", "if", "(", "!", "props", ".", "containsKey", "(", ...
Instances of the validators are created here rather than in the constructors. This is because some validators might need to maintain project-specific states. By instantiating the validators here, it ensures that the validator objects are project-specific, rather than global. {@inheritDoc} @see azkaban.project.validat...
[ "Instances", "of", "the", "validators", "are", "created", "here", "rather", "than", "in", "the", "constructors", ".", "This", "is", "because", "some", "validators", "might", "need", "to", "maintain", "project", "-", "specific", "states", ".", "By", "instantiat...
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/validator/XmlValidatorManager.java#L128-L177
130,887
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java
RestfulApiClient.buildUri
public static URI buildUri(final String host, final int port, final String path, final boolean isHttp, final Pair<String, String>... params) throws IOException { final URIBuilder builder = new URIBuilder(); builder.setScheme(isHttp ? "http" : "https").setHost(host).setPort(port); if (null != path && ...
java
public static URI buildUri(final String host, final int port, final String path, final boolean isHttp, final Pair<String, String>... params) throws IOException { final URIBuilder builder = new URIBuilder(); builder.setScheme(isHttp ? "http" : "https").setHost(host).setPort(port); if (null != path && ...
[ "public", "static", "URI", "buildUri", "(", "final", "String", "host", ",", "final", "int", "port", ",", "final", "String", "path", ",", "final", "boolean", "isHttp", ",", "final", "Pair", "<", "String", ",", "String", ">", "...", "params", ")", "throws"...
helper function to build a valid URI. @param host host name. @param port host port. @param path extra path after host. @param isHttp indicates if whether Http or HTTPS should be used. @param params extra query parameters. @return the URI built from the inputs.
[ "helper", "function", "to", "build", "a", "valid", "URI", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java#L61-L81
130,888
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java
RestfulApiClient.completeRequest
private static HttpEntityEnclosingRequestBase completeRequest( final HttpEntityEnclosingRequestBase request, final List<Pair<String, String>> params) throws UnsupportedEncodingException { if (request != null) { if (null != params && !params.isEmpty()) { final List<NameValuePair> formParams...
java
private static HttpEntityEnclosingRequestBase completeRequest( final HttpEntityEnclosingRequestBase request, final List<Pair<String, String>> params) throws UnsupportedEncodingException { if (request != null) { if (null != params && !params.isEmpty()) { final List<NameValuePair> formParams...
[ "private", "static", "HttpEntityEnclosingRequestBase", "completeRequest", "(", "final", "HttpEntityEnclosingRequestBase", "request", ",", "final", "List", "<", "Pair", "<", "String", ",", "String", ">", ">", "params", ")", "throws", "UnsupportedEncodingException", "{", ...
helper function to fill the request with header entries and posting body .
[ "helper", "function", "to", "fill", "the", "request", "with", "header", "entries", "and", "posting", "body", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java#L86-L99
130,889
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java
RestfulApiClient.httpPost
public T httpPost(final URI uri, final List<Pair<String, String>> params) throws IOException { // shortcut if the passed url is invalid. if (null == uri) { logger.error(" unable to perform httpPost as the passed uri is null."); return null; } final HttpPost post = new HttpPost(uri); ret...
java
public T httpPost(final URI uri, final List<Pair<String, String>> params) throws IOException { // shortcut if the passed url is invalid. if (null == uri) { logger.error(" unable to perform httpPost as the passed uri is null."); return null; } final HttpPost post = new HttpPost(uri); ret...
[ "public", "T", "httpPost", "(", "final", "URI", "uri", ",", "final", "List", "<", "Pair", "<", "String", ",", "String", ">", ">", "params", ")", "throws", "IOException", "{", "// shortcut if the passed url is invalid.", "if", "(", "null", "==", "uri", ")", ...
function to perform a Post http request. @param uri the URI of the request. @param params the form params to be posted, optional. @return the response object type of which is specified by user. @throws UnsupportedEncodingException, IOException
[ "function", "to", "perform", "a", "Post", "http", "request", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java#L117-L126
130,890
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java
RestfulApiClient.sendAndReturn
protected T sendAndReturn(final HttpUriRequest request) throws IOException { try (CloseableHttpClient client = HttpClients.createDefault()) { return this.parseResponse(client.execute(request)); } }
java
protected T sendAndReturn(final HttpUriRequest request) throws IOException { try (CloseableHttpClient client = HttpClients.createDefault()) { return this.parseResponse(client.execute(request)); } }
[ "protected", "T", "sendAndReturn", "(", "final", "HttpUriRequest", "request", ")", "throws", "IOException", "{", "try", "(", "CloseableHttpClient", "client", "=", "HttpClients", ".", "createDefault", "(", ")", ")", "{", "return", "this", ".", "parseResponse", "(...
function to dispatch the request and pass back the response.
[ "function", "to", "dispatch", "the", "request", "and", "pass", "back", "the", "response", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java#L131-L135
130,891
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/LoginAbstractAzkabanServlet.java
LoginAbstractAzkabanServlet.logRequest
private void logRequest(final HttpServletRequest req, final Session session) { final StringBuilder buf = new StringBuilder(); buf.append(getRealClientIpAddr(req)).append(" "); if (session != null && session.getUser() != null) { buf.append(session.getUser().getUserId()).append(" "); } else { ...
java
private void logRequest(final HttpServletRequest req, final Session session) { final StringBuilder buf = new StringBuilder(); buf.append(getRealClientIpAddr(req)).append(" "); if (session != null && session.getUser() != null) { buf.append(session.getUser().getUserId()).append(" "); } else { ...
[ "private", "void", "logRequest", "(", "final", "HttpServletRequest", "req", ",", "final", "Session", "session", ")", "{", "final", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "buf", ".", "append", "(", "getRealClientIpAddr", "(", "req",...
Log out request - the format should be close to Apache access log format
[ "Log", "out", "request", "-", "the", "format", "should", "be", "close", "to", "Apache", "access", "log", "format" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/LoginAbstractAzkabanServlet.java#L137-L169
130,892
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/LoginAbstractAzkabanServlet.java
LoginAbstractAzkabanServlet.handleMultiformPost
protected void handleMultiformPost(final HttpServletRequest req, final HttpServletResponse resp, final Map<String, Object> multipart, final Session session) throws ServletException, IOException { }
java
protected void handleMultiformPost(final HttpServletRequest req, final HttpServletResponse resp, final Map<String, Object> multipart, final Session session) throws ServletException, IOException { }
[ "protected", "void", "handleMultiformPost", "(", "final", "HttpServletRequest", "req", ",", "final", "HttpServletResponse", "resp", ",", "final", "Map", "<", "String", ",", "Object", ">", "multipart", ",", "final", "Session", "session", ")", "throws", "ServletExce...
The post request is handed off to the implementor after the user is logged in.
[ "The", "post", "request", "is", "handed", "off", "to", "the", "implementor", "after", "the", "user", "is", "logged", "in", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/LoginAbstractAzkabanServlet.java#L503-L506
130,893
azkaban/azkaban
az-core/src/main/java/azkaban/utils/ExecutorServiceUtils.java
ExecutorServiceUtils.gracefulShutdown
public void gracefulShutdown(final ExecutorService service, final Duration timeout) throws InterruptedException { service.shutdown(); // Disable new tasks from being submitted final long timeout_in_unit_of_miliseconds = timeout.toMillis(); // Wait a while for existing tasks to terminate if (!servi...
java
public void gracefulShutdown(final ExecutorService service, final Duration timeout) throws InterruptedException { service.shutdown(); // Disable new tasks from being submitted final long timeout_in_unit_of_miliseconds = timeout.toMillis(); // Wait a while for existing tasks to terminate if (!servi...
[ "public", "void", "gracefulShutdown", "(", "final", "ExecutorService", "service", ",", "final", "Duration", "timeout", ")", "throws", "InterruptedException", "{", "service", ".", "shutdown", "(", ")", ";", "// Disable new tasks from being submitted", "final", "long", ...
Gracefully shuts down the given executor service. <p>Adopted from <a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html"> the Oracle JAVA Documentation. </a> @param service the service to shutdown @param timeout max wait time for the tasks to shutdown. Note that the max wait tim...
[ "Gracefully", "shuts", "down", "the", "given", "executor", "service", "." ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/ExecutorServiceUtils.java#L46-L58
130,894
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureWrapperUtils.java
HadoopSecureWrapperUtils.createSecurityEnabledProxyUser
private static UserGroupInformation createSecurityEnabledProxyUser(String userToProxy, String fileLocation, Logger log ) throws IOException { if (!new File(fileLocation).exists()) { throw new RuntimeException("hadoop token file doesn't exist."); } log.info("Found token file. Setting " + Had...
java
private static UserGroupInformation createSecurityEnabledProxyUser(String userToProxy, String fileLocation, Logger log ) throws IOException { if (!new File(fileLocation).exists()) { throw new RuntimeException("hadoop token file doesn't exist."); } log.info("Found token file. Setting " + Had...
[ "private", "static", "UserGroupInformation", "createSecurityEnabledProxyUser", "(", "String", "userToProxy", ",", "String", "fileLocation", ",", "Logger", "log", ")", "throws", "IOException", "{", "if", "(", "!", "new", "File", "(", "fileLocation", ")", ".", "exis...
Perform all the magic required to get the proxyUser in a securitized grid @return a UserGroupInformation object for the specified userToProxy, which will also contain the logged in user's tokens
[ "Perform", "all", "the", "magic", "required", "to", "get", "the", "proxyUser", "in", "a", "securitized", "grid" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureWrapperUtils.java#L49-L73
130,895
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureWrapperUtils.java
HadoopSecureWrapperUtils.setupProxyUser
public static UserGroupInformation setupProxyUser(Properties jobProps, String tokenFile, Logger log) { UserGroupInformation proxyUser = null; if (!HadoopSecureWrapperUtils.shouldProxy(jobProps)) { log.info("submitting job as original submitter, not proxying"); return proxyUser; } // ...
java
public static UserGroupInformation setupProxyUser(Properties jobProps, String tokenFile, Logger log) { UserGroupInformation proxyUser = null; if (!HadoopSecureWrapperUtils.shouldProxy(jobProps)) { log.info("submitting job as original submitter, not proxying"); return proxyUser; } // ...
[ "public", "static", "UserGroupInformation", "setupProxyUser", "(", "Properties", "jobProps", ",", "String", "tokenFile", ",", "Logger", "log", ")", "{", "UserGroupInformation", "proxyUser", "=", "null", ";", "if", "(", "!", "HadoopSecureWrapperUtils", ".", "shouldPr...
Sets up the UserGroupInformation proxyUser object so that calling code can do doAs returns null if the jobProps does not call for a proxyUser @param jobProps job properties @param tokenFile pass tokenFile if known. Pass null if the tokenFile is in the environmental variable already. @return returns null if no need to ...
[ "Sets", "up", "the", "UserGroupInformation", "proxyUser", "object", "so", "that", "calling", "code", "can", "do", "doAs", "returns", "null", "if", "the", "jobProps", "does", "not", "call", "for", "a", "proxyUser" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureWrapperUtils.java#L86-L119
130,896
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureWrapperUtils.java
HadoopSecureWrapperUtils.loadAzkabanProps
@SuppressWarnings("DefaultCharset") public static Properties loadAzkabanProps() throws IOException { String propsFile = System.getenv(ProcessJob.JOB_PROP_ENV); Properties props = new Properties(); props.load(new BufferedReader(new FileReader(propsFile))); return props; }
java
@SuppressWarnings("DefaultCharset") public static Properties loadAzkabanProps() throws IOException { String propsFile = System.getenv(ProcessJob.JOB_PROP_ENV); Properties props = new Properties(); props.load(new BufferedReader(new FileReader(propsFile))); return props; }
[ "@", "SuppressWarnings", "(", "\"DefaultCharset\"", ")", "public", "static", "Properties", "loadAzkabanProps", "(", ")", "throws", "IOException", "{", "String", "propsFile", "=", "System", ".", "getenv", "(", "ProcessJob", ".", "JOB_PROP_ENV", ")", ";", "Propertie...
Loading the properties file, which is a combination of the jobProps file and sysProps file @return a Property file, which is the combination of the jobProps file and sysProps file
[ "Loading", "the", "properties", "file", "which", "is", "a", "combination", "of", "the", "jobProps", "file", "and", "sysProps", "file" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureWrapperUtils.java#L127-L133
130,897
azkaban/azkaban
az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureWrapperUtils.java
HadoopSecureWrapperUtils.shouldProxy
public static boolean shouldProxy(Properties props) { String shouldProxy = props.getProperty(HadoopSecurityManager.ENABLE_PROXYING); return shouldProxy != null && shouldProxy.equals("true"); }
java
public static boolean shouldProxy(Properties props) { String shouldProxy = props.getProperty(HadoopSecurityManager.ENABLE_PROXYING); return shouldProxy != null && shouldProxy.equals("true"); }
[ "public", "static", "boolean", "shouldProxy", "(", "Properties", "props", ")", "{", "String", "shouldProxy", "=", "props", ".", "getProperty", "(", "HadoopSecurityManager", ".", "ENABLE_PROXYING", ")", ";", "return", "shouldProxy", "!=", "null", "&&", "shouldProxy...
Looks for particular properties inside the Properties object passed in, and determines whether proxying should happen or not @return a boolean value of whether the job should proxy or not
[ "Looks", "for", "particular", "properties", "inside", "the", "Properties", "object", "passed", "in", "and", "determines", "whether", "proxying", "should", "happen", "or", "not" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopSecureWrapperUtils.java#L141-L144
130,898
azkaban/azkaban
azkaban-common/src/main/java/azkaban/metric/TimeBasedReportingMetric.java
TimeBasedReportingMetric.getTimerTask
private TimerTask getTimerTask() { final TimeBasedReportingMetric<T> lockObject = this; final TimerTask recurringReporting = new TimerTask() { @Override public void run() { synchronized (lockObject) { preTrackingEventMethod(); notifyManager(); postTrackingEventM...
java
private TimerTask getTimerTask() { final TimeBasedReportingMetric<T> lockObject = this; final TimerTask recurringReporting = new TimerTask() { @Override public void run() { synchronized (lockObject) { preTrackingEventMethod(); notifyManager(); postTrackingEventM...
[ "private", "TimerTask", "getTimerTask", "(", ")", "{", "final", "TimeBasedReportingMetric", "<", "T", ">", "lockObject", "=", "this", ";", "final", "TimerTask", "recurringReporting", "=", "new", "TimerTask", "(", ")", "{", "@", "Override", "public", "void", "r...
Get a TimerTask to reschedule Timer @return An anonymous TimerTask class
[ "Get", "a", "TimerTask", "to", "reschedule", "Timer" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/metric/TimeBasedReportingMetric.java#L57-L70
130,899
azkaban/azkaban
azkaban-common/src/main/java/azkaban/metric/TimeBasedReportingMetric.java
TimeBasedReportingMetric.updateInterval
public void updateInterval(final long interval) throws MetricException { if (!isValidInterval(interval)) { throw new MetricException("Invalid interval: Cannot update timer"); } logger.debug(String .format("Updating tracking interval to %d milisecond for %s metric", interval, getName())); t...
java
public void updateInterval(final long interval) throws MetricException { if (!isValidInterval(interval)) { throw new MetricException("Invalid interval: Cannot update timer"); } logger.debug(String .format("Updating tracking interval to %d milisecond for %s metric", interval, getName())); t...
[ "public", "void", "updateInterval", "(", "final", "long", "interval", ")", "throws", "MetricException", "{", "if", "(", "!", "isValidInterval", "(", "interval", ")", ")", "{", "throw", "new", "MetricException", "(", "\"Invalid interval: Cannot update timer\"", ")", ...
Method to change tracking interval
[ "Method", "to", "change", "tracking", "interval" ]
d258ea7d6e66807c6eff79c5325d6d3443618dff
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/metric/TimeBasedReportingMetric.java#L75-L84