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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
Ekryd/sortpom | sorter/src/main/java/sortpom/wrapper/ElementSortOrderMap.java | ElementSortOrderMap.addElement | public void addElement(Element element, int sortOrder) {
final String deepName = getDeepName(element);
elementNameSortOrderMap.put(deepName, sortOrder);
} | java | public void addElement(Element element, int sortOrder) {
final String deepName = getDeepName(element);
elementNameSortOrderMap.put(deepName, sortOrder);
} | [
"public",
"void",
"addElement",
"(",
"Element",
"element",
",",
"int",
"sortOrder",
")",
"{",
"final",
"String",
"deepName",
"=",
"getDeepName",
"(",
"element",
")",
";",
"elementNameSortOrderMap",
".",
"put",
"(",
"deepName",
",",
"sortOrder",
")",
";",
"}"... | Add an Xml element to the map
@param element Xml element
@param sortOrder an index describing the sort order (lower number == element towards the start of the file) | [
"Add",
"an",
"Xml",
"element",
"to",
"the",
"map"
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/ElementSortOrderMap.java#L24-L28 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/wrapper/ElementSortOrderMap.java | ElementSortOrderMap.containsElement | public boolean containsElement(Element element) {
String deepName = getDeepName(element);
return elementNameSortOrderMap.containsKey(deepName);
} | java | public boolean containsElement(Element element) {
String deepName = getDeepName(element);
return elementNameSortOrderMap.containsKey(deepName);
} | [
"public",
"boolean",
"containsElement",
"(",
"Element",
"element",
")",
"{",
"String",
"deepName",
"=",
"getDeepName",
"(",
"element",
")",
";",
"return",
"elementNameSortOrderMap",
".",
"containsKey",
"(",
"deepName",
")",
";",
"}"
] | Returns true if element is in the map | [
"Returns",
"true",
"if",
"element",
"is",
"in",
"the",
"map"
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/ElementSortOrderMap.java#L31-L34 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/XmlProcessor.java | XmlProcessor.setOriginalXml | public void setOriginalXml(final InputStream originalXml) throws JDOMException, IOException {
SAXBuilder parser = new SAXBuilder();
originalDocument = parser.build(originalXml);
} | java | public void setOriginalXml(final InputStream originalXml) throws JDOMException, IOException {
SAXBuilder parser = new SAXBuilder();
originalDocument = parser.build(originalXml);
} | [
"public",
"void",
"setOriginalXml",
"(",
"final",
"InputStream",
"originalXml",
")",
"throws",
"JDOMException",
",",
"IOException",
"{",
"SAXBuilder",
"parser",
"=",
"new",
"SAXBuilder",
"(",
")",
";",
"originalDocument",
"=",
"parser",
".",
"build",
"(",
"origi... | Sets the original xml that should be sorted. Builds a dom document of the
xml.
@param originalXml the new original xml
@throws org.jdom.JDOMException the jDOM exception
@throws java.io.IOException Signals that an I/O exception has occurred. | [
"Sets",
"the",
"original",
"xml",
"that",
"should",
"be",
"sorted",
".",
"Builds",
"a",
"dom",
"document",
"of",
"the",
"xml",
"."
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/XmlProcessor.java#L38-L41 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/XmlProcessor.java | XmlProcessor.sortXml | public void sortXml() {
newDocument = (Document) originalDocument.clone();
final Element rootElement = (Element) originalDocument.getRootElement().clone();
HierarchyRootWrapper rootWrapper = factory.createFromRootElement(rootElement);
rootWrapper.createWrappedStructure(factory);
... | java | public void sortXml() {
newDocument = (Document) originalDocument.clone();
final Element rootElement = (Element) originalDocument.getRootElement().clone();
HierarchyRootWrapper rootWrapper = factory.createFromRootElement(rootElement);
rootWrapper.createWrappedStructure(factory);
... | [
"public",
"void",
"sortXml",
"(",
")",
"{",
"newDocument",
"=",
"(",
"Document",
")",
"originalDocument",
".",
"clone",
"(",
")",
";",
"final",
"Element",
"rootElement",
"=",
"(",
"Element",
")",
"originalDocument",
".",
"getRootElement",
"(",
")",
".",
"c... | Creates a new dom document that contains the sorted xml. | [
"Creates",
"a",
"new",
"dom",
"document",
"that",
"contains",
"the",
"sorted",
"xml",
"."
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/XmlProcessor.java#L44-L57 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/XmlOutputGenerator.java | XmlOutputGenerator.setup | public void setup(PluginParameters pluginParameters) {
this.indentCharacters = pluginParameters.indentCharacters;
this.lineSeparatorUtil = pluginParameters.lineSeparatorUtil;
this.encoding = pluginParameters.encoding;
this.expandEmptyElements = pluginParameters.expandEmptyElements;
... | java | public void setup(PluginParameters pluginParameters) {
this.indentCharacters = pluginParameters.indentCharacters;
this.lineSeparatorUtil = pluginParameters.lineSeparatorUtil;
this.encoding = pluginParameters.encoding;
this.expandEmptyElements = pluginParameters.expandEmptyElements;
... | [
"public",
"void",
"setup",
"(",
"PluginParameters",
"pluginParameters",
")",
"{",
"this",
".",
"indentCharacters",
"=",
"pluginParameters",
".",
"indentCharacters",
";",
"this",
".",
"lineSeparatorUtil",
"=",
"pluginParameters",
".",
"lineSeparatorUtil",
";",
"this",
... | Setup default configuration | [
"Setup",
"default",
"configuration"
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/XmlOutputGenerator.java#L28-L34 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/XmlOutputGenerator.java | XmlOutputGenerator.getSortedXml | public String getSortedXml(Document newDocument) {
try (ByteArrayOutputStream sortedXml = new ByteArrayOutputStream()) {
BufferedLineSeparatorOutputStream bufferedLineOutputStream =
new BufferedLineSeparatorOutputStream(lineSeparatorUtil.toString(), sortedXml);
XMLOu... | java | public String getSortedXml(Document newDocument) {
try (ByteArrayOutputStream sortedXml = new ByteArrayOutputStream()) {
BufferedLineSeparatorOutputStream bufferedLineOutputStream =
new BufferedLineSeparatorOutputStream(lineSeparatorUtil.toString(), sortedXml);
XMLOu... | [
"public",
"String",
"getSortedXml",
"(",
"Document",
"newDocument",
")",
"{",
"try",
"(",
"ByteArrayOutputStream",
"sortedXml",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
")",
"{",
"BufferedLineSeparatorOutputStream",
"bufferedLineOutputStream",
"=",
"new",
"Buffere... | Returns the sorted xml as an OutputStream.
@return the sorted xml | [
"Returns",
"the",
"sorted",
"xml",
"as",
"an",
"OutputStream",
"."
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/XmlOutputGenerator.java#L41-L55 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/wrapper/WrapperFactoryImpl.java | WrapperFactoryImpl.initializeSortOrderMap | private void initializeSortOrderMap() {
try {
Document document = createDocumentFromDefaultSortOrderFile();
addElementsToSortOrderMap(document.getRootElement(), SORT_ORDER_BASE);
} catch (IOException | JDOMException e) {
throw new FailureException(e.getMessage(), e);
... | java | private void initializeSortOrderMap() {
try {
Document document = createDocumentFromDefaultSortOrderFile();
addElementsToSortOrderMap(document.getRootElement(), SORT_ORDER_BASE);
} catch (IOException | JDOMException e) {
throw new FailureException(e.getMessage(), e);
... | [
"private",
"void",
"initializeSortOrderMap",
"(",
")",
"{",
"try",
"{",
"Document",
"document",
"=",
"createDocumentFromDefaultSortOrderFile",
"(",
")",
";",
"addElementsToSortOrderMap",
"(",
"document",
".",
"getRootElement",
"(",
")",
",",
"SORT_ORDER_BASE",
")",
... | Creates sort order map from chosen sort order. | [
"Creates",
"sort",
"order",
"map",
"from",
"chosen",
"sort",
"order",
"."
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/WrapperFactoryImpl.java#L63-L70 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/wrapper/WrapperFactoryImpl.java | WrapperFactoryImpl.addElementsToSortOrderMap | private void addElementsToSortOrderMap(final Element element, int baseSortOrder) {
elementSortOrderMap.addElement(element, baseSortOrder);
final List<Element> castToChildElementList = castToChildElementList(element);
// Increments the sort order index for each element
int sortOrder = bas... | java | private void addElementsToSortOrderMap(final Element element, int baseSortOrder) {
elementSortOrderMap.addElement(element, baseSortOrder);
final List<Element> castToChildElementList = castToChildElementList(element);
// Increments the sort order index for each element
int sortOrder = bas... | [
"private",
"void",
"addElementsToSortOrderMap",
"(",
"final",
"Element",
"element",
",",
"int",
"baseSortOrder",
")",
"{",
"elementSortOrderMap",
".",
"addElement",
"(",
"element",
",",
"baseSortOrder",
")",
";",
"final",
"List",
"<",
"Element",
">",
"castToChildE... | Processes the chosen sort order. Adds sort order element and sort index to
a map. | [
"Processes",
"the",
"chosen",
"sort",
"order",
".",
"Adds",
"sort",
"order",
"element",
"and",
"sort",
"index",
"to",
"a",
"map",
"."
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/WrapperFactoryImpl.java#L84-L93 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/SortPomImpl.java | SortPomImpl.sortPom | public void sortPom() {
log.info("Sorting file " + pomFile.getAbsolutePath());
String originalXml = fileUtil.getPomFileContent();
String sortedXml = sortXml(originalXml);
if (pomFileIsSorted(originalXml, sortedXml)) {
log.info("Pom file is already sorted, exiting");
... | java | public void sortPom() {
log.info("Sorting file " + pomFile.getAbsolutePath());
String originalXml = fileUtil.getPomFileContent();
String sortedXml = sortXml(originalXml);
if (pomFileIsSorted(originalXml, sortedXml)) {
log.info("Pom file is already sorted, exiting");
... | [
"public",
"void",
"sortPom",
"(",
")",
"{",
"log",
".",
"info",
"(",
"\"Sorting file \"",
"+",
"pomFile",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"String",
"originalXml",
"=",
"fileUtil",
".",
"getPomFileContent",
"(",
")",
";",
"String",
"sortedXml",
... | Sorts the pom file. | [
"Sorts",
"the",
"pom",
"file",
"."
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/SortPomImpl.java#L91-L102 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/SortPomImpl.java | SortPomImpl.sortXml | private String sortXml(final String originalXml) {
xmlProcessingInstructionParser.scanForIgnoredSections(originalXml);
String xml = xmlProcessingInstructionParser.replaceIgnoredSections();
insertXmlInXmlProcessor(xml, () -> "Could not sort " + pomFile.getAbsolutePath() + " content: ");
... | java | private String sortXml(final String originalXml) {
xmlProcessingInstructionParser.scanForIgnoredSections(originalXml);
String xml = xmlProcessingInstructionParser.replaceIgnoredSections();
insertXmlInXmlProcessor(xml, () -> "Could not sort " + pomFile.getAbsolutePath() + " content: ");
... | [
"private",
"String",
"sortXml",
"(",
"final",
"String",
"originalXml",
")",
"{",
"xmlProcessingInstructionParser",
".",
"scanForIgnoredSections",
"(",
"originalXml",
")",
";",
"String",
"xml",
"=",
"xmlProcessingInstructionParser",
".",
"replaceIgnoredSections",
"(",
")... | Sorts the incoming xml.
@param originalXml the xml that should be sorted.
@return the sorted xml | [
"Sorts",
"the",
"incoming",
"xml",
"."
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/SortPomImpl.java#L110-L124 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/SortPomImpl.java | SortPomImpl.createBackupFile | private void createBackupFile() {
if (createBackupFile) {
if (backupFileExtension.trim().length() == 0) {
throw new FailureException("Could not create backup file, extension name was empty");
}
fileUtil.backupFile();
log.info(String.format("Saved b... | java | private void createBackupFile() {
if (createBackupFile) {
if (backupFileExtension.trim().length() == 0) {
throw new FailureException("Could not create backup file, extension name was empty");
}
fileUtil.backupFile();
log.info(String.format("Saved b... | [
"private",
"void",
"createBackupFile",
"(",
")",
"{",
"if",
"(",
"createBackupFile",
")",
"{",
"if",
"(",
"backupFileExtension",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"FailureException",
"(",
"\"Could not crea... | Creates the backup file for pom. | [
"Creates",
"the",
"backup",
"file",
"for",
"pom",
"."
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/SortPomImpl.java#L137-L146 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/SortPomImpl.java | SortPomImpl.saveSortedPomFile | private void saveSortedPomFile(final String sortedXml) {
fileUtil.savePomFile(sortedXml);
log.info("Saved sorted pom file to " + pomFile.getAbsolutePath());
} | java | private void saveSortedPomFile(final String sortedXml) {
fileUtil.savePomFile(sortedXml);
log.info("Saved sorted pom file to " + pomFile.getAbsolutePath());
} | [
"private",
"void",
"saveSortedPomFile",
"(",
"final",
"String",
"sortedXml",
")",
"{",
"fileUtil",
".",
"savePomFile",
"(",
"sortedXml",
")",
";",
"log",
".",
"info",
"(",
"\"Saved sorted pom file to \"",
"+",
"pomFile",
".",
"getAbsolutePath",
"(",
")",
")",
... | Saves the sorted pom file.
@param sortedXml the sorted xml | [
"Saves",
"the",
"sorted",
"pom",
"file",
"."
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/SortPomImpl.java#L153-L156 | train |
Ekryd/sortpom | sorter/src/main/java/sortpom/SortPomImpl.java | SortPomImpl.verifyPom | public void verifyPom() {
String pomFileName = pomFile.getAbsolutePath();
log.info("Verifying file " + pomFileName);
XmlOrderedResult xmlOrderedResult = isPomElementsSorted();
if (!xmlOrderedResult.isOrdered()) {
switch (verifyFailType) {
case WARN:
... | java | public void verifyPom() {
String pomFileName = pomFile.getAbsolutePath();
log.info("Verifying file " + pomFileName);
XmlOrderedResult xmlOrderedResult = isPomElementsSorted();
if (!xmlOrderedResult.isOrdered()) {
switch (verifyFailType) {
case WARN:
... | [
"public",
"void",
"verifyPom",
"(",
")",
"{",
"String",
"pomFileName",
"=",
"pomFile",
".",
"getAbsolutePath",
"(",
")",
";",
"log",
".",
"info",
"(",
"\"Verifying file \"",
"+",
"pomFileName",
")",
";",
"XmlOrderedResult",
"xmlOrderedResult",
"=",
"isPomElement... | Verify that the pom-file is sorted regardless of formatting | [
"Verify",
"that",
"the",
"pom",
"-",
"file",
"is",
"sorted",
"regardless",
"of",
"formatting"
] | 27056420803ed04001e4149b04a719fbac774c5d | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/SortPomImpl.java#L161-L186 | train |
voikko/corevoikko | libvoikko/java/src/main/java/org/puimula/libvoikko/ByteArray.java | ByteArray.s2n | public static byte[] s2n(String string) {
if (string == null) {
return null;
}
byte[] stringBytes = string.getBytes(UTF8);
byte[] allBytes = new byte[stringBytes.length + 1];
System.arraycopy(stringBytes, 0, allBytes, 0, stringBytes.length);
return allBytes;
... | java | public static byte[] s2n(String string) {
if (string == null) {
return null;
}
byte[] stringBytes = string.getBytes(UTF8);
byte[] allBytes = new byte[stringBytes.length + 1];
System.arraycopy(stringBytes, 0, allBytes, 0, stringBytes.length);
return allBytes;
... | [
"public",
"static",
"byte",
"[",
"]",
"s2n",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"byte",
"[",
"]",
"stringBytes",
"=",
"string",
".",
"getBytes",
"(",
"UTF8",
")",
";",
"byte",... | Java-to-native string mapping
@param string
@return native string | [
"Java",
"-",
"to",
"-",
"native",
"string",
"mapping"
] | b726429a7796a19ff0965ea0cc0bcf7c6580837e | https://github.com/voikko/corevoikko/blob/b726429a7796a19ff0965ea0cc0bcf7c6580837e/libvoikko/java/src/main/java/org/puimula/libvoikko/ByteArray.java#L61-L69 | train |
voikko/corevoikko | libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java | Voikko.spell | public synchronized boolean spell(String word) {
requireValidHandle();
if (!isValidInput(word)) {
return false;
}
int spellResult = getLib().voikkoSpellCstr(handle, s2n(word));
return (spellResult == Libvoikko.VOIKKO_SPELL_OK);
} | java | public synchronized boolean spell(String word) {
requireValidHandle();
if (!isValidInput(word)) {
return false;
}
int spellResult = getLib().voikkoSpellCstr(handle, s2n(word));
return (spellResult == Libvoikko.VOIKKO_SPELL_OK);
} | [
"public",
"synchronized",
"boolean",
"spell",
"(",
"String",
"word",
")",
"{",
"requireValidHandle",
"(",
")",
";",
"if",
"(",
"!",
"isValidInput",
"(",
"word",
")",
")",
"{",
"return",
"false",
";",
"}",
"int",
"spellResult",
"=",
"getLib",
"(",
")",
... | Check the spelling of given word.
@param word
@return true if the word is correct, false if it is incorrect. | [
"Check",
"the",
"spelling",
"of",
"given",
"word",
"."
] | b726429a7796a19ff0965ea0cc0bcf7c6580837e | https://github.com/voikko/corevoikko/blob/b726429a7796a19ff0965ea0cc0bcf7c6580837e/libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java#L140-L147 | train |
voikko/corevoikko | libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java | Voikko.grammarErrors | public synchronized List<GrammarError> grammarErrors(String text, String language) {
requireValidHandle();
List<GrammarError> errorList = new ArrayList<GrammarError>();
if (!isValidInput(text)) {
return errorList;
}
int offset = 0;
for (String paragraph : text... | java | public synchronized List<GrammarError> grammarErrors(String text, String language) {
requireValidHandle();
List<GrammarError> errorList = new ArrayList<GrammarError>();
if (!isValidInput(text)) {
return errorList;
}
int offset = 0;
for (String paragraph : text... | [
"public",
"synchronized",
"List",
"<",
"GrammarError",
">",
"grammarErrors",
"(",
"String",
"text",
",",
"String",
"language",
")",
"{",
"requireValidHandle",
"(",
")",
";",
"List",
"<",
"GrammarError",
">",
"errorList",
"=",
"new",
"ArrayList",
"<",
"GrammarE... | Check the given text for grammar errors and return a
list of GrammarError objects representing the errors that were found.
Unlike the C based API this method accepts multiple paragraphs
separated by newline characters.
@param text
@param language language in which error descriptions should be returned
@return list of g... | [
"Check",
"the",
"given",
"text",
"for",
"grammar",
"errors",
"and",
"return",
"a",
"list",
"of",
"GrammarError",
"objects",
"representing",
"the",
"errors",
"that",
"were",
"found",
".",
"Unlike",
"the",
"C",
"based",
"API",
"this",
"method",
"accepts",
"mul... | b726429a7796a19ff0965ea0cc0bcf7c6580837e | https://github.com/voikko/corevoikko/blob/b726429a7796a19ff0965ea0cc0bcf7c6580837e/libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java#L222-L234 | train |
voikko/corevoikko | libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java | Voikko.analyze | public synchronized List<Analysis> analyze(String word) {
requireValidHandle();
List<Analysis> analysisList = new ArrayList<Analysis>();
if (!isValidInput(word)) {
return analysisList;
}
Libvoikko lib = getLib();
Pointer cAnalysisList = lib.voikko... | java | public synchronized List<Analysis> analyze(String word) {
requireValidHandle();
List<Analysis> analysisList = new ArrayList<Analysis>();
if (!isValidInput(word)) {
return analysisList;
}
Libvoikko lib = getLib();
Pointer cAnalysisList = lib.voikko... | [
"public",
"synchronized",
"List",
"<",
"Analysis",
">",
"analyze",
"(",
"String",
"word",
")",
"{",
"requireValidHandle",
"(",
")",
";",
"List",
"<",
"Analysis",
">",
"analysisList",
"=",
"new",
"ArrayList",
"<",
"Analysis",
">",
"(",
")",
";",
"if",
"("... | Analyze the morphology of given word and return the list of
analysis results.
@param word
@return analysis results | [
"Analyze",
"the",
"morphology",
"of",
"given",
"word",
"and",
"return",
"the",
"list",
"of",
"analysis",
"results",
"."
] | b726429a7796a19ff0965ea0cc0bcf7c6580837e | https://github.com/voikko/corevoikko/blob/b726429a7796a19ff0965ea0cc0bcf7c6580837e/libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java#L280-L308 | train |
voikko/corevoikko | libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java | Voikko.tokens | public synchronized List<Token> tokens(String text) {
requireValidHandle();
List<Token> allTokens = new ArrayList<Token>();
int lastStart = 0;
for (int i = indexOfSpecialUnknown(text, 0); i != -1; i = indexOfSpecialUnknown(text, i + 1)) {
allTokens.addAll(tokensNonNull(text.s... | java | public synchronized List<Token> tokens(String text) {
requireValidHandle();
List<Token> allTokens = new ArrayList<Token>();
int lastStart = 0;
for (int i = indexOfSpecialUnknown(text, 0); i != -1; i = indexOfSpecialUnknown(text, i + 1)) {
allTokens.addAll(tokensNonNull(text.s... | [
"public",
"synchronized",
"List",
"<",
"Token",
">",
"tokens",
"(",
"String",
"text",
")",
"{",
"requireValidHandle",
"(",
")",
";",
"List",
"<",
"Token",
">",
"allTokens",
"=",
"new",
"ArrayList",
"<",
"Token",
">",
"(",
")",
";",
"int",
"lastStart",
... | Split the given natural language text into a list of Token objects.
@param text
@return list of tokens | [
"Split",
"the",
"given",
"natural",
"language",
"text",
"into",
"a",
"list",
"of",
"Token",
"objects",
"."
] | b726429a7796a19ff0965ea0cc0bcf7c6580837e | https://github.com/voikko/corevoikko/blob/b726429a7796a19ff0965ea0cc0bcf7c6580837e/libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java#L315-L326 | train |
voikko/corevoikko | libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java | Voikko.sentences | public synchronized List<Sentence> sentences(String text) {
requireValidHandle();
Libvoikko lib = getLib();
List<Sentence> result = new ArrayList<Sentence>();
if (!isValidInput(text)) {
result.add(new Sentence(text, SentenceStartType.NONE));
return result;
... | java | public synchronized List<Sentence> sentences(String text) {
requireValidHandle();
Libvoikko lib = getLib();
List<Sentence> result = new ArrayList<Sentence>();
if (!isValidInput(text)) {
result.add(new Sentence(text, SentenceStartType.NONE));
return result;
... | [
"public",
"synchronized",
"List",
"<",
"Sentence",
">",
"sentences",
"(",
"String",
"text",
")",
"{",
"requireValidHandle",
"(",
")",
";",
"Libvoikko",
"lib",
"=",
"getLib",
"(",
")",
";",
"List",
"<",
"Sentence",
">",
"result",
"=",
"new",
"ArrayList",
... | Split the given natural language text into a list of Sentence objects.
@param text
@return list of sentences | [
"Split",
"the",
"given",
"natural",
"language",
"text",
"into",
"a",
"list",
"of",
"Sentence",
"objects",
"."
] | b726429a7796a19ff0965ea0cc0bcf7c6580837e | https://github.com/voikko/corevoikko/blob/b726429a7796a19ff0965ea0cc0bcf7c6580837e/libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java#L367-L389 | train |
voikko/corevoikko | libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java | Voikko.addLibraryPath | public static void addLibraryPath(String libraryPath) {
for (String libraryName : LIBRARY_NAMES) {
NativeLibrary.addSearchPath(libraryName, libraryPath);
}
} | java | public static void addLibraryPath(String libraryPath) {
for (String libraryName : LIBRARY_NAMES) {
NativeLibrary.addSearchPath(libraryName, libraryPath);
}
} | [
"public",
"static",
"void",
"addLibraryPath",
"(",
"String",
"libraryPath",
")",
"{",
"for",
"(",
"String",
"libraryName",
":",
"LIBRARY_NAMES",
")",
"{",
"NativeLibrary",
".",
"addSearchPath",
"(",
"libraryName",
",",
"libraryPath",
")",
";",
"}",
"}"
] | Set the explicit path to the folder containing shared library files.
@param libraryPath | [
"Set",
"the",
"explicit",
"path",
"to",
"the",
"folder",
"containing",
"shared",
"library",
"files",
"."
] | b726429a7796a19ff0965ea0cc0bcf7c6580837e | https://github.com/voikko/corevoikko/blob/b726429a7796a19ff0965ea0cc0bcf7c6580837e/libvoikko/java/src/main/java/org/puimula/libvoikko/Voikko.java#L643-L647 | train |
xmlet/HtmlFlow | src/main/java/htmlflow/HtmlView.java | HtmlView.addPartial | public final <U> void addPartial(HtmlView<U> partial, U model) {
getVisitor().closeBeginTag();
partial.getVisitor().depth = getVisitor().depth;
if (this.getVisitor().isWriting())
getVisitor().write(partial.render(model));
} | java | public final <U> void addPartial(HtmlView<U> partial, U model) {
getVisitor().closeBeginTag();
partial.getVisitor().depth = getVisitor().depth;
if (this.getVisitor().isWriting())
getVisitor().write(partial.render(model));
} | [
"public",
"final",
"<",
"U",
">",
"void",
"addPartial",
"(",
"HtmlView",
"<",
"U",
">",
"partial",
",",
"U",
"model",
")",
"{",
"getVisitor",
"(",
")",
".",
"closeBeginTag",
"(",
")",
";",
"partial",
".",
"getVisitor",
"(",
")",
".",
"depth",
"=",
... | Adds a partial view to this view.
@param partial inner view.
@param model the domain object bound to the partial view.
@param <U> the type of the domain model of the partial view. | [
"Adds",
"a",
"partial",
"view",
"to",
"this",
"view",
"."
] | 5318be5765b0850496645d7c11bdf2848c094b17 | https://github.com/xmlet/HtmlFlow/blob/5318be5765b0850496645d7c11bdf2848c094b17/src/main/java/htmlflow/HtmlView.java#L170-L175 | train |
Ardesco/selenium-standalone-server-plugin | src/main/java/com/lazerycode/selenium/download/FileDownloader.java | FileDownloader.attemptToDownload | public File attemptToDownload(URL fileLocation) throws URISyntaxException, IOException {
String filename = FilenameUtils.getName(fileLocation.getFile());
SocketConfig socketConfig = SocketConfig.custom().setSoTimeout(fileDownloadReadTimeout).build();
RequestConfig requestConfig = RequestConfig.... | java | public File attemptToDownload(URL fileLocation) throws URISyntaxException, IOException {
String filename = FilenameUtils.getName(fileLocation.getFile());
SocketConfig socketConfig = SocketConfig.custom().setSoTimeout(fileDownloadReadTimeout).build();
RequestConfig requestConfig = RequestConfig.... | [
"public",
"File",
"attemptToDownload",
"(",
"URL",
"fileLocation",
")",
"throws",
"URISyntaxException",
",",
"IOException",
"{",
"String",
"filename",
"=",
"FilenameUtils",
".",
"getName",
"(",
"fileLocation",
".",
"getFile",
"(",
")",
")",
";",
"SocketConfig",
... | Attempt to download a file
@param fileLocation URL of the file to download
@return File
@throws URISyntaxException Invalid URI
@throws IOException Unable to interact with file system | [
"Attempt",
"to",
"download",
"a",
"file"
] | e0ecfad426c1a28115cab60def84731d7a4d7e6f | https://github.com/Ardesco/selenium-standalone-server-plugin/blob/e0ecfad426c1a28115cab60def84731d7a4d7e6f/src/main/java/com/lazerycode/selenium/download/FileDownloader.java#L58-L90 | train |
Ardesco/selenium-standalone-server-plugin | src/main/java/com/lazerycode/selenium/download/FileDownloader.java | FileDownloader.localFilePath | private String localFilePath(File downloadDirectory) throws MojoFailureException {
if (downloadDirectory.exists()) {
if (downloadDirectory.isDirectory()) {
return downloadDirectory.getAbsolutePath();
} else {
throw new MojoFailureException("'" + downloadDi... | java | private String localFilePath(File downloadDirectory) throws MojoFailureException {
if (downloadDirectory.exists()) {
if (downloadDirectory.isDirectory()) {
return downloadDirectory.getAbsolutePath();
} else {
throw new MojoFailureException("'" + downloadDi... | [
"private",
"String",
"localFilePath",
"(",
"File",
"downloadDirectory",
")",
"throws",
"MojoFailureException",
"{",
"if",
"(",
"downloadDirectory",
".",
"exists",
"(",
")",
")",
"{",
"if",
"(",
"downloadDirectory",
".",
"isDirectory",
"(",
")",
")",
"{",
"retu... | Set the location directory where files will be downloaded to
@param downloadDirectory The directory that the file will be downloaded to. | [
"Set",
"the",
"location",
"directory",
"where",
"files",
"will",
"be",
"downloaded",
"to"
] | e0ecfad426c1a28115cab60def84731d7a4d7e6f | https://github.com/Ardesco/selenium-standalone-server-plugin/blob/e0ecfad426c1a28115cab60def84731d7a4d7e6f/src/main/java/com/lazerycode/selenium/download/FileDownloader.java#L97-L111 | train |
Ardesco/selenium-standalone-server-plugin | src/main/java/com/lazerycode/selenium/download/DownloadHandler.java | DownloadHandler.downloadFile | protected File downloadFile(DriverDetails driverDetails, boolean shouldWeCheckFileHash) throws MojoExecutionException, IOException, URISyntaxException {
URL remoteFileLocation = driverDetails.fileLocation;
final String filename = FilenameUtils.getName(remoteFileLocation.getFile());
for (int re... | java | protected File downloadFile(DriverDetails driverDetails, boolean shouldWeCheckFileHash) throws MojoExecutionException, IOException, URISyntaxException {
URL remoteFileLocation = driverDetails.fileLocation;
final String filename = FilenameUtils.getName(remoteFileLocation.getFile());
for (int re... | [
"protected",
"File",
"downloadFile",
"(",
"DriverDetails",
"driverDetails",
",",
"boolean",
"shouldWeCheckFileHash",
")",
"throws",
"MojoExecutionException",
",",
"IOException",
",",
"URISyntaxException",
"{",
"URL",
"remoteFileLocation",
"=",
"driverDetails",
".",
"fileL... | Perform the file download
@param driverDetails Driver details extracted from Repositorymap.xml
@param shouldWeCheckFileHash true if file hash should be checked
@return File
@throws MojoExecutionException Unable to download file
@throws IOException Error writing to file system
@throws URISyntaxExcept... | [
"Perform",
"the",
"file",
"download"
] | e0ecfad426c1a28115cab60def84731d7a4d7e6f | https://github.com/Ardesco/selenium-standalone-server-plugin/blob/e0ecfad426c1a28115cab60def84731d7a4d7e6f/src/main/java/com/lazerycode/selenium/download/DownloadHandler.java#L61-L83 | train |
Ardesco/selenium-standalone-server-plugin | src/main/java/com/lazerycode/selenium/extract/CompressedFile.java | CompressedFile.getInputStream | InputStream getInputStream() throws IOException {
switch (filetype) {
case GZ:
LOG.debug("Decompressing .gz file");
return new GzipCompressorInputStream(new FileInputStream(compressedFile));
case BZ2:
LOG.debug("Decompressing .bz2 file");
... | java | InputStream getInputStream() throws IOException {
switch (filetype) {
case GZ:
LOG.debug("Decompressing .gz file");
return new GzipCompressorInputStream(new FileInputStream(compressedFile));
case BZ2:
LOG.debug("Decompressing .bz2 file");
... | [
"InputStream",
"getInputStream",
"(",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"filetype",
")",
"{",
"case",
"GZ",
":",
"LOG",
".",
"debug",
"(",
"\"Decompressing .gz file\"",
")",
";",
"return",
"new",
"GzipCompressorInputStream",
"(",
"new",
"FileInpu... | Get an InputStream for the decompressed file.
@return An InputStream, the type could be BZip2CompressorInputStream, or GzipCompressorInputStream depending on what type of file was initially supplied
@throws IOException IOException | [
"Get",
"an",
"InputStream",
"for",
"the",
"decompressed",
"file",
"."
] | e0ecfad426c1a28115cab60def84731d7a4d7e6f | https://github.com/Ardesco/selenium-standalone-server-plugin/blob/e0ecfad426c1a28115cab60def84731d7a4d7e6f/src/main/java/com/lazerycode/selenium/extract/CompressedFile.java#L54-L64 | train |
Ardesco/selenium-standalone-server-plugin | src/main/java/com/lazerycode/selenium/extract/CompressedFile.java | CompressedFile.getArchiveType | DownloadableFileType getArchiveType() {
try {
return DownloadableFileType.valueOf(FilenameUtils.getExtension(decompressedFilename).toUpperCase());
} catch (IllegalArgumentException e) {
LOG.debug("Not a recognised Archive type");
return null;
}
} | java | DownloadableFileType getArchiveType() {
try {
return DownloadableFileType.valueOf(FilenameUtils.getExtension(decompressedFilename).toUpperCase());
} catch (IllegalArgumentException e) {
LOG.debug("Not a recognised Archive type");
return null;
}
} | [
"DownloadableFileType",
"getArchiveType",
"(",
")",
"{",
"try",
"{",
"return",
"DownloadableFileType",
".",
"valueOf",
"(",
"FilenameUtils",
".",
"getExtension",
"(",
"decompressedFilename",
")",
".",
"toUpperCase",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Illega... | Find out if the uncompressed file is an archive
@return ArchiveType.TAR if a tar, or null if not an archive | [
"Find",
"out",
"if",
"the",
"uncompressed",
"file",
"is",
"an",
"archive"
] | e0ecfad426c1a28115cab60def84731d7a4d7e6f | https://github.com/Ardesco/selenium-standalone-server-plugin/blob/e0ecfad426c1a28115cab60def84731d7a4d7e6f/src/main/java/com/lazerycode/selenium/extract/CompressedFile.java#L71-L78 | train |
Ardesco/selenium-standalone-server-plugin | src/main/java/com/lazerycode/selenium/SeleniumServerMojo.java | SeleniumServerMojo.setRepositoryMapFile | private void setRepositoryMapFile() throws MojoExecutionException {
if (this.customRepositoryMap != null && !this.customRepositoryMap.isEmpty()) {
File repositoryMap = getRepositoryMapFile(this.customRepositoryMap);
if (repositoryMap.exists()) {
checkRepositoryMapIsVa... | java | private void setRepositoryMapFile() throws MojoExecutionException {
if (this.customRepositoryMap != null && !this.customRepositoryMap.isEmpty()) {
File repositoryMap = getRepositoryMapFile(this.customRepositoryMap);
if (repositoryMap.exists()) {
checkRepositoryMapIsVa... | [
"private",
"void",
"setRepositoryMapFile",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"this",
".",
"customRepositoryMap",
"!=",
"null",
"&&",
"!",
"this",
".",
"customRepositoryMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"File",
"repositoryMap",... | Set the RepositoryMap used to get file information.
If the supplied map is invalid it will default to the pre-packaged one here.
@throws MojoExecutionException | [
"Set",
"the",
"RepositoryMap",
"used",
"to",
"get",
"file",
"information",
".",
"If",
"the",
"supplied",
"map",
"is",
"invalid",
"it",
"will",
"default",
"to",
"the",
"pre",
"-",
"packaged",
"one",
"here",
"."
] | e0ecfad426c1a28115cab60def84731d7a4d7e6f | https://github.com/Ardesco/selenium-standalone-server-plugin/blob/e0ecfad426c1a28115cab60def84731d7a4d7e6f/src/main/java/com/lazerycode/selenium/SeleniumServerMojo.java#L307-L325 | train |
Ardesco/selenium-standalone-server-plugin | src/main/java/com/lazerycode/selenium/SeleniumServerMojo.java | SeleniumServerMojo.checkRepositoryMapIsValid | protected void checkRepositoryMapIsValid(File repositoryMap) throws MojoExecutionException {
URL schemaFile = this.getClass().getResource("/RepositoryMap.xsd");
Source xmlFile = new StreamSource(repositoryMap);
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEM... | java | protected void checkRepositoryMapIsValid(File repositoryMap) throws MojoExecutionException {
URL schemaFile = this.getClass().getResource("/RepositoryMap.xsd");
Source xmlFile = new StreamSource(repositoryMap);
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEM... | [
"protected",
"void",
"checkRepositoryMapIsValid",
"(",
"File",
"repositoryMap",
")",
"throws",
"MojoExecutionException",
"{",
"URL",
"schemaFile",
"=",
"this",
".",
"getClass",
"(",
")",
".",
"getResource",
"(",
"\"/RepositoryMap.xsd\"",
")",
";",
"Source",
"xmlFile... | Validate any custom repository maps that are supplied against the xsd.
Throw an error and stop if it is not valid.
Assume it doesn't exist if we get an IOError and fall back to default file.
@throws MojoExecutionException thrown if customRepositoryMap is not valid | [
"Validate",
"any",
"custom",
"repository",
"maps",
"that",
"are",
"supplied",
"against",
"the",
"xsd",
".",
"Throw",
"an",
"error",
"and",
"stop",
"if",
"it",
"is",
"not",
"valid",
".",
"Assume",
"it",
"doesn",
"t",
"exist",
"if",
"we",
"get",
"an",
"I... | e0ecfad426c1a28115cab60def84731d7a4d7e6f | https://github.com/Ardesco/selenium-standalone-server-plugin/blob/e0ecfad426c1a28115cab60def84731d7a4d7e6f/src/main/java/com/lazerycode/selenium/SeleniumServerMojo.java#L334-L347 | train |
Ardesco/selenium-standalone-server-plugin | src/main/java/com/lazerycode/selenium/extract/FileExtractor.java | FileExtractor.extractFileFromArchive | public String extractFileFromArchive(File downloadedCompressedFile, String extractedToFilePath, BinaryType possibleFilenames) throws IOException, IllegalArgumentException, MojoFailureException {
DownloadableFileType fileType = DownloadableFileType.valueOf(FilenameUtils.getExtension(downloadedCompressedFile.getN... | java | public String extractFileFromArchive(File downloadedCompressedFile, String extractedToFilePath, BinaryType possibleFilenames) throws IOException, IllegalArgumentException, MojoFailureException {
DownloadableFileType fileType = DownloadableFileType.valueOf(FilenameUtils.getExtension(downloadedCompressedFile.getN... | [
"public",
"String",
"extractFileFromArchive",
"(",
"File",
"downloadedCompressedFile",
",",
"String",
"extractedToFilePath",
",",
"BinaryType",
"possibleFilenames",
")",
"throws",
"IOException",
",",
"IllegalArgumentException",
",",
"MojoFailureException",
"{",
"DownloadableF... | Extract binary from a downloaded archive file
@param downloadedCompressedFile The downloaded compressed file
@param extractedToFilePath Path to extracted file
@param possibleFilenames Names of the files we want to extract
@return boolean
@throws IOException Unable to write to filesystem
@throw... | [
"Extract",
"binary",
"from",
"a",
"downloaded",
"archive",
"file"
] | e0ecfad426c1a28115cab60def84731d7a4d7e6f | https://github.com/Ardesco/selenium-standalone-server-plugin/blob/e0ecfad426c1a28115cab60def84731d7a4d7e6f/src/main/java/com/lazerycode/selenium/extract/FileExtractor.java#L49-L72 | train |
Ardesco/selenium-standalone-server-plugin | src/main/java/com/lazerycode/selenium/extract/FileExtractor.java | FileExtractor.copyFileToDisk | private String copyFileToDisk(InputStream inputStream, String pathToExtractTo, String filename) throws IOException {
if (!overwriteFilesThatExist) {
File[] existingFiles = new File(pathToExtractTo).listFiles();
if (null != existingFiles && existingFiles.length > 0) {
for ... | java | private String copyFileToDisk(InputStream inputStream, String pathToExtractTo, String filename) throws IOException {
if (!overwriteFilesThatExist) {
File[] existingFiles = new File(pathToExtractTo).listFiles();
if (null != existingFiles && existingFiles.length > 0) {
for ... | [
"private",
"String",
"copyFileToDisk",
"(",
"InputStream",
"inputStream",
",",
"String",
"pathToExtractTo",
",",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"overwriteFilesThatExist",
")",
"{",
"File",
"[",
"]",
"existingFiles",
"=",
... | Copy a file from an inputsteam to disk
@param inputStream A valid input stream to read
@param pathToExtractTo Path of the file we want to create
@param filename Filename of the file we want to create
@return Absolute path of the newly created file (Or existing file if overwriteFilesThatExist is set to false... | [
"Copy",
"a",
"file",
"from",
"an",
"inputsteam",
"to",
"disk"
] | e0ecfad426c1a28115cab60def84731d7a4d7e6f | https://github.com/Ardesco/selenium-standalone-server-plugin/blob/e0ecfad426c1a28115cab60def84731d7a4d7e6f/src/main/java/com/lazerycode/selenium/extract/FileExtractor.java#L218-L249 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadDelivery.java | DownloadDelivery.postStart | void postStart(final DownloadRequest request, final long totalBytes) {
downloadPoster.execute(new Runnable() {
@Override public void run() {
request.downloadCallback().onStart(request.downloadId(), totalBytes);
}
});
} | java | void postStart(final DownloadRequest request, final long totalBytes) {
downloadPoster.execute(new Runnable() {
@Override public void run() {
request.downloadCallback().onStart(request.downloadId(), totalBytes);
}
});
} | [
"void",
"postStart",
"(",
"final",
"DownloadRequest",
"request",
",",
"final",
"long",
"totalBytes",
")",
"{",
"downloadPoster",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"request",
".",... | Post download start event.
@param request download request
@param totalBytes total bytes | [
"Post",
"download",
"start",
"event",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadDelivery.java#L29-L35 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadDelivery.java | DownloadDelivery.postRetry | void postRetry(final DownloadRequest request) {
downloadPoster.execute(new Runnable() {
@Override public void run() {
request.downloadCallback().onRetry(request.downloadId());
}
});
} | java | void postRetry(final DownloadRequest request) {
downloadPoster.execute(new Runnable() {
@Override public void run() {
request.downloadCallback().onRetry(request.downloadId());
}
});
} | [
"void",
"postRetry",
"(",
"final",
"DownloadRequest",
"request",
")",
"{",
"downloadPoster",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"request",
".",
"downloadCallback",
"(",
")",
".",
... | Post download retry event.
@param request download request | [
"Post",
"download",
"retry",
"event",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadDelivery.java#L42-L48 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadDelivery.java | DownloadDelivery.postProgress | void postProgress(final DownloadRequest request, final long bytesWritten, final long totalBytes) {
downloadPoster.execute(new Runnable() {
@Override public void run() {
request.downloadCallback().onProgress(request.downloadId(), bytesWritten, totalBytes);
}
});
} | java | void postProgress(final DownloadRequest request, final long bytesWritten, final long totalBytes) {
downloadPoster.execute(new Runnable() {
@Override public void run() {
request.downloadCallback().onProgress(request.downloadId(), bytesWritten, totalBytes);
}
});
} | [
"void",
"postProgress",
"(",
"final",
"DownloadRequest",
"request",
",",
"final",
"long",
"bytesWritten",
",",
"final",
"long",
"totalBytes",
")",
"{",
"downloadPoster",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
... | Post download progress event.
@param request download request
@param bytesWritten the bytes have written to file
@param totalBytes the total bytes of currnet file in downloading | [
"Post",
"download",
"progress",
"event",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadDelivery.java#L57-L63 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadDelivery.java | DownloadDelivery.postSuccess | void postSuccess(final DownloadRequest request) {
downloadPoster.execute(new Runnable() {
@Override public void run() {
request.downloadCallback().onSuccess(request.downloadId(), request.destinationFilePath());
}
});
} | java | void postSuccess(final DownloadRequest request) {
downloadPoster.execute(new Runnable() {
@Override public void run() {
request.downloadCallback().onSuccess(request.downloadId(), request.destinationFilePath());
}
});
} | [
"void",
"postSuccess",
"(",
"final",
"DownloadRequest",
"request",
")",
"{",
"downloadPoster",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"request",
".",
"downloadCallback",
"(",
")",
"."... | Post download success event.
@param request download request | [
"Post",
"download",
"success",
"event",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadDelivery.java#L70-L76 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadDelivery.java | DownloadDelivery.postFailure | void postFailure(final DownloadRequest request, final int statusCode, final String errMsg) {
downloadPoster.execute(new Runnable() {
@Override public void run() {
request.downloadCallback().onFailure(request.downloadId(), statusCode, errMsg);
}
});
} | java | void postFailure(final DownloadRequest request, final int statusCode, final String errMsg) {
downloadPoster.execute(new Runnable() {
@Override public void run() {
request.downloadCallback().onFailure(request.downloadId(), statusCode, errMsg);
}
});
} | [
"void",
"postFailure",
"(",
"final",
"DownloadRequest",
"request",
",",
"final",
"int",
"statusCode",
",",
"final",
"String",
"errMsg",
")",
"{",
"downloadPoster",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run... | Post download failure event.
@param request download request
@param statusCode status code
@param errMsg error message | [
"Post",
"download",
"failure",
"event",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadDelivery.java#L85-L91 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadManager.java | DownloadManager.add | public int add(DownloadRequest request) {
request = checkNotNull(request, "request == null");
if (isDownloading(request.uri().toString())) {
return -1;
}
request.context(context);
request.downloader(downloader.copy());
/* add download request into download request queue */
return dow... | java | public int add(DownloadRequest request) {
request = checkNotNull(request, "request == null");
if (isDownloading(request.uri().toString())) {
return -1;
}
request.context(context);
request.downloader(downloader.copy());
/* add download request into download request queue */
return dow... | [
"public",
"int",
"add",
"(",
"DownloadRequest",
"request",
")",
"{",
"request",
"=",
"checkNotNull",
"(",
"request",
",",
"\"request == null\"",
")",
";",
"if",
"(",
"isDownloading",
"(",
"request",
".",
"uri",
"(",
")",
".",
"toString",
"(",
")",
")",
"... | Add one download request into the queue.
@param request download request
@return download id, if the id is not set, then manager will generate one.
if the request is in downloading, then -1 will be returned | [
"Add",
"one",
"download",
"request",
"into",
"the",
"queue",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadManager.java#L37-L48 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadRequest.java | DownloadRequest.updateDestinationFilePath | @SuppressWarnings("ResultOfMethodCallIgnored") void updateDestinationFilePath(String filename) {
String separator = destinationDirectory.endsWith("/") ? "" : File.separator;
destinationFilePath = destinationDirectory + separator + filename;
Log.d("TAG", "destinationFilePath: " + destinationFilePath);
/*... | java | @SuppressWarnings("ResultOfMethodCallIgnored") void updateDestinationFilePath(String filename) {
String separator = destinationDirectory.endsWith("/") ? "" : File.separator;
destinationFilePath = destinationDirectory + separator + filename;
Log.d("TAG", "destinationFilePath: " + destinationFilePath);
/*... | [
"@",
"SuppressWarnings",
"(",
"\"ResultOfMethodCallIgnored\"",
")",
"void",
"updateDestinationFilePath",
"(",
"String",
"filename",
")",
"{",
"String",
"separator",
"=",
"destinationDirectory",
".",
"endsWith",
"(",
"\"/\"",
")",
"?",
"\"\"",
":",
"File",
".",
"se... | Update absolute file path according to the directory and filename.
@param filename filename to save | [
"Update",
"absolute",
"file",
"path",
"according",
"to",
"the",
"directory",
"and",
"filename",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadRequest.java#L228-L238 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadRequestQueue.java | DownloadRequestQueue.add | boolean add(DownloadRequest request) {
/* if the request is downloading, do nothing */
if (query(request.downloadId()) != DownloadState.INVALID
|| query(request.uri()) != DownloadState.INVALID) {
Log.w(TAG, "the download requst is in downloading");
return false;
}
/* tag the request... | java | boolean add(DownloadRequest request) {
/* if the request is downloading, do nothing */
if (query(request.downloadId()) != DownloadState.INVALID
|| query(request.uri()) != DownloadState.INVALID) {
Log.w(TAG, "the download requst is in downloading");
return false;
}
/* tag the request... | [
"boolean",
"add",
"(",
"DownloadRequest",
"request",
")",
"{",
"/* if the request is downloading, do nothing */",
"if",
"(",
"query",
"(",
"request",
".",
"downloadId",
"(",
")",
")",
"!=",
"DownloadState",
".",
"INVALID",
"||",
"query",
"(",
"request",
".",
"ur... | Add download request to the download request queue.
@param request download request
@return true if the request is not in queue, otherwise return false | [
"Add",
"download",
"request",
"to",
"the",
"download",
"request",
"queue",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadRequestQueue.java#L86-L105 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadRequestQueue.java | DownloadRequestQueue.cancel | boolean cancel(int downloadId) {
synchronized (currentRequests) {
for (DownloadRequest request : currentRequests) {
if (request.downloadId() == downloadId) {
request.cancel();
return true;
}
}
}
return false;
} | java | boolean cancel(int downloadId) {
synchronized (currentRequests) {
for (DownloadRequest request : currentRequests) {
if (request.downloadId() == downloadId) {
request.cancel();
return true;
}
}
}
return false;
} | [
"boolean",
"cancel",
"(",
"int",
"downloadId",
")",
"{",
"synchronized",
"(",
"currentRequests",
")",
"{",
"for",
"(",
"DownloadRequest",
"request",
":",
"currentRequests",
")",
"{",
"if",
"(",
"request",
".",
"downloadId",
"(",
")",
"==",
"downloadId",
")",... | Cancel a download in progress.
@param downloadId download id
@return true if download has canceled, otherwise return false | [
"Cancel",
"a",
"download",
"in",
"progress",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadRequestQueue.java#L113-L124 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadRequestQueue.java | DownloadRequestQueue.query | DownloadState query(int downloadId) {
synchronized (currentRequests) {
for (DownloadRequest request : currentRequests) {
if (request.downloadId() == downloadId) {
return request.downloadState();
}
}
}
return DownloadState.INVALID;
} | java | DownloadState query(int downloadId) {
synchronized (currentRequests) {
for (DownloadRequest request : currentRequests) {
if (request.downloadId() == downloadId) {
return request.downloadState();
}
}
}
return DownloadState.INVALID;
} | [
"DownloadState",
"query",
"(",
"int",
"downloadId",
")",
"{",
"synchronized",
"(",
"currentRequests",
")",
"{",
"for",
"(",
"DownloadRequest",
"request",
":",
"currentRequests",
")",
"{",
"if",
"(",
"request",
".",
"downloadId",
"(",
")",
"==",
"downloadId",
... | To check if the request is downloading according to download id.
@param downloadId download id
@return true if the request is downloading, otherwise return false | [
"To",
"check",
"if",
"the",
"request",
"is",
"downloading",
"according",
"to",
"download",
"id",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadRequestQueue.java#L154-L164 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadRequestQueue.java | DownloadRequestQueue.query | DownloadState query(Uri uri) {
synchronized (currentRequests) {
for (DownloadRequest request : currentRequests) {
if (request.uri().toString().equals(uri.toString())) {
return request.downloadState();
}
}
}
return DownloadState.INVALID;
} | java | DownloadState query(Uri uri) {
synchronized (currentRequests) {
for (DownloadRequest request : currentRequests) {
if (request.uri().toString().equals(uri.toString())) {
return request.downloadState();
}
}
}
return DownloadState.INVALID;
} | [
"DownloadState",
"query",
"(",
"Uri",
"uri",
")",
"{",
"synchronized",
"(",
"currentRequests",
")",
"{",
"for",
"(",
"DownloadRequest",
"request",
":",
"currentRequests",
")",
"{",
"if",
"(",
"request",
".",
"uri",
"(",
")",
".",
"toString",
"(",
")",
".... | To check if the request is downloading according to download url.
@param uri the uri to check
@return true if the request is downloading, otherwise return false | [
"To",
"check",
"if",
"the",
"request",
"is",
"downloading",
"according",
"to",
"download",
"url",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadRequestQueue.java#L172-L182 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/DownloadRequestQueue.java | DownloadRequestQueue.release | void release() {
/* release current download request */
cancelAll();
/* release download queue */
if (downloadQueue != null) {
downloadQueue = null;
}
/* release dispathcers */
if (dispatchers != null) {
stop();
for (int i = 0; i < dispatchers.length; i++) {
disp... | java | void release() {
/* release current download request */
cancelAll();
/* release download queue */
if (downloadQueue != null) {
downloadQueue = null;
}
/* release dispathcers */
if (dispatchers != null) {
stop();
for (int i = 0; i < dispatchers.length; i++) {
disp... | [
"void",
"release",
"(",
")",
"{",
"/* release current download request */",
"cancelAll",
"(",
")",
";",
"/* release download queue */",
"if",
"(",
"downloadQueue",
"!=",
"null",
")",
"{",
"downloadQueue",
"=",
"null",
";",
"}",
"/* release dispathcers */",
"if",
"("... | Release all the resource. | [
"Release",
"all",
"the",
"resource",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/DownloadRequestQueue.java#L207-L226 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/Utils.java | Utils.isWifi | static boolean isWifi(Context context) {
if (context == null) {
return false;
}
ConnectivityManager manager =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (manager == null) {
return false;
}
NetworkInfo info = manager.getActiveNetworkInfo(... | java | static boolean isWifi(Context context) {
if (context == null) {
return false;
}
ConnectivityManager manager =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (manager == null) {
return false;
}
NetworkInfo info = manager.getActiveNetworkInfo(... | [
"static",
"boolean",
"isWifi",
"(",
"Context",
"context",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"ConnectivityManager",
"manager",
"=",
"(",
"ConnectivityManager",
")",
"context",
".",
"getSystemService",
"(",
"C... | To check whether current network is wifi.
@param context context
@return true if network if wifi, otherwise return false | [
"To",
"check",
"whether",
"current",
"network",
"is",
"wifi",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/Utils.java#L48-L61 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/Utils.java | Utils.getFilenameFromUrl | static String getFilenameFromUrl(String url) {
String filename = md5(url) + ".down";
int index = url.lastIndexOf("/");
if (index > 0) {
String tmpFilename = url.substring(index + 1);
int qmarkIndex = tmpFilename.indexOf("?");
if (qmarkIndex > 0) {
tmpFilename = tmpFilename.substri... | java | static String getFilenameFromUrl(String url) {
String filename = md5(url) + ".down";
int index = url.lastIndexOf("/");
if (index > 0) {
String tmpFilename = url.substring(index + 1);
int qmarkIndex = tmpFilename.indexOf("?");
if (qmarkIndex > 0) {
tmpFilename = tmpFilename.substri... | [
"static",
"String",
"getFilenameFromUrl",
"(",
"String",
"url",
")",
"{",
"String",
"filename",
"=",
"md5",
"(",
"url",
")",
"+",
"\".down\"",
";",
"int",
"index",
"=",
"url",
".",
"lastIndexOf",
"(",
"\"/\"",
")",
";",
"if",
"(",
"index",
">",
"0",
... | Get filename from url.
@param url url
@return filename or md5 if no available filename | [
"Get",
"filename",
"from",
"url",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/Utils.java#L92-L110 | train |
Coolerfall/Android-HttpDownloadManager | library/src/main/java/com/coolerfall/download/Utils.java | Utils.getFilenameFromHeader | public static String getFilenameFromHeader(String url, String contentDisposition) {
String filename;
if (!TextUtils.isEmpty(contentDisposition)) {
int index = contentDisposition.indexOf("filename");
if (index > 0) {
filename = contentDisposition.substring(index + 9, contentDisposition.length... | java | public static String getFilenameFromHeader(String url, String contentDisposition) {
String filename;
if (!TextUtils.isEmpty(contentDisposition)) {
int index = contentDisposition.indexOf("filename");
if (index > 0) {
filename = contentDisposition.substring(index + 9, contentDisposition.length... | [
"public",
"static",
"String",
"getFilenameFromHeader",
"(",
"String",
"url",
",",
"String",
"contentDisposition",
")",
"{",
"String",
"filename",
";",
"if",
"(",
"!",
"TextUtils",
".",
"isEmpty",
"(",
"contentDisposition",
")",
")",
"{",
"int",
"index",
"=",
... | Get filename from content disposition in header.
@param url url of current file to download
@param contentDisposition content disposition in header
@return filename in header if existed, otherwise get from url | [
"Get",
"filename",
"from",
"content",
"disposition",
"in",
"header",
"."
] | 2b32451c1799c77708c12bf8155e43c7dc25bc57 | https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/Utils.java#L119-L140 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/profiling/ProfilingUtils.java | ProfilingUtils.loadJobManagerProfiler | @SuppressWarnings("unchecked")
public static JobManagerProfiler loadJobManagerProfiler(String profilerClassName, InetAddress jobManagerBindAddress) {
final Class<? extends JobManagerProfiler> profilerClass;
try {
profilerClass = (Class<? extends JobManagerProfiler>) Class.forName(profilerClassName);
} catch ... | java | @SuppressWarnings("unchecked")
public static JobManagerProfiler loadJobManagerProfiler(String profilerClassName, InetAddress jobManagerBindAddress) {
final Class<? extends JobManagerProfiler> profilerClass;
try {
profilerClass = (Class<? extends JobManagerProfiler>) Class.forName(profilerClassName);
} catch ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"JobManagerProfiler",
"loadJobManagerProfiler",
"(",
"String",
"profilerClassName",
",",
"InetAddress",
"jobManagerBindAddress",
")",
"{",
"final",
"Class",
"<",
"?",
"extends",
"JobManagerProfiler",
... | Creates an instance of the job manager's profiling component.
@param profilerClassName
the class name of the profiling component to load
@param jobManagerBindAddress
the address the job manager's RPC server is bound to
@return an instance of the job manager profiling component or <code>null</code> if an error occurs | [
"Creates",
"an",
"instance",
"of",
"the",
"job",
"manager",
"s",
"profiling",
"component",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/profiling/ProfilingUtils.java#L87-L123 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/profiling/ProfilingUtils.java | ProfilingUtils.loadTaskManagerProfiler | @SuppressWarnings("unchecked")
public static TaskManagerProfiler loadTaskManagerProfiler(String profilerClassName, InetAddress jobManagerAddress,
InstanceConnectionInfo instanceConnectionInfo) {
final Class<? extends TaskManagerProfiler> profilerClass;
try {
profilerClass = (Class<? extends TaskManagerProfi... | java | @SuppressWarnings("unchecked")
public static TaskManagerProfiler loadTaskManagerProfiler(String profilerClassName, InetAddress jobManagerAddress,
InstanceConnectionInfo instanceConnectionInfo) {
final Class<? extends TaskManagerProfiler> profilerClass;
try {
profilerClass = (Class<? extends TaskManagerProfi... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"TaskManagerProfiler",
"loadTaskManagerProfiler",
"(",
"String",
"profilerClassName",
",",
"InetAddress",
"jobManagerAddress",
",",
"InstanceConnectionInfo",
"instanceConnectionInfo",
")",
"{",
"final",
... | Creates an instance of the task manager's profiling component.
@param profilerClassName
the class name of the profiling component to load
@return an instance of the task manager profiling component or <code>null</code> if an error occurs | [
"Creates",
"an",
"instance",
"of",
"the",
"task",
"manager",
"s",
"profiling",
"component",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/profiling/ProfilingUtils.java#L132-L169 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/DistributionPatternProvider.java | DistributionPatternProvider.createWire | public static boolean createWire(final DistributionPattern pattern, final int nodeLowerStage,
final int nodeUpperStage, final int sizeSetLowerStage, final int sizeSetUpperStage) {
switch (pattern) {
case BIPARTITE:
return true;
case POINTWISE:
if (sizeSetLowerStage < sizeSetUpperStage) {
if (nodeLo... | java | public static boolean createWire(final DistributionPattern pattern, final int nodeLowerStage,
final int nodeUpperStage, final int sizeSetLowerStage, final int sizeSetUpperStage) {
switch (pattern) {
case BIPARTITE:
return true;
case POINTWISE:
if (sizeSetLowerStage < sizeSetUpperStage) {
if (nodeLo... | [
"public",
"static",
"boolean",
"createWire",
"(",
"final",
"DistributionPattern",
"pattern",
",",
"final",
"int",
"nodeLowerStage",
",",
"final",
"int",
"nodeUpperStage",
",",
"final",
"int",
"sizeSetLowerStage",
",",
"final",
"int",
"sizeSetUpperStage",
")",
"{",
... | Checks if two subtasks of different tasks should be wired.
@param pattern
the distribution pattern that should be used
@param nodeLowerStage
the index of the producing task's subtask
@param nodeUpperStage
the index of the consuming task's subtask
@param sizeSetLowerStage
the number of subtasks of the producing task
@p... | [
"Checks",
"if",
"two",
"subtasks",
"of",
"different",
"tasks",
"should",
"be",
"wired",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/DistributionPatternProvider.java#L36-L76 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java | ManagementGroupVertex.insertForwardEdge | void insertForwardEdge(final ManagementGroupEdge edge, final int index) {
while (index >= this.forwardEdges.size()) {
this.forwardEdges.add(null);
}
this.forwardEdges.set(index, edge);
} | java | void insertForwardEdge(final ManagementGroupEdge edge, final int index) {
while (index >= this.forwardEdges.size()) {
this.forwardEdges.add(null);
}
this.forwardEdges.set(index, edge);
} | [
"void",
"insertForwardEdge",
"(",
"final",
"ManagementGroupEdge",
"edge",
",",
"final",
"int",
"index",
")",
"{",
"while",
"(",
"index",
">=",
"this",
".",
"forwardEdges",
".",
"size",
"(",
")",
")",
"{",
"this",
".",
"forwardEdges",
".",
"add",
"(",
"nu... | Inserts a new edge starting at this group vertex at the given index.
@param edge
the edge to be added
@param index
the index at which the edge shall be added | [
"Inserts",
"a",
"new",
"edge",
"starting",
"at",
"this",
"group",
"vertex",
"at",
"the",
"given",
"index",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java#L127-L134 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java | ManagementGroupVertex.insertBackwardEdge | void insertBackwardEdge(final ManagementGroupEdge edge, final int index) {
while (index >= this.backwardEdges.size()) {
this.backwardEdges.add(null);
}
this.backwardEdges.set(index, edge);
} | java | void insertBackwardEdge(final ManagementGroupEdge edge, final int index) {
while (index >= this.backwardEdges.size()) {
this.backwardEdges.add(null);
}
this.backwardEdges.set(index, edge);
} | [
"void",
"insertBackwardEdge",
"(",
"final",
"ManagementGroupEdge",
"edge",
",",
"final",
"int",
"index",
")",
"{",
"while",
"(",
"index",
">=",
"this",
".",
"backwardEdges",
".",
"size",
"(",
")",
")",
"{",
"this",
".",
"backwardEdges",
".",
"add",
"(",
... | Inserts a new edge arriving at this group vertex at the given index.
@param edge
the edge to be added
@param index
the index at which the edge shall be added | [
"Inserts",
"a",
"new",
"edge",
"arriving",
"at",
"this",
"group",
"vertex",
"at",
"the",
"given",
"index",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java#L144-L151 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java | ManagementGroupVertex.getForwardEdge | public ManagementGroupEdge getForwardEdge(final int index) {
if (index < this.forwardEdges.size()) {
return this.forwardEdges.get(index);
}
return null;
} | java | public ManagementGroupEdge getForwardEdge(final int index) {
if (index < this.forwardEdges.size()) {
return this.forwardEdges.get(index);
}
return null;
} | [
"public",
"ManagementGroupEdge",
"getForwardEdge",
"(",
"final",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"this",
".",
"forwardEdges",
".",
"size",
"(",
")",
")",
"{",
"return",
"this",
".",
"forwardEdges",
".",
"get",
"(",
"index",
")",
";",
... | Returns the group edge which leaves this group vertex at the given index.
@param index
the index of the group edge
@return the group edge which leaves this group vertex at the given index or <code>null</code> if no such group
edge exists | [
"Returns",
"the",
"group",
"edge",
"which",
"leaves",
"this",
"group",
"vertex",
"at",
"the",
"given",
"index",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java#L179-L186 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java | ManagementGroupVertex.getBackwardEdge | public ManagementGroupEdge getBackwardEdge(final int index) {
if (index < this.backwardEdges.size()) {
return this.backwardEdges.get(index);
}
return null;
} | java | public ManagementGroupEdge getBackwardEdge(final int index) {
if (index < this.backwardEdges.size()) {
return this.backwardEdges.get(index);
}
return null;
} | [
"public",
"ManagementGroupEdge",
"getBackwardEdge",
"(",
"final",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"this",
".",
"backwardEdges",
".",
"size",
"(",
")",
")",
"{",
"return",
"this",
".",
"backwardEdges",
".",
"get",
"(",
"index",
")",
";"... | Returns the group edge which arrives at this group vertex at the given index.
@param index
the index of the group edge
@return the group edge which arrives at this group vertex at the given index or <code>null</code> if no such
group edge exists | [
"Returns",
"the",
"group",
"edge",
"which",
"arrives",
"at",
"this",
"group",
"vertex",
"at",
"the",
"given",
"index",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java#L196-L203 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java | ManagementGroupVertex.collectVertices | void collectVertices(final List<ManagementVertex> vertices) {
final Iterator<ManagementVertex> it = this.groupMembers.iterator();
while (it.hasNext()) {
vertices.add(it.next());
}
} | java | void collectVertices(final List<ManagementVertex> vertices) {
final Iterator<ManagementVertex> it = this.groupMembers.iterator();
while (it.hasNext()) {
vertices.add(it.next());
}
} | [
"void",
"collectVertices",
"(",
"final",
"List",
"<",
"ManagementVertex",
">",
"vertices",
")",
"{",
"final",
"Iterator",
"<",
"ManagementVertex",
">",
"it",
"=",
"this",
".",
"groupMembers",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNex... | Adds all management vertices which are included in this group vertex to the given list.
@param vertices
the list to which the vertices shall be added | [
"Adds",
"all",
"management",
"vertices",
"which",
"are",
"included",
"in",
"this",
"group",
"vertex",
"to",
"the",
"given",
"list",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java#L228-L234 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java | ManagementGroupVertex.getGroupMember | public ManagementVertex getGroupMember(final int index) {
if (index < this.groupMembers.size()) {
return this.groupMembers.get(index);
}
return null;
} | java | public ManagementVertex getGroupMember(final int index) {
if (index < this.groupMembers.size()) {
return this.groupMembers.get(index);
}
return null;
} | [
"public",
"ManagementVertex",
"getGroupMember",
"(",
"final",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"this",
".",
"groupMembers",
".",
"size",
"(",
")",
")",
"{",
"return",
"this",
".",
"groupMembers",
".",
"get",
"(",
"index",
")",
";",
"}... | Returns the management vertex with the given index.
@param index
the index of the management vertex to be returned
@return the management vertex with the given index or <code>null</code> if no such vertex exists | [
"Returns",
"the",
"management",
"vertex",
"with",
"the",
"given",
"index",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java#L270-L277 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java | ManagementGroupVertex.getSuccessors | public List<ManagementGroupVertex> getSuccessors() {
final List<ManagementGroupVertex> successors = new ArrayList<ManagementGroupVertex>();
for (ManagementGroupEdge edge : this.forwardEdges) {
successors.add(edge.getTarget());
}
return successors;
} | java | public List<ManagementGroupVertex> getSuccessors() {
final List<ManagementGroupVertex> successors = new ArrayList<ManagementGroupVertex>();
for (ManagementGroupEdge edge : this.forwardEdges) {
successors.add(edge.getTarget());
}
return successors;
} | [
"public",
"List",
"<",
"ManagementGroupVertex",
">",
"getSuccessors",
"(",
")",
"{",
"final",
"List",
"<",
"ManagementGroupVertex",
">",
"successors",
"=",
"new",
"ArrayList",
"<",
"ManagementGroupVertex",
">",
"(",
")",
";",
"for",
"(",
"ManagementGroupEdge",
"... | Returns the list of successors of this group vertex. A successor is a group vertex which can be reached via a
group edge originating at this group vertex.
@return the list of successors of this group vertex. | [
"Returns",
"the",
"list",
"of",
"successors",
"of",
"this",
"group",
"vertex",
".",
"A",
"successor",
"is",
"a",
"group",
"vertex",
"which",
"can",
"be",
"reached",
"via",
"a",
"group",
"edge",
"originating",
"at",
"this",
"group",
"vertex",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java#L382-L391 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java | ManagementGroupVertex.getPredecessors | public List<ManagementGroupVertex> getPredecessors() {
final List<ManagementGroupVertex> predecessors = new ArrayList<ManagementGroupVertex>();
for (ManagementGroupEdge edge : this.backwardEdges) {
predecessors.add(edge.getSource());
}
return predecessors;
} | java | public List<ManagementGroupVertex> getPredecessors() {
final List<ManagementGroupVertex> predecessors = new ArrayList<ManagementGroupVertex>();
for (ManagementGroupEdge edge : this.backwardEdges) {
predecessors.add(edge.getSource());
}
return predecessors;
} | [
"public",
"List",
"<",
"ManagementGroupVertex",
">",
"getPredecessors",
"(",
")",
"{",
"final",
"List",
"<",
"ManagementGroupVertex",
">",
"predecessors",
"=",
"new",
"ArrayList",
"<",
"ManagementGroupVertex",
">",
"(",
")",
";",
"for",
"(",
"ManagementGroupEdge",... | Returns the list of predecessors of this group vertex. A predecessors is a group vertex which can be reached via
a group edge arriving at this group vertex.
@return the list of predecessors of this group vertex. | [
"Returns",
"the",
"list",
"of",
"predecessors",
"of",
"this",
"group",
"vertex",
".",
"A",
"predecessors",
"is",
"a",
"group",
"vertex",
"which",
"can",
"be",
"reached",
"via",
"a",
"group",
"edge",
"arriving",
"at",
"this",
"group",
"vertex",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java#L399-L408 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java | ManagementGroupVertex.toJson | public String toJson() {
StringBuilder json = new StringBuilder("");
json.append("{");
json.append("\"groupvertexid\": \"" + this.getID() + "\",");
json.append("\"groupvertexname\": \"" + StringUtils.escapeHtml(this.getName()) + "\",");
json.append("\"numberofgroupmembers\": " + this.getNumberOfGroupMember... | java | public String toJson() {
StringBuilder json = new StringBuilder("");
json.append("{");
json.append("\"groupvertexid\": \"" + this.getID() + "\",");
json.append("\"groupvertexname\": \"" + StringUtils.escapeHtml(this.getName()) + "\",");
json.append("\"numberofgroupmembers\": " + this.getNumberOfGroupMember... | [
"public",
"String",
"toJson",
"(",
")",
"{",
"StringBuilder",
"json",
"=",
"new",
"StringBuilder",
"(",
"\"\"",
")",
";",
"json",
".",
"append",
"(",
"\"{\"",
")",
";",
"json",
".",
"append",
"(",
"\"\\\"groupvertexid\\\": \\\"\"",
"+",
"this",
".",
"getID... | Returns Json representation of this ManagementGroupVertex
@return | [
"Returns",
"Json",
"representation",
"of",
"this",
"ManagementGroupVertex"
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java#L420-L478 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/local/LocalInstanceManager.java | LocalInstanceManager.createDefaultInstanceType | public static final InstanceType createDefaultInstanceType() {
final HardwareDescription hardwareDescription = HardwareDescriptionFactory.extractFromSystem();
int diskCapacityInGB = 0;
final String[] tempDirs = GlobalConfiguration.getString(ConfigConstants.TASK_MANAGER_TMP_DIR_KEY,
ConfigConstants.DEFAULT_TAS... | java | public static final InstanceType createDefaultInstanceType() {
final HardwareDescription hardwareDescription = HardwareDescriptionFactory.extractFromSystem();
int diskCapacityInGB = 0;
final String[] tempDirs = GlobalConfiguration.getString(ConfigConstants.TASK_MANAGER_TMP_DIR_KEY,
ConfigConstants.DEFAULT_TAS... | [
"public",
"static",
"final",
"InstanceType",
"createDefaultInstanceType",
"(",
")",
"{",
"final",
"HardwareDescription",
"hardwareDescription",
"=",
"HardwareDescriptionFactory",
".",
"extractFromSystem",
"(",
")",
";",
"int",
"diskCapacityInGB",
"=",
"0",
";",
"final",... | Creates a default instance type based on the hardware characteristics of the machine that calls this method. The
default instance type contains the machine's number of CPU cores and size of physical memory. The disc capacity
is calculated from the free space in the directory for temporary files.
@return the default in... | [
"Creates",
"a",
"default",
"instance",
"type",
"based",
"on",
"the",
"hardware",
"characteristics",
"of",
"the",
"machine",
"that",
"calls",
"this",
"method",
".",
"The",
"default",
"instance",
"type",
"contains",
"the",
"machine",
"s",
"number",
"of",
"CPU",
... | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/local/LocalInstanceManager.java#L319-L337 | train |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/program/Client.java | Client.run | public JobExecutionResult run(JobWithJars prog, int parallelism, boolean wait) throws CompilerException, ProgramInvocationException {
return run(getOptimizedPlan(prog, parallelism), prog.getJarFiles(), wait);
} | java | public JobExecutionResult run(JobWithJars prog, int parallelism, boolean wait) throws CompilerException, ProgramInvocationException {
return run(getOptimizedPlan(prog, parallelism), prog.getJarFiles(), wait);
} | [
"public",
"JobExecutionResult",
"run",
"(",
"JobWithJars",
"prog",
",",
"int",
"parallelism",
",",
"boolean",
"wait",
")",
"throws",
"CompilerException",
",",
"ProgramInvocationException",
"{",
"return",
"run",
"(",
"getOptimizedPlan",
"(",
"prog",
",",
"parallelism... | Runs a program on the nephele system whose job-manager is configured in this client's configuration.
This method involves all steps, from compiling, job-graph generation to submission.
@param prog The program to be executed.
@param wait A flag that indicates whether this function call should block until the program ex... | [
"Runs",
"a",
"program",
"on",
"the",
"nephele",
"system",
"whose",
"job",
"-",
"manager",
"is",
"configured",
"in",
"this",
"client",
"s",
"configuration",
".",
"This",
"method",
"involves",
"all",
"steps",
"from",
"compiling",
"job",
"-",
"graph",
"generati... | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/program/Client.java#L261-L263 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/cache/FileCache.java | FileCache.createTmpFile | public FutureTask<Path> createTmpFile(String name, String filePath, JobID jobID) {
synchronized (count) {
Pair<JobID, String> key = new ImmutablePair(jobID,name);
if (count.containsKey(key)) {
count.put(key, count.get(key) + 1);
} else {
count.put(key, 1);
}
}
CopyProcess cp = new CopyProcess... | java | public FutureTask<Path> createTmpFile(String name, String filePath, JobID jobID) {
synchronized (count) {
Pair<JobID, String> key = new ImmutablePair(jobID,name);
if (count.containsKey(key)) {
count.put(key, count.get(key) + 1);
} else {
count.put(key, 1);
}
}
CopyProcess cp = new CopyProcess... | [
"public",
"FutureTask",
"<",
"Path",
">",
"createTmpFile",
"(",
"String",
"name",
",",
"String",
"filePath",
",",
"JobID",
"jobID",
")",
"{",
"synchronized",
"(",
"count",
")",
"{",
"Pair",
"<",
"JobID",
",",
"String",
">",
"key",
"=",
"new",
"ImmutableP... | If the file doesn't exists locally, it will copy the file to the temp directory. | [
"If",
"the",
"file",
"doesn",
"t",
"exists",
"locally",
"it",
"will",
"copy",
"the",
"file",
"to",
"the",
"temp",
"directory",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/cache/FileCache.java#L56-L70 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/cache/FileCache.java | FileCache.deleteTmpFile | public void deleteTmpFile(String name, JobID jobID) {
DeleteProcess dp = new DeleteProcess(name, jobID, count.get(new ImmutablePair(jobID,name)));
executorService.schedule(dp, 5000L, TimeUnit.MILLISECONDS);
} | java | public void deleteTmpFile(String name, JobID jobID) {
DeleteProcess dp = new DeleteProcess(name, jobID, count.get(new ImmutablePair(jobID,name)));
executorService.schedule(dp, 5000L, TimeUnit.MILLISECONDS);
} | [
"public",
"void",
"deleteTmpFile",
"(",
"String",
"name",
",",
"JobID",
"jobID",
")",
"{",
"DeleteProcess",
"dp",
"=",
"new",
"DeleteProcess",
"(",
"name",
",",
"jobID",
",",
"count",
".",
"get",
"(",
"new",
"ImmutablePair",
"(",
"jobID",
",",
"name",
")... | Leave a 5 seconds delay to clear the local file. | [
"Leave",
"a",
"5",
"seconds",
"delay",
"to",
"clear",
"the",
"local",
"file",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/cache/FileCache.java#L75-L78 | train |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/api/common/io/DelimitedInputFormat.java | DelimitedInputFormat.configure | @Override
public void configure(Configuration parameters) {
super.configure(parameters);
String delimString = parameters.getString(RECORD_DELIMITER, null);
if (delimString != null) {
String charsetName = parameters.getString(RECORD_DELIMITER_ENCODING, null);
if (charsetName == null) {
setDelimiter(... | java | @Override
public void configure(Configuration parameters) {
super.configure(parameters);
String delimString = parameters.getString(RECORD_DELIMITER, null);
if (delimString != null) {
String charsetName = parameters.getString(RECORD_DELIMITER_ENCODING, null);
if (charsetName == null) {
setDelimiter(... | [
"@",
"Override",
"public",
"void",
"configure",
"(",
"Configuration",
"parameters",
")",
"{",
"super",
".",
"configure",
"(",
"parameters",
")",
";",
"String",
"delimString",
"=",
"parameters",
".",
"getString",
"(",
"RECORD_DELIMITER",
",",
"null",
")",
";",
... | Configures this input format by reading the path to the file from the configuration andge the string that
defines the record delimiter.
@param parameters The configuration object to read the parameters from. | [
"Configures",
"this",
"input",
"format",
"by",
"reading",
"the",
"path",
"to",
"the",
"file",
"from",
"the",
"configuration",
"andge",
"the",
"string",
"that",
"defines",
"the",
"record",
"delimiter",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/io/DelimitedInputFormat.java#L273-L307 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/JobManagerUtils.java | JobManagerUtils.loadInstanceManager | @SuppressWarnings("unchecked")
static InstanceManager loadInstanceManager(final String instanceManagerClassName) {
Class<? extends InstanceManager> instanceManagerClass;
try {
instanceManagerClass = (Class<? extends InstanceManager>) Class.forName(instanceManagerClassName);
} catch (ClassNotFoundException e)... | java | @SuppressWarnings("unchecked")
static InstanceManager loadInstanceManager(final String instanceManagerClassName) {
Class<? extends InstanceManager> instanceManagerClass;
try {
instanceManagerClass = (Class<? extends InstanceManager>) Class.forName(instanceManagerClassName);
} catch (ClassNotFoundException e)... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"InstanceManager",
"loadInstanceManager",
"(",
"final",
"String",
"instanceManagerClassName",
")",
"{",
"Class",
"<",
"?",
"extends",
"InstanceManager",
">",
"instanceManagerClass",
";",
"try",
"{",
"instan... | Tries to locate a class with given name and to
instantiate a instance manager from it.
@param instanceManagerClassName
the name of the class to instantiate the instance manager object from
@return the {@link InstanceManager} object instantiated from the class with the provided name | [
"Tries",
"to",
"locate",
"a",
"class",
"with",
"given",
"name",
"and",
"to",
"instantiate",
"a",
"instance",
"manager",
"from",
"it",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/JobManagerUtils.java#L111-L135 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/network/bufferprovider/LocalBufferPool.java | LocalBufferPool.recycleBuffer | private void recycleBuffer(MemorySegment buffer) {
synchronized (this.buffers) {
if (this.isDestroyed) {
this.globalBufferPool.returnBuffer(buffer);
this.numRequestedBuffers--;
} else {
// if the number of designated buffers changed in the meantime, make sure
// to return the buffer to the globa... | java | private void recycleBuffer(MemorySegment buffer) {
synchronized (this.buffers) {
if (this.isDestroyed) {
this.globalBufferPool.returnBuffer(buffer);
this.numRequestedBuffers--;
} else {
// if the number of designated buffers changed in the meantime, make sure
// to return the buffer to the globa... | [
"private",
"void",
"recycleBuffer",
"(",
"MemorySegment",
"buffer",
")",
"{",
"synchronized",
"(",
"this",
".",
"buffers",
")",
"{",
"if",
"(",
"this",
".",
"isDestroyed",
")",
"{",
"this",
".",
"globalBufferPool",
".",
"returnBuffer",
"(",
"buffer",
")",
... | Returns a buffer to the buffer pool and notifies listeners about the availability of a new buffer.
@param buffer buffer to return to the buffer pool | [
"Returns",
"a",
"buffer",
"to",
"the",
"buffer",
"pool",
"and",
"notifies",
"listeners",
"about",
"the",
"availability",
"of",
"a",
"new",
"buffer",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/network/bufferprovider/LocalBufferPool.java#L291-L318 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/topology/NetworkNode.java | NetworkNode.getDistance | public int getDistance(final NetworkNode networkNode) {
int steps = 0;
NetworkNode tmp = this;
while (tmp != null) {
final int distance = tmp.isPredecessorOrSelfOf(networkNode);
if (distance >= 0) {
return (steps + distance);
}
tmp = tmp.getParentNode();
++steps;
}
return Integer.MAX_VA... | java | public int getDistance(final NetworkNode networkNode) {
int steps = 0;
NetworkNode tmp = this;
while (tmp != null) {
final int distance = tmp.isPredecessorOrSelfOf(networkNode);
if (distance >= 0) {
return (steps + distance);
}
tmp = tmp.getParentNode();
++steps;
}
return Integer.MAX_VA... | [
"public",
"int",
"getDistance",
"(",
"final",
"NetworkNode",
"networkNode",
")",
"{",
"int",
"steps",
"=",
"0",
";",
"NetworkNode",
"tmp",
"=",
"this",
";",
"while",
"(",
"tmp",
"!=",
"null",
")",
"{",
"final",
"int",
"distance",
"=",
"tmp",
".",
"isPr... | Determines the distance to the given network node. The distance is determined as the number of internal network
nodes that must be traversed in order to send a packet from one node to the other plus one.
@param networkNode
the node to determine the distance for
@return the distance to the given network node or <code>I... | [
"Determines",
"the",
"distance",
"to",
"the",
"given",
"network",
"node",
".",
"The",
"distance",
"is",
"determined",
"as",
"the",
"number",
"of",
"internal",
"network",
"nodes",
"that",
"must",
"be",
"traversed",
"in",
"order",
"to",
"send",
"a",
"packet",
... | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/topology/NetworkNode.java#L161-L177 | train |
stratosphere/stratosphere | stratosphere-addons/jdbc/src/main/java/eu/stratosphere/api/java/record/io/jdbc/JDBCInputFormat.java | JDBCInputFormat.nextRecord | @Override
public Record nextRecord(Record record) {
try {
resultSet.next();
ResultSetMetaData rsmd = resultSet.getMetaData();
int column_count = rsmd.getColumnCount();
record.setNumFields(column_count);
for (int pos = 0; pos < column_count; pos++) {
int type = rsmd.getColumnType(pos + 1);
ret... | java | @Override
public Record nextRecord(Record record) {
try {
resultSet.next();
ResultSetMetaData rsmd = resultSet.getMetaData();
int column_count = rsmd.getColumnCount();
record.setNumFields(column_count);
for (int pos = 0; pos < column_count; pos++) {
int type = rsmd.getColumnType(pos + 1);
ret... | [
"@",
"Override",
"public",
"Record",
"nextRecord",
"(",
"Record",
"record",
")",
"{",
"try",
"{",
"resultSet",
".",
"next",
"(",
")",
";",
"ResultSetMetaData",
"rsmd",
"=",
"resultSet",
".",
"getMetaData",
"(",
")",
";",
"int",
"column_count",
"=",
"rsmd",... | Stores the next resultSet row in a Record
@param record
target Record
@return boolean value indicating that the operation was successful | [
"Stores",
"the",
"next",
"resultSet",
"row",
"in",
"a",
"Record"
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/jdbc/src/main/java/eu/stratosphere/api/java/record/io/jdbc/JDBCInputFormat.java#L352-L373 | train |
stratosphere/stratosphere | stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexUpdateFunction.java | VertexUpdateFunction.getIterationAggregator | public <T extends Aggregator<?>> T getIterationAggregator(String name) {
return this.runtimeContext.<T>getIterationAggregator(name);
} | java | public <T extends Aggregator<?>> T getIterationAggregator(String name) {
return this.runtimeContext.<T>getIterationAggregator(name);
} | [
"public",
"<",
"T",
"extends",
"Aggregator",
"<",
"?",
">",
">",
"T",
"getIterationAggregator",
"(",
"String",
"name",
")",
"{",
"return",
"this",
".",
"runtimeContext",
".",
"<",
"T",
">",
"getIterationAggregator",
"(",
"name",
")",
";",
"}"
] | Gets the iteration aggregator registered under the given name. The iteration aggregator is combines
all aggregates globally once per superstep and makes them available in the next superstep.
@param name The name of the aggregator.
@return The aggregator registered under this name, or null, if no aggregator was registe... | [
"Gets",
"the",
"iteration",
"aggregator",
"registered",
"under",
"the",
"given",
"name",
".",
"The",
"iteration",
"aggregator",
"is",
"combines",
"all",
"aggregates",
"globally",
"once",
"per",
"superstep",
"and",
"makes",
"them",
"available",
"in",
"the",
"next... | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexUpdateFunction.java#L94-L96 | train |
stratosphere/stratosphere | stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexUpdateFunction.java | VertexUpdateFunction.getPreviousIterationAggregate | public <T extends Value> T getPreviousIterationAggregate(String name) {
return this.runtimeContext.<T>getPreviousIterationAggregate(name);
} | java | public <T extends Value> T getPreviousIterationAggregate(String name) {
return this.runtimeContext.<T>getPreviousIterationAggregate(name);
} | [
"public",
"<",
"T",
"extends",
"Value",
">",
"T",
"getPreviousIterationAggregate",
"(",
"String",
"name",
")",
"{",
"return",
"this",
".",
"runtimeContext",
".",
"<",
"T",
">",
"getPreviousIterationAggregate",
"(",
"name",
")",
";",
"}"
] | Get the aggregated value that an aggregator computed in the previous iteration.
@param name The name of the aggregator.
@return The aggregated value of the previous iteration. | [
"Get",
"the",
"aggregated",
"value",
"that",
"an",
"aggregator",
"computed",
"in",
"the",
"previous",
"iteration",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexUpdateFunction.java#L104-L106 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/iomanager/BlockChannelWriter.java | BlockChannelWriter.writeBlock | public void writeBlock(MemorySegment segment) throws IOException
{
// check the error state of this channel
checkErroneous();
// write the current buffer and get the next one
this.requestsNotReturned.incrementAndGet();
if (this.closed || this.requestQueue.isClosed()) {
// if we found ourselves closed a... | java | public void writeBlock(MemorySegment segment) throws IOException
{
// check the error state of this channel
checkErroneous();
// write the current buffer and get the next one
this.requestsNotReturned.incrementAndGet();
if (this.closed || this.requestQueue.isClosed()) {
// if we found ourselves closed a... | [
"public",
"void",
"writeBlock",
"(",
"MemorySegment",
"segment",
")",
"throws",
"IOException",
"{",
"// check the error state of this channel",
"checkErroneous",
"(",
")",
";",
"// write the current buffer and get the next one",
"this",
".",
"requestsNotReturned",
".",
"incre... | Issues a asynchronous write request to the writer.
@param segment The segment to be written.
@throws IOException Thrown, when the writer encounters an I/O error. Due to the asynchronous nature of the
writer, the exception thrown here may have been caused by an earlier write request. | [
"Issues",
"a",
"asynchronous",
"write",
"request",
"to",
"the",
"writer",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/iomanager/BlockChannelWriter.java#L64-L78 | train |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java | CliFrontend.getProgramSpecificOptions | static Options getProgramSpecificOptions(Options options) {
options.addOption(JAR_OPTION);
options.addOption(CLASS_OPTION);
options.addOption(PARALLELISM_OPTION);
options.addOption(ARGS_OPTION);
return options;
} | java | static Options getProgramSpecificOptions(Options options) {
options.addOption(JAR_OPTION);
options.addOption(CLASS_OPTION);
options.addOption(PARALLELISM_OPTION);
options.addOption(ARGS_OPTION);
return options;
} | [
"static",
"Options",
"getProgramSpecificOptions",
"(",
"Options",
"options",
")",
"{",
"options",
".",
"addOption",
"(",
"JAR_OPTION",
")",
";",
"options",
".",
"addOption",
"(",
"CLASS_OPTION",
")",
";",
"options",
".",
"addOption",
"(",
"PARALLELISM_OPTION",
"... | gets the program options with the old flags for jar file and arguments | [
"gets",
"the",
"program",
"options",
"with",
"the",
"old",
"flags",
"for",
"jar",
"file",
"and",
"arguments"
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L167-L173 | train |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java | CliFrontend.getProgramSpecificOptionsWithoutDeprecatedOptions | static Options getProgramSpecificOptionsWithoutDeprecatedOptions(Options options) {
options.addOption(CLASS_OPTION);
options.addOption(PARALLELISM_OPTION);
return options;
} | java | static Options getProgramSpecificOptionsWithoutDeprecatedOptions(Options options) {
options.addOption(CLASS_OPTION);
options.addOption(PARALLELISM_OPTION);
return options;
} | [
"static",
"Options",
"getProgramSpecificOptionsWithoutDeprecatedOptions",
"(",
"Options",
"options",
")",
"{",
"options",
".",
"addOption",
"(",
"CLASS_OPTION",
")",
";",
"options",
".",
"addOption",
"(",
"PARALLELISM_OPTION",
")",
";",
"return",
"options",
";",
"}"... | gets the program options without the old flags for jar file and arguments | [
"gets",
"the",
"program",
"options",
"without",
"the",
"old",
"flags",
"for",
"jar",
"file",
"and",
"arguments"
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L176-L180 | train |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java | CliFrontend.getRunOptions | static Options getRunOptions(Options options) {
Options o = getProgramSpecificOptions(options);
return getJobManagerAddressOption(o);
} | java | static Options getRunOptions(Options options) {
Options o = getProgramSpecificOptions(options);
return getJobManagerAddressOption(o);
} | [
"static",
"Options",
"getRunOptions",
"(",
"Options",
"options",
")",
"{",
"Options",
"o",
"=",
"getProgramSpecificOptions",
"(",
"options",
")",
";",
"return",
"getJobManagerAddressOption",
"(",
"o",
")",
";",
"}"
] | Builds command line options for the run action.
@return Command line options for the run action. | [
"Builds",
"command",
"line",
"options",
"for",
"the",
"run",
"action",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L187-L190 | train |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java | CliFrontend.getInfoOptions | static Options getInfoOptions(Options options) {
options = getProgramSpecificOptions(options);
options = getJobManagerAddressOption(options);
options.addOption(DESCR_OPTION);
options.addOption(PLAN_OPTION);
return options;
} | java | static Options getInfoOptions(Options options) {
options = getProgramSpecificOptions(options);
options = getJobManagerAddressOption(options);
options.addOption(DESCR_OPTION);
options.addOption(PLAN_OPTION);
return options;
} | [
"static",
"Options",
"getInfoOptions",
"(",
"Options",
"options",
")",
"{",
"options",
"=",
"getProgramSpecificOptions",
"(",
"options",
")",
";",
"options",
"=",
"getJobManagerAddressOption",
"(",
"options",
")",
";",
"options",
".",
"addOption",
"(",
"DESCR_OPTI... | Builds command line options for the info action.
@return Command line options for the info action. | [
"Builds",
"command",
"line",
"options",
"for",
"the",
"info",
"action",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L207-L213 | train |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java | CliFrontend.getListOptions | static Options getListOptions(Options options) {
options.addOption(RUNNING_OPTION);
options.addOption(SCHEDULED_OPTION);
options = getJobManagerAddressOption(options);
return options;
} | java | static Options getListOptions(Options options) {
options.addOption(RUNNING_OPTION);
options.addOption(SCHEDULED_OPTION);
options = getJobManagerAddressOption(options);
return options;
} | [
"static",
"Options",
"getListOptions",
"(",
"Options",
"options",
")",
"{",
"options",
".",
"addOption",
"(",
"RUNNING_OPTION",
")",
";",
"options",
".",
"addOption",
"(",
"SCHEDULED_OPTION",
")",
";",
"options",
"=",
"getJobManagerAddressOption",
"(",
"options",
... | Builds command line options for the list action.
@return Command line options for the list action. | [
"Builds",
"command",
"line",
"options",
"for",
"the",
"list",
"action",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L228-L233 | train |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java | CliFrontend.getCancelOptions | static Options getCancelOptions(Options options) {
options.addOption(ID_OPTION);
options = getJobManagerAddressOption(options);
return options;
} | java | static Options getCancelOptions(Options options) {
options.addOption(ID_OPTION);
options = getJobManagerAddressOption(options);
return options;
} | [
"static",
"Options",
"getCancelOptions",
"(",
"Options",
"options",
")",
"{",
"options",
".",
"addOption",
"(",
"ID_OPTION",
")",
";",
"options",
"=",
"getJobManagerAddressOption",
"(",
"options",
")",
";",
"return",
"options",
";",
"}"
] | Builds command line options for the cancel action.
@return Command line options for the cancel action. | [
"Builds",
"command",
"line",
"options",
"for",
"the",
"cancel",
"action",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L240-L244 | train |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java | CliFrontend.cancel | protected int cancel(String[] args) {
// Parse command line options
CommandLine line;
try {
line = parser.parse(CANCEL_OPTIONS, args, false);
}
catch (MissingOptionException e) {
System.out.println(e.getMessage());
printHelpForCancel();
return 1;
}
catch (UnrecognizedOptionException e) {
Sy... | java | protected int cancel(String[] args) {
// Parse command line options
CommandLine line;
try {
line = parser.parse(CANCEL_OPTIONS, args, false);
}
catch (MissingOptionException e) {
System.out.println(e.getMessage());
printHelpForCancel();
return 1;
}
catch (UnrecognizedOptionException e) {
Sy... | [
"protected",
"int",
"cancel",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"// Parse command line options",
"CommandLine",
"line",
";",
"try",
"{",
"line",
"=",
"parser",
".",
"parse",
"(",
"CANCEL_OPTIONS",
",",
"args",
",",
"false",
")",
";",
"}",
"catch",... | Executes the cancel action.
@param args Command line arguments for the cancel action. | [
"Executes",
"the",
"cancel",
"action",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L587-L653 | train |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java | CliFrontend.getGlobalConfiguration | protected Configuration getGlobalConfiguration() {
if (!globalConfigurationLoaded) {
String location = getConfigurationDirectory();
GlobalConfiguration.loadConfiguration(location);
globalConfigurationLoaded = true;
}
return GlobalConfiguration.getConfiguration();
} | java | protected Configuration getGlobalConfiguration() {
if (!globalConfigurationLoaded) {
String location = getConfigurationDirectory();
GlobalConfiguration.loadConfiguration(location);
globalConfigurationLoaded = true;
}
return GlobalConfiguration.getConfiguration();
} | [
"protected",
"Configuration",
"getGlobalConfiguration",
"(",
")",
"{",
"if",
"(",
"!",
"globalConfigurationLoaded",
")",
"{",
"String",
"location",
"=",
"getConfigurationDirectory",
"(",
")",
";",
"GlobalConfiguration",
".",
"loadConfiguration",
"(",
"location",
")",
... | Reads configuration settings. The default path can be overridden
by setting the ENV variable "STRATOSPHERE_CONF_DIR".
@return Stratosphere's global configuration | [
"Reads",
"configuration",
"settings",
".",
"The",
"default",
"path",
"can",
"be",
"overridden",
"by",
"setting",
"the",
"ENV",
"variable",
"STRATOSPHERE_CONF_DIR",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L803-L810 | train |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java | CliFrontend.handleError | private int handleError(Throwable t) {
System.out.println("Error: " + t.getMessage());
if (this.verbose) {
t.printStackTrace();
} else {
System.out.println("For a more detailed error message use the vebose output option '-v'.");
}
return 1;
} | java | private int handleError(Throwable t) {
System.out.println("Error: " + t.getMessage());
if (this.verbose) {
t.printStackTrace();
} else {
System.out.println("For a more detailed error message use the vebose output option '-v'.");
}
return 1;
} | [
"private",
"int",
"handleError",
"(",
"Throwable",
"t",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Error: \"",
"+",
"t",
".",
"getMessage",
"(",
")",
")",
";",
"if",
"(",
"this",
".",
"verbose",
")",
"{",
"t",
".",
"printStackTrace",
"("... | Displays exceptions.
@param e the exception to display. | [
"Displays",
"exceptions",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L883-L891 | train |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java | CliFrontend.main | public static void main(String[] args) throws ParseException {
CliFrontend cli = new CliFrontend();
int retCode = cli.parseParameters(args);
System.exit(retCode);
} | java | public static void main(String[] args) throws ParseException {
CliFrontend cli = new CliFrontend();
int retCode = cli.parseParameters(args);
System.exit(retCode);
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"ParseException",
"{",
"CliFrontend",
"cli",
"=",
"new",
"CliFrontend",
"(",
")",
";",
"int",
"retCode",
"=",
"cli",
".",
"parseParameters",
"(",
"args",
")",
";",
"Syste... | Submits the job based on the arguments | [
"Submits",
"the",
"job",
"based",
"on",
"the",
"arguments"
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L949-L953 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java | RegularPactTask.registerInputOutput | @Override
public void registerInputOutput() {
if (LOG.isDebugEnabled()) {
LOG.debug(formatLogString("Start registering input and output."));
}
// get the classloader first. the classloader might have been set before by mock environments during testing
if (this.userCodeClassLoader == null) {
try {
th... | java | @Override
public void registerInputOutput() {
if (LOG.isDebugEnabled()) {
LOG.debug(formatLogString("Start registering input and output."));
}
// get the classloader first. the classloader might have been set before by mock environments during testing
if (this.userCodeClassLoader == null) {
try {
th... | [
"@",
"Override",
"public",
"void",
"registerInputOutput",
"(",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"formatLogString",
"(",
"\"Start registering input and output.\"",
")",
")",
";",
"}",
"// get the c... | Initialization method. Runs in the execution graph setup phase in the JobManager
and as a setup method on the TaskManager. | [
"Initialization",
"method",
".",
"Runs",
"in",
"the",
"execution",
"graph",
"setup",
"phase",
"in",
"the",
"JobManager",
"and",
"as",
"a",
"setup",
"method",
"on",
"the",
"TaskManager",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java#L223-L272 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java | RegularPactTask.reportAndClearAccumulators | protected static void reportAndClearAccumulators(Environment env, Map<String, Accumulator<?, ?>> accumulators,
ArrayList<ChainedDriver<?, ?>> chainedTasks) {
// We can merge here the accumulators from the stub and the chained
// tasks. Type conflicts can occur here if counters with same name but
// different ... | java | protected static void reportAndClearAccumulators(Environment env, Map<String, Accumulator<?, ?>> accumulators,
ArrayList<ChainedDriver<?, ?>> chainedTasks) {
// We can merge here the accumulators from the stub and the chained
// tasks. Type conflicts can occur here if counters with same name but
// different ... | [
"protected",
"static",
"void",
"reportAndClearAccumulators",
"(",
"Environment",
"env",
",",
"Map",
"<",
"String",
",",
"Accumulator",
"<",
"?",
",",
"?",
">",
">",
"accumulators",
",",
"ArrayList",
"<",
"ChainedDriver",
"<",
"?",
",",
"?",
">",
">",
"chai... | This method is called at the end of a task, receiving the accumulators of
the task and the chained tasks. It merges them into a single map of
accumulators and sends them to the JobManager.
@param chainedTasks
Each chained task might have accumulators which will be merged
with the accumulators of the stub. | [
"This",
"method",
"is",
"called",
"at",
"the",
"end",
"of",
"a",
"task",
"receiving",
"the",
"accumulators",
"of",
"the",
"task",
"and",
"the",
"chained",
"tasks",
".",
"It",
"merges",
"them",
"into",
"a",
"single",
"map",
"of",
"accumulators",
"and",
"s... | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java#L564-L598 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java | RegularPactTask.initInputsSerializersAndComparators | protected void initInputsSerializersAndComparators(int numInputs) throws Exception {
this.inputSerializers = new TypeSerializerFactory<?>[numInputs];
this.inputComparators = this.driver.requiresComparatorOnInput() ? new TypeComparator[numInputs] : null;
this.inputIterators = new MutableObjectIterator[numInputs];
... | java | protected void initInputsSerializersAndComparators(int numInputs) throws Exception {
this.inputSerializers = new TypeSerializerFactory<?>[numInputs];
this.inputComparators = this.driver.requiresComparatorOnInput() ? new TypeComparator[numInputs] : null;
this.inputIterators = new MutableObjectIterator[numInputs];
... | [
"protected",
"void",
"initInputsSerializersAndComparators",
"(",
"int",
"numInputs",
")",
"throws",
"Exception",
"{",
"this",
".",
"inputSerializers",
"=",
"new",
"TypeSerializerFactory",
"<",
"?",
">",
"[",
"numInputs",
"]",
";",
"this",
".",
"inputComparators",
... | Creates all the serializers and comparators. | [
"Creates",
"all",
"the",
"serializers",
"and",
"comparators",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java#L763-L781 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionPipeline.java | ExecutionPipeline.setAllocatedResource | public void setAllocatedResource(final AllocatedResource resource) {
final Iterator<ExecutionVertex> it = this.vertices.iterator();
while (it.hasNext()) {
final ExecutionVertex vertex = it.next();
vertex.setAllocatedResource(resource);
}
} | java | public void setAllocatedResource(final AllocatedResource resource) {
final Iterator<ExecutionVertex> it = this.vertices.iterator();
while (it.hasNext()) {
final ExecutionVertex vertex = it.next();
vertex.setAllocatedResource(resource);
}
} | [
"public",
"void",
"setAllocatedResource",
"(",
"final",
"AllocatedResource",
"resource",
")",
"{",
"final",
"Iterator",
"<",
"ExecutionVertex",
">",
"it",
"=",
"this",
".",
"vertices",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
... | Sets the given allocated resource for all vertices included in this pipeline.
@param resource
the allocated resource to set for all vertices included in this pipeline | [
"Sets",
"the",
"given",
"allocated",
"resource",
"for",
"all",
"vertices",
"included",
"in",
"this",
"pipeline",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionPipeline.java#L99-L106 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionPipeline.java | ExecutionPipeline.updateExecutionState | public void updateExecutionState(final ExecutionState executionState) {
final Iterator<ExecutionVertex> it = this.vertices.iterator();
while (it.hasNext()) {
final ExecutionVertex vertex = it.next();
vertex.updateExecutionState(executionState);
}
} | java | public void updateExecutionState(final ExecutionState executionState) {
final Iterator<ExecutionVertex> it = this.vertices.iterator();
while (it.hasNext()) {
final ExecutionVertex vertex = it.next();
vertex.updateExecutionState(executionState);
}
} | [
"public",
"void",
"updateExecutionState",
"(",
"final",
"ExecutionState",
"executionState",
")",
"{",
"final",
"Iterator",
"<",
"ExecutionVertex",
">",
"it",
"=",
"this",
".",
"vertices",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(... | Updates the execution state for all vertices included in this pipeline.
@param executionState
the execution state to set for all vertices included in this pipeline | [
"Updates",
"the",
"execution",
"state",
"for",
"all",
"vertices",
"included",
"in",
"this",
"pipeline",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionPipeline.java#L114-L122 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java | RuntimeEnvironment.getExecutingThread | public Thread getExecutingThread() {
synchronized (this) {
if (this.executingThread == null) {
if (this.taskName == null) {
this.executingThread = new Thread(this);
}
else {
this.executingThread = new Thread(this, getTaskNameWithIndex());
}
}
return this.executingThread;
}
} | java | public Thread getExecutingThread() {
synchronized (this) {
if (this.executingThread == null) {
if (this.taskName == null) {
this.executingThread = new Thread(this);
}
else {
this.executingThread = new Thread(this, getTaskNameWithIndex());
}
}
return this.executingThread;
}
} | [
"public",
"Thread",
"getExecutingThread",
"(",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"this",
".",
"executingThread",
"==",
"null",
")",
"{",
"if",
"(",
"this",
".",
"taskName",
"==",
"null",
")",
"{",
"this",
".",
"executingThread",... | Returns the thread which is assigned to execute the user code.
@return the thread which is assigned to execute the user code | [
"Returns",
"the",
"thread",
"which",
"is",
"assigned",
"to",
"execute",
"the",
"user",
"code",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java#L421-L435 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java | RuntimeEnvironment.waitForInputChannelsToBeClosed | private void waitForInputChannelsToBeClosed() throws IOException, InterruptedException {
// Wait for disconnection of all output gates
while (true) {
// Make sure, we leave this method with an InterruptedException when the task has been canceled
if (this.executionObserver.isCanceled()) {
throw new Interr... | java | private void waitForInputChannelsToBeClosed() throws IOException, InterruptedException {
// Wait for disconnection of all output gates
while (true) {
// Make sure, we leave this method with an InterruptedException when the task has been canceled
if (this.executionObserver.isCanceled()) {
throw new Interr... | [
"private",
"void",
"waitForInputChannelsToBeClosed",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"// Wait for disconnection of all output gates",
"while",
"(",
"true",
")",
"{",
"// Make sure, we leave this method with an InterruptedException when the task ha... | Blocks until all input channels are closed.
@throws IOException thrown if an error occurred while closing the input channels
@throws InterruptedException thrown if the thread waiting for the channels to be closed is interrupted | [
"Blocks",
"until",
"all",
"input",
"channels",
"are",
"closed",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java#L460-L484 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java | RuntimeEnvironment.closeInputGates | private void closeInputGates() throws IOException, InterruptedException {
for (int i = 0; i < this.inputGates.size(); i++) {
final InputGate<? extends IOReadableWritable> eig = this.inputGates.get(i);
// Important: close must be called on each input gate exactly once
eig.close();
}
} | java | private void closeInputGates() throws IOException, InterruptedException {
for (int i = 0; i < this.inputGates.size(); i++) {
final InputGate<? extends IOReadableWritable> eig = this.inputGates.get(i);
// Important: close must be called on each input gate exactly once
eig.close();
}
} | [
"private",
"void",
"closeInputGates",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"inputGates",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"final",
"InputGate"... | Closes all input gates which are not already closed. | [
"Closes",
"all",
"input",
"gates",
"which",
"are",
"not",
"already",
"closed",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java#L489-L496 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java | RuntimeEnvironment.requestAllOutputGatesToClose | private void requestAllOutputGatesToClose() throws IOException, InterruptedException {
for (int i = 0; i < this.outputGates.size(); i++) {
this.outputGates.get(i).requestClose();
}
} | java | private void requestAllOutputGatesToClose() throws IOException, InterruptedException {
for (int i = 0; i < this.outputGates.size(); i++) {
this.outputGates.get(i).requestClose();
}
} | [
"private",
"void",
"requestAllOutputGatesToClose",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"outputGates",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"this",
... | Requests all output gates to be closed. | [
"Requests",
"all",
"output",
"gates",
"to",
"be",
"closed",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java#L501-L505 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/ipc/RPC.java | RPC.stopProxy | public static void stopProxy(VersionedProtocol proxy) {
if (proxy != null) {
((Invoker) Proxy.getInvocationHandler(proxy)).close();
}
} | java | public static void stopProxy(VersionedProtocol proxy) {
if (proxy != null) {
((Invoker) Proxy.getInvocationHandler(proxy)).close();
}
} | [
"public",
"static",
"void",
"stopProxy",
"(",
"VersionedProtocol",
"proxy",
")",
"{",
"if",
"(",
"proxy",
"!=",
"null",
")",
"{",
"(",
"(",
"Invoker",
")",
"Proxy",
".",
"getInvocationHandler",
"(",
"proxy",
")",
")",
".",
"close",
"(",
")",
";",
"}",
... | Stop this proxy and release its invoker's resource
@param proxy
the proxy to be stopped | [
"Stop",
"this",
"proxy",
"and",
"release",
"its",
"invoker",
"s",
"resource"
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/ipc/RPC.java#L344-L348 | train |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/util/StringUtils.java | StringUtils.arrayToString | public static final String arrayToString(Object array) {
if (array == null) {
throw new NullPointerException();
}
if (array instanceof int[]) {
return Arrays.toString((int[]) array);
}
if (array instanceof long[]) {
return Arrays.toString((long[]) array);
}
if (array instanceof Object[]) {
... | java | public static final String arrayToString(Object array) {
if (array == null) {
throw new NullPointerException();
}
if (array instanceof int[]) {
return Arrays.toString((int[]) array);
}
if (array instanceof long[]) {
return Arrays.toString((long[]) array);
}
if (array instanceof Object[]) {
... | [
"public",
"static",
"final",
"String",
"arrayToString",
"(",
"Object",
"array",
")",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"if",
"(",
"array",
"instanceof",
"int",
"[",
"]",
")",
"{... | Returns a string representation of the given array. This method takes an Object
to allow also all types of primitive type arrays.
@param array The array to create a string representation for.
@return The string representation of the array.
@throws IllegalArgumentException If the given object is no array. | [
"Returns",
"a",
"string",
"representation",
"of",
"the",
"given",
"array",
".",
"This",
"method",
"takes",
"an",
"Object",
"to",
"allow",
"also",
"all",
"types",
"of",
"primitive",
"type",
"arrays",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/util/StringUtils.java#L179-L217 | train |
stratosphere/stratosphere | stratosphere-compiler/src/main/java/eu/stratosphere/compiler/dataproperties/LocalProperties.java | LocalProperties.filterByNodesConstantSet | public LocalProperties filterByNodesConstantSet(OptimizerNode node, int input)
{
// check, whether the local order is preserved
Ordering no = this.ordering;
FieldList ngf = this.groupedFields;
Set<FieldSet> nuf = this.uniqueFields;
if (this.ordering != null) {
final FieldList involvedIndexes = this.ord... | java | public LocalProperties filterByNodesConstantSet(OptimizerNode node, int input)
{
// check, whether the local order is preserved
Ordering no = this.ordering;
FieldList ngf = this.groupedFields;
Set<FieldSet> nuf = this.uniqueFields;
if (this.ordering != null) {
final FieldList involvedIndexes = this.ord... | [
"public",
"LocalProperties",
"filterByNodesConstantSet",
"(",
"OptimizerNode",
"node",
",",
"int",
"input",
")",
"{",
"// check, whether the local order is preserved",
"Ordering",
"no",
"=",
"this",
".",
"ordering",
";",
"FieldList",
"ngf",
"=",
"this",
".",
"groupedF... | Filters these properties by what can be preserved through a user function's constant fields set.
@param node The optimizer node that potentially modifies the properties.
@param input The input of the node which is relevant.
@return True, if the resulting properties are non trivial. | [
"Filters",
"these",
"properties",
"by",
"what",
"can",
"be",
"preserved",
"through",
"a",
"user",
"function",
"s",
"constant",
"fields",
"set",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-compiler/src/main/java/eu/stratosphere/compiler/dataproperties/LocalProperties.java#L165-L214 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionSignature.java | ExecutionSignature.createSignature | public static synchronized ExecutionSignature createSignature(
final Class<? extends AbstractInvokable> invokableClass, final JobID jobID) {
// First, try to load message digest algorithm, if necessary
if (messageDigest == null) {
try {
messageDigest = MessageDigest.getInstance(HASHINGALGORITHM);
} ca... | java | public static synchronized ExecutionSignature createSignature(
final Class<? extends AbstractInvokable> invokableClass, final JobID jobID) {
// First, try to load message digest algorithm, if necessary
if (messageDigest == null) {
try {
messageDigest = MessageDigest.getInstance(HASHINGALGORITHM);
} ca... | [
"public",
"static",
"synchronized",
"ExecutionSignature",
"createSignature",
"(",
"final",
"Class",
"<",
"?",
"extends",
"AbstractInvokable",
">",
"invokableClass",
",",
"final",
"JobID",
"jobID",
")",
"{",
"// First, try to load message digest algorithm, if necessary",
"if... | Calculates the execution signature from the given class name and job ID.
@param invokableClass
the name of the class to contain the task program
@param jobID
the ID of the job
@return the cryptographic signature of this vertex | [
"Calculates",
"the",
"execution",
"signature",
"from",
"the",
"given",
"class",
"name",
"and",
"job",
"ID",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionSignature.java#L78-L114 | train |
stratosphere/stratosphere | stratosphere-addons/jdbc/src/main/java/eu/stratosphere/api/java/io/jdbc/JDBCInputFormat.java | JDBCInputFormat.open | @Override
public void open(InputSplit ignored) throws IOException {
try {
establishConnection();
statement = dbConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
resultSet = statement.executeQuery(query);
} catch (SQLException se) {
close();
throw new IllegalArgumen... | java | @Override
public void open(InputSplit ignored) throws IOException {
try {
establishConnection();
statement = dbConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
resultSet = statement.executeQuery(query);
} catch (SQLException se) {
close();
throw new IllegalArgumen... | [
"@",
"Override",
"public",
"void",
"open",
"(",
"InputSplit",
"ignored",
")",
"throws",
"IOException",
"{",
"try",
"{",
"establishConnection",
"(",
")",
";",
"statement",
"=",
"dbConn",
".",
"createStatement",
"(",
"ResultSet",
".",
"TYPE_SCROLL_INSENSITIVE",
",... | Connects to the source database and executes the query.
@param ignored
@throws IOException | [
"Connects",
"to",
"the",
"source",
"database",
"and",
"executes",
"the",
"query",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/jdbc/src/main/java/eu/stratosphere/api/java/io/jdbc/JDBCInputFormat.java#L75-L87 | train |
stratosphere/stratosphere | stratosphere-addons/jdbc/src/main/java/eu/stratosphere/api/java/io/jdbc/JDBCInputFormat.java | JDBCInputFormat.nextRecord | @Override
public OUT nextRecord(OUT tuple) throws IOException {
try {
resultSet.next();
if (columnTypes == null) {
extractTypes(tuple);
}
addValue(tuple);
return tuple;
} catch (SQLException se) {
close();
throw new IOException("Couldn't read data - " + se.getMessage(), se);
} catch (Nul... | java | @Override
public OUT nextRecord(OUT tuple) throws IOException {
try {
resultSet.next();
if (columnTypes == null) {
extractTypes(tuple);
}
addValue(tuple);
return tuple;
} catch (SQLException se) {
close();
throw new IOException("Couldn't read data - " + se.getMessage(), se);
} catch (Nul... | [
"@",
"Override",
"public",
"OUT",
"nextRecord",
"(",
"OUT",
"tuple",
")",
"throws",
"IOException",
"{",
"try",
"{",
"resultSet",
".",
"next",
"(",
")",
";",
"if",
"(",
"columnTypes",
"==",
"null",
")",
"{",
"extractTypes",
"(",
"tuple",
")",
";",
"}",
... | Stores the next resultSet row in a tuple
@param tuple
@return tuple containing next row
@throws java.io.IOException | [
"Stores",
"the",
"next",
"resultSet",
"row",
"in",
"a",
"tuple"
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/jdbc/src/main/java/eu/stratosphere/api/java/io/jdbc/JDBCInputFormat.java#L151-L167 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/runtime/fs/hdfs/DistributedFileSystem.java | DistributedFileSystem.getHadoopConfiguration | public static org.apache.hadoop.conf.Configuration getHadoopConfiguration() {
Configuration retConf = new org.apache.hadoop.conf.Configuration();
// We need to load both core-site.xml and hdfs-site.xml to determine the default fs path and
// the hdfs configuration
// Try to load HDFS configuration from Hadoop'... | java | public static org.apache.hadoop.conf.Configuration getHadoopConfiguration() {
Configuration retConf = new org.apache.hadoop.conf.Configuration();
// We need to load both core-site.xml and hdfs-site.xml to determine the default fs path and
// the hdfs configuration
// Try to load HDFS configuration from Hadoop'... | [
"public",
"static",
"org",
".",
"apache",
".",
"hadoop",
".",
"conf",
".",
"Configuration",
"getHadoopConfiguration",
"(",
")",
"{",
"Configuration",
"retConf",
"=",
"new",
"org",
".",
"apache",
".",
"hadoop",
".",
"conf",
".",
"Configuration",
"(",
")",
"... | Returns a new Hadoop Configuration object using the path to the hadoop conf configured
in the Stratosphere configuration.
This method is public because its being used in the HadoopDataSource. | [
"Returns",
"a",
"new",
"Hadoop",
"Configuration",
"object",
"using",
"the",
"path",
"to",
"the",
"hadoop",
"conf",
"configured",
"in",
"the",
"Stratosphere",
"configuration",
".",
"This",
"method",
"is",
"public",
"because",
"its",
"being",
"used",
"in",
"the"... | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/runtime/fs/hdfs/DistributedFileSystem.java#L164-L218 | train |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/iomanager/BlockChannelReader.java | BlockChannelReader.readBlock | public void readBlock(MemorySegment segment) throws IOException
{
// check the error state of this channel
checkErroneous();
// write the current buffer and get the next one
// the statements have to be in this order to avoid incrementing the counter
// after the channel has been closed
this.requestsNot... | java | public void readBlock(MemorySegment segment) throws IOException
{
// check the error state of this channel
checkErroneous();
// write the current buffer and get the next one
// the statements have to be in this order to avoid incrementing the counter
// after the channel has been closed
this.requestsNot... | [
"public",
"void",
"readBlock",
"(",
"MemorySegment",
"segment",
")",
"throws",
"IOException",
"{",
"// check the error state of this channel",
"checkErroneous",
"(",
")",
";",
"// write the current buffer and get the next one",
"// the statements have to be in this order to avoid inc... | Issues a read request, which will asynchronously fill the given segment with the next block in the
underlying file channel. Once the read request is fulfilled, the segment will be added to this reader's
return queue.
@param segment The segment to read the block into.
@throws IOException Thrown, when the reader encount... | [
"Issues",
"a",
"read",
"request",
"which",
"will",
"asynchronously",
"fill",
"the",
"given",
"segment",
"with",
"the",
"next",
"block",
"in",
"the",
"underlying",
"file",
"channel",
".",
"Once",
"the",
"read",
"request",
"is",
"fulfilled",
"the",
"segment",
... | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/iomanager/BlockChannelReader.java#L66-L82 | train |
stratosphere/stratosphere | stratosphere-java/src/main/java/eu/stratosphere/api/java/ExecutionEnvironment.java | ExecutionEnvironment.readTextFile | public DataSource<String> readTextFile(String filePath) {
Validate.notNull(filePath, "The file path may not be null.");
return new DataSource<String>(this, new TextInputFormat(new Path(filePath)), BasicTypeInfo.STRING_TYPE_INFO );
} | java | public DataSource<String> readTextFile(String filePath) {
Validate.notNull(filePath, "The file path may not be null.");
return new DataSource<String>(this, new TextInputFormat(new Path(filePath)), BasicTypeInfo.STRING_TYPE_INFO );
} | [
"public",
"DataSource",
"<",
"String",
">",
"readTextFile",
"(",
"String",
"filePath",
")",
"{",
"Validate",
".",
"notNull",
"(",
"filePath",
",",
"\"The file path may not be null.\"",
")",
";",
"return",
"new",
"DataSource",
"<",
"String",
">",
"(",
"this",
"... | Creates a DataSet that represents the Strings produced by reading the given file line wise.
The file will be read with the system's default character set.
@param filePath The path of the file, as a URI (e.g., "file:///some/local/file" or "hdfs://host:port/file/path").
@return A DataSet that represents the data read fr... | [
"Creates",
"a",
"DataSet",
"that",
"represents",
"the",
"Strings",
"produced",
"by",
"reading",
"the",
"given",
"file",
"line",
"wise",
".",
"The",
"file",
"will",
"be",
"read",
"with",
"the",
"system",
"s",
"default",
"character",
"set",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-java/src/main/java/eu/stratosphere/api/java/ExecutionEnvironment.java#L175-L179 | train |
stratosphere/stratosphere | stratosphere-java/src/main/java/eu/stratosphere/api/java/ExecutionEnvironment.java | ExecutionEnvironment.generateSequence | public DataSource<Long> generateSequence(long from, long to) {
return fromParallelCollection(new NumberSequenceIterator(from, to), BasicTypeInfo.LONG_TYPE_INFO);
} | java | public DataSource<Long> generateSequence(long from, long to) {
return fromParallelCollection(new NumberSequenceIterator(from, to), BasicTypeInfo.LONG_TYPE_INFO);
} | [
"public",
"DataSource",
"<",
"Long",
">",
"generateSequence",
"(",
"long",
"from",
",",
"long",
"to",
")",
"{",
"return",
"fromParallelCollection",
"(",
"new",
"NumberSequenceIterator",
"(",
"from",
",",
"to",
")",
",",
"BasicTypeInfo",
".",
"LONG_TYPE_INFO",
... | Creates a new data set that contains a sequence of numbers. The data set will be created in parallel,
so there is no guarantee about the oder of the elements.
@param from The number to start at (inclusive).
@param to The number to stop at (inclusive).
@return A DataSet, containing all number in the {@code [from, to]} ... | [
"Creates",
"a",
"new",
"data",
"set",
"that",
"contains",
"a",
"sequence",
"of",
"numbers",
".",
"The",
"data",
"set",
"will",
"be",
"created",
"in",
"parallel",
"so",
"there",
"is",
"no",
"guarantee",
"about",
"the",
"oder",
"of",
"the",
"elements",
"."... | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-java/src/main/java/eu/stratosphere/api/java/ExecutionEnvironment.java#L494-L496 | train |
stratosphere/stratosphere | stratosphere-java/src/main/java/eu/stratosphere/api/java/record/io/DelimitedOutputFormat.java | DelimitedOutputFormat.configure | public void configure(Configuration config)
{
super.configure(config);
final String delim = config.getString(RECORD_DELIMITER, "\n");
final String charsetName = config.getString(RECORD_DELIMITER_ENCODING, null);
if (delim == null) {
throw new IllegalArgumentException("The delimiter in the DelimitedOutp... | java | public void configure(Configuration config)
{
super.configure(config);
final String delim = config.getString(RECORD_DELIMITER, "\n");
final String charsetName = config.getString(RECORD_DELIMITER_ENCODING, null);
if (delim == null) {
throw new IllegalArgumentException("The delimiter in the DelimitedOutp... | [
"public",
"void",
"configure",
"(",
"Configuration",
"config",
")",
"{",
"super",
".",
"configure",
"(",
"config",
")",
";",
"final",
"String",
"delim",
"=",
"config",
".",
"getString",
"(",
"RECORD_DELIMITER",
",",
"\"\\n\"",
")",
";",
"final",
"String",
... | Calls the super classes to configure themselves and reads the config parameters for the delimiter and
the write buffer size.
@param config The configuration to read the parameters from.
@see eu.stratosphere.api.java.record.io.FileOutputFormat#configure(eu.stratosphere.configuration.Configuration) | [
"Calls",
"the",
"super",
"classes",
"to",
"configure",
"themselves",
"and",
"reads",
"the",
"config",
"parameters",
"for",
"the",
"delimiter",
"and",
"the",
"write",
"buffer",
"size",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-java/src/main/java/eu/stratosphere/api/java/record/io/DelimitedOutputFormat.java#L79-L100 | train |
stratosphere/stratosphere | stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexCentricIteration.java | VertexCentricIteration.addBroadcastSetForMessagingFunction | public void addBroadcastSetForMessagingFunction(String name, DataSet<?> data) {
this.bcVarsMessaging.add(new Tuple2<String, DataSet<?>>(name, data));
} | java | public void addBroadcastSetForMessagingFunction(String name, DataSet<?> data) {
this.bcVarsMessaging.add(new Tuple2<String, DataSet<?>>(name, data));
} | [
"public",
"void",
"addBroadcastSetForMessagingFunction",
"(",
"String",
"name",
",",
"DataSet",
"<",
"?",
">",
"data",
")",
"{",
"this",
".",
"bcVarsMessaging",
".",
"add",
"(",
"new",
"Tuple2",
"<",
"String",
",",
"DataSet",
"<",
"?",
">",
">",
"(",
"na... | Adds a data set as a broadcast set to the messaging function.
@param name The name under which the broadcast data is available in the messaging function.
@param data The data set to be broadcasted. | [
"Adds",
"a",
"data",
"set",
"as",
"a",
"broadcast",
"set",
"to",
"the",
"messaging",
"function",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexCentricIteration.java#L180-L182 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.