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
2,600
windy1/google-places-api-java
src/main/java/se/walkercrou/places/PlaceBuilder.java
PlaceBuilder.toJson
public JSONObject toJson() { JSONObject obj = new JSONObject().put(OBJECT_LOCATION, new JSONObject().put("lat", lat).put("lng", lng)) .put(STRING_NAME, name).put(STRING_TYPES, new JSONArray(types)); if (accuracy != -1) obj.put(INTEGER_ACCURACY, accuracy); if (phoneNum...
java
public JSONObject toJson() { JSONObject obj = new JSONObject().put(OBJECT_LOCATION, new JSONObject().put("lat", lat).put("lng", lng)) .put(STRING_NAME, name).put(STRING_TYPES, new JSONArray(types)); if (accuracy != -1) obj.put(INTEGER_ACCURACY, accuracy); if (phoneNum...
[ "public", "JSONObject", "toJson", "(", ")", "{", "JSONObject", "obj", "=", "new", "JSONObject", "(", ")", ".", "put", "(", "OBJECT_LOCATION", ",", "new", "JSONObject", "(", ")", ".", "put", "(", "\"lat\"", ",", "lat", ")", ".", "put", "(", "\"lng\"", ...
Returns a Google formatted JSON object to be sent to Google's servers. @return Google formatted JSON
[ "Returns", "a", "Google", "formatted", "JSON", "object", "to", "be", "sent", "to", "Google", "s", "servers", "." ]
a5f2a18a7d1ca03fc0480637eae255fe92fc8b86
https://github.com/windy1/google-places-api-java/blob/a5f2a18a7d1ca03fc0480637eae255fe92fc8b86/src/main/java/se/walkercrou/places/PlaceBuilder.java#L120-L134
2,601
windy1/google-places-api-java
src/main/java/se/walkercrou/places/Photo.java
Photo.download
public Photo download(int maxWidth, int maxHeight, Param... extraParams) { image = place.getClient().downloadPhoto(this, maxWidth, maxHeight, extraParams); return this; }
java
public Photo download(int maxWidth, int maxHeight, Param... extraParams) { image = place.getClient().downloadPhoto(this, maxWidth, maxHeight, extraParams); return this; }
[ "public", "Photo", "download", "(", "int", "maxWidth", ",", "int", "maxHeight", ",", "Param", "...", "extraParams", ")", "{", "image", "=", "place", ".", "getClient", "(", ")", ".", "downloadPhoto", "(", "this", ",", "maxWidth", ",", "maxHeight", ",", "e...
Downloads the photo and caches it within the photo. @param maxWidth of photo @param maxHeight of photo @param extraParams to append to request url @return this
[ "Downloads", "the", "photo", "and", "caches", "it", "within", "the", "photo", "." ]
a5f2a18a7d1ca03fc0480637eae255fe92fc8b86
https://github.com/windy1/google-places-api-java/blob/a5f2a18a7d1ca03fc0480637eae255fe92fc8b86/src/main/java/se/walkercrou/places/Photo.java#L35-L38
2,602
windy1/google-places-api-java
src/main/java/se/walkercrou/places/exception/GooglePlacesException.java
GooglePlacesException.parse
public static GooglePlacesException parse(String statusCode, String errorMessage) { Class<?> clazz = statusClassMap.get(statusCode); if (clazz == null) return null; try { if (errorMessage == null || errorMessage.isEmpty()) return (GooglePlacesException) cl...
java
public static GooglePlacesException parse(String statusCode, String errorMessage) { Class<?> clazz = statusClassMap.get(statusCode); if (clazz == null) return null; try { if (errorMessage == null || errorMessage.isEmpty()) return (GooglePlacesException) cl...
[ "public", "static", "GooglePlacesException", "parse", "(", "String", "statusCode", ",", "String", "errorMessage", ")", "{", "Class", "<", "?", ">", "clazz", "=", "statusClassMap", ".", "get", "(", "statusCode", ")", ";", "if", "(", "clazz", "==", "null", "...
Returns the correct exception from a server-given status code and error message. @param statusCode to find exception for @param errorMessage error message from server @return exception that matches the specified status code
[ "Returns", "the", "correct", "exception", "from", "a", "server", "-", "given", "status", "code", "and", "error", "message", "." ]
a5f2a18a7d1ca03fc0480637eae255fe92fc8b86
https://github.com/windy1/google-places-api-java/blob/a5f2a18a7d1ca03fc0480637eae255fe92fc8b86/src/main/java/se/walkercrou/places/exception/GooglePlacesException.java#L81-L96
2,603
windy1/google-places-api-java
src/main/java/se/walkercrou/places/TypeParam.java
TypeParam.value
public Param value(List<String> values) { StringBuilder valuesSb = new StringBuilder(); for (int i = 0; i < values.size(); i++) { valuesSb.append(values.get(i)); if (i != (values.size() - 1)) { valuesSb.append("%7C"); // it represents a pipeline character | ...
java
public Param value(List<String> values) { StringBuilder valuesSb = new StringBuilder(); for (int i = 0; i < values.size(); i++) { valuesSb.append(values.get(i)); if (i != (values.size() - 1)) { valuesSb.append("%7C"); // it represents a pipeline character | ...
[ "public", "Param", "value", "(", "List", "<", "String", ">", "values", ")", "{", "StringBuilder", "valuesSb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "values", ".", "size", "(", ")", ";", "i", ...
Sets the values of the Param. @param values of params @return this params
[ "Sets", "the", "values", "of", "the", "Param", "." ]
a5f2a18a7d1ca03fc0480637eae255fe92fc8b86
https://github.com/windy1/google-places-api-java/blob/a5f2a18a7d1ca03fc0480637eae255fe92fc8b86/src/main/java/se/walkercrou/places/TypeParam.java#L30-L40
2,604
bootique/bootique-jersey
bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleExtender.java
JerseyModuleExtender.setProperty
public JerseyModuleExtender setProperty(String name, Object value) { contributeProperties().addBinding(name).toInstance(value); return this; }
java
public JerseyModuleExtender setProperty(String name, Object value) { contributeProperties().addBinding(name).toInstance(value); return this; }
[ "public", "JerseyModuleExtender", "setProperty", "(", "String", "name", ",", "Object", "value", ")", "{", "contributeProperties", "(", ")", ".", "addBinding", "(", "name", ")", ".", "toInstance", "(", "value", ")", ";", "return", "this", ";", "}" ]
Sets Jersey container property. This allows setting ResourceConfig properties that can not be set via JAX RS features. @param name property name @param value property value @return @see org.glassfish.jersey.server.ServerProperties @since 0.22
[ "Sets", "Jersey", "container", "property", ".", "This", "allows", "setting", "ResourceConfig", "properties", "that", "can", "not", "be", "set", "via", "JAX", "RS", "features", "." ]
8def056158f0ad1914e975625eb5ed3e4712648c
https://github.com/bootique/bootique-jersey/blob/8def056158f0ad1914e975625eb5ed3e4712648c/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleExtender.java#L104-L107
2,605
mediathekview/MServer
src/main/java/mServer/crawler/CrawlerTool.java
CrawlerTool.startMsg
public static synchronized void startMsg() { Log.startZeit.setTime(System.currentTimeMillis()); Log.versionMsg(Const.PROGRAMMNAME); Log.sysLog(Log.LILNE); Log.sysLog(""); Log.sysLog("Programmpfad: " + Functions.getPathJar()); Log.sysLog("Filmliste: " + getPathFilmlist_jso...
java
public static synchronized void startMsg() { Log.startZeit.setTime(System.currentTimeMillis()); Log.versionMsg(Const.PROGRAMMNAME); Log.sysLog(Log.LILNE); Log.sysLog(""); Log.sysLog("Programmpfad: " + Functions.getPathJar()); Log.sysLog("Filmliste: " + getPathFilmlist_jso...
[ "public", "static", "synchronized", "void", "startMsg", "(", ")", "{", "Log", ".", "startZeit", ".", "setTime", "(", "System", ".", "currentTimeMillis", "(", ")", ")", ";", "Log", ".", "versionMsg", "(", "Const", ".", "PROGRAMMNAME", ")", ";", "Log", "."...
ist die aktuelle Filmliste, xz komprimiert
[ "ist", "die", "aktuelle", "Filmliste", "xz", "komprimiert" ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/CrawlerTool.java#L33-L63
2,606
mediathekview/MServer
src/main/java/mServer/crawler/sender/base/UrlUtils.java
UrlUtils.addDomainIfMissing
public static String addDomainIfMissing(final String aUrl, final String aDomain) { if (aUrl != null && !aUrl.isEmpty() && aUrl.startsWith("/")) { return aDomain + aUrl; } return aUrl; }
java
public static String addDomainIfMissing(final String aUrl, final String aDomain) { if (aUrl != null && !aUrl.isEmpty() && aUrl.startsWith("/")) { return aDomain + aUrl; } return aUrl; }
[ "public", "static", "String", "addDomainIfMissing", "(", "final", "String", "aUrl", ",", "final", "String", "aDomain", ")", "{", "if", "(", "aUrl", "!=", "null", "&&", "!", "aUrl", ".", "isEmpty", "(", ")", "&&", "aUrl", ".", "startsWith", "(", "\"/\"", ...
adds the domain if missing. @param aUrl the url to check @param aDomain the domain to add @return the url including the domain
[ "adds", "the", "domain", "if", "missing", "." ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/base/UrlUtils.java#L37-L43
2,607
mediathekview/MServer
src/main/java/mServer/crawler/sender/base/UrlUtils.java
UrlUtils.addProtocolIfMissing
public static String addProtocolIfMissing(final String aUrl, final String aProtocol) { if (aUrl != null && aUrl.startsWith("//")) { return aProtocol + aUrl; } return aUrl; }
java
public static String addProtocolIfMissing(final String aUrl, final String aProtocol) { if (aUrl != null && aUrl.startsWith("//")) { return aProtocol + aUrl; } return aUrl; }
[ "public", "static", "String", "addProtocolIfMissing", "(", "final", "String", "aUrl", ",", "final", "String", "aProtocol", ")", "{", "if", "(", "aUrl", "!=", "null", "&&", "aUrl", ".", "startsWith", "(", "\"//\"", ")", ")", "{", "return", "aProtocol", "+",...
adds the protocol if missing. @param aUrl the url to check @param aProtocol the protocol to add @return the url including the protocol
[ "adds", "the", "protocol", "if", "missing", "." ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/base/UrlUtils.java#L52-L58
2,608
mediathekview/MServer
src/main/java/mServer/crawler/sender/base/UrlUtils.java
UrlUtils.changeOrAddParameter
public static String changeOrAddParameter(final String aUrl, final String aParameter, final String aValue) { final StringBuilder newUrlBuilder = new StringBuilder(); final String[] splittedUrl = aUrl.split(REGEX_ESCAPOR + URL_TO_PARAMETERS_SPLITTERATOR); newUrlBuilder.append(splittedUrl[0]); ...
java
public static String changeOrAddParameter(final String aUrl, final String aParameter, final String aValue) { final StringBuilder newUrlBuilder = new StringBuilder(); final String[] splittedUrl = aUrl.split(REGEX_ESCAPOR + URL_TO_PARAMETERS_SPLITTERATOR); newUrlBuilder.append(splittedUrl[0]); ...
[ "public", "static", "String", "changeOrAddParameter", "(", "final", "String", "aUrl", ",", "final", "String", "aParameter", ",", "final", "String", "aValue", ")", "{", "final", "StringBuilder", "newUrlBuilder", "=", "new", "StringBuilder", "(", ")", ";", "final"...
Changes or adds an URL parameter. @param aUrl The URL which parameter should be changed or gets the parameter added. @param aParameter The parameter which should be changed or added. @param aValue The parameter value. @return The changed URL.
[ "Changes", "or", "adds", "an", "URL", "parameter", "." ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/base/UrlUtils.java#L68-L90
2,609
mediathekview/MServer
src/main/java/mServer/crawler/sender/base/UrlUtils.java
UrlUtils.existsUrl
public static boolean existsUrl(final String aUrl) { try { final URL url = new URL(aUrl); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("HEAD"); connection.connect(); return connection.getResponseCode() == 200; } catch (...
java
public static boolean existsUrl(final String aUrl) { try { final URL url = new URL(aUrl); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("HEAD"); connection.connect(); return connection.getResponseCode() == 200; } catch (...
[ "public", "static", "boolean", "existsUrl", "(", "final", "String", "aUrl", ")", "{", "try", "{", "final", "URL", "url", "=", "new", "URL", "(", "aUrl", ")", ";", "HttpURLConnection", "connection", "=", "(", "HttpURLConnection", ")", "url", ".", "openConne...
checks whether an url exists. uses head request to check. @param aUrl the url to check @return true if url exists else false.
[ "checks", "whether", "an", "url", "exists", ".", "uses", "head", "request", "to", "check", "." ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/base/UrlUtils.java#L98-L108
2,610
mediathekview/MServer
src/main/java/mServer/crawler/sender/base/UrlUtils.java
UrlUtils.getFileName
public static Optional<String> getFileName(final String aUrl) { if (aUrl != null) { int index = aUrl.lastIndexOf('/'); if (index > 0) { final String file = aUrl.substring(index + 1); if (file.contains(".")) { return Optional.of(file); } } } ret...
java
public static Optional<String> getFileName(final String aUrl) { if (aUrl != null) { int index = aUrl.lastIndexOf('/'); if (index > 0) { final String file = aUrl.substring(index + 1); if (file.contains(".")) { return Optional.of(file); } } } ret...
[ "public", "static", "Optional", "<", "String", ">", "getFileName", "(", "final", "String", "aUrl", ")", "{", "if", "(", "aUrl", "!=", "null", ")", "{", "int", "index", "=", "aUrl", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "index", ">...
returns the file name of the url. @param aUrl the url @return the name of the file
[ "returns", "the", "file", "name", "of", "the", "url", "." ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/base/UrlUtils.java#L139-L151
2,611
mediathekview/MServer
src/main/java/mServer/crawler/sender/base/UrlUtils.java
UrlUtils.getFileType
public static Optional<String> getFileType(final String aUrl) { if (aUrl != null) { int index = aUrl.lastIndexOf('.'); if (index > 0) { return Optional.of(aUrl.substring(index + 1)); } } return Optional.empty(); }
java
public static Optional<String> getFileType(final String aUrl) { if (aUrl != null) { int index = aUrl.lastIndexOf('.'); if (index > 0) { return Optional.of(aUrl.substring(index + 1)); } } return Optional.empty(); }
[ "public", "static", "Optional", "<", "String", ">", "getFileType", "(", "final", "String", "aUrl", ")", "{", "if", "(", "aUrl", "!=", "null", ")", "{", "int", "index", "=", "aUrl", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "index", ">...
returns the file type of the url. @param aUrl the url @return the type of the file
[ "returns", "the", "file", "type", "of", "the", "url", "." ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/base/UrlUtils.java#L159-L168
2,612
mediathekview/MServer
src/main/java/mServer/crawler/sender/base/UrlUtils.java
UrlUtils.getProtocol
public static Optional<String> getProtocol(final String aUrl) { if (aUrl != null) { int index = aUrl.indexOf("//"); if (index > 0) { String protocol = aUrl.substring(0, index); return Optional.of(protocol); } } return Optional.empty(); }
java
public static Optional<String> getProtocol(final String aUrl) { if (aUrl != null) { int index = aUrl.indexOf("//"); if (index > 0) { String protocol = aUrl.substring(0, index); return Optional.of(protocol); } } return Optional.empty(); }
[ "public", "static", "Optional", "<", "String", ">", "getProtocol", "(", "final", "String", "aUrl", ")", "{", "if", "(", "aUrl", "!=", "null", ")", "{", "int", "index", "=", "aUrl", ".", "indexOf", "(", "\"//\"", ")", ";", "if", "(", "index", ">", "...
returns the protocol of the url. @param aUrl the url @return the protocol of the url (e.g. "http:")
[ "returns", "the", "protocol", "of", "the", "url", "." ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/base/UrlUtils.java#L176-L186
2,613
mediathekview/MServer
src/main/java/mServer/crawler/sender/base/UrlUtils.java
UrlUtils.getUrlParameterValue
public static Optional<String> getUrlParameterValue(final String aUrl, final String aParameterName) throws UrlParseException { if (aUrl != null) { Map<String, String> parameters = getUrlParameters(aUrl); if (parameters.containsKey(aParameterName)) { return Optional.of(parameters.get(aParamet...
java
public static Optional<String> getUrlParameterValue(final String aUrl, final String aParameterName) throws UrlParseException { if (aUrl != null) { Map<String, String> parameters = getUrlParameters(aUrl); if (parameters.containsKey(aParameterName)) { return Optional.of(parameters.get(aParamet...
[ "public", "static", "Optional", "<", "String", ">", "getUrlParameterValue", "(", "final", "String", "aUrl", ",", "final", "String", "aParameterName", ")", "throws", "UrlParseException", "{", "if", "(", "aUrl", "!=", "null", ")", "{", "Map", "<", "String", ",...
returns the value of an url parameter. @param aUrl the url @param aParameterName the name of the url parameter @return the parameter value
[ "returns", "the", "value", "of", "an", "url", "parameter", "." ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/base/UrlUtils.java#L195-L204
2,614
mediathekview/MServer
src/main/java/mServer/crawler/sender/arte/ArteVideoDetailsDeserializer.java
ArteVideoDetailsDeserializer.getBroadcastDate
private String getBroadcastDate(JsonArray broadcastArray) { String broadcastDate = ""; String broadcastBeginFirst = ""; String broadcastBeginMajor = ""; String broadcastBeginMinor = ""; // nach Priorität der BroadcastTypen den relevanten Eintrag suchen // FIRST_BROADCAST...
java
private String getBroadcastDate(JsonArray broadcastArray) { String broadcastDate = ""; String broadcastBeginFirst = ""; String broadcastBeginMajor = ""; String broadcastBeginMinor = ""; // nach Priorität der BroadcastTypen den relevanten Eintrag suchen // FIRST_BROADCAST...
[ "private", "String", "getBroadcastDate", "(", "JsonArray", "broadcastArray", ")", "{", "String", "broadcastDate", "=", "\"\"", ";", "String", "broadcastBeginFirst", "=", "\"\"", ";", "String", "broadcastBeginMajor", "=", "\"\"", ";", "String", "broadcastBeginMinor", ...
ermittelt Ausstrahlungsdatum aus der Liste der Ausstrahlungen @param broadcastArray @return
[ "ermittelt", "Ausstrahlungsdatum", "aus", "der", "Liste", "der", "Ausstrahlungen" ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/arte/ArteVideoDetailsDeserializer.java#L176-L230
2,615
mediathekview/MServer
src/main/java/mServer/crawler/sender/arte/ArteVideoDetailsDeserializer.java
ArteVideoDetailsDeserializer.getBroadcastDateConsideringCatchupRights
private String getBroadcastDateConsideringCatchupRights(JsonObject broadcastObject) { String broadcastDate = ""; JsonElement elementBegin = broadcastObject.get(JSON_ELEMENT_BROADCAST_CATCHUPRIGHTS_BEGIN); JsonElement elementEnd = broadcastObject.get(JSON_ELEMENT_BROADCAST_CATCHUPRIGHTS_...
java
private String getBroadcastDateConsideringCatchupRights(JsonObject broadcastObject) { String broadcastDate = ""; JsonElement elementBegin = broadcastObject.get(JSON_ELEMENT_BROADCAST_CATCHUPRIGHTS_BEGIN); JsonElement elementEnd = broadcastObject.get(JSON_ELEMENT_BROADCAST_CATCHUPRIGHTS_...
[ "private", "String", "getBroadcastDateConsideringCatchupRights", "(", "JsonObject", "broadcastObject", ")", "{", "String", "broadcastDate", "=", "\"\"", ";", "JsonElement", "elementBegin", "=", "broadcastObject", ".", "get", "(", "JSON_ELEMENT_BROADCAST_CATCHUPRIGHTS_BEGIN", ...
Liefert den Beginn der Ausstrahlung, wenn - heute im Zeitraum von CatchUpRights liegt - oder heute vor dem Zeitraum liegt - oder CatchUpRights nicht gesetzt ist @param broadcastObject @return der Beginn der Ausstrahlung oder ""
[ "Liefert", "den", "Beginn", "der", "Ausstrahlung", "wenn", "-", "heute", "im", "Zeitraum", "von", "CatchUpRights", "liegt", "-", "oder", "heute", "vor", "dem", "Zeitraum", "liegt", "-", "oder", "CatchUpRights", "nicht", "gesetzt", "ist" ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/arte/ArteVideoDetailsDeserializer.java#L241-L280
2,616
mediathekview/MServer
src/main/java/mServer/crawler/sender/orf/JsonUtils.java
JsonUtils.getAttributeAsString
public static Optional<String> getAttributeAsString(final JsonObject aJsonObject, final String aAttributeName) { if (aJsonObject.has(aAttributeName)) { final JsonElement aElement = aJsonObject.get(aAttributeName); if (!aElement.isJsonNull()) { return Optional.of(aElement.getAsString())...
java
public static Optional<String> getAttributeAsString(final JsonObject aJsonObject, final String aAttributeName) { if (aJsonObject.has(aAttributeName)) { final JsonElement aElement = aJsonObject.get(aAttributeName); if (!aElement.isJsonNull()) { return Optional.of(aElement.getAsString())...
[ "public", "static", "Optional", "<", "String", ">", "getAttributeAsString", "(", "final", "JsonObject", "aJsonObject", ",", "final", "String", "aAttributeName", ")", "{", "if", "(", "aJsonObject", ".", "has", "(", "aAttributeName", ")", ")", "{", "final", "Jso...
Gets the value of an attribute @param aJsonObject the object @param aAttributeName the name of the attribute @return the value of the attribute, if it exists, else Optional.empty
[ "Gets", "the", "value", "of", "an", "attribute" ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/orf/JsonUtils.java#L20-L30
2,617
mediathekview/MServer
src/main/java/mServer/tool/MserverDatumZeit.java
MserverDatumZeit.formatTime
public static String formatTime(String dateValue, FastDateFormat sdf) { try { return FDF_OUT_TIME.format(sdf.parse(dateValue)); } catch (ParseException ex) { LOG.debug(String.format("Fehler beim Parsen des Datums %s: %s", dateValue, ex.getMessage())); } ...
java
public static String formatTime(String dateValue, FastDateFormat sdf) { try { return FDF_OUT_TIME.format(sdf.parse(dateValue)); } catch (ParseException ex) { LOG.debug(String.format("Fehler beim Parsen des Datums %s: %s", dateValue, ex.getMessage())); } ...
[ "public", "static", "String", "formatTime", "(", "String", "dateValue", ",", "FastDateFormat", "sdf", ")", "{", "try", "{", "return", "FDF_OUT_TIME", ".", "format", "(", "sdf", ".", "parse", "(", "dateValue", ")", ")", ";", "}", "catch", "(", "ParseExcepti...
formats a datetime string to the time format used in DatenFilm @param dateValue the datetime value @param sdf the format of dateValue @return the formatted time string
[ "formats", "a", "datetime", "string", "to", "the", "time", "format", "used", "in", "DatenFilm" ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/tool/MserverDatumZeit.java#L98-L106
2,618
mediathekview/MServer
src/main/java/mServer/crawler/FilmeSuchen.java
FilmeSuchen.filmeBeimSenderLaden
public synchronized void filmeBeimSenderLaden(ListeFilme listeFilme) { initStart(listeFilme); // die mReader nach Prio starten mrStarten(0); if (!Config.getStop()) { // waren und wenn Suchlauf noch nicht abgebrochen weiter mit dem Rest mrWarten(); mrStarten(1); allStarted...
java
public synchronized void filmeBeimSenderLaden(ListeFilme listeFilme) { initStart(listeFilme); // die mReader nach Prio starten mrStarten(0); if (!Config.getStop()) { // waren und wenn Suchlauf noch nicht abgebrochen weiter mit dem Rest mrWarten(); mrStarten(1); allStarted...
[ "public", "synchronized", "void", "filmeBeimSenderLaden", "(", "ListeFilme", "listeFilme", ")", "{", "initStart", "(", "listeFilme", ")", ";", "// die mReader nach Prio starten\r", "mrStarten", "(", "0", ")", ";", "if", "(", "!", "Config", ".", "getStop", "(", "...
es werden alle Filme gesucht @param listeFilme
[ "es", "werden", "alle", "Filme", "gesucht" ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/FilmeSuchen.java#L119-L129
2,619
mediathekview/MServer
src/main/java/mServer/crawler/FilmeSuchen.java
FilmeSuchen.updateSender
public void updateSender(String[] nameSender, ListeFilme listeFilme) { // nur für den Mauskontext "Sender aktualisieren" boolean starten = false; initStart(listeFilme); for (MediathekReader reader : mediathekListe) { for (String s : nameSender) { if (reader.checkNameSenderFilmliste(s...
java
public void updateSender(String[] nameSender, ListeFilme listeFilme) { // nur für den Mauskontext "Sender aktualisieren" boolean starten = false; initStart(listeFilme); for (MediathekReader reader : mediathekListe) { for (String s : nameSender) { if (reader.checkNameSenderFilmliste(s...
[ "public", "void", "updateSender", "(", "String", "[", "]", "nameSender", ",", "ListeFilme", "listeFilme", ")", "{", "// nur für den Mauskontext \"Sender aktualisieren\"\r", "boolean", "starten", "=", "false", ";", "initStart", "(", "listeFilme", ")", ";", "for", "("...
es werden nur einige Sender aktualisiert @param nameSender @param listeFilme
[ "es", "werden", "nur", "einige", "Sender", "aktualisiert" ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/FilmeSuchen.java#L137-L155
2,620
mediathekview/MServer
src/main/java/mServer/crawler/sender/MediathekArd.java
MediathekArd.searchForUrlsWithM3U8
private Map<Qualities, String> searchForUrlsWithM3U8( final MSStringBuilder aSeiteStringExtractor) { final Map<Qualities, String> urls = new EnumMap<>(Qualities.class); final ArrayList<String> patternMatches = new ArrayList<>(); aSeiteStringExtractor.extractList(M3U8_PATTERN_START, M3U8_PATTERN_E...
java
private Map<Qualities, String> searchForUrlsWithM3U8( final MSStringBuilder aSeiteStringExtractor) { final Map<Qualities, String> urls = new EnumMap<>(Qualities.class); final ArrayList<String> patternMatches = new ArrayList<>(); aSeiteStringExtractor.extractList(M3U8_PATTERN_START, M3U8_PATTERN_E...
[ "private", "Map", "<", "Qualities", ",", "String", ">", "searchForUrlsWithM3U8", "(", "final", "MSStringBuilder", "aSeiteStringExtractor", ")", "{", "final", "Map", "<", "Qualities", ",", "String", ">", "urls", "=", "new", "EnumMap", "<>", "(", "Qualities", "....
Searches the Seite for a quality auto to get a M3U8 URL. If the URL is from WRD it searches for the URLs of the MP4 files. @param aSeiteStringExtractor The Seite. @return A Map containing the URLs and Qualities which was found. An empty Map if nothing was found.
[ "Searches", "the", "Seite", "for", "a", "quality", "auto", "to", "get", "a", "M3U8", "URL", ".", "If", "the", "URL", "is", "from", "WRD", "it", "searches", "for", "the", "URLs", "of", "the", "MP4", "files", "." ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/MediathekArd.java#L563-L588
2,621
mediathekview/MServer
src/main/java/mServer/crawler/sender/MediathekBr.java
MediathekBr.getUrl
private String getUrl(MSStringBuilder seiteXml, String pattern) { return seiteXml.extract(pattern, PATTERN_DLURL, PATTERN_END); }
java
private String getUrl(MSStringBuilder seiteXml, String pattern) { return seiteXml.extract(pattern, PATTERN_DLURL, PATTERN_END); }
[ "private", "String", "getUrl", "(", "MSStringBuilder", "seiteXml", ",", "String", "pattern", ")", "{", "return", "seiteXml", ".", "extract", "(", "pattern", ",", "PATTERN_DLURL", ",", "PATTERN_END", ")", ";", "}" ]
gets the url for the specified pattern @param seiteXml The xml site where to extract the url @param pattern The pattern used to identify the url type @return The extracted url
[ "gets", "the", "url", "for", "the", "specified", "pattern" ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/MediathekBr.java#L585-L587
2,622
mediathekview/MServer
src/main/java/mServer/crawler/sender/MediathekReader.java
MediathekReader.addFilm
protected void addFilm(DatenFilm film) { film.setFileSize(); upgradeUrl(film); film.setUrlHistory(); setGeo(film); if (mlibFilmeSuchen.listeFilmeNeu.addFilmVomSender(film)) { // dann ist er neu FilmeSuchen.listeSenderLaufen.inc(film.arr[DatenFilm.FILM_SENDER], RunSender.Count.FILME); ...
java
protected void addFilm(DatenFilm film) { film.setFileSize(); upgradeUrl(film); film.setUrlHistory(); setGeo(film); if (mlibFilmeSuchen.listeFilmeNeu.addFilmVomSender(film)) { // dann ist er neu FilmeSuchen.listeSenderLaufen.inc(film.arr[DatenFilm.FILM_SENDER], RunSender.Count.FILME); ...
[ "protected", "void", "addFilm", "(", "DatenFilm", "film", ")", "{", "film", ".", "setFileSize", "(", ")", ";", "upgradeUrl", "(", "film", ")", ";", "film", ".", "setUrlHistory", "(", ")", ";", "setGeo", "(", "film", ")", ";", "if", "(", "mlibFilmeSuche...
Es werden die gefundenen Filme in die Liste einsortiert. @param film der einzufügende Film
[ "Es", "werden", "die", "gefundenen", "Filme", "in", "die", "Liste", "einsortiert", "." ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/MediathekReader.java#L218-L229
2,623
mediathekview/MServer
src/main/java/mServer/crawler/sender/orf/tasks/OrfHelper.java
OrfHelper.parseLetterLinks
public static List<String> parseLetterLinks(Document aDocument) { final List<String> results = new ArrayList<>(); Elements links = aDocument.select(LETTER_URL_SELECTOR); links.forEach(element -> { if (element.hasAttr(ATTRIBUTE_HREF)) { String subpage = element.attr(ATTRIBUTE_HREF); re...
java
public static List<String> parseLetterLinks(Document aDocument) { final List<String> results = new ArrayList<>(); Elements links = aDocument.select(LETTER_URL_SELECTOR); links.forEach(element -> { if (element.hasAttr(ATTRIBUTE_HREF)) { String subpage = element.attr(ATTRIBUTE_HREF); re...
[ "public", "static", "List", "<", "String", ">", "parseLetterLinks", "(", "Document", "aDocument", ")", "{", "final", "List", "<", "String", ">", "results", "=", "new", "ArrayList", "<>", "(", ")", ";", "Elements", "links", "=", "aDocument", ".", "select", ...
determines the links to the letter pages @param aDocument the html document with letter links @return list with urls
[ "determines", "the", "links", "to", "the", "letter", "pages" ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/orf/tasks/OrfHelper.java#L49-L61
2,624
mediathekview/MServer
src/main/java/mServer/tool/HashFileWriter.java
HashFileWriter.writeHash
public void writeHash(String id) { try (BufferedWriter fileWriter = Files.newBufferedWriter(baseDir.resolve(FILE_NAME), StandardCharsets.UTF_8)) { fileWriter.write(id); } catch (IOException ioException) { Log.errorLog(494461668, ioException, "Der Filmlisten Hash konnte nicht geschrieben werden."); } }
java
public void writeHash(String id) { try (BufferedWriter fileWriter = Files.newBufferedWriter(baseDir.resolve(FILE_NAME), StandardCharsets.UTF_8)) { fileWriter.write(id); } catch (IOException ioException) { Log.errorLog(494461668, ioException, "Der Filmlisten Hash konnte nicht geschrieben werden."); } }
[ "public", "void", "writeHash", "(", "String", "id", ")", "{", "try", "(", "BufferedWriter", "fileWriter", "=", "Files", ".", "newBufferedWriter", "(", "baseDir", ".", "resolve", "(", "FILE_NAME", ")", ",", "StandardCharsets", ".", "UTF_8", ")", ")", "{", "...
Schreibt die gegebene ID in die Filmlist Hash Datei. @param id Die zu schreibende ID.
[ "Schreibt", "die", "gegebene", "ID", "in", "die", "Filmlist", "Hash", "Datei", "." ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/tool/HashFileWriter.java#L32-L38
2,625
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/JSONUtil.java
JSONUtil.writeJson
public static void writeJson(Writer writer, Object object) throws IOException { ObjectMapper om = ObjectMapperProvider.createCustomMapper(); om.configure(SerializationConfig.Feature.INDENT_OUTPUT, true); om.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false); writer.write(om.writeValueAs...
java
public static void writeJson(Writer writer, Object object) throws IOException { ObjectMapper om = ObjectMapperProvider.createCustomMapper(); om.configure(SerializationConfig.Feature.INDENT_OUTPUT, true); om.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false); writer.write(om.writeValueAs...
[ "public", "static", "void", "writeJson", "(", "Writer", "writer", ",", "Object", "object", ")", "throws", "IOException", "{", "ObjectMapper", "om", "=", "ObjectMapperProvider", ".", "createCustomMapper", "(", ")", ";", "om", ".", "configure", "(", "Serialization...
Writes object to the writer as JSON using Jackson and adds a new-line before flushing. @param writer the writer to write the JSON to @param object the object to write as JSON @throws IOException if the object can't be serialized as JSON or written to the writer
[ "Writes", "object", "to", "the", "writer", "as", "JSON", "using", "Jackson", "and", "adds", "a", "new", "-", "line", "before", "flushing", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/JSONUtil.java#L44-L53
2,626
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsService.java
HdfsStatsService.getAllDirs
public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { // path ...
java
public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { // path ...
[ "public", "List", "<", "HdfsStats", ">", "getAllDirs", "(", "String", "cluster", ",", "String", "pathPrefix", ",", "int", "limit", ",", "long", "runId", ")", "throws", "IOException", "{", "long", "encodedRunId", "=", "getEncodedRunId", "(", "runId", ")", ";"...
Gets hdfs stats about all dirs on the given cluster @param cluster @param pathPrefix @param limit @param runId @return list of hdfs stats @throws IOException
[ "Gets", "hdfs", "stats", "about", "all", "dirs", "on", "the", "given", "cluster" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsService.java#L103-L132
2,627
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsService.java
HdfsStatsService.createFromScanResults
private List<HdfsStats> createFromScanResults(String cluster, String path, Scan scan, int maxCount, boolean checkPath, long starttime, long endtime) throws IOException { Map<HdfsStatsKey, HdfsStats> hdfsStats = new HashMap<HdfsStatsKey, HdfsStats>(); ResultScanner scanner = null; Stopwat...
java
private List<HdfsStats> createFromScanResults(String cluster, String path, Scan scan, int maxCount, boolean checkPath, long starttime, long endtime) throws IOException { Map<HdfsStatsKey, HdfsStats> hdfsStats = new HashMap<HdfsStatsKey, HdfsStats>(); ResultScanner scanner = null; Stopwat...
[ "private", "List", "<", "HdfsStats", ">", "createFromScanResults", "(", "String", "cluster", ",", "String", "path", ",", "Scan", "scan", ",", "int", "maxCount", ",", "boolean", "checkPath", ",", "long", "starttime", ",", "long", "endtime", ")", "throws", "IO...
Scans the hbase table and populates the hdfs stats @param cluster @param scan @param maxCount @return @throws IOException
[ "Scans", "the", "hbase", "table", "and", "populates", "the", "hdfs", "stats" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsService.java#L174-L225
2,628
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsService.java
HdfsStatsService.populateHdfsStats
private int populateHdfsStats(Result result, Map<HdfsStatsKey, HdfsStats> hdfsStats, boolean checkPath, String path, long starttime, long endtime, int rowCount) { HdfsStatsKey currentFullKey = hdfsStatsKeyConv.fromBytes(result.getRow()); QualifiedPathKey qpk = currentFullKey.getQualifiedPathKey(); ...
java
private int populateHdfsStats(Result result, Map<HdfsStatsKey, HdfsStats> hdfsStats, boolean checkPath, String path, long starttime, long endtime, int rowCount) { HdfsStatsKey currentFullKey = hdfsStatsKeyConv.fromBytes(result.getRow()); QualifiedPathKey qpk = currentFullKey.getQualifiedPathKey(); ...
[ "private", "int", "populateHdfsStats", "(", "Result", "result", ",", "Map", "<", "HdfsStatsKey", ",", "HdfsStats", ">", "hdfsStats", ",", "boolean", "checkPath", ",", "String", "path", ",", "long", "starttime", ",", "long", "endtime", ",", "int", "rowCount", ...
Populates the hdfs stats for a cluster based on the hbase Result For federated hadoop2 clusters, there are multiple namespaces Since the namespace is part of the rowkey, we need to create an hdfs key without namespace so that we can aggregate across namespaces @param hbase scan result @param map of hdfsStats
[ "Populates", "the", "hdfs", "stats", "for", "a", "cluster", "based", "on", "the", "hbase", "Result" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsService.java#L237-L269
2,629
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/TaskKeyConverter.java
TaskKeyConverter.toBytes
@Override public byte[] toBytes(TaskKey taskKey) { return Bytes.add(jobKeyConv.toBytes(taskKey), Constants.SEP_BYTES, Bytes.toBytes(taskKey.getTaskId())); }
java
@Override public byte[] toBytes(TaskKey taskKey) { return Bytes.add(jobKeyConv.toBytes(taskKey), Constants.SEP_BYTES, Bytes.toBytes(taskKey.getTaskId())); }
[ "@", "Override", "public", "byte", "[", "]", "toBytes", "(", "TaskKey", "taskKey", ")", "{", "return", "Bytes", ".", "add", "(", "jobKeyConv", ".", "toBytes", "(", "taskKey", ")", ",", "Constants", ".", "SEP_BYTES", ",", "Bytes", ".", "toBytes", "(", "...
Returns the bytes representation for a TaskKey. @param taskKey the TaskKey instance to serialize @return the serialized representation of the TaskKey
[ "Returns", "the", "bytes", "representation", "for", "a", "TaskKey", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/TaskKeyConverter.java#L36-L40
2,630
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/TaskKeyConverter.java
TaskKeyConverter.fromBytes
@Override public TaskKey fromBytes(byte[] bytes) { byte[][] keyComponents = JobKeyConverter.splitJobKey(bytes); JobKey jobKey = jobKeyConv.parseJobKey(keyComponents); return new TaskKey(jobKey, (keyComponents.length > 5 ? Bytes.toString(keyComponents[5]) : null)); }
java
@Override public TaskKey fromBytes(byte[] bytes) { byte[][] keyComponents = JobKeyConverter.splitJobKey(bytes); JobKey jobKey = jobKeyConv.parseJobKey(keyComponents); return new TaskKey(jobKey, (keyComponents.length > 5 ? Bytes.toString(keyComponents[5]) : null)); }
[ "@", "Override", "public", "TaskKey", "fromBytes", "(", "byte", "[", "]", "bytes", ")", "{", "byte", "[", "]", "[", "]", "keyComponents", "=", "JobKeyConverter", ".", "splitJobKey", "(", "bytes", ")", ";", "JobKey", "jobKey", "=", "jobKeyConv", ".", "par...
Generates a TaskKey from the byte encoded format. @param bytes the serialized version of a task key @return the deserialized TaskKey instance
[ "Generates", "a", "TaskKey", "from", "the", "byte", "encoded", "format", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/TaskKeyConverter.java#L48-L54
2,631
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java
JobHistoryRawService.getRawJobConfiguration
public Configuration getRawJobConfiguration(QualifiedJobId jobId) throws IOException { Configuration conf = null; byte[] rowKey = idConv.toBytes(jobId); Get get = new Get(rowKey); get.addColumn(Constants.RAW_FAM_BYTES, Constants.JOBCONF_COL_BYTES); Table rawTable = null; try { rawTab...
java
public Configuration getRawJobConfiguration(QualifiedJobId jobId) throws IOException { Configuration conf = null; byte[] rowKey = idConv.toBytes(jobId); Get get = new Get(rowKey); get.addColumn(Constants.RAW_FAM_BYTES, Constants.JOBCONF_COL_BYTES); Table rawTable = null; try { rawTab...
[ "public", "Configuration", "getRawJobConfiguration", "(", "QualifiedJobId", "jobId", ")", "throws", "IOException", "{", "Configuration", "conf", "=", "null", ";", "byte", "[", "]", "rowKey", "=", "idConv", ".", "toBytes", "(", "jobId", ")", ";", "Get", "get", ...
Returns the raw job configuration stored for the given cluster and job ID @param jobId the cluster and job ID to look up @return the stored job configuration @throws IOException
[ "Returns", "the", "raw", "job", "configuration", "stored", "for", "the", "given", "cluster", "and", "job", "ID" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java#L295-L318
2,632
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java
JobHistoryRawService.getRawJobHistory
public String getRawJobHistory(QualifiedJobId jobId) throws IOException { String historyData = null; byte[] rowKey = idConv.toBytes(jobId); Get get = new Get(rowKey); get.addColumn(Constants.RAW_FAM_BYTES, Constants.JOBHISTORY_COL_BYTES); Table rawTable = null; try { rawTable = hbaseConnec...
java
public String getRawJobHistory(QualifiedJobId jobId) throws IOException { String historyData = null; byte[] rowKey = idConv.toBytes(jobId); Get get = new Get(rowKey); get.addColumn(Constants.RAW_FAM_BYTES, Constants.JOBHISTORY_COL_BYTES); Table rawTable = null; try { rawTable = hbaseConnec...
[ "public", "String", "getRawJobHistory", "(", "QualifiedJobId", "jobId", ")", "throws", "IOException", "{", "String", "historyData", "=", "null", ";", "byte", "[", "]", "rowKey", "=", "idConv", ".", "toBytes", "(", "jobId", ")", ";", "Get", "get", "=", "new...
Returns the raw job history file stored for the given cluster and job ID. @param jobId the cluster and job ID to look up @return the stored job history file contents or {@code null} if no corresponding record was found @throws IOException
[ "Returns", "the", "raw", "job", "history", "file", "stored", "for", "the", "given", "cluster", "and", "job", "ID", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java#L327-L348
2,633
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java
JobHistoryRawService.getApproxSubmitTime
public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, ...
java
public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, ...
[ "public", "long", "getApproxSubmitTime", "(", "Result", "value", ")", "throws", "MissingColumnInResultException", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Cannot get last modification time from \"", "+", "\"a n...
attempts to approximately set the job submit time based on the last modification time of the job history file @param value result @return approximate job submit time @throws MissingColumnInResultException
[ "attempts", "to", "approximately", "set", "the", "job", "submit", "time", "based", "on", "the", "last", "modification", "time", "of", "the", "job", "history", "file" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java#L500-L524
2,634
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java
JobHistoryRawService.markJobForReprocesssing
public void markJobForReprocesssing(QualifiedJobId jobId) throws IOException { Put p = new Put(idConv.toBytes(jobId)); p.addColumn(Constants.INFO_FAM_BYTES, Constants.RAW_COL_REPROCESS_BYTES, Bytes.toBytes(true)); Table rawTable = null; try { rawTable = hbaseConnection .getTable(...
java
public void markJobForReprocesssing(QualifiedJobId jobId) throws IOException { Put p = new Put(idConv.toBytes(jobId)); p.addColumn(Constants.INFO_FAM_BYTES, Constants.RAW_COL_REPROCESS_BYTES, Bytes.toBytes(true)); Table rawTable = null; try { rawTable = hbaseConnection .getTable(...
[ "public", "void", "markJobForReprocesssing", "(", "QualifiedJobId", "jobId", ")", "throws", "IOException", "{", "Put", "p", "=", "new", "Put", "(", "idConv", ".", "toBytes", "(", "jobId", ")", ")", ";", "p", ".", "addColumn", "(", "Constants", ".", "INFO_F...
Flags a job's RAW record for reprocessing @param jobId
[ "Flags", "a", "job", "s", "RAW", "record", "for", "reprocessing" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java#L543-L557
2,635
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java
JobHistoryRawService.getAggregatedStatusPut
public Put getAggregatedStatusPut(byte[] row, byte[] col, Boolean status) { Put put = new Put(row); put.addColumn(Constants.INFO_FAM_BYTES, col, Bytes.toBytes(status)); try { LOG.info(" agg status " + status + " and put " + put.toJSON()); } catch (IOException e) { // ignore json exception ...
java
public Put getAggregatedStatusPut(byte[] row, byte[] col, Boolean status) { Put put = new Put(row); put.addColumn(Constants.INFO_FAM_BYTES, col, Bytes.toBytes(status)); try { LOG.info(" agg status " + status + " and put " + put.toJSON()); } catch (IOException e) { // ignore json exception ...
[ "public", "Put", "getAggregatedStatusPut", "(", "byte", "[", "]", "row", ",", "byte", "[", "]", "col", ",", "Boolean", "status", ")", "{", "Put", "put", "=", "new", "Put", "(", "row", ")", ";", "put", ".", "addColumn", "(", "Constants", ".", "INFO_FA...
creates a put to be updated into the RAW table for aggregation status @param row key @param status of aggregation @return {@link Put}
[ "creates", "a", "put", "to", "be", "updated", "into", "the", "RAW", "table", "for", "aggregation", "status" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java#L591-L600
2,636
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java
JobHistoryRawService.getStatusAgg
public boolean getStatusAgg(byte[] row, byte[] col) throws IOException { Get g = new Get(row); g.addColumn(Constants.INFO_FAM_BYTES, col); Table rawTable = null; Cell cell = null; try { rawTable = hbaseConnection .getTable(TableName.valueOf(Constants.HISTORY_RAW_TABLE)); Result...
java
public boolean getStatusAgg(byte[] row, byte[] col) throws IOException { Get g = new Get(row); g.addColumn(Constants.INFO_FAM_BYTES, col); Table rawTable = null; Cell cell = null; try { rawTable = hbaseConnection .getTable(TableName.valueOf(Constants.HISTORY_RAW_TABLE)); Result...
[ "public", "boolean", "getStatusAgg", "(", "byte", "[", "]", "row", ",", "byte", "[", "]", "col", ")", "throws", "IOException", "{", "Get", "g", "=", "new", "Get", "(", "row", ")", ";", "g", ".", "addColumn", "(", "Constants", ".", "INFO_FAM_BYTES", "...
creates a Get to be fetch daily aggregation status from the RAW table @param row key @return {@link Get} @throws IOException
[ "creates", "a", "Get", "to", "be", "fetch", "daily", "aggregation", "status", "from", "the", "RAW", "table" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryRawService.java#L608-L634
2,637
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/FlowKey.java
FlowKey.compareTo
@Override public int compareTo(Object other) { if (other == null) { return -1; } FlowKey otherKey = (FlowKey)other; return new CompareToBuilder() .appendSuper(super.compareTo(other)) .append(getEncodedRunId(), otherKey.getEncodedRunId()) .toComparison(); }
java
@Override public int compareTo(Object other) { if (other == null) { return -1; } FlowKey otherKey = (FlowKey)other; return new CompareToBuilder() .appendSuper(super.compareTo(other)) .append(getEncodedRunId(), otherKey.getEncodedRunId()) .toComparison(); }
[ "@", "Override", "public", "int", "compareTo", "(", "Object", "other", ")", "{", "if", "(", "other", "==", "null", ")", "{", "return", "-", "1", ";", "}", "FlowKey", "otherKey", "=", "(", "FlowKey", ")", "other", ";", "return", "new", "CompareToBuilder...
Compares two FlowKey objects on the basis of their cluster, userName, appId and encodedRunId @param other @return 0 if this cluster, userName, appId and encodedRunId are equal to the other's cluster, userName, appId and encodedRunId, 1 if this cluster or userName or appId or encodedRunId are less than the other's clus...
[ "Compares", "two", "FlowKey", "objects", "on", "the", "basis", "of", "their", "cluster", "userName", "appId", "and", "encodedRunId" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/FlowKey.java#L86-L96
2,638
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryByIdService.java
JobHistoryByIdService.writeIndexes
public void writeIndexes(JobKey jobKey) throws IOException { // Defensive coding if (jobKey != null) { Table historyByJobIdTable = null; try { historyByJobIdTable = hbaseConnection .getTable(TableName.valueOf(Constants.HISTORY_BY_JOBID_TABLE)); byte[] jobKeyBytes = jobKe...
java
public void writeIndexes(JobKey jobKey) throws IOException { // Defensive coding if (jobKey != null) { Table historyByJobIdTable = null; try { historyByJobIdTable = hbaseConnection .getTable(TableName.valueOf(Constants.HISTORY_BY_JOBID_TABLE)); byte[] jobKeyBytes = jobKe...
[ "public", "void", "writeIndexes", "(", "JobKey", "jobKey", ")", "throws", "IOException", "{", "// Defensive coding", "if", "(", "jobKey", "!=", "null", ")", "{", "Table", "historyByJobIdTable", "=", "null", ";", "try", "{", "historyByJobIdTable", "=", "hbaseConn...
Create the secondary indexes records cluster!jobId->jobKey. @param jobKey @throws IOException if the entry cannot be written.
[ "Create", "the", "secondary", "indexes", "records", "cluster!jobId", "-", ">", "jobKey", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryByIdService.java#L95-L118
2,639
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java
ByteUtil.join
public static byte[] join(byte[] separator, byte[]... components) { if (components == null || components.length == 0) { return Constants.EMPTY_BYTES; } int finalSize = 0; if (separator != null) { finalSize = separator.length * (components.length - 1); } for (byte[] comp : components...
java
public static byte[] join(byte[] separator, byte[]... components) { if (components == null || components.length == 0) { return Constants.EMPTY_BYTES; } int finalSize = 0; if (separator != null) { finalSize = separator.length * (components.length - 1); } for (byte[] comp : components...
[ "public", "static", "byte", "[", "]", "join", "(", "byte", "[", "]", "separator", ",", "byte", "[", "]", "...", "components", ")", "{", "if", "(", "components", "==", "null", "||", "components", ".", "length", "==", "0", ")", "{", "return", "Constant...
Returns a single byte array containing all of the individual component arrays separated by the separator array. @param separator @param components @return
[ "Returns", "a", "single", "byte", "array", "containing", "all", "of", "the", "individual", "component", "arrays", "separated", "by", "the", "separator", "array", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java#L163-L187
2,640
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java
ByteUtil.safeCopy
public static byte[] safeCopy(byte[] source, int offset, int length) { if (length < 0 || source.length < offset+length) { return null; } byte[] copy = new byte[length]; System.arraycopy(source, offset, copy, 0, length); return copy; }
java
public static byte[] safeCopy(byte[] source, int offset, int length) { if (length < 0 || source.length < offset+length) { return null; } byte[] copy = new byte[length]; System.arraycopy(source, offset, copy, 0, length); return copy; }
[ "public", "static", "byte", "[", "]", "safeCopy", "(", "byte", "[", "]", "source", ",", "int", "offset", ",", "int", "length", ")", "{", "if", "(", "length", "<", "0", "||", "source", ".", "length", "<", "offset", "+", "length", ")", "{", "return",...
Returns a copy of the source byte array, starting at offset for the given length. If the offset + length is out of bounds for the array, returns null. @param source @param offset @param length @return
[ "Returns", "a", "copy", "of", "the", "source", "byte", "array", "starting", "at", "offset", "for", "the", "given", "length", ".", "If", "the", "offset", "+", "length", "is", "out", "of", "bounds", "for", "the", "array", "returns", "null", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java#L242-L249
2,641
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java
ByteUtil.getValueAsLong
public static long getValueAsLong(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { try { long retValue = Bytes.toLong(value); return retValue; } catch (NumberFormatException nfe) { LOG.error("Caught NFE while...
java
public static long getValueAsLong(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { try { long retValue = Bytes.toLong(value); return retValue; } catch (NumberFormatException nfe) { LOG.error("Caught NFE while...
[ "public", "static", "long", "getValueAsLong", "(", "final", "byte", "[", "]", "key", ",", "final", "Map", "<", "byte", "[", "]", ",", "byte", "[", "]", ">", "taskValues", ")", "{", "byte", "[", "]", "value", "=", "taskValues", ".", "get", "(", "key...
return a value from the NavigableMap as a long @param key @param taskValues @return value as Long or 0L
[ "return", "a", "value", "from", "the", "NavigableMap", "as", "a", "long" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java#L257-L276
2,642
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java
ByteUtil.getValueAsString
public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } }
java
public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } }
[ "public", "static", "String", "getValueAsString", "(", "final", "byte", "[", "]", "key", ",", "final", "Map", "<", "byte", "[", "]", ",", "byte", "[", "]", ">", "taskValues", ")", "{", "byte", "[", "]", "value", "=", "taskValues", ".", "get", "(", ...
return a value from the NavigableMap as a String @param key @param taskValues @return value as a String or ""
[ "return", "a", "value", "from", "the", "NavigableMap", "as", "a", "String" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java#L284-L292
2,643
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java
ByteUtil.getValueAsDouble
public static double getValueAsDouble(byte[] key, NavigableMap<byte[], byte[]> infoValues) { byte[] value = infoValues.get(key); if (value != null) { return Bytes.toDouble(value); } else { return 0.0; } }
java
public static double getValueAsDouble(byte[] key, NavigableMap<byte[], byte[]> infoValues) { byte[] value = infoValues.get(key); if (value != null) { return Bytes.toDouble(value); } else { return 0.0; } }
[ "public", "static", "double", "getValueAsDouble", "(", "byte", "[", "]", "key", ",", "NavigableMap", "<", "byte", "[", "]", ",", "byte", "[", "]", ">", "infoValues", ")", "{", "byte", "[", "]", "value", "=", "infoValues", ".", "get", "(", "key", ")",...
return a value from the NavigableMap as a Double @param key to be looked up for the value @param infoValues - the map containing the key values @return value as Double or 0.0
[ "return", "a", "value", "from", "the", "NavigableMap", "as", "a", "Double" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java#L300-L308
2,644
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java
ByteUtil.getValueAsInt
public static int getValueAsInt(byte[] key, Map<byte[], byte[]> infoValues) { byte[] value = infoValues.get(key); if (value != null) { try { int retValue = Bytes.toInt(value); return retValue; } catch (NumberFormatException nfe) { LOG.error("Caught NFE while converting to int...
java
public static int getValueAsInt(byte[] key, Map<byte[], byte[]> infoValues) { byte[] value = infoValues.get(key); if (value != null) { try { int retValue = Bytes.toInt(value); return retValue; } catch (NumberFormatException nfe) { LOG.error("Caught NFE while converting to int...
[ "public", "static", "int", "getValueAsInt", "(", "byte", "[", "]", "key", ",", "Map", "<", "byte", "[", "]", ",", "byte", "[", "]", ">", "infoValues", ")", "{", "byte", "[", "]", "value", "=", "infoValues", ".", "get", "(", "key", ")", ";", "if",...
get value from a map as an int @param key @param infoValues @return int
[ "get", "value", "from", "a", "map", "as", "an", "int" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/ByteUtil.java#L316-L334
2,645
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/AppKey.java
AppKey.compareTo
@Override public int compareTo(Object other) { if (other == null) { return -1; } AppKey otherKey = (AppKey) other; return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(this.userName, otherKey.getUserName()) .append(this.appId, otherKey.getApp...
java
@Override public int compareTo(Object other) { if (other == null) { return -1; } AppKey otherKey = (AppKey) other; return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(this.userName, otherKey.getUserName()) .append(this.appId, otherKey.getApp...
[ "@", "Override", "public", "int", "compareTo", "(", "Object", "other", ")", "{", "if", "(", "other", "==", "null", ")", "{", "return", "-", "1", ";", "}", "AppKey", "otherKey", "=", "(", "AppKey", ")", "other", ";", "return", "new", "CompareToBuilder",...
Compares two AppKey objects on the basis of their cluster, userName, appId and encodedRunId @param other @return 0 if this cluster, userName, appId are equal to the other's cluster, userName, appId, 1 if this cluster or userName or appId are less than the other's cluster, userName, appId, -1 if this cluster and userNam...
[ "Compares", "two", "AppKey", "objects", "on", "the", "basis", "of", "their", "cluster", "userName", "appId", "and", "encodedRunId" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/AppKey.java#L84-L95
2,646
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserFactory.java
JobHistoryFileParserFactory.getVersion
public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { // the first 10 bytes in a hadoop2.0 history file contain Avro-Json String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equa...
java
public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { // the first 10 bytes in a hadoop2.0 history file contain Avro-Json String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equa...
[ "public", "static", "HadoopVersion", "getVersion", "(", "byte", "[", "]", "historyFileContents", ")", "{", "if", "(", "historyFileContents", ".", "length", ">", "HADOOP2_VERSION_LENGTH", ")", "{", "// the first 10 bytes in a hadoop2.0 history file contain Avro-Json", "Strin...
determines the verison of hadoop that the history file belongs to @return returns 1 for hadoop 1 (pre MAPREDUCE-1016) returns 2 for newer job history files (newer job history files have "AVRO-JSON" as the signature at the start of the file, REFERENCE: https://issues.apache.org/jira/browse/MAPREDUCE-1016? \ focusedComm...
[ "determines", "the", "verison", "of", "hadoop", "that", "the", "history", "file", "belongs", "to" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserFactory.java#L50-L60
2,647
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/mapreduce/CombineFileInputFormat.java
CombineFileInputFormat.createPool
protected void createPool(PathFilter... filters) { MultiPathFilter multi = new MultiPathFilter(); for (PathFilter f: filters) { multi.add(f); } pools.add(multi); }
java
protected void createPool(PathFilter... filters) { MultiPathFilter multi = new MultiPathFilter(); for (PathFilter f: filters) { multi.add(f); } pools.add(multi); }
[ "protected", "void", "createPool", "(", "PathFilter", "...", "filters", ")", "{", "MultiPathFilter", "multi", "=", "new", "MultiPathFilter", "(", ")", ";", "for", "(", "PathFilter", "f", ":", "filters", ")", "{", "multi", ".", "add", "(", "f", ")", ";", ...
Create a new pool and add the filters to it. A pathname can satisfy any one of the specified filters. A split cannot have files from different pools.
[ "Create", "a", "new", "pool", "and", "add", "the", "filters", "to", "it", ".", "A", "pathname", "can", "satisfy", "any", "one", "of", "the", "specified", "filters", ".", "A", "split", "cannot", "have", "files", "from", "different", "pools", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/mapreduce/CombineFileInputFormat.java#L129-L135
2,648
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/mapreduce/CombineFileInputFormat.java
CombineFileInputFormat.addCreatedSplit
private void addCreatedSplit(List<InputSplit> splitList, List<String> locations, ArrayList<OneBlockInfo> validBlocks) { // create an input split Path[] fl = new Path[validBlocks.size()]; long[] offset = new long[validBlocks.size()]; long[] ...
java
private void addCreatedSplit(List<InputSplit> splitList, List<String> locations, ArrayList<OneBlockInfo> validBlocks) { // create an input split Path[] fl = new Path[validBlocks.size()]; long[] offset = new long[validBlocks.size()]; long[] ...
[ "private", "void", "addCreatedSplit", "(", "List", "<", "InputSplit", ">", "splitList", ",", "List", "<", "String", ">", "locations", ",", "ArrayList", "<", "OneBlockInfo", ">", "validBlocks", ")", "{", "// create an input split", "Path", "[", "]", "fl", "=", ...
Create a single split from the list of blocks specified in validBlocks Add this new split into splitList.
[ "Create", "a", "single", "split", "from", "the", "list", "of", "blocks", "specified", "in", "validBlocks", "Add", "this", "new", "split", "into", "splitList", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/mapreduce/CombineFileInputFormat.java#L432-L449
2,649
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobKeyConverter.java
JobKeyConverter.toBytes
@Override public byte[] toBytes(JobKey jobKey) { if (jobKey == null) { return Constants.EMPTY_BYTES; } else { return ByteUtil.join(Constants.SEP_BYTES, Bytes.toBytes(jobKey.getCluster()), Bytes.toBytes(jobKey.getUserName()), Bytes.toBytes(jobKey.getAppId()), ...
java
@Override public byte[] toBytes(JobKey jobKey) { if (jobKey == null) { return Constants.EMPTY_BYTES; } else { return ByteUtil.join(Constants.SEP_BYTES, Bytes.toBytes(jobKey.getCluster()), Bytes.toBytes(jobKey.getUserName()), Bytes.toBytes(jobKey.getAppId()), ...
[ "@", "Override", "public", "byte", "[", "]", "toBytes", "(", "JobKey", "jobKey", ")", "{", "if", "(", "jobKey", "==", "null", ")", "{", "return", "Constants", ".", "EMPTY_BYTES", ";", "}", "else", "{", "return", "ByteUtil", ".", "join", "(", "Constants...
Returns the byte encoded representation of a JobKey @param jobKey the JobKey to serialize @return the byte encoded representation of the JobKey
[ "Returns", "the", "byte", "encoded", "representation", "of", "a", "JobKey" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobKeyConverter.java#L36-L48
2,650
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobKeyConverter.java
JobKeyConverter.parseJobKey
public JobKey parseJobKey(byte[][] keyComponents) { // runId is inverted in the bytes representation so we get reverse // chronological order long encodedRunId = keyComponents.length > 3 ? Bytes.toLong(keyComponents[3]) : Long.MAX_VALUE; JobId jobId = keyComponents.length > 4 ? idConv.f...
java
public JobKey parseJobKey(byte[][] keyComponents) { // runId is inverted in the bytes representation so we get reverse // chronological order long encodedRunId = keyComponents.length > 3 ? Bytes.toLong(keyComponents[3]) : Long.MAX_VALUE; JobId jobId = keyComponents.length > 4 ? idConv.f...
[ "public", "JobKey", "parseJobKey", "(", "byte", "[", "]", "[", "]", "keyComponents", ")", "{", "// runId is inverted in the bytes representation so we get reverse", "// chronological order", "long", "encodedRunId", "=", "keyComponents", ".", "length", ">", "3", "?", "By...
Constructs a JobKey instance from the individual byte encoded key components. @param keyComponents as split on @return a JobKey instance containing the decoded components
[ "Constructs", "a", "JobKey", "instance", "from", "the", "individual", "byte", "encoded", "key", "components", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobKeyConverter.java#L72-L86
2,651
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/VersionInfo.java
VersionInfo.compareTo
@Override public int compareTo(VersionInfo other) { if (this.timestamp == other.timestamp) { return 0; } if (this.timestamp < other.timestamp) { return 1; } return -1; }
java
@Override public int compareTo(VersionInfo other) { if (this.timestamp == other.timestamp) { return 0; } if (this.timestamp < other.timestamp) { return 1; } return -1; }
[ "@", "Override", "public", "int", "compareTo", "(", "VersionInfo", "other", ")", "{", "if", "(", "this", ".", "timestamp", "==", "other", ".", "timestamp", ")", "{", "return", "0", ";", "}", "if", "(", "this", ".", "timestamp", "<", "other", ".", "ti...
Compares two VersionInfo timestamps to order them in reverse chronological order @param other @return 0 if timestamps are equal, 1 if this timestamp less than other timestamp, -1 if this timestamp is greater than other timestamp
[ "Compares", "two", "VersionInfo", "timestamps", "to", "order", "them", "in", "reverse", "chronological", "order" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/VersionInfo.java#L55-L64
2,652
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/TaskKey.java
TaskKey.compareTo
@Override public int compareTo(Object other) { if (other == null) { return -1; } TaskKey otherKey = (TaskKey) other; return new CompareToBuilder().appendSuper(super.compareTo(otherKey)) .append(this.taskId, otherKey.getTaskId()) .toComparison(); }
java
@Override public int compareTo(Object other) { if (other == null) { return -1; } TaskKey otherKey = (TaskKey) other; return new CompareToBuilder().appendSuper(super.compareTo(otherKey)) .append(this.taskId, otherKey.getTaskId()) .toComparison(); }
[ "@", "Override", "public", "int", "compareTo", "(", "Object", "other", ")", "{", "if", "(", "other", "==", "null", ")", "{", "return", "-", "1", ";", "}", "TaskKey", "otherKey", "=", "(", "TaskKey", ")", "other", ";", "return", "new", "CompareToBuilder...
Compares two TaskKey objects on the basis of their taskId @param other @return 0 if the taskIds are equal, 1 if this taskId is greater than other taskId, -1 if this taskId is less than other taskId
[ "Compares", "two", "TaskKey", "objects", "on", "the", "basis", "of", "their", "taskId" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/TaskKey.java#L61-L70
2,653
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/JobKey.java
JobKey.compareTo
@Override public int compareTo(Object other) { if (other == null) { return -1; } JobKey otherKey = (JobKey)other; return new CompareToBuilder().appendSuper(super.compareTo(otherKey)) .append(this.jobId, otherKey.getJobId()) .toComparison(); }
java
@Override public int compareTo(Object other) { if (other == null) { return -1; } JobKey otherKey = (JobKey)other; return new CompareToBuilder().appendSuper(super.compareTo(otherKey)) .append(this.jobId, otherKey.getJobId()) .toComparison(); }
[ "@", "Override", "public", "int", "compareTo", "(", "Object", "other", ")", "{", "if", "(", "other", "==", "null", ")", "{", "return", "-", "1", ";", "}", "JobKey", "otherKey", "=", "(", "JobKey", ")", "other", ";", "return", "new", "CompareToBuilder",...
Compares two JobKey QualifiedJobId @param other @return 0 if the Qualified Job Ids are equal, 1 if this QualifiedJobId greater than other QualifiedJobId, -1 if this QualifiedJobId is less than other QualifiedJobId
[ "Compares", "two", "JobKey", "QualifiedJobId" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/JobKey.java#L119-L128
2,654
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserBase.java
JobHistoryFileParserBase.getHadoopVersionPut
public Put getHadoopVersionPut(HadoopVersion historyFileVersion, byte[] jobKeyBytes) { Put pVersion = new Put(jobKeyBytes); byte[] valueBytes = null; valueBytes = Bytes.toBytes(historyFileVersion.toString()); byte[] qualifier = Bytes.toBytes(JobHistoryKeys.hadoopversion.toString().toLowerCase()); pVersio...
java
public Put getHadoopVersionPut(HadoopVersion historyFileVersion, byte[] jobKeyBytes) { Put pVersion = new Put(jobKeyBytes); byte[] valueBytes = null; valueBytes = Bytes.toBytes(historyFileVersion.toString()); byte[] qualifier = Bytes.toBytes(JobHistoryKeys.hadoopversion.toString().toLowerCase()); pVersio...
[ "public", "Put", "getHadoopVersionPut", "(", "HadoopVersion", "historyFileVersion", ",", "byte", "[", "]", "jobKeyBytes", ")", "{", "Put", "pVersion", "=", "new", "Put", "(", "jobKeyBytes", ")", ";", "byte", "[", "]", "valueBytes", "=", "null", ";", "valueBy...
generates a put that sets the hadoop version for a record @param historyFileVersion @param jobKeyBytes @return Put
[ "generates", "a", "put", "that", "sets", "the", "hadoop", "version", "for", "a", "record" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserBase.java#L57-L64
2,655
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserBase.java
JobHistoryFileParserBase.getSubmitTimeMillisFromJobHistory
public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: // look for the job sub...
java
public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: // look for the job sub...
[ "public", "static", "long", "getSubmitTimeMillisFromJobHistory", "(", "byte", "[", "]", "jobHistoryRaw", ")", "{", "long", "submitTimeMillis", "=", "0", ";", "if", "(", "null", "==", "jobHistoryRaw", ")", "{", "return", "submitTimeMillis", ";", "}", "HadoopVersi...
fetches the submit time from a raw job history byte representation @param jobHistoryRaw from which to pull the SUBMIT_TIME @return the job submit time in milliseconds since January 1, 1970 UTC; or 0 if no value can be found.
[ "fetches", "the", "submit", "time", "from", "a", "raw", "job", "history", "byte", "representation" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserBase.java#L162-L229
2,656
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/FlowEventService.java
FlowEventService.addEvent
public void addEvent(FlowEvent event) throws IOException { Put p = createPutForEvent(event); Table eventTable = null; try { eventTable = hbaseConnection .getTable(TableName.valueOf(Constants.FLOW_EVENT_TABLE)); eventTable.put(p); } finally { if (eventTable != null) { ...
java
public void addEvent(FlowEvent event) throws IOException { Put p = createPutForEvent(event); Table eventTable = null; try { eventTable = hbaseConnection .getTable(TableName.valueOf(Constants.FLOW_EVENT_TABLE)); eventTable.put(p); } finally { if (eventTable != null) { ...
[ "public", "void", "addEvent", "(", "FlowEvent", "event", ")", "throws", "IOException", "{", "Put", "p", "=", "createPutForEvent", "(", "event", ")", ";", "Table", "eventTable", "=", "null", ";", "try", "{", "eventTable", "=", "hbaseConnection", ".", "getTabl...
Stores a single flow event row @param event @throws IOException
[ "Stores", "a", "single", "flow", "event", "row" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/FlowEventService.java#L83-L95
2,657
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/FlowEventService.java
FlowEventService.addEvents
public void addEvents(List<FlowEvent> events) throws IOException { List<Put> puts = new ArrayList<Put>(events.size()); for (FlowEvent e : events) { puts.add(createPutForEvent(e)); } Table eventTable = null; try { eventTable = hbaseConnection .getTable(TableName.valueOf(Constant...
java
public void addEvents(List<FlowEvent> events) throws IOException { List<Put> puts = new ArrayList<Put>(events.size()); for (FlowEvent e : events) { puts.add(createPutForEvent(e)); } Table eventTable = null; try { eventTable = hbaseConnection .getTable(TableName.valueOf(Constant...
[ "public", "void", "addEvents", "(", "List", "<", "FlowEvent", ">", "events", ")", "throws", "IOException", "{", "List", "<", "Put", ">", "puts", "=", "new", "ArrayList", "<", "Put", ">", "(", "events", ".", "size", "(", ")", ")", ";", "for", "(", "...
Stores a batch of events @param events @throws IOException
[ "Stores", "a", "batch", "of", "events" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/FlowEventService.java#L102-L117
2,658
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsKeyConverter.java
HdfsStatsKeyConverter.toBytes
@Override public byte[] toBytes(HdfsStatsKey hdfsStatsKey) { if (hdfsStatsKey == null || hdfsStatsKey.getQualifiedPathKey() == null) { return HdfsConstants.EMPTY_BYTES; } else { if (StringUtils.isBlank(hdfsStatsKey.getQualifiedPathKey().getNamespace())) { // hadoop1 or non federated namesp...
java
@Override public byte[] toBytes(HdfsStatsKey hdfsStatsKey) { if (hdfsStatsKey == null || hdfsStatsKey.getQualifiedPathKey() == null) { return HdfsConstants.EMPTY_BYTES; } else { if (StringUtils.isBlank(hdfsStatsKey.getQualifiedPathKey().getNamespace())) { // hadoop1 or non federated namesp...
[ "@", "Override", "public", "byte", "[", "]", "toBytes", "(", "HdfsStatsKey", "hdfsStatsKey", ")", "{", "if", "(", "hdfsStatsKey", "==", "null", "||", "hdfsStatsKey", ".", "getQualifiedPathKey", "(", ")", "==", "null", ")", "{", "return", "HdfsConstants", "."...
Returns the byte encoded representation of a HdfsStatsKey @param hdfsStats the HdfsStatsKey to serialize @return the byte encoded representation of the HdfsStatsKey
[ "Returns", "the", "byte", "encoded", "representation", "of", "a", "HdfsStatsKey" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsKeyConverter.java#L44-L64
2,659
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsKeyConverter.java
HdfsStatsKeyConverter.parseHdfsStatsKey
public static HdfsStatsKey parseHdfsStatsKey(byte[][] keyComponents) { return new HdfsStatsKey(new QualifiedPathKey( // cluster: (keyComponents.length > 1 ? Bytes.toString(keyComponents[1]) : null), // path: (keyComponents.length > 2 ? Bytes.toString(keyComponents[2]) : null), ...
java
public static HdfsStatsKey parseHdfsStatsKey(byte[][] keyComponents) { return new HdfsStatsKey(new QualifiedPathKey( // cluster: (keyComponents.length > 1 ? Bytes.toString(keyComponents[1]) : null), // path: (keyComponents.length > 2 ? Bytes.toString(keyComponents[2]) : null), ...
[ "public", "static", "HdfsStatsKey", "parseHdfsStatsKey", "(", "byte", "[", "]", "[", "]", "keyComponents", ")", "{", "return", "new", "HdfsStatsKey", "(", "new", "QualifiedPathKey", "(", "// cluster:", "(", "keyComponents", ".", "length", ">", "1", "?", "Bytes...
Constructs a HdfsStatsKey instance from the individual byte encoded key components. @param keyComponents as split on Separator '!' @return a HdfsStatsKey instance containing the decoded components
[ "Constructs", "a", "HdfsStatsKey", "instance", "from", "the", "individual", "byte", "encoded", "key", "components", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsKeyConverter.java#L84-L94
2,660
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsKeyConverter.java
HdfsStatsKeyConverter.splitHdfsStatsKey
static byte[][] splitHdfsStatsKey(byte[] rawKey) { byte[][] splits = ByteUtil.split(rawKey, HdfsConstants.SEP_BYTES, HdfsConstants.NUM_HDFS_USAGE_ROWKEY_COMPONENTS); return splits; }
java
static byte[][] splitHdfsStatsKey(byte[] rawKey) { byte[][] splits = ByteUtil.split(rawKey, HdfsConstants.SEP_BYTES, HdfsConstants.NUM_HDFS_USAGE_ROWKEY_COMPONENTS); return splits; }
[ "static", "byte", "[", "]", "[", "]", "splitHdfsStatsKey", "(", "byte", "[", "]", "rawKey", ")", "{", "byte", "[", "]", "[", "]", "splits", "=", "ByteUtil", ".", "split", "(", "rawKey", ",", "HdfsConstants", ".", "SEP_BYTES", ",", "HdfsConstants", ".",...
Handles splitting the encoded hdfsStats key @param rawKey byte encoded representation of the path key @return
[ "Handles", "splitting", "the", "encoded", "hdfsStats", "key" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsKeyConverter.java#L102-L106
2,661
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/TaskDetails.java
TaskDetails.compareTo
@Override public int compareTo(TaskDetails otherTask) { if (otherTask == null) { return -1; } return new CompareToBuilder().append(this.taskKey, otherTask.getTaskKey()) .toComparison(); }
java
@Override public int compareTo(TaskDetails otherTask) { if (otherTask == null) { return -1; } return new CompareToBuilder().append(this.taskKey, otherTask.getTaskKey()) .toComparison(); }
[ "@", "Override", "public", "int", "compareTo", "(", "TaskDetails", "otherTask", ")", "{", "if", "(", "otherTask", "==", "null", ")", "{", "return", "-", "1", ";", "}", "return", "new", "CompareToBuilder", "(", ")", ".", "append", "(", "this", ".", "tas...
Compares two TaskDetails objects on the basis of their TaskKey @param other @return 0 if this TaskKey is equal to the other TaskKey, 1 if this TaskKey greater than other TaskKey, -1 if this TaskKey is less than other TaskKey
[ "Compares", "two", "TaskDetails", "objects", "on", "the", "basis", "of", "their", "TaskKey" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/TaskDetails.java#L128-L136
2,662
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobFile.java
JobFile.parseFilename
private void parseFilename() { // Add additional filtering to discard empty files, or files ending in .crc if ((filename != null) && (filename.length() > 0) && (!filename.endsWith(".crc"))) { Matcher matcher = PATTERN.matcher(filename); if (matcher.matches()) { // jobTracker = ""; ...
java
private void parseFilename() { // Add additional filtering to discard empty files, or files ending in .crc if ((filename != null) && (filename.length() > 0) && (!filename.endsWith(".crc"))) { Matcher matcher = PATTERN.matcher(filename); if (matcher.matches()) { // jobTracker = ""; ...
[ "private", "void", "parseFilename", "(", ")", "{", "// Add additional filtering to discard empty files, or files ending in .crc", "if", "(", "(", "filename", "!=", "null", ")", "&&", "(", "filename", ".", "length", "(", ")", ">", "0", ")", "&&", "(", "!", "filen...
Parse the filename and pull the jobtracker and jobid out of it.
[ "Parse", "the", "filename", "and", "pull", "the", "jobtracker", "and", "jobid", "out", "of", "it", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobFile.java#L74-L98
2,663
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/BatchUtil.java
BatchUtil.shouldRetain
public static boolean shouldRetain(int i, int maxRetention, int length) { // Files with a zero-based index greater or equal than the retentionCutoff // should be retained. int retentionCutoff = length - maxRetention; boolean retain = (i >= retentionCutoff) ? true : false; return retain; }
java
public static boolean shouldRetain(int i, int maxRetention, int length) { // Files with a zero-based index greater or equal than the retentionCutoff // should be retained. int retentionCutoff = length - maxRetention; boolean retain = (i >= retentionCutoff) ? true : false; return retain; }
[ "public", "static", "boolean", "shouldRetain", "(", "int", "i", ",", "int", "maxRetention", ",", "int", "length", ")", "{", "// Files with a zero-based index greater or equal than the retentionCutoff", "// should be retained.", "int", "retentionCutoff", "=", "length", "-", ...
Method that can be used when iterating over an array and you want to retain only maxRetention items. @param i index of element in ordered array of length @param maxRetention total number of elements to retain. @param length of the ordered array @return whether this element should be retained or not.
[ "Method", "that", "can", "be", "used", "when", "iterating", "over", "an", "array", "and", "you", "want", "to", "retain", "only", "maxRetention", "items", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/BatchUtil.java#L41-L47
2,664
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java
JobHistoryFileParserHadoop2.getJobStatusPut
private Put getJobStatusPut() { Put pStatus = new Put(jobKeyBytes); byte[] valueBytes = Bytes.toBytes(this.jobStatus); byte[] qualifier = Bytes.toBytes(JobHistoryKeys.JOB_STATUS.toString().toLowerCase()); pStatus.addColumn(Constants.INFO_FAM_BYTES, qualifier, valueBytes); return pStatus; }
java
private Put getJobStatusPut() { Put pStatus = new Put(jobKeyBytes); byte[] valueBytes = Bytes.toBytes(this.jobStatus); byte[] qualifier = Bytes.toBytes(JobHistoryKeys.JOB_STATUS.toString().toLowerCase()); pStatus.addColumn(Constants.INFO_FAM_BYTES, qualifier, valueBytes); return pStatus; }
[ "private", "Put", "getJobStatusPut", "(", ")", "{", "Put", "pStatus", "=", "new", "Put", "(", "jobKeyBytes", ")", ";", "byte", "[", "]", "valueBytes", "=", "Bytes", ".", "toBytes", "(", "this", ".", "jobStatus", ")", ";", "byte", "[", "]", "qualifier",...
generates a put for job status @return Put that contains Job Status
[ "generates", "a", "put", "for", "job", "status" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java#L321-L327
2,665
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java
JobHistoryFileParserHadoop2.understandSchema
private void understandSchema(String schema) throws JSONException { JSONObject j1 = new JSONObject(schema); JSONArray fields = j1.getJSONArray(FIELDS); String fieldName; String fieldTypeValue; Object recName; for (int k = 0; k < fields.length(); k++) { if (fields.get(k) == null) { ...
java
private void understandSchema(String schema) throws JSONException { JSONObject j1 = new JSONObject(schema); JSONArray fields = j1.getJSONArray(FIELDS); String fieldName; String fieldTypeValue; Object recName; for (int k = 0; k < fields.length(); k++) { if (fields.get(k) == null) { ...
[ "private", "void", "understandSchema", "(", "String", "schema", ")", "throws", "JSONException", "{", "JSONObject", "j1", "=", "new", "JSONObject", "(", "schema", ")", ";", "JSONArray", "fields", "=", "j1", ".", "getJSONArray", "(", "FIELDS", ")", ";", "Strin...
understand the schema so that we can parse the rest of the file @throws JSONException
[ "understand", "the", "schema", "so", "that", "we", "can", "parse", "the", "rest", "of", "the", "file" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java#L333-L378
2,666
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java
JobHistoryFileParserHadoop2.iterateAndPreparePuts
private void iterateAndPreparePuts(JSONObject eventDetails, Put p, Hadoop2RecordType recType) throws JSONException { Iterator<?> keys = eventDetails.keys(); while (keys.hasNext()) { String key = (String) keys.next(); processAllTypes(p, recType, eventDetails, key); } }
java
private void iterateAndPreparePuts(JSONObject eventDetails, Put p, Hadoop2RecordType recType) throws JSONException { Iterator<?> keys = eventDetails.keys(); while (keys.hasNext()) { String key = (String) keys.next(); processAllTypes(p, recType, eventDetails, key); } }
[ "private", "void", "iterateAndPreparePuts", "(", "JSONObject", "eventDetails", ",", "Put", "p", ",", "Hadoop2RecordType", "recType", ")", "throws", "JSONException", "{", "Iterator", "<", "?", ">", "keys", "=", "eventDetails", ".", "keys", "(", ")", ";", "while...
iterate over the event details and prepare puts @throws JSONException
[ "iterate", "over", "the", "event", "details", "and", "prepare", "puts" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java#L488-L495
2,667
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java
JobHistoryFileParserHadoop2.getKey
private String getKey(String key) throws IllegalArgumentException { String checkKey = JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING.containsKey(key) ? JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING .get(key) : key; return (JobHistoryKeys.valueOf(checkKey).toString()); }
java
private String getKey(String key) throws IllegalArgumentException { String checkKey = JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING.containsKey(key) ? JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING .get(key) : key; return (JobHistoryKeys.valueOf(checkKey).toString()); }
[ "private", "String", "getKey", "(", "String", "key", ")", "throws", "IllegalArgumentException", "{", "String", "checkKey", "=", "JobHistoryKeys", ".", "HADOOP2_TO_HADOOP1_MAPPING", ".", "containsKey", "(", "key", ")", "?", "JobHistoryKeys", ".", "HADOOP2_TO_HADOOP1_MA...
maintains compatibility between hadoop 1.0 keys and hadoop 2.0 keys. It also confirms that this key exists in JobHistoryKeys enum @throws IllegalArgumentException NullPointerException
[ "maintains", "compatibility", "between", "hadoop", "1", ".", "0", "keys", "and", "hadoop", "2", ".", "0", "keys", ".", "It", "also", "confirms", "that", "this", "key", "exists", "in", "JobHistoryKeys", "enum" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java#L597-L602
2,668
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java
JobHistoryFileParserHadoop2.populatePut
private void populatePut(Put p, byte[] family, String key, long value) { byte[] valueBytes = null; valueBytes = (value != 0L) ? Bytes.toBytes(value) : Constants.ZERO_LONG_BYTES; byte[] qualifier = Bytes.toBytes(getKey(key).toLowerCase()); p.addColumn(family, qualifier, valueBytes); }
java
private void populatePut(Put p, byte[] family, String key, long value) { byte[] valueBytes = null; valueBytes = (value != 0L) ? Bytes.toBytes(value) : Constants.ZERO_LONG_BYTES; byte[] qualifier = Bytes.toBytes(getKey(key).toLowerCase()); p.addColumn(family, qualifier, valueBytes); }
[ "private", "void", "populatePut", "(", "Put", "p", ",", "byte", "[", "]", "family", ",", "String", "key", ",", "long", "value", ")", "{", "byte", "[", "]", "valueBytes", "=", "null", ";", "valueBytes", "=", "(", "value", "!=", "0L", ")", "?", "Byte...
populates a put for long values @param {@link Put} p @param {@link Constants} family @param String key @param long value
[ "populates", "a", "put", "for", "long", "values" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java#L611-L617
2,669
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java
JobHistoryFileParserHadoop2.getValue
byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + this.jobKey); } if (Long.clas...
java
byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + this.jobKey); } if (Long.clas...
[ "byte", "[", "]", "getValue", "(", "String", "key", ",", "int", "value", ")", "{", "byte", "[", "]", "valueBytes", "=", "null", ";", "Class", "<", "?", ">", "clazz", "=", "JobHistoryKeys", ".", "KEY_TYPES", ".", "get", "(", "JobHistoryKeys", ".", "va...
gets the int values as ints or longs some keys in 2.0 are now int, they were longs in 1.0 this will maintain compatiblity between 1.0 and 2.0 by casting those ints to long keeping this function package level visible (unit testing) @throws IllegalArgumentException if new key is encountered
[ "gets", "the", "int", "values", "as", "ints", "or", "longs", "some", "keys", "in", "2", ".", "0", "are", "now", "int", "they", "were", "longs", "in", "1", ".", "0", "this", "will", "maintain", "compatiblity", "between", "1", ".", "0", "and", "2", "...
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java#L626-L639
2,670
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java
JobHistoryFileParserHadoop2.getTaskKey
public byte[] getTaskKey(String prefix, String jobNumber, String fullId) { String taskComponent = fullId; if (fullId == null) { taskComponent = ""; } else { String expectedPrefix = prefix + jobNumber + "_"; if ((fullId.startsWith(expectedPrefix)) && (fullId.length() > expectedPrefix.length...
java
public byte[] getTaskKey(String prefix, String jobNumber, String fullId) { String taskComponent = fullId; if (fullId == null) { taskComponent = ""; } else { String expectedPrefix = prefix + jobNumber + "_"; if ((fullId.startsWith(expectedPrefix)) && (fullId.length() > expectedPrefix.length...
[ "public", "byte", "[", "]", "getTaskKey", "(", "String", "prefix", ",", "String", "jobNumber", ",", "String", "fullId", ")", "{", "String", "taskComponent", "=", "fullId", ";", "if", "(", "fullId", "==", "null", ")", "{", "taskComponent", "=", "\"\"", ";...
Returns the Task ID or Task Attempt ID, stripped of the leading job ID, appended to the job row key.
[ "Returns", "the", "Task", "ID", "or", "Task", "Attempt", "ID", "stripped", "of", "the", "leading", "job", "ID", "appended", "to", "the", "job", "row", "key", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java#L793-L804
2,671
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java
JobHistoryFileParserHadoop2.getAMKey
public byte[] getAMKey(String prefix, String fullId) { String taskComponent = prefix + fullId; return taskKeyConv.toBytes(new TaskKey(this.jobKey, taskComponent)); }
java
public byte[] getAMKey(String prefix, String fullId) { String taskComponent = prefix + fullId; return taskKeyConv.toBytes(new TaskKey(this.jobKey, taskComponent)); }
[ "public", "byte", "[", "]", "getAMKey", "(", "String", "prefix", ",", "String", "fullId", ")", "{", "String", "taskComponent", "=", "prefix", "+", "fullId", ";", "return", "taskKeyConv", ".", "toBytes", "(", "new", "TaskKey", "(", "this", ".", "jobKey", ...
Returns the AM Attempt id stripped of the leading job ID, appended to the job row key.
[ "Returns", "the", "AM", "Attempt", "id", "stripped", "of", "the", "leading", "job", "ID", "appended", "to", "the", "job", "row", "key", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java#L809-L813
2,672
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java
JobHistoryFileParserHadoop2.printAllPuts
public void printAllPuts(List<Put> p) { for (Put p1 : p) { Map<byte[], List<KeyValue>> d = p1.getFamilyMap(); for (byte[] k : d.keySet()) { System.out.println(" k " + Bytes.toString(k)); } for (List<KeyValue> lkv : d.values()) { for (KeyValue kv : lkv) { System.out....
java
public void printAllPuts(List<Put> p) { for (Put p1 : p) { Map<byte[], List<KeyValue>> d = p1.getFamilyMap(); for (byte[] k : d.keySet()) { System.out.println(" k " + Bytes.toString(k)); } for (List<KeyValue> lkv : d.values()) { for (KeyValue kv : lkv) { System.out....
[ "public", "void", "printAllPuts", "(", "List", "<", "Put", ">", "p", ")", "{", "for", "(", "Put", "p1", ":", "p", ")", "{", "Map", "<", "byte", "[", "]", ",", "List", "<", "KeyValue", ">", ">", "d", "=", "p1", ".", "getFamilyMap", "(", ")", "...
utitlity function for printing all puts
[ "utitlity", "function", "for", "printing", "all", "puts" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java#L835-L848
2,673
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/FlowQueueService.java
FlowQueueService.moveFlow
public void moveFlow(FlowQueueKey oldKey, FlowQueueKey newKey) throws DataException, IOException { byte[] oldRowKey = queueKeyConverter.toBytes(oldKey); Get get = new Get(oldRowKey); Table flowQueueTable = null; try { flowQueueTable = hbaseConnection .getTable(TableName.valueOf(Con...
java
public void moveFlow(FlowQueueKey oldKey, FlowQueueKey newKey) throws DataException, IOException { byte[] oldRowKey = queueKeyConverter.toBytes(oldKey); Get get = new Get(oldRowKey); Table flowQueueTable = null; try { flowQueueTable = hbaseConnection .getTable(TableName.valueOf(Con...
[ "public", "void", "moveFlow", "(", "FlowQueueKey", "oldKey", ",", "FlowQueueKey", "newKey", ")", "throws", "DataException", ",", "IOException", "{", "byte", "[", "]", "oldRowKey", "=", "queueKeyConverter", ".", "toBytes", "(", "oldKey", ")", ";", "Get", "get",...
Moves a flow_queue record from one row key to another. All Cells in the existing row will be written to the new row. This would primarily be used for transitioning a flow's data from one status to another. @param oldKey the existing row key to move @param newKey the new row key to move to @throws IOException
[ "Moves", "a", "flow_queue", "record", "from", "one", "row", "key", "to", "another", ".", "All", "Cells", "in", "the", "existing", "row", "will", "be", "written", "to", "the", "new", "row", ".", "This", "would", "primarily", "be", "used", "for", "transiti...
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/FlowQueueService.java#L96-L125
2,674
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/FlowQueueService.java
FlowQueueService.getPaginatedFlowsForStatus
public PaginatedResult<Flow> getPaginatedFlowsForStatus(String cluster, Flow.Status status, int limit, String user, byte[] startRow) throws IOException { // retrieve one more flow than requested for pagination support List<Flow> flows = getFlowsForStatus(cluster, status, limit + 1, user, sta...
java
public PaginatedResult<Flow> getPaginatedFlowsForStatus(String cluster, Flow.Status status, int limit, String user, byte[] startRow) throws IOException { // retrieve one more flow than requested for pagination support List<Flow> flows = getFlowsForStatus(cluster, status, limit + 1, user, sta...
[ "public", "PaginatedResult", "<", "Flow", ">", "getPaginatedFlowsForStatus", "(", "String", "cluster", ",", "Flow", ".", "Status", "status", ",", "int", "limit", ",", "String", "user", ",", "byte", "[", "]", "startRow", ")", "throws", "IOException", "{", "//...
Returns a page of flows for the given cluster and status @param cluster The cluster for the flows' execution @param status The flows' status @param limit Maximum number of flows to retrieve @param user Filter results to this user, if present @param startRow Start pagination with this row (inclusive), if present @return...
[ "Returns", "a", "page", "of", "flows", "for", "the", "given", "cluster", "and", "status" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/FlowQueueService.java#L271-L286
2,675
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/MinMaxJobFileTracker.java
MinMaxJobFileTracker.track
public JobFile track(FileStatus jobFileStatus) { String jobfileName = jobFileStatus.getPath().getName(); JobFile jobFile = new JobFile(jobfileName); // Extra check, caller should already have taken care of this. if (jobFile.isJobConfFile() || jobFile.isJobHistoryFile()) { track(jobFile.getJobid(...
java
public JobFile track(FileStatus jobFileStatus) { String jobfileName = jobFileStatus.getPath().getName(); JobFile jobFile = new JobFile(jobfileName); // Extra check, caller should already have taken care of this. if (jobFile.isJobConfFile() || jobFile.isJobHistoryFile()) { track(jobFile.getJobid(...
[ "public", "JobFile", "track", "(", "FileStatus", "jobFileStatus", ")", "{", "String", "jobfileName", "=", "jobFileStatus", ".", "getPath", "(", ")", ".", "getName", "(", ")", ";", "JobFile", "jobFile", "=", "new", "JobFile", "(", "jobfileName", ")", ";", "...
Converts a jobFileStatus to a JobFile and tracks the min and max modification times and JobIds. @param jobFileStatus of a jobfile, must be a proper JobFile. Cannot be null. @return a JobFile for the given jobFileStatus.
[ "Converts", "a", "jobFileStatus", "to", "a", "JobFile", "and", "tracks", "the", "min", "and", "max", "modification", "times", "and", "JobIds", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/MinMaxJobFileTracker.java#L70-L88
2,676
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobFileProcessor.java
JobFileProcessor.processRecords
boolean processRecords(Configuration conf, Connection hbaseConnection, String cluster, int batchSize, int threadCount, String processFileSubstring) throws IOException, InterruptedException, ClassNotFoundException, ExecutionException, RowKeyParseException { List<ProcessRecord> processRecords = ...
java
boolean processRecords(Configuration conf, Connection hbaseConnection, String cluster, int batchSize, int threadCount, String processFileSubstring) throws IOException, InterruptedException, ClassNotFoundException, ExecutionException, RowKeyParseException { List<ProcessRecord> processRecords = ...
[ "boolean", "processRecords", "(", "Configuration", "conf", ",", "Connection", "hbaseConnection", ",", "String", "cluster", ",", "int", "batchSize", ",", "int", "threadCount", ",", "String", "processFileSubstring", ")", "throws", "IOException", ",", "InterruptedExcepti...
Pick up the ranges of jobs to process from ProcessRecords. Skip raw rows that have already been processed. @param conf used to contact HBase and to run jobs against @param hbaseConnection @param cluster for which to process records. @param batchSize the total number of jobs to process in a batch (a MR job scanning the...
[ "Pick", "up", "the", "ranges", "of", "jobs", "to", "process", "from", "ProcessRecords", ".", "Skip", "raw", "rows", "that", "have", "already", "been", "processed", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobFileProcessor.java#L379-L409
2,677
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobFileProcessor.java
JobFileProcessor.runJobs
private boolean runJobs(int threadCount, List<JobRunner> jobRunners) throws InterruptedException, ExecutionException { ExecutorService execSvc = Executors.newFixedThreadPool(threadCount); if ((jobRunners == null) || (jobRunners.size() == 0)) { return true; } boolean success = true; try...
java
private boolean runJobs(int threadCount, List<JobRunner> jobRunners) throws InterruptedException, ExecutionException { ExecutorService execSvc = Executors.newFixedThreadPool(threadCount); if ((jobRunners == null) || (jobRunners.size() == 0)) { return true; } boolean success = true; try...
[ "private", "boolean", "runJobs", "(", "int", "threadCount", ",", "List", "<", "JobRunner", ">", "jobRunners", ")", "throws", "InterruptedException", ",", "ExecutionException", "{", "ExecutorService", "execSvc", "=", "Executors", ".", "newFixedThreadPool", "(", "thre...
Run the jobs and wait for all of them to complete. @param threadCount up to how many jobs to run in parallel @param jobRunners the list of jobs to run. @return whether all jobs completed successfully or not. @throws InterruptedException when interrupted while running jobs. @throws ExecutionException when at least one ...
[ "Run", "the", "jobs", "and", "wait", "for", "all", "of", "them", "to", "complete", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobFileProcessor.java#L450-L486
2,678
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java
JobHistoryService.createFlowScan
private Scan createFlowScan(byte[] rowPrefix, int limit, String version) { Scan scan = new Scan(); scan.setStartRow(rowPrefix); // using a large scanner caching value with a small limit can mean we scan a // lot more data than necessary, so lower the caching for low limits scan.setCaching(Math.min(...
java
private Scan createFlowScan(byte[] rowPrefix, int limit, String version) { Scan scan = new Scan(); scan.setStartRow(rowPrefix); // using a large scanner caching value with a small limit can mean we scan a // lot more data than necessary, so lower the caching for low limits scan.setCaching(Math.min(...
[ "private", "Scan", "createFlowScan", "(", "byte", "[", "]", "rowPrefix", ",", "int", "limit", ",", "String", "version", ")", "{", "Scan", "scan", "=", "new", "Scan", "(", ")", ";", "scan", ".", "setStartRow", "(", "rowPrefix", ")", ";", "// using a large...
creates a scan for flow data @param rowPrefix - start row prefix @param limit - limit on scanned results @param version - version to match @return Scan
[ "creates", "a", "scan", "for", "flow", "data" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java#L225-L246
2,679
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java
JobHistoryService.getJobByJobID
public JobDetails getJobByJobID(String cluster, String jobId) throws IOException { return getJobByJobID(cluster, jobId, false); }
java
public JobDetails getJobByJobID(String cluster, String jobId) throws IOException { return getJobByJobID(cluster, jobId, false); }
[ "public", "JobDetails", "getJobByJobID", "(", "String", "cluster", ",", "String", "jobId", ")", "throws", "IOException", "{", "return", "getJobByJobID", "(", "cluster", ",", "jobId", ",", "false", ")", ";", "}" ]
Returns a specific job's data by job ID. This version does not populate the job's task data. @param cluster the cluster identifier @param cluster the job ID
[ "Returns", "a", "specific", "job", "s", "data", "by", "job", "ID", ".", "This", "version", "does", "not", "populate", "the", "job", "s", "task", "data", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java#L401-L404
2,680
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java
JobHistoryService.getTaskScan
private Scan getTaskScan(JobKey jobKey) { byte[] startKey = Bytes.add(jobKeyConv.toBytes(jobKey), Constants.SEP_BYTES); Scan scan = new Scan(); scan.setStartRow(startKey); // only return tasks for this job scan.setFilter(new WhileMatchFilter(new PrefixFilter(startKey))); // expect a lot ...
java
private Scan getTaskScan(JobKey jobKey) { byte[] startKey = Bytes.add(jobKeyConv.toBytes(jobKey), Constants.SEP_BYTES); Scan scan = new Scan(); scan.setStartRow(startKey); // only return tasks for this job scan.setFilter(new WhileMatchFilter(new PrefixFilter(startKey))); // expect a lot ...
[ "private", "Scan", "getTaskScan", "(", "JobKey", "jobKey", ")", "{", "byte", "[", "]", "startKey", "=", "Bytes", ".", "add", "(", "jobKeyConv", ".", "toBytes", "(", "jobKey", ")", ",", "Constants", ".", "SEP_BYTES", ")", ";", "Scan", "scan", "=", "new"...
Returns a Scan instance to retrieve all the task rows for a given job from the job_history_task table. @param jobKey the job key to match for all task rows @return a {@code Scan} instance for the job_history_task table
[ "Returns", "a", "Scan", "instance", "to", "retrieve", "all", "the", "task", "rows", "for", "a", "given", "job", "from", "the", "job_history_task", "table", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java#L634-L644
2,681
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java
JobHistoryService.parseConfiguration
public static Configuration parseConfiguration( Map<byte[], byte[]> keyValues) { Configuration config = new Configuration(false); byte[] configPrefix = Bytes.add(Constants.JOB_CONF_COLUMN_PREFIX_BYTES, Constants.SEP_BYTES); for (Map.Entry<byte[], byte[]> entry : keyValues.entrySet()) { b...
java
public static Configuration parseConfiguration( Map<byte[], byte[]> keyValues) { Configuration config = new Configuration(false); byte[] configPrefix = Bytes.add(Constants.JOB_CONF_COLUMN_PREFIX_BYTES, Constants.SEP_BYTES); for (Map.Entry<byte[], byte[]> entry : keyValues.entrySet()) { b...
[ "public", "static", "Configuration", "parseConfiguration", "(", "Map", "<", "byte", "[", "]", ",", "byte", "[", "]", ">", "keyValues", ")", "{", "Configuration", "config", "=", "new", "Configuration", "(", "false", ")", ";", "byte", "[", "]", "configPrefix...
Converts serialized configuration properties back in to a Configuration object. @param keyValues @return
[ "Converts", "serialized", "configuration", "properties", "back", "in", "to", "a", "Configuration", "object", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java#L653-L668
2,682
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java
JobHistoryService.parseCounters
public static CounterMap parseCounters(byte[] prefix, Map<byte[], byte[]> keyValues) { CounterMap counterValues = new CounterMap(); byte[] counterPrefix = Bytes.add(prefix, Constants.SEP_BYTES); for (Map.Entry<byte[], byte[]> entry : keyValues.entrySet()) { byte[] key = entry.getKey(); if ...
java
public static CounterMap parseCounters(byte[] prefix, Map<byte[], byte[]> keyValues) { CounterMap counterValues = new CounterMap(); byte[] counterPrefix = Bytes.add(prefix, Constants.SEP_BYTES); for (Map.Entry<byte[], byte[]> entry : keyValues.entrySet()) { byte[] key = entry.getKey(); if ...
[ "public", "static", "CounterMap", "parseCounters", "(", "byte", "[", "]", "prefix", ",", "Map", "<", "byte", "[", "]", ",", "byte", "[", "]", ">", "keyValues", ")", "{", "CounterMap", "counterValues", "=", "new", "CounterMap", "(", ")", ";", "byte", "[...
Converts encoded key values back into counter objects. @param keyValues @return
[ "Converts", "encoded", "key", "values", "back", "into", "counter", "objects", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java#L676-L700
2,683
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java
JobHistoryService.removeJob
public int removeJob(JobKey key) throws IOException { byte[] jobRow = jobKeyConv.toBytes(key); Table historyTable = hbaseConnection.getTable(TableName.valueOf(Constants.HISTORY_TABLE)); historyTable.delete(new Delete(jobRow)); historyTable.close(); int deleteCount = 1; // delete all t...
java
public int removeJob(JobKey key) throws IOException { byte[] jobRow = jobKeyConv.toBytes(key); Table historyTable = hbaseConnection.getTable(TableName.valueOf(Constants.HISTORY_TABLE)); historyTable.delete(new Delete(jobRow)); historyTable.close(); int deleteCount = 1; // delete all t...
[ "public", "int", "removeJob", "(", "JobKey", "key", ")", "throws", "IOException", "{", "byte", "[", "]", "jobRow", "=", "jobKeyConv", ".", "toBytes", "(", "key", ")", ";", "Table", "historyTable", "=", "hbaseConnection", ".", "getTable", "(", "TableName", ...
Removes the job's row from the job_history table, and all related task rows from the job_history_task table. @param key the job to be removed @return the number of rows deleted. @throws IOException
[ "Removes", "the", "job", "s", "row", "from", "the", "job_history", "table", "and", "all", "related", "task", "rows", "from", "the", "job_history_task", "table", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java#L783-L828
2,684
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/HadoopConfUtil.java
HadoopConfUtil.getUserNameInConf
public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { // neither user.name...
java
public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { // neither user.name...
[ "public", "static", "String", "getUserNameInConf", "(", "Configuration", "jobConf", ")", "throws", "IllegalArgumentException", "{", "String", "userName", "=", "jobConf", ".", "get", "(", "Constants", ".", "USER_CONF_KEY_HADOOP2", ")", ";", "if", "(", "StringUtils", ...
Get the user name from the job conf check for hadoop2 config param, then hadoop1 @param jobConf @return userName @throws IllegalArgumentException
[ "Get", "the", "user", "name", "from", "the", "job", "conf", "check", "for", "hadoop2", "config", "param", "then", "hadoop1" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/HadoopConfUtil.java#L42-L55
2,685
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/HadoopConfUtil.java
HadoopConfUtil.contains
public static boolean contains(Configuration jobConf, String name) { if (StringUtils.isNotBlank(jobConf.get(name))) { return true; } else { return false; } }
java
public static boolean contains(Configuration jobConf, String name) { if (StringUtils.isNotBlank(jobConf.get(name))) { return true; } else { return false; } }
[ "public", "static", "boolean", "contains", "(", "Configuration", "jobConf", ",", "String", "name", ")", "{", "if", "(", "StringUtils", ".", "isNotBlank", "(", "jobConf", ".", "get", "(", "name", ")", ")", ")", "{", "return", "true", ";", "}", "else", "...
checks if the jobConf contains a certain parameter @param jobConf @param name @return true if the job conf contains that parameter false if the job conf does not contain that parameter
[ "checks", "if", "the", "jobConf", "contains", "a", "certain", "parameter" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/HadoopConfUtil.java#L65-L71
2,686
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/HadoopConfUtil.java
HadoopConfUtil.getQueueName
public static String getQueueName(Configuration jobConf) { // look for the hadoop2 queuename first String hRavenQueueName = jobConf.get(Constants.QUEUENAME_HADOOP2); if (StringUtils.isBlank(hRavenQueueName)) { // presumably a hadoop1 conf, check for fair scheduler pool name hRavenQueueName = jobConf .g...
java
public static String getQueueName(Configuration jobConf) { // look for the hadoop2 queuename first String hRavenQueueName = jobConf.get(Constants.QUEUENAME_HADOOP2); if (StringUtils.isBlank(hRavenQueueName)) { // presumably a hadoop1 conf, check for fair scheduler pool name hRavenQueueName = jobConf .g...
[ "public", "static", "String", "getQueueName", "(", "Configuration", "jobConf", ")", "{", "// look for the hadoop2 queuename first", "String", "hRavenQueueName", "=", "jobConf", ".", "get", "(", "Constants", ".", "QUEUENAME_HADOOP2", ")", ";", "if", "(", "StringUtils",...
retrieves the queue name from a hadoop conf looks for hadoop2 and hadoop1 settings @param jobConf @return queuename
[ "retrieves", "the", "queue", "name", "from", "a", "hadoop", "conf", "looks", "for", "hadoop2", "and", "hadoop1", "settings" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/HadoopConfUtil.java#L80-L106
2,687
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/AppVersionService.java
AppVersionService.getDistinctVersions
public List<VersionInfo> getDistinctVersions(String cluster, String user, String appId) throws IOException { Get get = new Get(getRowKey(cluster, user, appId)); List<VersionInfo> versions = Lists.newArrayList(); Long ts = 0L; Table versionsTable = null; try { versionsTable = hbaseConnect...
java
public List<VersionInfo> getDistinctVersions(String cluster, String user, String appId) throws IOException { Get get = new Get(getRowKey(cluster, user, appId)); List<VersionInfo> versions = Lists.newArrayList(); Long ts = 0L; Table versionsTable = null; try { versionsTable = hbaseConnect...
[ "public", "List", "<", "VersionInfo", ">", "getDistinctVersions", "(", "String", "cluster", ",", "String", "user", ",", "String", "appId", ")", "throws", "IOException", "{", "Get", "get", "=", "new", "Get", "(", "getRowKey", "(", "cluster", ",", "user", ",...
Returns the list of distinct versions for the given application sorted in reverse chronological order @param cluster @param user @param appId @return the list of versions sorted in reverse chronological order (the list will be empty if no versions are found) @throws IOException
[ "Returns", "the", "list", "of", "distinct", "versions", "for", "the", "given", "application", "sorted", "in", "reverse", "chronological", "order" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/AppVersionService.java#L110-L149
2,688
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/AppVersionService.java
AppVersionService.addVersion
public boolean addVersion(String cluster, String user, String appId, String version, long timestamp) throws IOException { boolean updated = false; // check if the version already exists byte[] rowKey = getRowKey(cluster, user, appId); byte[] versionCol = Bytes.toBytes(version); int attempts ...
java
public boolean addVersion(String cluster, String user, String appId, String version, long timestamp) throws IOException { boolean updated = false; // check if the version already exists byte[] rowKey = getRowKey(cluster, user, appId); byte[] versionCol = Bytes.toBytes(version); int attempts ...
[ "public", "boolean", "addVersion", "(", "String", "cluster", ",", "String", "user", ",", "String", "appId", ",", "String", "version", ",", "long", "timestamp", ")", "throws", "IOException", "{", "boolean", "updated", "=", "false", ";", "// check if the version a...
Adds an entry for the given version, if it does not already exist. If the given timestamp is earlier than the currently stored timestamp for the version, it will be updated. @param cluster cluster identifier (cluster@identifier) @param user user name @param appId application identifier @param version version identifie...
[ "Adds", "an", "entry", "for", "the", "given", "version", "if", "it", "does", "not", "already", "exist", ".", "If", "the", "given", "timestamp", "is", "earlier", "than", "the", "currently", "stored", "timestamp", "for", "the", "version", "it", "will", "be",...
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/AppVersionService.java#L165-L231
2,689
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/rest/client/HRavenRestClient.java
HRavenRestClient.fetchFlowsWithConfig
public List<Flow> fetchFlowsWithConfig(String cluster, String username, String batchDesc, String signature, int limit, String... configProps) throws IOException { LOG.info(String.format( "Fetching last %d matching jobs for cluster=%s, user.name=%s, " + "batch.desc=%s, pig.logical.pla...
java
public List<Flow> fetchFlowsWithConfig(String cluster, String username, String batchDesc, String signature, int limit, String... configProps) throws IOException { LOG.info(String.format( "Fetching last %d matching jobs for cluster=%s, user.name=%s, " + "batch.desc=%s, pig.logical.pla...
[ "public", "List", "<", "Flow", ">", "fetchFlowsWithConfig", "(", "String", "cluster", ",", "String", "username", ",", "String", "batchDesc", ",", "String", "signature", ",", "int", "limit", ",", "String", "...", "configProps", ")", "throws", "IOException", "{"...
Fetches a list of flows that include jobs in that flow that include the specified configuration properties @param cluster @param username @param batchDesc @param signature @param limit @param configProps @return list of flows @throws IOException
[ "Fetches", "a", "list", "of", "flows", "that", "include", "jobs", "in", "that", "flow", "that", "include", "the", "specified", "configuration", "properties" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/rest/client/HRavenRestClient.java#L156-L177
2,690
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/rest/client/HRavenRestClient.java
HRavenRestClient.fetchFlowsWithConfig
public List<Flow> fetchFlowsWithConfig(String cluster, String username, String batchDesc, String signature, int limit, List<String> flowResponseFilters, List<String> jobResponseFilters, List<String> configPropertyFields) throws IOException { LOG.info(String.format( "Fetching last %d matchi...
java
public List<Flow> fetchFlowsWithConfig(String cluster, String username, String batchDesc, String signature, int limit, List<String> flowResponseFilters, List<String> jobResponseFilters, List<String> configPropertyFields) throws IOException { LOG.info(String.format( "Fetching last %d matchi...
[ "public", "List", "<", "Flow", ">", "fetchFlowsWithConfig", "(", "String", "cluster", ",", "String", "username", ",", "String", "batchDesc", ",", "String", "signature", ",", "int", "limit", ",", "List", "<", "String", ">", "flowResponseFilters", ",", "List", ...
Fetches a list of flows that include jobs in that flow that include the specified flow fields and job fields specified configuration properties @param cluster @param username @param batchDesc @param signature @param limit @param flowResponseFilters @param jobResponseFilters @param configPropertyFields @return list of f...
[ "Fetches", "a", "list", "of", "flows", "that", "include", "jobs", "in", "that", "flow", "that", "include", "the", "specified", "flow", "fields", "and", "job", "fields", "specified", "configuration", "properties" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/rest/client/HRavenRestClient.java#L193-L210
2,691
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/rest/client/HRavenRestClient.java
HRavenRestClient.buildFlowURL
private StringBuilder buildFlowURL(String cluster, String username, String batchDesc, String signature, int limit, List<String> flowResponseFilters, List<String> jobResponseFilters) throws IOException { StringBuilder urlStringBuilder = new StringBuilder(); urlStringBuilder.append("http://"); ...
java
private StringBuilder buildFlowURL(String cluster, String username, String batchDesc, String signature, int limit, List<String> flowResponseFilters, List<String> jobResponseFilters) throws IOException { StringBuilder urlStringBuilder = new StringBuilder(); urlStringBuilder.append("http://"); ...
[ "private", "StringBuilder", "buildFlowURL", "(", "String", "cluster", ",", "String", "username", ",", "String", "batchDesc", ",", "String", "signature", ",", "int", "limit", ",", "List", "<", "String", ">", "flowResponseFilters", ",", "List", "<", "String", ">...
builds up a StringBuilder with the parameters for the FLOW API @param cluster @param username @param batchDesc @param signature @param limit @param flowResponseFilters @param jobResponseFilters @return @throws IOException
[ "builds", "up", "a", "StringBuilder", "with", "the", "parameters", "for", "the", "FLOW", "API" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/rest/client/HRavenRestClient.java#L279-L316
2,692
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/rest/client/HRavenRestClient.java
HRavenRestClient.fetchTaskDetails
public List<TaskDetails> fetchTaskDetails(String cluster, String jobId) throws IOException { String urlString = String.format("http://%s/api/v1/tasks/%s/%s", apiHostname, cluster, jobId); return retrieveTaskDetailsFromUrl(urlString); }
java
public List<TaskDetails> fetchTaskDetails(String cluster, String jobId) throws IOException { String urlString = String.format("http://%s/api/v1/tasks/%s/%s", apiHostname, cluster, jobId); return retrieveTaskDetailsFromUrl(urlString); }
[ "public", "List", "<", "TaskDetails", ">", "fetchTaskDetails", "(", "String", "cluster", ",", "String", "jobId", ")", "throws", "IOException", "{", "String", "urlString", "=", "String", ".", "format", "(", "\"http://%s/api/v1/tasks/%s/%s\"", ",", "apiHostname", ",...
Fetch details tasks of a given job. @param cluster @param jobId @return
[ "Fetch", "details", "tasks", "of", "a", "given", "job", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/rest/client/HRavenRestClient.java#L334-L339
2,693
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/rest/client/HRavenRestClient.java
HRavenRestClient.fetchTaskDetails
public List<TaskDetails> fetchTaskDetails(String cluster, String jobId, List<String> taskResponseFilters) throws IOException { String taskFilters = StringUtil.buildParam("include", taskResponseFilters); String urlString = String.format("http://%s/api/v1/tasks/%s/%s?%s", apiHostname, cluster, jobId...
java
public List<TaskDetails> fetchTaskDetails(String cluster, String jobId, List<String> taskResponseFilters) throws IOException { String taskFilters = StringUtil.buildParam("include", taskResponseFilters); String urlString = String.format("http://%s/api/v1/tasks/%s/%s?%s", apiHostname, cluster, jobId...
[ "public", "List", "<", "TaskDetails", ">", "fetchTaskDetails", "(", "String", "cluster", ",", "String", "jobId", ",", "List", "<", "String", ">", "taskResponseFilters", ")", "throws", "IOException", "{", "String", "taskFilters", "=", "StringUtil", ".", "buildPar...
Fetch details tasks of a given job for the specified fields @param cluster @param jobId @param taskResponseFilters @return
[ "Fetch", "details", "tasks", "of", "a", "given", "job", "for", "the", "specified", "fields" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/rest/client/HRavenRestClient.java#L348-L354
2,694
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java
JobFileTableMapper.aggreagteJobStats
private void aggreagteJobStats(JobDetails jobDetails, byte[] rowKey, Context context, AggregationConstants.AGGREGATION_TYPE aggType) throws IOException, InterruptedException { byte[] aggStatusCol = null; switch (aggType) { case DAILY: aggStatusCol = AggregationConstants.JOB_DAIL...
java
private void aggreagteJobStats(JobDetails jobDetails, byte[] rowKey, Context context, AggregationConstants.AGGREGATION_TYPE aggType) throws IOException, InterruptedException { byte[] aggStatusCol = null; switch (aggType) { case DAILY: aggStatusCol = AggregationConstants.JOB_DAIL...
[ "private", "void", "aggreagteJobStats", "(", "JobDetails", "jobDetails", ",", "byte", "[", "]", "rowKey", ",", "Context", "context", ",", "AggregationConstants", ".", "AGGREGATION_TYPE", "aggType", ")", "throws", "IOException", ",", "InterruptedException", "{", "byt...
aggregate this job's stats only if re-aggregation is turned on OR aggreation is on AND job not already aggregated if job has already been aggregated, we don't want to mistakenly aggregate again
[ "aggregate", "this", "job", "s", "stats", "only", "if", "re", "-", "aggregation", "is", "turned", "on", "OR", "aggreation", "is", "on", "AND", "job", "not", "already", "aggregated" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java#L385-L423
2,695
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java
JobFileTableMapper.getMegaByteMillisPut
private Put getMegaByteMillisPut(Long mbMillis, JobKey jobKey) { Put pMb = new Put(jobKeyConv.toBytes(jobKey)); pMb.addColumn(Constants.INFO_FAM_BYTES, Constants.MEGABYTEMILLIS_BYTES, Bytes.toBytes(mbMillis)); return pMb; }
java
private Put getMegaByteMillisPut(Long mbMillis, JobKey jobKey) { Put pMb = new Put(jobKeyConv.toBytes(jobKey)); pMb.addColumn(Constants.INFO_FAM_BYTES, Constants.MEGABYTEMILLIS_BYTES, Bytes.toBytes(mbMillis)); return pMb; }
[ "private", "Put", "getMegaByteMillisPut", "(", "Long", "mbMillis", ",", "JobKey", "jobKey", ")", "{", "Put", "pMb", "=", "new", "Put", "(", "jobKeyConv", ".", "toBytes", "(", "jobKey", ")", ")", ";", "pMb", ".", "addColumn", "(", "Constants", ".", "INFO_...
generates a put for the megabytemillis @param mbMillis @param jobKey @return the put with megabytemillis
[ "generates", "a", "put", "for", "the", "megabytemillis" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java#L431-L436
2,696
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java
JobFileTableMapper.loadCostProperties
Properties loadCostProperties(Path cachePath, String machineType) { Properties prop = new Properties(); InputStream inp = null; try { inp = new FileInputStream(cachePath.toString()); prop.load(inp); return prop; } catch (FileNotFoundException fnf) { LOG.error("cost properties doe...
java
Properties loadCostProperties(Path cachePath, String machineType) { Properties prop = new Properties(); InputStream inp = null; try { inp = new FileInputStream(cachePath.toString()); prop.load(inp); return prop; } catch (FileNotFoundException fnf) { LOG.error("cost properties doe...
[ "Properties", "loadCostProperties", "(", "Path", "cachePath", ",", "String", "machineType", ")", "{", "Properties", "prop", "=", "new", "Properties", "(", ")", ";", "InputStream", "inp", "=", "null", ";", "try", "{", "inp", "=", "new", "FileInputStream", "("...
looks for cost file in distributed cache @param cachePath of the cost properties file @param machineType of the node the job ran on @throws IOException
[ "looks", "for", "cost", "file", "in", "distributed", "cache" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java#L444-L466
2,697
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java
JobFileTableMapper.getJobCost
private Double getJobCost(Long mbMillis, Configuration currentConf) { Double computeTco = 0.0; Long machineMemory = 0L; Properties prop = null; String machineType = currentConf.get(Constants.HRAVEN_MACHINE_TYPE, "default"); LOG.debug(" machine type " + machineType); try { Path[] ca...
java
private Double getJobCost(Long mbMillis, Configuration currentConf) { Double computeTco = 0.0; Long machineMemory = 0L; Properties prop = null; String machineType = currentConf.get(Constants.HRAVEN_MACHINE_TYPE, "default"); LOG.debug(" machine type " + machineType); try { Path[] ca...
[ "private", "Double", "getJobCost", "(", "Long", "mbMillis", ",", "Configuration", "currentConf", ")", "{", "Double", "computeTco", "=", "0.0", ";", "Long", "machineMemory", "=", "0L", ";", "Properties", "prop", "=", "null", ";", "String", "machineType", "=", ...
calculates the cost of this job based on mbMillis, machineType and cost details from the properties file @param mbMillis @param currentConf @return cost of the job
[ "calculates", "the", "cost", "of", "this", "job", "based", "on", "mbMillis", "machineType", "and", "cost", "details", "from", "the", "properties", "file" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java#L475-L528
2,698
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java
JobFileTableMapper.getJobCostPut
private Put getJobCostPut(Double jobCost, JobKey jobKey) { Put pJobCost = new Put(jobKeyConv.toBytes(jobKey)); pJobCost.addColumn(Constants.INFO_FAM_BYTES, Constants.JOBCOST_BYTES, Bytes.toBytes(jobCost)); return pJobCost; }
java
private Put getJobCostPut(Double jobCost, JobKey jobKey) { Put pJobCost = new Put(jobKeyConv.toBytes(jobKey)); pJobCost.addColumn(Constants.INFO_FAM_BYTES, Constants.JOBCOST_BYTES, Bytes.toBytes(jobCost)); return pJobCost; }
[ "private", "Put", "getJobCostPut", "(", "Double", "jobCost", ",", "JobKey", "jobKey", ")", "{", "Put", "pJobCost", "=", "new", "Put", "(", "jobKeyConv", ".", "toBytes", "(", "jobKey", ")", ")", ";", "pJobCost", ".", "addColumn", "(", "Constants", ".", "I...
generates a put for the job cost @param jobCost @param jobKey @return the put with job cost
[ "generates", "a", "put", "for", "the", "job", "cost" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java#L536-L541
2,699
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/JobDetails.java
JobDetails.compareTo
@Override public int compareTo(JobDetails otherJob) { if (otherJob == null) { return -1; } return new CompareToBuilder().append(this.jobKey, otherJob.getJobKey()) .toComparison(); }
java
@Override public int compareTo(JobDetails otherJob) { if (otherJob == null) { return -1; } return new CompareToBuilder().append(this.jobKey, otherJob.getJobKey()) .toComparison(); }
[ "@", "Override", "public", "int", "compareTo", "(", "JobDetails", "otherJob", ")", "{", "if", "(", "otherJob", "==", "null", ")", "{", "return", "-", "1", ";", "}", "return", "new", "CompareToBuilder", "(", ")", ".", "append", "(", "this", ".", "jobKey...
Compares two JobDetails objects on the basis of their JobKey @param other @return 0 if this JobKey is equal to the other JobKey, 1 if this JobKey greater than other JobKey, -1 if this JobKey is less than other JobKey
[ "Compares", "two", "JobDetails", "objects", "on", "the", "basis", "of", "their", "JobKey" ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/JobDetails.java#L113-L120