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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
greenrobot/essentials | java-essentials/src/main/java/org/greenrobot/essentials/StringUtils.java | StringUtils.decodeUrlIso | public static String decodeUrlIso(String stringToDecode) {
try {
return URLDecoder.decode(stringToDecode, "ISO-8859-1");
} catch (UnsupportedEncodingException e1) {
throw new RuntimeException(e1);
}
} | java | public static String decodeUrlIso(String stringToDecode) {
try {
return URLDecoder.decode(stringToDecode, "ISO-8859-1");
} catch (UnsupportedEncodingException e1) {
throw new RuntimeException(e1);
}
} | [
"public",
"static",
"String",
"decodeUrlIso",
"(",
"String",
"stringToDecode",
")",
"{",
"try",
"{",
"return",
"URLDecoder",
".",
"decode",
"(",
"stringToDecode",
",",
"\"ISO-8859-1\"",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e1",
")",
"{",... | URL-Decodes a given string using ISO-8859-1. No UnsupportedEncodingException to handle as it is dealt with in
this method. | [
"URL",
"-",
"Decodes",
"a",
"given",
"string",
"using",
"ISO",
"-",
"8859",
"-",
"1",
".",
"No",
"UnsupportedEncodingException",
"to",
"handle",
"as",
"it",
"is",
"dealt",
"with",
"in",
"this",
"method",
"."
] | 31eaaeb410174004196c9ef9c9469e0d02afd94b | https://github.com/greenrobot/essentials/blob/31eaaeb410174004196c9ef9c9469e0d02afd94b/java-essentials/src/main/java/org/greenrobot/essentials/StringUtils.java#L104-L110 | train |
greenrobot/essentials | java-essentials/src/main/java/org/greenrobot/essentials/StringUtils.java | StringUtils.ellipsize | public static String ellipsize(String text, int maxLength, String end) {
if (text != null && text.length() > maxLength) {
return text.substring(0, maxLength - end.length()) + end;
}
return text;
} | java | public static String ellipsize(String text, int maxLength, String end) {
if (text != null && text.length() > maxLength) {
return text.substring(0, maxLength - end.length()) + end;
}
return text;
} | [
"public",
"static",
"String",
"ellipsize",
"(",
"String",
"text",
",",
"int",
"maxLength",
",",
"String",
"end",
")",
"{",
"if",
"(",
"text",
"!=",
"null",
"&&",
"text",
".",
"length",
"(",
")",
">",
"maxLength",
")",
"{",
"return",
"text",
".",
"sub... | Cuts the string at the end if it's longer than maxLength and appends the given end string to it. The length of
the resulting string is always less or equal to the given maxLength. It's valid to pass a null text; in this
case null is returned. | [
"Cuts",
"the",
"string",
"at",
"the",
"end",
"if",
"it",
"s",
"longer",
"than",
"maxLength",
"and",
"appends",
"the",
"given",
"end",
"string",
"to",
"it",
".",
"The",
"length",
"of",
"the",
"resulting",
"string",
"is",
"always",
"less",
"or",
"equal",
... | 31eaaeb410174004196c9ef9c9469e0d02afd94b | https://github.com/greenrobot/essentials/blob/31eaaeb410174004196c9ef9c9469e0d02afd94b/java-essentials/src/main/java/org/greenrobot/essentials/StringUtils.java#L228-L233 | train |
greenrobot/essentials | java-essentials/src/main/java/org/greenrobot/essentials/StringUtils.java | StringUtils.join | public static String join(Iterable<?> iterable, String separator) {
if (iterable != null) {
StringBuilder buf = new StringBuilder();
Iterator<?> it = iterable.iterator();
char singleChar = separator.length() == 1 ? separator.charAt(0) : 0;
while (it.hasNext()) {
... | java | public static String join(Iterable<?> iterable, String separator) {
if (iterable != null) {
StringBuilder buf = new StringBuilder();
Iterator<?> it = iterable.iterator();
char singleChar = separator.length() == 1 ? separator.charAt(0) : 0;
while (it.hasNext()) {
... | [
"public",
"static",
"String",
"join",
"(",
"Iterable",
"<",
"?",
">",
"iterable",
",",
"String",
"separator",
")",
"{",
"if",
"(",
"iterable",
"!=",
"null",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Iterator",
"<",
... | Joins the given iterable objects using the given separator into a single string.
@return the joined string or an empty string if iterable is null | [
"Joins",
"the",
"given",
"iterable",
"objects",
"using",
"the",
"given",
"separator",
"into",
"a",
"single",
"string",
"."
] | 31eaaeb410174004196c9ef9c9469e0d02afd94b | https://github.com/greenrobot/essentials/blob/31eaaeb410174004196c9ef9c9469e0d02afd94b/java-essentials/src/main/java/org/greenrobot/essentials/StringUtils.java#L259-L279 | train |
greenrobot/essentials | java-essentials/src/main/java/org/greenrobot/essentials/StringUtils.java | StringUtils.join | public static String join(int[] array, String separator) {
if (array != null) {
StringBuilder buf = new StringBuilder(Math.max(16, (separator.length() + 1) * array.length));
char singleChar = separator.length() == 1 ? separator.charAt(0) : 0;
for (int i = 0; i < array.length;... | java | public static String join(int[] array, String separator) {
if (array != null) {
StringBuilder buf = new StringBuilder(Math.max(16, (separator.length() + 1) * array.length));
char singleChar = separator.length() == 1 ? separator.charAt(0) : 0;
for (int i = 0; i < array.length;... | [
"public",
"static",
"String",
"join",
"(",
"int",
"[",
"]",
"array",
",",
"String",
"separator",
")",
"{",
"if",
"(",
"array",
"!=",
"null",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"Math",
".",
"max",
"(",
"16",
",",
"(",
... | Joins the given ints using the given separator into a single string.
@return the joined string or an empty string if the int array is null | [
"Joins",
"the",
"given",
"ints",
"using",
"the",
"given",
"separator",
"into",
"a",
"single",
"string",
"."
] | 31eaaeb410174004196c9ef9c9469e0d02afd94b | https://github.com/greenrobot/essentials/blob/31eaaeb410174004196c9ef9c9469e0d02afd94b/java-essentials/src/main/java/org/greenrobot/essentials/StringUtils.java#L286-L305 | train |
mkopylec/charon-spring-boot-starter | src/main/java/com/github/mkopylec/charon/core/http/RequestForwarder.java | RequestForwarder.prepareForwardedResponseHeaders | protected void prepareForwardedResponseHeaders(ResponseData response) {
HttpHeaders headers = response.getHeaders();
headers.remove(TRANSFER_ENCODING);
headers.remove(CONNECTION);
headers.remove("Public-Key-Pins");
headers.remove(SERVER);
headers.remove("Strict-Transport-... | java | protected void prepareForwardedResponseHeaders(ResponseData response) {
HttpHeaders headers = response.getHeaders();
headers.remove(TRANSFER_ENCODING);
headers.remove(CONNECTION);
headers.remove("Public-Key-Pins");
headers.remove(SERVER);
headers.remove("Strict-Transport-... | [
"protected",
"void",
"prepareForwardedResponseHeaders",
"(",
"ResponseData",
"response",
")",
"{",
"HttpHeaders",
"headers",
"=",
"response",
".",
"getHeaders",
"(",
")",
";",
"headers",
".",
"remove",
"(",
"TRANSFER_ENCODING",
")",
";",
"headers",
".",
"remove",
... | Remove any protocol-level headers from the remote server's response that
do not apply to the new response we are sending.
@param response | [
"Remove",
"any",
"protocol",
"-",
"level",
"headers",
"from",
"the",
"remote",
"server",
"s",
"response",
"that",
"do",
"not",
"apply",
"to",
"the",
"new",
"response",
"we",
"are",
"sending",
"."
] | 9a3aa4ffd0bae6a1f94cd983bbf17cd36f4ff594 | https://github.com/mkopylec/charon-spring-boot-starter/blob/9a3aa4ffd0bae6a1f94cd983bbf17cd36f4ff594/src/main/java/com/github/mkopylec/charon/core/http/RequestForwarder.java#L98-L105 | train |
mkopylec/charon-spring-boot-starter | src/main/java/com/github/mkopylec/charon/core/http/RequestForwarder.java | RequestForwarder.prepareForwardedRequestHeaders | protected void prepareForwardedRequestHeaders(RequestData request, ForwardDestination destination) {
HttpHeaders headers = request.getHeaders();
headers.set(HOST, destination.getUri().getAuthority());
headers.remove(TE);
} | java | protected void prepareForwardedRequestHeaders(RequestData request, ForwardDestination destination) {
HttpHeaders headers = request.getHeaders();
headers.set(HOST, destination.getUri().getAuthority());
headers.remove(TE);
} | [
"protected",
"void",
"prepareForwardedRequestHeaders",
"(",
"RequestData",
"request",
",",
"ForwardDestination",
"destination",
")",
"{",
"HttpHeaders",
"headers",
"=",
"request",
".",
"getHeaders",
"(",
")",
";",
"headers",
".",
"set",
"(",
"HOST",
",",
"destinat... | Remove any protocol-level headers from the clients request that
do not apply to the new request we are sending to the remote server.
@param request
@param destination | [
"Remove",
"any",
"protocol",
"-",
"level",
"headers",
"from",
"the",
"clients",
"request",
"that",
"do",
"not",
"apply",
"to",
"the",
"new",
"request",
"we",
"are",
"sending",
"to",
"the",
"remote",
"server",
"."
] | 9a3aa4ffd0bae6a1f94cd983bbf17cd36f4ff594 | https://github.com/mkopylec/charon-spring-boot-starter/blob/9a3aa4ffd0bae6a1f94cd983bbf17cd36f4ff594/src/main/java/com/github/mkopylec/charon/core/http/RequestForwarder.java#L114-L118 | train |
patka/cassandra-migration | cassandra-migration/src/main/java/org/cognitor/cassandra/migration/MigrationRepository.java | MigrationRepository.normalizePath | private String normalizePath(String scriptPath) {
StringBuilder builder = new StringBuilder(scriptPath.length() + 1);
if (scriptPath.startsWith("/")) {
builder.append(scriptPath.substring(1));
} else {
builder.append(scriptPath);
}
if (!scriptPath.endsWith... | java | private String normalizePath(String scriptPath) {
StringBuilder builder = new StringBuilder(scriptPath.length() + 1);
if (scriptPath.startsWith("/")) {
builder.append(scriptPath.substring(1));
} else {
builder.append(scriptPath);
}
if (!scriptPath.endsWith... | [
"private",
"String",
"normalizePath",
"(",
"String",
"scriptPath",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"scriptPath",
".",
"length",
"(",
")",
"+",
"1",
")",
";",
"if",
"(",
"scriptPath",
".",
"startsWith",
"(",
"\"/\"",
... | Ensures that every path starts and ends with a slash character.
@param scriptPath the scriptPath that needs to be normalized
@return a path with leading and trailing slash | [
"Ensures",
"that",
"every",
"path",
"starts",
"and",
"ends",
"with",
"a",
"slash",
"character",
"."
] | c61840c23b17a18df704d136909c26ff46bd5c77 | https://github.com/patka/cassandra-migration/blob/c61840c23b17a18df704d136909c26ff46bd5c77/cassandra-migration/src/main/java/org/cognitor/cassandra/migration/MigrationRepository.java#L143-L154 | train |
patka/cassandra-migration | cassandra-migration/src/main/java/org/cognitor/cassandra/migration/MigrationRepository.java | MigrationRepository.getMigrationsSinceVersion | public List<DbMigration> getMigrationsSinceVersion(int version) {
List<DbMigration> dbMigrations = new ArrayList<>();
migrationScripts.stream().filter(script -> script.getVersion() > version).forEach(script -> {
String content = loadScriptContent(script);
dbMigrations.add(new DbM... | java | public List<DbMigration> getMigrationsSinceVersion(int version) {
List<DbMigration> dbMigrations = new ArrayList<>();
migrationScripts.stream().filter(script -> script.getVersion() > version).forEach(script -> {
String content = loadScriptContent(script);
dbMigrations.add(new DbM... | [
"public",
"List",
"<",
"DbMigration",
">",
"getMigrationsSinceVersion",
"(",
"int",
"version",
")",
"{",
"List",
"<",
"DbMigration",
">",
"dbMigrations",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"migrationScripts",
".",
"stream",
"(",
")",
".",
"filter"... | Returns all migrations starting from and excluding the given version. Usually you want to provide the version of
the database here to get all migrations that need to be executed. In case there is no script with a newer
version than the one given, an empty list is returned.
@param version the version that is currently ... | [
"Returns",
"all",
"migrations",
"starting",
"from",
"and",
"excluding",
"the",
"given",
"version",
".",
"Usually",
"you",
"want",
"to",
"provide",
"the",
"version",
"of",
"the",
"database",
"here",
"to",
"get",
"all",
"migrations",
"that",
"need",
"to",
"be"... | c61840c23b17a18df704d136909c26ff46bd5c77 | https://github.com/patka/cassandra-migration/blob/c61840c23b17a18df704d136909c26ff46bd5c77/cassandra-migration/src/main/java/org/cognitor/cassandra/migration/MigrationRepository.java#L235-L242 | train |
patka/cassandra-migration | cassandra-migration/src/main/java/org/cognitor/cassandra/migration/Database.java | Database.getVersion | public int getVersion() {
ResultSet resultSet = session.execute(format(VERSION_QUERY, getTableName()));
Row result = resultSet.one();
if (result == null) {
return 0;
}
return result.getInt(0);
} | java | public int getVersion() {
ResultSet resultSet = session.execute(format(VERSION_QUERY, getTableName()));
Row result = resultSet.one();
if (result == null) {
return 0;
}
return result.getInt(0);
} | [
"public",
"int",
"getVersion",
"(",
")",
"{",
"ResultSet",
"resultSet",
"=",
"session",
".",
"execute",
"(",
"format",
"(",
"VERSION_QUERY",
",",
"getTableName",
"(",
")",
")",
")",
";",
"Row",
"result",
"=",
"resultSet",
".",
"one",
"(",
")",
";",
"if... | Gets the current version of the database schema. This version is taken
from the migration table and represent the latest successful entry.
@return the current schema version | [
"Gets",
"the",
"current",
"version",
"of",
"the",
"database",
"schema",
".",
"This",
"version",
"is",
"taken",
"from",
"the",
"migration",
"table",
"and",
"represent",
"the",
"latest",
"successful",
"entry",
"."
] | c61840c23b17a18df704d136909c26ff46bd5c77 | https://github.com/patka/cassandra-migration/blob/c61840c23b17a18df704d136909c26ff46bd5c77/cassandra-migration/src/main/java/org/cognitor/cassandra/migration/Database.java#L134-L141 | train |
patka/cassandra-migration | cassandra-migration/src/main/java/org/cognitor/cassandra/migration/Database.java | Database.logMigration | private void logMigration(DbMigration migration, boolean wasSuccessful) {
BoundStatement boundStatement = logMigrationStatement.bind(wasSuccessful, migration.getVersion(),
migration.getScriptName(), migration.getMigrationScript(), new Date());
session.execute(boundStatement);
} | java | private void logMigration(DbMigration migration, boolean wasSuccessful) {
BoundStatement boundStatement = logMigrationStatement.bind(wasSuccessful, migration.getVersion(),
migration.getScriptName(), migration.getMigrationScript(), new Date());
session.execute(boundStatement);
} | [
"private",
"void",
"logMigration",
"(",
"DbMigration",
"migration",
",",
"boolean",
"wasSuccessful",
")",
"{",
"BoundStatement",
"boundStatement",
"=",
"logMigrationStatement",
".",
"bind",
"(",
"wasSuccessful",
",",
"migration",
".",
"getVersion",
"(",
")",
",",
... | Inserts the result of the migration into the migration table
@param migration the migration that was executed
@param wasSuccessful indicates if the migration was successful or not | [
"Inserts",
"the",
"result",
"of",
"the",
"migration",
"into",
"the",
"migration",
"table"
] | c61840c23b17a18df704d136909c26ff46bd5c77 | https://github.com/patka/cassandra-migration/blob/c61840c23b17a18df704d136909c26ff46bd5c77/cassandra-migration/src/main/java/org/cognitor/cassandra/migration/Database.java#L219-L223 | train |
patka/cassandra-migration | cassandra-migration/src/main/java/org/cognitor/cassandra/migration/MigrationTask.java | MigrationTask.migrate | public void migrate() {
if (databaseIsUpToDate()) {
LOGGER.info(format("Keyspace %s is already up to date at version %d", database.getKeyspaceName(),
database.getVersion()));
return;
}
List<DbMigration> migrations = repository.getMigrationsSinceVersio... | java | public void migrate() {
if (databaseIsUpToDate()) {
LOGGER.info(format("Keyspace %s is already up to date at version %d", database.getKeyspaceName(),
database.getVersion()));
return;
}
List<DbMigration> migrations = repository.getMigrationsSinceVersio... | [
"public",
"void",
"migrate",
"(",
")",
"{",
"if",
"(",
"databaseIsUpToDate",
"(",
")",
")",
"{",
"LOGGER",
".",
"info",
"(",
"format",
"(",
"\"Keyspace %s is already up to date at version %d\"",
",",
"database",
".",
"getKeyspaceName",
"(",
")",
",",
"database",... | Start the actual migration. Take the version of the database, get all required migrations and execute them or do
nothing if the DB is already up to date.
At the end the underlying database instance is closed.
@throws MigrationException if a migration fails | [
"Start",
"the",
"actual",
"migration",
".",
"Take",
"the",
"version",
"of",
"the",
"database",
"get",
"all",
"required",
"migrations",
"and",
"execute",
"them",
"or",
"do",
"nothing",
"if",
"the",
"DB",
"is",
"already",
"up",
"to",
"date",
"."
] | c61840c23b17a18df704d136909c26ff46bd5c77 | https://github.com/patka/cassandra-migration/blob/c61840c23b17a18df704d136909c26ff46bd5c77/cassandra-migration/src/main/java/org/cognitor/cassandra/migration/MigrationTask.java#L44-L55 | train |
patka/cassandra-migration | cassandra-migration/src/main/java/org/cognitor/cassandra/migration/scanner/FileSystemLocationScanner.java | FileSystemLocationScanner.findResourceNames | public Set<String> findResourceNames(String location, URI locationUri) throws IOException {
String filePath = toFilePath(locationUri);
File folder = new File(filePath);
if (!folder.isDirectory()) {
LOGGER.debug("Skipping path as it is not a directory: " + filePath);
retur... | java | public Set<String> findResourceNames(String location, URI locationUri) throws IOException {
String filePath = toFilePath(locationUri);
File folder = new File(filePath);
if (!folder.isDirectory()) {
LOGGER.debug("Skipping path as it is not a directory: " + filePath);
retur... | [
"public",
"Set",
"<",
"String",
">",
"findResourceNames",
"(",
"String",
"location",
",",
"URI",
"locationUri",
")",
"throws",
"IOException",
"{",
"String",
"filePath",
"=",
"toFilePath",
"(",
"locationUri",
")",
";",
"File",
"folder",
"=",
"new",
"File",
"(... | Scans a path on the filesystem for resources inside the given classpath location.
@param location The system-independent location on the classpath.
@param locationUri The system-specific physical location URI.
@return a sorted set containing all the resources inside the given location
@throws IOException if an erro... | [
"Scans",
"a",
"path",
"on",
"the",
"filesystem",
"for",
"resources",
"inside",
"the",
"given",
"classpath",
"location",
"."
] | c61840c23b17a18df704d136909c26ff46bd5c77 | https://github.com/patka/cassandra-migration/blob/c61840c23b17a18df704d136909c26ff46bd5c77/cassandra-migration/src/main/java/org/cognitor/cassandra/migration/scanner/FileSystemLocationScanner.java#L34-L48 | train |
patka/cassandra-migration | cassandra-migration/src/main/java/org/cognitor/cassandra/migration/scanner/FileSystemLocationScanner.java | FileSystemLocationScanner.findResourceNamesFromFileSystem | private Set<String> findResourceNamesFromFileSystem(String classPathRootOnDisk, String scanRootLocation, File folder) {
LOGGER.debug("Scanning for resources in path: {} ({})", folder.getPath(), scanRootLocation);
File[] files = folder.listFiles();
if (files == null) {
return emptySe... | java | private Set<String> findResourceNamesFromFileSystem(String classPathRootOnDisk, String scanRootLocation, File folder) {
LOGGER.debug("Scanning for resources in path: {} ({})", folder.getPath(), scanRootLocation);
File[] files = folder.listFiles();
if (files == null) {
return emptySe... | [
"private",
"Set",
"<",
"String",
">",
"findResourceNamesFromFileSystem",
"(",
"String",
"classPathRootOnDisk",
",",
"String",
"scanRootLocation",
",",
"File",
"folder",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Scanning for resources in path: {} ({})\"",
",",
"folder",
... | Finds all the resource names contained in this file system folder.
@param classPathRootOnDisk The location of the classpath root on disk, with a trailing slash.
@param scanRootLocation The root location of the scan on the classpath, without leading or trailing slashes.
@param folder The folder to look ... | [
"Finds",
"all",
"the",
"resource",
"names",
"contained",
"in",
"this",
"file",
"system",
"folder",
"."
] | c61840c23b17a18df704d136909c26ff46bd5c77 | https://github.com/patka/cassandra-migration/blob/c61840c23b17a18df704d136909c26ff46bd5c77/cassandra-migration/src/main/java/org/cognitor/cassandra/migration/scanner/FileSystemLocationScanner.java#L58-L79 | train |
patka/cassandra-migration | cassandra-migration/src/main/java/org/cognitor/cassandra/migration/scanner/FileSystemLocationScanner.java | FileSystemLocationScanner.toResourceNameOnClasspath | private String toResourceNameOnClasspath(String classPathRootOnDisk, File file) {
String fileName = file.getAbsolutePath().replace("\\", "/");
return fileName.substring(classPathRootOnDisk.length());
} | java | private String toResourceNameOnClasspath(String classPathRootOnDisk, File file) {
String fileName = file.getAbsolutePath().replace("\\", "/");
return fileName.substring(classPathRootOnDisk.length());
} | [
"private",
"String",
"toResourceNameOnClasspath",
"(",
"String",
"classPathRootOnDisk",
",",
"File",
"file",
")",
"{",
"String",
"fileName",
"=",
"file",
".",
"getAbsolutePath",
"(",
")",
".",
"replace",
"(",
"\"\\\\\"",
",",
"\"/\"",
")",
";",
"return",
"file... | Converts this file into a resource name on the classpath by cutting of the file path
to the classpath root.
@param classPathRootOnDisk The location of the classpath root on disk, with a trailing slash.
@param file The file.
@return The resource name on the classpath. | [
"Converts",
"this",
"file",
"into",
"a",
"resource",
"name",
"on",
"the",
"classpath",
"by",
"cutting",
"of",
"the",
"file",
"path",
"to",
"the",
"classpath",
"root",
"."
] | c61840c23b17a18df704d136909c26ff46bd5c77 | https://github.com/patka/cassandra-migration/blob/c61840c23b17a18df704d136909c26ff46bd5c77/cassandra-migration/src/main/java/org/cognitor/cassandra/migration/scanner/FileSystemLocationScanner.java#L89-L92 | train |
patka/cassandra-migration | cassandra-migration/src/main/java/org/cognitor/cassandra/migration/util/Ensure.java | Ensure.notNull | public static <T> T notNull(T argument, String argumentName) {
if (argument == null) {
throw new IllegalArgumentException("Argument " + argumentName + " must not be null.");
}
return argument;
} | java | public static <T> T notNull(T argument, String argumentName) {
if (argument == null) {
throw new IllegalArgumentException("Argument " + argumentName + " must not be null.");
}
return argument;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"notNull",
"(",
"T",
"argument",
",",
"String",
"argumentName",
")",
"{",
"if",
"(",
"argument",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument \"",
"+",
"argumentName",
"+",
"\"... | Checks if the given argument is null and throws an exception with a
message containing the argument name if that it true.
@param argument the argument to check for null
@param argumentName the name of the argument to check.
This is used in the exception message.
@param <T> the type of the argument
@return... | [
"Checks",
"if",
"the",
"given",
"argument",
"is",
"null",
"and",
"throws",
"an",
"exception",
"with",
"a",
"message",
"containing",
"the",
"argument",
"name",
"if",
"that",
"it",
"true",
"."
] | c61840c23b17a18df704d136909c26ff46bd5c77 | https://github.com/patka/cassandra-migration/blob/c61840c23b17a18df704d136909c26ff46bd5c77/cassandra-migration/src/main/java/org/cognitor/cassandra/migration/util/Ensure.java#L21-L26 | train |
patka/cassandra-migration | cassandra-migration/src/main/java/org/cognitor/cassandra/migration/util/Ensure.java | Ensure.notNullOrEmpty | public static String notNullOrEmpty(String argument, String argumentName) {
if (argument == null || argument.trim().isEmpty()) {
throw new IllegalArgumentException("Argument " + argumentName + " must not be null or empty.");
}
return argument;
} | java | public static String notNullOrEmpty(String argument, String argumentName) {
if (argument == null || argument.trim().isEmpty()) {
throw new IllegalArgumentException("Argument " + argumentName + " must not be null or empty.");
}
return argument;
} | [
"public",
"static",
"String",
"notNullOrEmpty",
"(",
"String",
"argument",
",",
"String",
"argumentName",
")",
"{",
"if",
"(",
"argument",
"==",
"null",
"||",
"argument",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"Illegal... | Checks if the given String is null or contains only whitespaces.
The String is trimmed before the empty check.
@param argument the String to check for null or emptiness
@param argumentName the name of the argument to check.
This is used in the exception message.
@return the String that was given as argument
@throw... | [
"Checks",
"if",
"the",
"given",
"String",
"is",
"null",
"or",
"contains",
"only",
"whitespaces",
".",
"The",
"String",
"is",
"trimmed",
"before",
"the",
"empty",
"check",
"."
] | c61840c23b17a18df704d136909c26ff46bd5c77 | https://github.com/patka/cassandra-migration/blob/c61840c23b17a18df704d136909c26ff46bd5c77/cassandra-migration/src/main/java/org/cognitor/cassandra/migration/util/Ensure.java#L38-L43 | train |
allure-framework/allure1 | allure-commons/src/main/java/ru/yandex/qatools/allure/commons/AllureFileUtils.java | AllureFileUtils.unmarshal | public static TestSuiteResult unmarshal(File testSuite) throws IOException {
try (InputStream stream = new FileInputStream(testSuite)) {
return unmarshal(stream);
}
} | java | public static TestSuiteResult unmarshal(File testSuite) throws IOException {
try (InputStream stream = new FileInputStream(testSuite)) {
return unmarshal(stream);
}
} | [
"public",
"static",
"TestSuiteResult",
"unmarshal",
"(",
"File",
"testSuite",
")",
"throws",
"IOException",
"{",
"try",
"(",
"InputStream",
"stream",
"=",
"new",
"FileInputStream",
"(",
"testSuite",
")",
")",
"{",
"return",
"unmarshal",
"(",
"stream",
")",
";"... | Unmarshal test suite from given file. | [
"Unmarshal",
"test",
"suite",
"from",
"given",
"file",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commons/src/main/java/ru/yandex/qatools/allure/commons/AllureFileUtils.java#L38-L42 | train |
allure-framework/allure1 | allure-commons/src/main/java/ru/yandex/qatools/allure/commons/AllureFileUtils.java | AllureFileUtils.unmarshalSuites | public static List<TestSuiteResult> unmarshalSuites(File... directories) throws IOException {
List<TestSuiteResult> results = new ArrayList<>();
List<File> files = listTestSuiteFiles(directories);
for (File file : files) {
results.add(unmarshal(file));
}
return resu... | java | public static List<TestSuiteResult> unmarshalSuites(File... directories) throws IOException {
List<TestSuiteResult> results = new ArrayList<>();
List<File> files = listTestSuiteFiles(directories);
for (File file : files) {
results.add(unmarshal(file));
}
return resu... | [
"public",
"static",
"List",
"<",
"TestSuiteResult",
">",
"unmarshalSuites",
"(",
"File",
"...",
"directories",
")",
"throws",
"IOException",
"{",
"List",
"<",
"TestSuiteResult",
">",
"results",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"File... | Find and unmarshal all test suite files in given directories.
@throws IOException if any occurs.
@see #unmarshal(File) | [
"Find",
"and",
"unmarshal",
"all",
"test",
"suite",
"files",
"in",
"given",
"directories",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commons/src/main/java/ru/yandex/qatools/allure/commons/AllureFileUtils.java#L68-L77 | train |
allure-framework/allure1 | allure-commons/src/main/java/ru/yandex/qatools/allure/commons/AllureFileUtils.java | AllureFileUtils.listFilesByRegex | public static List<File> listFilesByRegex(String regex, File... directories) {
return listFiles(directories,
new RegexFileFilter(regex),
CanReadFileFilter.CAN_READ);
} | java | public static List<File> listFilesByRegex(String regex, File... directories) {
return listFiles(directories,
new RegexFileFilter(regex),
CanReadFileFilter.CAN_READ);
} | [
"public",
"static",
"List",
"<",
"File",
">",
"listFilesByRegex",
"(",
"String",
"regex",
",",
"File",
"...",
"directories",
")",
"{",
"return",
"listFiles",
"(",
"directories",
",",
"new",
"RegexFileFilter",
"(",
"regex",
")",
",",
"CanReadFileFilter",
".",
... | Returns list of files matches specified regex in specified directories
@param regex to match file names
@param directories to find
@return list of files matches specified regex in specified directories | [
"Returns",
"list",
"of",
"files",
"matches",
"specified",
"regex",
"in",
"specified",
"directories"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commons/src/main/java/ru/yandex/qatools/allure/commons/AllureFileUtils.java#L112-L116 | train |
allure-framework/allure1 | allure-commons/src/main/java/ru/yandex/qatools/allure/commons/AllureFileUtils.java | AllureFileUtils.listFiles | public static List<File> listFiles(File[] directories, IOFileFilter fileFilter, IOFileFilter dirFilter) {
List<File> files = new ArrayList<>();
for (File directory : directories) {
if (!directory.isDirectory()) {
continue;
}
Collection<File> filesInDir... | java | public static List<File> listFiles(File[] directories, IOFileFilter fileFilter, IOFileFilter dirFilter) {
List<File> files = new ArrayList<>();
for (File directory : directories) {
if (!directory.isDirectory()) {
continue;
}
Collection<File> filesInDir... | [
"public",
"static",
"List",
"<",
"File",
">",
"listFiles",
"(",
"File",
"[",
"]",
"directories",
",",
"IOFileFilter",
"fileFilter",
",",
"IOFileFilter",
"dirFilter",
")",
"{",
"List",
"<",
"File",
">",
"files",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";... | Returns list of files matches filters in specified directories
@param directories which will using to find files
@param fileFilter file filter
@param dirFilter directory filter
@return list of files matches filters in specified directories | [
"Returns",
"list",
"of",
"files",
"matches",
"filters",
"in",
"specified",
"directories"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commons/src/main/java/ru/yandex/qatools/allure/commons/AllureFileUtils.java#L126-L138 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AnnotationManager.java | AnnotationManager.populateAnnotations | private void populateAnnotations(Collection<Annotation> annotations) {
for (Annotation each : annotations) {
this.annotations.put(each.annotationType(), each);
}
} | java | private void populateAnnotations(Collection<Annotation> annotations) {
for (Annotation each : annotations) {
this.annotations.put(each.annotationType(), each);
}
} | [
"private",
"void",
"populateAnnotations",
"(",
"Collection",
"<",
"Annotation",
">",
"annotations",
")",
"{",
"for",
"(",
"Annotation",
"each",
":",
"annotations",
")",
"{",
"this",
".",
"annotations",
".",
"put",
"(",
"each",
".",
"annotationType",
"(",
")"... | Used to populate Map with given annotations
@param annotations initial value for annotations | [
"Used",
"to",
"populate",
"Map",
"with",
"given",
"annotations"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AnnotationManager.java#L76-L80 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AnnotationManager.java | AnnotationManager.setDefaults | public void setDefaults(Annotation[] defaultAnnotations) {
if (defaultAnnotations == null) {
return;
}
for (Annotation each : defaultAnnotations) {
Class<? extends Annotation> key = each.annotationType();
if (Title.class.equals(key) || Description.class.equals... | java | public void setDefaults(Annotation[] defaultAnnotations) {
if (defaultAnnotations == null) {
return;
}
for (Annotation each : defaultAnnotations) {
Class<? extends Annotation> key = each.annotationType();
if (Title.class.equals(key) || Description.class.equals... | [
"public",
"void",
"setDefaults",
"(",
"Annotation",
"[",
"]",
"defaultAnnotations",
")",
"{",
"if",
"(",
"defaultAnnotations",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
"Annotation",
"each",
":",
"defaultAnnotations",
")",
"{",
"Class",
"<",
... | Set default values for annotations.
Initial annotation take precedence over the default annotation when both annotation types are present
@param defaultAnnotations default value for annotations | [
"Set",
"default",
"values",
"for",
"annotations",
".",
"Initial",
"annotation",
"take",
"precedence",
"over",
"the",
"default",
"annotation",
"when",
"both",
"annotation",
"types",
"are",
"present"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AnnotationManager.java#L88-L101 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AnnotationManager.java | AnnotationManager.getHostname | private static String getHostname() {
if (Hostname == null) {
try {
Hostname = InetAddress.getLocalHost().getHostName();
} catch (Exception e) {
Hostname = "default";
LOGGER.warn("Can not get current hostname", e);
}
}
... | java | private static String getHostname() {
if (Hostname == null) {
try {
Hostname = InetAddress.getLocalHost().getHostName();
} catch (Exception e) {
Hostname = "default";
LOGGER.warn("Can not get current hostname", e);
}
}
... | [
"private",
"static",
"String",
"getHostname",
"(",
")",
"{",
"if",
"(",
"Hostname",
"==",
"null",
")",
"{",
"try",
"{",
"Hostname",
"=",
"InetAddress",
".",
"getLocalHost",
"(",
")",
".",
"getHostName",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e... | Save current hostname and reuse it.
@return hostname as String | [
"Save",
"current",
"hostname",
"and",
"reuse",
"it",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AnnotationManager.java#L108-L118 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AnnotationManager.java | AnnotationManager.withExecutorInfo | public static TestCaseStartedEvent withExecutorInfo(TestCaseStartedEvent event) {
event.getLabels().add(createHostLabel(getHostname()));
event.getLabels().add(createThreadLabel(format("%s.%s(%s)",
ManagementFactory.getRuntimeMXBean().getName(),
Thread.curr... | java | public static TestCaseStartedEvent withExecutorInfo(TestCaseStartedEvent event) {
event.getLabels().add(createHostLabel(getHostname()));
event.getLabels().add(createThreadLabel(format("%s.%s(%s)",
ManagementFactory.getRuntimeMXBean().getName(),
Thread.curr... | [
"public",
"static",
"TestCaseStartedEvent",
"withExecutorInfo",
"(",
"TestCaseStartedEvent",
"event",
")",
"{",
"event",
".",
"getLabels",
"(",
")",
".",
"add",
"(",
"createHostLabel",
"(",
"getHostname",
"(",
")",
")",
")",
";",
"event",
".",
"getLabels",
"("... | Add information about host and thread to specified test case started event
@param event given event to update
@return updated event | [
"Add",
"information",
"about",
"host",
"and",
"thread",
"to",
"specified",
"test",
"case",
"started",
"event"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AnnotationManager.java#L193-L201 | train |
allure-framework/allure1 | allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportOpen.java | ReportOpen.openBrowser | private void openBrowser(URI url) throws IOException {
if (Desktop.isDesktopSupported()) {
Desktop.getDesktop().browse(url);
} else {
LOGGER.error("Can not open browser because this capability is not supported on " +
"your platform. You can use the link below ... | java | private void openBrowser(URI url) throws IOException {
if (Desktop.isDesktopSupported()) {
Desktop.getDesktop().browse(url);
} else {
LOGGER.error("Can not open browser because this capability is not supported on " +
"your platform. You can use the link below ... | [
"private",
"void",
"openBrowser",
"(",
"URI",
"url",
")",
"throws",
"IOException",
"{",
"if",
"(",
"Desktop",
".",
"isDesktopSupported",
"(",
")",
")",
"{",
"Desktop",
".",
"getDesktop",
"(",
")",
".",
"browse",
"(",
"url",
")",
";",
"}",
"else",
"{",
... | Open the given url in default system browser. | [
"Open",
"the",
"given",
"url",
"in",
"default",
"system",
"browser",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportOpen.java#L53-L60 | train |
allure-framework/allure1 | allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportOpen.java | ReportOpen.setUpServer | private Server setUpServer() {
Server server = new Server(port);
ResourceHandler handler = new ResourceHandler();
handler.setDirectoriesListed(true);
handler.setWelcomeFiles(new String[]{"index.html"});
handler.setResourceBase(getReportDirectoryPath().toAbsolutePath().toString())... | java | private Server setUpServer() {
Server server = new Server(port);
ResourceHandler handler = new ResourceHandler();
handler.setDirectoriesListed(true);
handler.setWelcomeFiles(new String[]{"index.html"});
handler.setResourceBase(getReportDirectoryPath().toAbsolutePath().toString())... | [
"private",
"Server",
"setUpServer",
"(",
")",
"{",
"Server",
"server",
"=",
"new",
"Server",
"(",
"port",
")",
";",
"ResourceHandler",
"handler",
"=",
"new",
"ResourceHandler",
"(",
")",
";",
"handler",
".",
"setDirectoriesListed",
"(",
"true",
")",
";",
"... | Set up server for report directory. | [
"Set",
"up",
"server",
"for",
"report",
"directory",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportOpen.java#L65-L76 | train |
allure-framework/allure1 | allure-report-plugin-api/src/main/java/ru/yandex/qatools/allure/data/plugins/AbstractPlugin.java | AbstractPlugin.checkModifiers | private static boolean checkModifiers(Class<? extends AbstractPlugin> pluginClass) {
int modifiers = pluginClass.getModifiers();
return !Modifier.isAbstract(modifiers) &&
!Modifier.isInterface(modifiers) &&
!Modifier.isPrivate(modifiers);
} | java | private static boolean checkModifiers(Class<? extends AbstractPlugin> pluginClass) {
int modifiers = pluginClass.getModifiers();
return !Modifier.isAbstract(modifiers) &&
!Modifier.isInterface(modifiers) &&
!Modifier.isPrivate(modifiers);
} | [
"private",
"static",
"boolean",
"checkModifiers",
"(",
"Class",
"<",
"?",
"extends",
"AbstractPlugin",
">",
"pluginClass",
")",
"{",
"int",
"modifiers",
"=",
"pluginClass",
".",
"getModifiers",
"(",
")",
";",
"return",
"!",
"Modifier",
".",
"isAbstract",
"(",
... | Check given class modifiers. Plugin with resources plugin should not be private or abstract
or interface. | [
"Check",
"given",
"class",
"modifiers",
".",
"Plugin",
"with",
"resources",
"plugin",
"should",
"not",
"be",
"private",
"or",
"abstract",
"or",
"interface",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-report-plugin-api/src/main/java/ru/yandex/qatools/allure/data/plugins/AbstractPlugin.java#L110-L115 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/experimental/ListenersNotifier.java | ListenersNotifier.fire | @Override
public void fire(StepStartedEvent event) {
for (LifecycleListener listener : listeners) {
try {
listener.fire(event);
} catch (Exception e) {
logError(listener, e);
}
}
} | java | @Override
public void fire(StepStartedEvent event) {
for (LifecycleListener listener : listeners) {
try {
listener.fire(event);
} catch (Exception e) {
logError(listener, e);
}
}
} | [
"@",
"Override",
"public",
"void",
"fire",
"(",
"StepStartedEvent",
"event",
")",
"{",
"for",
"(",
"LifecycleListener",
"listener",
":",
"listeners",
")",
"{",
"try",
"{",
"listener",
".",
"fire",
"(",
"event",
")",
";",
"}",
"catch",
"(",
"Exception",
"... | Invoke to tell listeners that an step started event processed | [
"Invoke",
"to",
"tell",
"listeners",
"that",
"an",
"step",
"started",
"event",
"processed"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/experimental/ListenersNotifier.java#L106-L115 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/experimental/ListenersNotifier.java | ListenersNotifier.logError | private void logError(LifecycleListener listener, Exception e) {
LOGGER.error("Error for listener " + listener.getClass(), e);
} | java | private void logError(LifecycleListener listener, Exception e) {
LOGGER.error("Error for listener " + listener.getClass(), e);
} | [
"private",
"void",
"logError",
"(",
"LifecycleListener",
"listener",
",",
"Exception",
"e",
")",
"{",
"LOGGER",
".",
"error",
"(",
"\"Error for listener \"",
"+",
"listener",
".",
"getClass",
"(",
")",
",",
"e",
")",
";",
"}"
] | This method log given exception in specified listener | [
"This",
"method",
"log",
"given",
"exception",
"in",
"specified",
"listener"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/experimental/ListenersNotifier.java#L246-L248 | train |
allure-framework/allure1 | allure-java-aspects/src/main/java/ru/yandex/qatools/allure/aspects/AllureAspectUtils.java | AllureAspectUtils.cutEnd | public static String cutEnd(String data, int maxLength) {
if (data.length() > maxLength) {
return data.substring(0, maxLength) + "...";
} else {
return data;
}
} | java | public static String cutEnd(String data, int maxLength) {
if (data.length() > maxLength) {
return data.substring(0, maxLength) + "...";
} else {
return data;
}
} | [
"public",
"static",
"String",
"cutEnd",
"(",
"String",
"data",
",",
"int",
"maxLength",
")",
"{",
"if",
"(",
"data",
".",
"length",
"(",
")",
">",
"maxLength",
")",
"{",
"return",
"data",
".",
"substring",
"(",
"0",
",",
"maxLength",
")",
"+",
"\"...... | Cut all characters from maxLength and replace it with "..." | [
"Cut",
"all",
"characters",
"from",
"maxLength",
"and",
"replace",
"it",
"with",
"..."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-aspects/src/main/java/ru/yandex/qatools/allure/aspects/AllureAspectUtils.java#L90-L96 | train |
allure-framework/allure1 | allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/ServiceLoaderUtils.java | ServiceLoaderUtils.load | public static <T> List<T> load(ClassLoader classLoader, Class<T> serviceType) {
List<T> foundServices = new ArrayList<>();
Iterator<T> iterator = ServiceLoader.load(serviceType, classLoader).iterator();
while (checkHasNextSafely(iterator)) {
try {
T item = iterator.n... | java | public static <T> List<T> load(ClassLoader classLoader, Class<T> serviceType) {
List<T> foundServices = new ArrayList<>();
Iterator<T> iterator = ServiceLoader.load(serviceType, classLoader).iterator();
while (checkHasNextSafely(iterator)) {
try {
T item = iterator.n... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"load",
"(",
"ClassLoader",
"classLoader",
",",
"Class",
"<",
"T",
">",
"serviceType",
")",
"{",
"List",
"<",
"T",
">",
"foundServices",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Iterator... | Invoke to find all services for given service type using specified class loader
@param classLoader specified class loader
@param serviceType given service type
@return List of found services | [
"Invoke",
"to",
"find",
"all",
"services",
"for",
"given",
"service",
"type",
"using",
"specified",
"class",
"loader"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/ServiceLoaderUtils.java#L35-L50 | train |
allure-framework/allure1 | allure-bundle/src/main/java/ru/yandex/qatools/allure/AllureMain.java | AllureMain.unpackFace | private static void unpackFace(File outputDirectory) throws IOException {
ClassLoader loader = AllureMain.class.getClassLoader();
for (ClassPath.ResourceInfo info : ClassPath.from(loader).getResources()) {
Matcher matcher = REPORT_RESOURCE_PATTERN.matcher(info.getResourceName());
... | java | private static void unpackFace(File outputDirectory) throws IOException {
ClassLoader loader = AllureMain.class.getClassLoader();
for (ClassPath.ResourceInfo info : ClassPath.from(loader).getResources()) {
Matcher matcher = REPORT_RESOURCE_PATTERN.matcher(info.getResourceName());
... | [
"private",
"static",
"void",
"unpackFace",
"(",
"File",
"outputDirectory",
")",
"throws",
"IOException",
"{",
"ClassLoader",
"loader",
"=",
"AllureMain",
".",
"class",
".",
"getClassLoader",
"(",
")",
";",
"for",
"(",
"ClassPath",
".",
"ResourceInfo",
"info",
... | Unpack report face to given directory.
@param outputDirectory the output directory to unpack face.
@throws IOException if any occurs. | [
"Unpack",
"report",
"face",
"to",
"given",
"directory",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-bundle/src/main/java/ru/yandex/qatools/allure/AllureMain.java#L59-L74 | train |
allure-framework/allure1 | allure-commandline/src/main/java/ru/yandex/qatools/allure/command/AbstractCommand.java | AbstractCommand.createTempDirectory | protected Path createTempDirectory(String prefix) {
try {
return Files.createTempDirectory(tempDirectory, prefix);
} catch (IOException e) {
throw new AllureCommandException(e);
}
} | java | protected Path createTempDirectory(String prefix) {
try {
return Files.createTempDirectory(tempDirectory, prefix);
} catch (IOException e) {
throw new AllureCommandException(e);
}
} | [
"protected",
"Path",
"createTempDirectory",
"(",
"String",
"prefix",
")",
"{",
"try",
"{",
"return",
"Files",
".",
"createTempDirectory",
"(",
"tempDirectory",
",",
"prefix",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"AllureC... | Creates an temporary directory. The created directory will be deleted when
command will ended. | [
"Creates",
"an",
"temporary",
"directory",
".",
"The",
"created",
"directory",
"will",
"be",
"deleted",
"when",
"command",
"will",
"ended",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/AbstractCommand.java#L65-L71 | train |
allure-framework/allure1 | allure-commandline/src/main/java/ru/yandex/qatools/allure/command/AbstractCommand.java | AbstractCommand.getLogLevel | private Level getLogLevel() {
return isQuiet() ? Level.OFF : isVerbose() ? Level.DEBUG : Level.INFO;
} | java | private Level getLogLevel() {
return isQuiet() ? Level.OFF : isVerbose() ? Level.DEBUG : Level.INFO;
} | [
"private",
"Level",
"getLogLevel",
"(",
")",
"{",
"return",
"isQuiet",
"(",
")",
"?",
"Level",
".",
"OFF",
":",
"isVerbose",
"(",
")",
"?",
"Level",
".",
"DEBUG",
":",
"Level",
".",
"INFO",
";",
"}"
] | Get log level depends on provided client parameters such as verbose and quiet. | [
"Get",
"log",
"level",
"depends",
"on",
"provided",
"client",
"parameters",
"such",
"as",
"verbose",
"and",
"quiet",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/AbstractCommand.java#L138-L140 | train |
allure-framework/allure1 | allure-model/src/main/java/ru/yandex/qatools/allure/config/AllureNamingUtils.java | AllureNamingUtils.isBadXmlCharacter | public static boolean isBadXmlCharacter(char c) {
boolean cDataCharacter = c < '\u0020' && c != '\t' && c != '\r' && c != '\n';
cDataCharacter |= (c >= '\uD800' && c < '\uE000');
cDataCharacter |= (c == '\uFFFE' || c == '\uFFFF');
return cDataCharacter;
} | java | public static boolean isBadXmlCharacter(char c) {
boolean cDataCharacter = c < '\u0020' && c != '\t' && c != '\r' && c != '\n';
cDataCharacter |= (c >= '\uD800' && c < '\uE000');
cDataCharacter |= (c == '\uFFFE' || c == '\uFFFF');
return cDataCharacter;
} | [
"public",
"static",
"boolean",
"isBadXmlCharacter",
"(",
"char",
"c",
")",
"{",
"boolean",
"cDataCharacter",
"=",
"c",
"<",
"'",
"'",
"&&",
"c",
"!=",
"'",
"'",
"&&",
"c",
"!=",
"'",
"'",
"&&",
"c",
"!=",
"'",
"'",
";",
"cDataCharacter",
"|=",
"(",... | Detect bad xml 1.0 characters
@param c to detect
@return true if specified character valid, false otherwise | [
"Detect",
"bad",
"xml",
"1",
".",
"0",
"characters"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-model/src/main/java/ru/yandex/qatools/allure/config/AllureNamingUtils.java#L49-L54 | train |
allure-framework/allure1 | allure-model/src/main/java/ru/yandex/qatools/allure/config/AllureNamingUtils.java | AllureNamingUtils.replaceBadXmlCharactersBySpace | public static void replaceBadXmlCharactersBySpace(char[] cbuf, int off, int len) {
for (int i = off; i < off + len; i++) {
if (isBadXmlCharacter(cbuf[i])) {
cbuf[i] = '\u0020';
}
}
} | java | public static void replaceBadXmlCharactersBySpace(char[] cbuf, int off, int len) {
for (int i = off; i < off + len; i++) {
if (isBadXmlCharacter(cbuf[i])) {
cbuf[i] = '\u0020';
}
}
} | [
"public",
"static",
"void",
"replaceBadXmlCharactersBySpace",
"(",
"char",
"[",
"]",
"cbuf",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"off",
";",
"i",
"<",
"off",
"+",
"len",
";",
"i",
"++",
")",
"{",
"if",
"("... | Replace bad xml charactes in given array by space
@param cbuf buffer to replace in
@param off Offset from which to start reading characters
@param len Number of characters to be replaced | [
"Replace",
"bad",
"xml",
"charactes",
"in",
"given",
"array",
"by",
"space"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-model/src/main/java/ru/yandex/qatools/allure/config/AllureNamingUtils.java#L63-L69 | train |
allure-framework/allure1 | allure-commons/src/main/java/ru/yandex/qatools/allure/commons/BadXmlCharacterFilterReader.java | BadXmlCharacterFilterReader.read | @Override
public int read(char[] cbuf, int off, int len) throws IOException {
int numChars = super.read(cbuf, off, len);
replaceBadXmlCharactersBySpace(cbuf, off, len);
return numChars;
} | java | @Override
public int read(char[] cbuf, int off, int len) throws IOException {
int numChars = super.read(cbuf, off, len);
replaceBadXmlCharactersBySpace(cbuf, off, len);
return numChars;
} | [
"@",
"Override",
"public",
"int",
"read",
"(",
"char",
"[",
"]",
"cbuf",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"int",
"numChars",
"=",
"super",
".",
"read",
"(",
"cbuf",
",",
"off",
",",
"len",
")",
";",
"replaceB... | Reads characters into a portion of an array, then replace invalid XML characters
@throws IOException If an I/O error occurs
@see ru.yandex.qatools.allure.config.AllureNamingUtils#isBadXmlCharacter(char) by space | [
"Reads",
"characters",
"into",
"a",
"portion",
"of",
"an",
"array",
"then",
"replace",
"invalid",
"XML",
"characters"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commons/src/main/java/ru/yandex/qatools/allure/commons/BadXmlCharacterFilterReader.java#L31-L36 | train |
allure-framework/allure1 | allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportClean.java | ReportClean.runUnsafe | @Override
protected void runUnsafe() throws Exception {
Path reportDirectory = getReportDirectoryPath();
Files.walkFileTree(reportDirectory, new DeleteVisitor());
LOGGER.info("Report directory <{}> was successfully cleaned.", reportDirectory);
} | java | @Override
protected void runUnsafe() throws Exception {
Path reportDirectory = getReportDirectoryPath();
Files.walkFileTree(reportDirectory, new DeleteVisitor());
LOGGER.info("Report directory <{}> was successfully cleaned.", reportDirectory);
} | [
"@",
"Override",
"protected",
"void",
"runUnsafe",
"(",
")",
"throws",
"Exception",
"{",
"Path",
"reportDirectory",
"=",
"getReportDirectoryPath",
"(",
")",
";",
"Files",
".",
"walkFileTree",
"(",
"reportDirectory",
",",
"new",
"DeleteVisitor",
"(",
")",
")",
... | Remove the report directory. | [
"Remove",
"the",
"report",
"directory",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportClean.java#L22-L27 | train |
allure-framework/allure1 | allure-report-data/src/main/java/ru/yandex/qatools/allure/data/DummyReportGenerator.java | DummyReportGenerator.main | public static void main(String[] args) {
if (args.length < 2) { // NOSONAR
LOGGER.error("There must be at least two arguments");
return;
}
int lastIndex = args.length - 1;
AllureReportGenerator reportGenerator = new AllureReportGenerator(
getFiles(... | java | public static void main(String[] args) {
if (args.length < 2) { // NOSONAR
LOGGER.error("There must be at least two arguments");
return;
}
int lastIndex = args.length - 1;
AllureReportGenerator reportGenerator = new AllureReportGenerator(
getFiles(... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
".",
"length",
"<",
"2",
")",
"{",
"// NOSONAR",
"LOGGER",
".",
"error",
"(",
"\"There must be at least two arguments\"",
")",
";",
"return",
";",
"}",
"int... | Generate Allure report data from directories with allure report results.
@param args a list of directory paths. First (args.length - 1) arguments -
results directories, last argument - the folder to generated data | [
"Generate",
"Allure",
"report",
"data",
"from",
"directories",
"with",
"allure",
"report",
"results",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-report-data/src/main/java/ru/yandex/qatools/allure/data/DummyReportGenerator.java#L28-L38 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java | AllureResultsUtils.setPropertySafely | public static void setPropertySafely(Marshaller marshaller, String name, Object value) {
try {
marshaller.setProperty(name, value);
} catch (PropertyException e) {
LOGGER.warn(String.format("Can't set \"%s\" property to given marshaller", name), e);
}
} | java | public static void setPropertySafely(Marshaller marshaller, String name, Object value) {
try {
marshaller.setProperty(name, value);
} catch (PropertyException e) {
LOGGER.warn(String.format("Can't set \"%s\" property to given marshaller", name), e);
}
} | [
"public",
"static",
"void",
"setPropertySafely",
"(",
"Marshaller",
"marshaller",
",",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"marshaller",
".",
"setProperty",
"(",
"name",
",",
"value",
")",
";",
"}",
"catch",
"(",
"PropertyExceptio... | Try to set specified property to given marshaller
@param marshaller specified marshaller
@param name name of property to set
@param value value of property to set | [
"Try",
"to",
"set",
"specified",
"property",
"to",
"given",
"marshaller"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java#L194-L200 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java | AllureResultsUtils.writeAttachmentWithErrorMessage | public static Attachment writeAttachmentWithErrorMessage(Throwable throwable, String title) {
String message = throwable.getMessage();
try {
return writeAttachment(message.getBytes(CONFIG.getAttachmentsEncoding()), title);
} catch (Exception e) {
e.addSuppressed(throwable... | java | public static Attachment writeAttachmentWithErrorMessage(Throwable throwable, String title) {
String message = throwable.getMessage();
try {
return writeAttachment(message.getBytes(CONFIG.getAttachmentsEncoding()), title);
} catch (Exception e) {
e.addSuppressed(throwable... | [
"public",
"static",
"Attachment",
"writeAttachmentWithErrorMessage",
"(",
"Throwable",
"throwable",
",",
"String",
"title",
")",
"{",
"String",
"message",
"=",
"throwable",
".",
"getMessage",
"(",
")",
";",
"try",
"{",
"return",
"writeAttachment",
"(",
"message",
... | Write throwable as attachment.
@param throwable to write
@param title title of attachment
@return Created {@link ru.yandex.qatools.allure.model.Attachment} | [
"Write",
"throwable",
"as",
"attachment",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java#L243-L252 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java | AllureResultsUtils.getExtensionByMimeType | public static String getExtensionByMimeType(String type) {
MimeTypes types = getDefaultMimeTypes();
try {
return types.forName(type).getExtension();
} catch (Exception e) {
LOGGER.warn("Can't detect extension for MIME-type " + type, e);
return "";
}
... | java | public static String getExtensionByMimeType(String type) {
MimeTypes types = getDefaultMimeTypes();
try {
return types.forName(type).getExtension();
} catch (Exception e) {
LOGGER.warn("Can't detect extension for MIME-type " + type, e);
return "";
}
... | [
"public",
"static",
"String",
"getExtensionByMimeType",
"(",
"String",
"type",
")",
"{",
"MimeTypes",
"types",
"=",
"getDefaultMimeTypes",
"(",
")",
";",
"try",
"{",
"return",
"types",
".",
"forName",
"(",
"type",
")",
".",
"getExtension",
"(",
")",
";",
"... | Generate attachment extension from mime type
@param type valid mime-type
@return extension if it's known for specified mime-type, or empty string
otherwise | [
"Generate",
"attachment",
"extension",
"from",
"mime",
"type"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java#L311-L319 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/events/AddParameterEvent.java | AddParameterEvent.process | @Override
public void process(TestCaseResult context) {
context.getParameters().add(new Parameter()
.withName(getName())
.withValue(getValue())
.withKind(ParameterKind.valueOf(getKind()))
);
} | java | @Override
public void process(TestCaseResult context) {
context.getParameters().add(new Parameter()
.withName(getName())
.withValue(getValue())
.withKind(ParameterKind.valueOf(getKind()))
);
} | [
"@",
"Override",
"public",
"void",
"process",
"(",
"TestCaseResult",
"context",
")",
"{",
"context",
".",
"getParameters",
"(",
")",
".",
"add",
"(",
"new",
"Parameter",
"(",
")",
".",
"withName",
"(",
"getName",
"(",
")",
")",
".",
"withValue",
"(",
"... | Add parameter to testCase
@param context which can be changed | [
"Add",
"parameter",
"to",
"testCase"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/events/AddParameterEvent.java#L46-L53 | train |
allure-framework/allure1 | allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java | ReportGenerate.validateResultsDirectories | protected void validateResultsDirectories() {
for (String result : results) {
if (Files.notExists(Paths.get(result))) {
throw new AllureCommandException(String.format("Report directory <%s> not found.", result));
}
}
} | java | protected void validateResultsDirectories() {
for (String result : results) {
if (Files.notExists(Paths.get(result))) {
throw new AllureCommandException(String.format("Report directory <%s> not found.", result));
}
}
} | [
"protected",
"void",
"validateResultsDirectories",
"(",
")",
"{",
"for",
"(",
"String",
"result",
":",
"results",
")",
"{",
"if",
"(",
"Files",
".",
"notExists",
"(",
"Paths",
".",
"get",
"(",
"result",
")",
")",
")",
"{",
"throw",
"new",
"AllureCommandE... | Throws an exception if at least one results directory is missing. | [
"Throws",
"an",
"exception",
"if",
"at",
"least",
"one",
"results",
"directory",
"is",
"missing",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java#L56-L62 | train |
allure-framework/allure1 | allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java | ReportGenerate.getClasspath | protected String getClasspath() throws IOException {
List<String> classpath = new ArrayList<>();
classpath.add(getBundleJarPath());
classpath.addAll(getPluginsPath());
return StringUtils.toString(classpath.toArray(new String[classpath.size()]), " ");
} | java | protected String getClasspath() throws IOException {
List<String> classpath = new ArrayList<>();
classpath.add(getBundleJarPath());
classpath.addAll(getPluginsPath());
return StringUtils.toString(classpath.toArray(new String[classpath.size()]), " ");
} | [
"protected",
"String",
"getClasspath",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"classpath",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"classpath",
".",
"add",
"(",
"getBundleJarPath",
"(",
")",
")",
";",
"classpath",
".",
... | Returns the classpath for executable jar. | [
"Returns",
"the",
"classpath",
"for",
"executable",
"jar",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java#L80-L85 | train |
allure-framework/allure1 | allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java | ReportGenerate.getExecutableJar | protected String getExecutableJar() throws IOException {
Manifest manifest = new Manifest();
manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");
manifest.getMainAttributes().put(Attributes.Name.MAIN_CLASS, MAIN);
manifest.getMainAttributes().put(Attributes.Name.CLA... | java | protected String getExecutableJar() throws IOException {
Manifest manifest = new Manifest();
manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");
manifest.getMainAttributes().put(Attributes.Name.MAIN_CLASS, MAIN);
manifest.getMainAttributes().put(Attributes.Name.CLA... | [
"protected",
"String",
"getExecutableJar",
"(",
")",
"throws",
"IOException",
"{",
"Manifest",
"manifest",
"=",
"new",
"Manifest",
"(",
")",
";",
"manifest",
".",
"getMainAttributes",
"(",
")",
".",
"put",
"(",
"Attributes",
".",
"Name",
".",
"MANIFEST_VERSION... | Create an executable jar to generate the report. Created jar contains only
allure configuration file. | [
"Create",
"an",
"executable",
"jar",
"to",
"generate",
"the",
"report",
".",
"Created",
"jar",
"contains",
"only",
"allure",
"configuration",
"file",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java#L91-L109 | train |
allure-framework/allure1 | allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java | ReportGenerate.getBundleJarPath | protected String getBundleJarPath() throws MalformedURLException {
Path path = PROPERTIES.getAllureHome().resolve("app/allure-bundle.jar").toAbsolutePath();
if (Files.notExists(path)) {
throw new AllureCommandException(String.format("Bundle not found by path <%s>", path));
}
... | java | protected String getBundleJarPath() throws MalformedURLException {
Path path = PROPERTIES.getAllureHome().resolve("app/allure-bundle.jar").toAbsolutePath();
if (Files.notExists(path)) {
throw new AllureCommandException(String.format("Bundle not found by path <%s>", path));
}
... | [
"protected",
"String",
"getBundleJarPath",
"(",
")",
"throws",
"MalformedURLException",
"{",
"Path",
"path",
"=",
"PROPERTIES",
".",
"getAllureHome",
"(",
")",
".",
"resolve",
"(",
"\"app/allure-bundle.jar\"",
")",
".",
"toAbsolutePath",
"(",
")",
";",
"if",
"("... | Returns the bundle jar classpath element. | [
"Returns",
"the",
"bundle",
"jar",
"classpath",
"element",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java#L114-L120 | train |
allure-framework/allure1 | allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java | ReportGenerate.getPluginsPath | protected List<String> getPluginsPath() throws IOException {
List<String> result = new ArrayList<>();
Path pluginsDirectory = PROPERTIES.getAllureHome().resolve("plugins").toAbsolutePath();
if (Files.notExists(pluginsDirectory)) {
return Collections.emptyList();
}
tr... | java | protected List<String> getPluginsPath() throws IOException {
List<String> result = new ArrayList<>();
Path pluginsDirectory = PROPERTIES.getAllureHome().resolve("plugins").toAbsolutePath();
if (Files.notExists(pluginsDirectory)) {
return Collections.emptyList();
}
tr... | [
"protected",
"List",
"<",
"String",
">",
"getPluginsPath",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Path",
"pluginsDirectory",
"=",
"PROPERTIES",
".",
"getAllureHome",
"(",
... | Returns the plugins classpath elements. | [
"Returns",
"the",
"plugins",
"classpath",
"elements",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java#L125-L138 | train |
allure-framework/allure1 | allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java | ReportGenerate.getJavaExecutablePath | protected String getJavaExecutablePath() {
String executableName = isWindows() ? "bin/java.exe" : "bin/java";
return PROPERTIES.getJavaHome().resolve(executableName).toAbsolutePath().toString();
} | java | protected String getJavaExecutablePath() {
String executableName = isWindows() ? "bin/java.exe" : "bin/java";
return PROPERTIES.getJavaHome().resolve(executableName).toAbsolutePath().toString();
} | [
"protected",
"String",
"getJavaExecutablePath",
"(",
")",
"{",
"String",
"executableName",
"=",
"isWindows",
"(",
")",
"?",
"\"bin/java.exe\"",
":",
"\"bin/java\"",
";",
"return",
"PROPERTIES",
".",
"getJavaHome",
"(",
")",
".",
"resolve",
"(",
"executableName",
... | Returns the path to java executable. | [
"Returns",
"the",
"path",
"to",
"java",
"executable",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java#L158-L161 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureShutdownHook.java | AllureShutdownHook.run | @Override
public void run() {
for (Map.Entry<String, TestSuiteResult> entry : testSuites) {
for (TestCaseResult testCase : entry.getValue().getTestCases()) {
markTestcaseAsInterruptedIfNotFinishedYet(testCase);
}
entry.getValue().getTestCases().add(createF... | java | @Override
public void run() {
for (Map.Entry<String, TestSuiteResult> entry : testSuites) {
for (TestCaseResult testCase : entry.getValue().getTestCases()) {
markTestcaseAsInterruptedIfNotFinishedYet(testCase);
}
entry.getValue().getTestCases().add(createF... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"TestSuiteResult",
">",
"entry",
":",
"testSuites",
")",
"{",
"for",
"(",
"TestCaseResult",
"testCase",
":",
"entry",
".",
"getValue",
"(",
")... | Mark unfinished test cases as interrupted for each unfinished test suite, then write
test suite result
@see #createFakeTestcaseWithWarning(ru.yandex.qatools.allure.model.TestSuiteResult)
@see #markTestcaseAsInterruptedIfNotFinishedYet(ru.yandex.qatools.allure.model.TestCaseResult) | [
"Mark",
"unfinished",
"test",
"cases",
"as",
"interrupted",
"for",
"each",
"unfinished",
"test",
"suite",
"then",
"write",
"test",
"suite",
"result"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureShutdownHook.java#L36-L46 | train |
allure-framework/allure1 | allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/AllureReportUtils.java | AllureReportUtils.checkDirectory | public static void checkDirectory(File directory) {
if (!(directory.exists() || directory.mkdirs())) {
throw new ReportGenerationException(
String.format("Can't create data directory <%s>", directory.getAbsolutePath())
);
}
} | java | public static void checkDirectory(File directory) {
if (!(directory.exists() || directory.mkdirs())) {
throw new ReportGenerationException(
String.format("Can't create data directory <%s>", directory.getAbsolutePath())
);
}
} | [
"public",
"static",
"void",
"checkDirectory",
"(",
"File",
"directory",
")",
"{",
"if",
"(",
"!",
"(",
"directory",
".",
"exists",
"(",
")",
"||",
"directory",
".",
"mkdirs",
"(",
")",
")",
")",
"{",
"throw",
"new",
"ReportGenerationException",
"(",
"Str... | If directory doesn't exists try to create it.
@param directory given directory to check
@throws ReportGenerationException if can't create specified directory | [
"If",
"directory",
"doesn",
"t",
"exists",
"try",
"to",
"create",
"it",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/AllureReportUtils.java#L50-L56 | train |
allure-framework/allure1 | allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/AllureReportUtils.java | AllureReportUtils.serialize | public static int serialize(final File directory, String name, Object obj) {
try (FileOutputStream stream = new FileOutputStream(new File(directory, name))) {
return serialize(stream, obj);
} catch (IOException e) {
throw new ReportGenerationException(e);
}
} | java | public static int serialize(final File directory, String name, Object obj) {
try (FileOutputStream stream = new FileOutputStream(new File(directory, name))) {
return serialize(stream, obj);
} catch (IOException e) {
throw new ReportGenerationException(e);
}
} | [
"public",
"static",
"int",
"serialize",
"(",
"final",
"File",
"directory",
",",
"String",
"name",
",",
"Object",
"obj",
")",
"{",
"try",
"(",
"FileOutputStream",
"stream",
"=",
"new",
"FileOutputStream",
"(",
"new",
"File",
"(",
"directory",
",",
"name",
"... | Serialize specified object to directory with specified name.
@param directory write to
@param name serialize object with specified name
@param obj object to serialize
@return number of bytes written to directory | [
"Serialize",
"specified",
"object",
"to",
"directory",
"with",
"specified",
"name",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/AllureReportUtils.java#L66-L72 | train |
allure-framework/allure1 | allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/AllureReportUtils.java | AllureReportUtils.serialize | public static int serialize(OutputStream stream, Object obj) {
ObjectMapper mapper = createMapperWithJaxbAnnotationInspector();
try (DataOutputStream data = new DataOutputStream(stream);
OutputStreamWriter writer = new OutputStreamWriter(data, StandardCharsets.UTF_8)) {
mapper.... | java | public static int serialize(OutputStream stream, Object obj) {
ObjectMapper mapper = createMapperWithJaxbAnnotationInspector();
try (DataOutputStream data = new DataOutputStream(stream);
OutputStreamWriter writer = new OutputStreamWriter(data, StandardCharsets.UTF_8)) {
mapper.... | [
"public",
"static",
"int",
"serialize",
"(",
"OutputStream",
"stream",
",",
"Object",
"obj",
")",
"{",
"ObjectMapper",
"mapper",
"=",
"createMapperWithJaxbAnnotationInspector",
"(",
")",
";",
"try",
"(",
"DataOutputStream",
"data",
"=",
"new",
"DataOutputStream",
... | Serialize specified object to directory with specified name. Given output stream will be closed.
@param obj object to serialize
@return number of bytes written to directory | [
"Serialize",
"specified",
"object",
"to",
"directory",
"with",
"specified",
"name",
".",
"Given",
"output",
"stream",
"will",
"be",
"closed",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/AllureReportUtils.java#L80-L90 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/events/StepStartedEvent.java | StepStartedEvent.process | @Override
public void process(Step step) {
step.setName(getName());
step.setStatus(Status.PASSED);
step.setStart(System.currentTimeMillis());
step.setTitle(getTitle());
} | java | @Override
public void process(Step step) {
step.setName(getName());
step.setStatus(Status.PASSED);
step.setStart(System.currentTimeMillis());
step.setTitle(getTitle());
} | [
"@",
"Override",
"public",
"void",
"process",
"(",
"Step",
"step",
")",
"{",
"step",
".",
"setName",
"(",
"getName",
"(",
")",
")",
";",
"step",
".",
"setStatus",
"(",
"Status",
".",
"PASSED",
")",
";",
"step",
".",
"setStart",
"(",
"System",
".",
... | Sets name, status, start time and title to specified step
@param step which will be changed | [
"Sets",
"name",
"status",
"start",
"time",
"and",
"title",
"to",
"specified",
"step"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/events/StepStartedEvent.java#L31-L37 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/storages/StepStorage.java | StepStorage.childValue | @Override
protected Deque<Step> childValue(Deque<Step> parentValue) {
Deque<Step> queue = new LinkedList<>();
queue.add(parentValue.getFirst());
return queue;
} | java | @Override
protected Deque<Step> childValue(Deque<Step> parentValue) {
Deque<Step> queue = new LinkedList<>();
queue.add(parentValue.getFirst());
return queue;
} | [
"@",
"Override",
"protected",
"Deque",
"<",
"Step",
">",
"childValue",
"(",
"Deque",
"<",
"Step",
">",
"parentValue",
")",
"{",
"Deque",
"<",
"Step",
">",
"queue",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"queue",
".",
"add",
"(",
"parentValue",
... | In case parent thread spawn thread we need create a new queue
for child thread but use the only one root step. In the end all steps will be
children of root step, all we need is sync adding steps
@param parentValue value from parent thread
@return local copy of queue in this thread with parent root as first element | [
"In",
"case",
"parent",
"thread",
"spawn",
"thread",
"we",
"need",
"create",
"a",
"new",
"queue",
"for",
"child",
"thread",
"but",
"use",
"the",
"only",
"one",
"root",
"step",
".",
"In",
"the",
"end",
"all",
"steps",
"will",
"be",
"children",
"of",
"ro... | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/storages/StepStorage.java#L50-L55 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/storages/StepStorage.java | StepStorage.createRootStep | public Step createRootStep() {
return new Step()
.withName("Root step")
.withTitle("Allure step processing error: if you see this step something went wrong.")
.withStart(System.currentTimeMillis())
.withStatus(Status.BROKEN);
} | java | public Step createRootStep() {
return new Step()
.withName("Root step")
.withTitle("Allure step processing error: if you see this step something went wrong.")
.withStart(System.currentTimeMillis())
.withStatus(Status.BROKEN);
} | [
"public",
"Step",
"createRootStep",
"(",
")",
"{",
"return",
"new",
"Step",
"(",
")",
".",
"withName",
"(",
"\"Root step\"",
")",
".",
"withTitle",
"(",
"\"Allure step processing error: if you see this step something went wrong.\"",
")",
".",
"withStart",
"(",
"System... | Construct new root step. Used for inspect problems with Allure lifecycle
@return new root step marked as broken | [
"Construct",
"new",
"root",
"step",
".",
"Used",
"for",
"inspect",
"problems",
"with",
"Allure",
"lifecycle"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/storages/StepStorage.java#L114-L120 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/events/RemoveAttachmentsEvent.java | RemoveAttachmentsEvent.process | @Override
public void process(Step context) {
Iterator<Attachment> iterator = context.getAttachments().listIterator();
while (iterator.hasNext()) {
Attachment attachment = iterator.next();
if (pattern.matcher(attachment.getSource()).matches()) {
deleteAttachme... | java | @Override
public void process(Step context) {
Iterator<Attachment> iterator = context.getAttachments().listIterator();
while (iterator.hasNext()) {
Attachment attachment = iterator.next();
if (pattern.matcher(attachment.getSource()).matches()) {
deleteAttachme... | [
"@",
"Override",
"public",
"void",
"process",
"(",
"Step",
"context",
")",
"{",
"Iterator",
"<",
"Attachment",
">",
"iterator",
"=",
"context",
".",
"getAttachments",
"(",
")",
".",
"listIterator",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext",
... | Remove attachments matches pattern from step and all step substeps
@param context from which attachments will be removed | [
"Remove",
"attachments",
"matches",
"pattern",
"from",
"step",
"and",
"all",
"step",
"substeps"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/events/RemoveAttachmentsEvent.java#L33-L47 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java | Allure.fire | public void fire(StepStartedEvent event) {
Step step = new Step();
event.process(step);
stepStorage.put(step);
notifier.fire(event);
} | java | public void fire(StepStartedEvent event) {
Step step = new Step();
event.process(step);
stepStorage.put(step);
notifier.fire(event);
} | [
"public",
"void",
"fire",
"(",
"StepStartedEvent",
"event",
")",
"{",
"Step",
"step",
"=",
"new",
"Step",
"(",
")",
";",
"event",
".",
"process",
"(",
"step",
")",
";",
"stepStorage",
".",
"put",
"(",
"step",
")",
";",
"notifier",
".",
"fire",
"(",
... | Process StepStartedEvent. New step will be created and added to
stepStorage.
@param event to process | [
"Process",
"StepStartedEvent",
".",
"New",
"step",
"will",
"be",
"created",
"and",
"added",
"to",
"stepStorage",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java#L64-L70 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java | Allure.fire | public void fire(StepEvent event) {
Step step = stepStorage.getLast();
event.process(step);
notifier.fire(event);
} | java | public void fire(StepEvent event) {
Step step = stepStorage.getLast();
event.process(step);
notifier.fire(event);
} | [
"public",
"void",
"fire",
"(",
"StepEvent",
"event",
")",
"{",
"Step",
"step",
"=",
"stepStorage",
".",
"getLast",
"(",
")",
";",
"event",
".",
"process",
"(",
"step",
")",
";",
"notifier",
".",
"fire",
"(",
"event",
")",
";",
"}"
] | Process any StepEvent. You can change last added to stepStorage
step using this method.
@param event to process | [
"Process",
"any",
"StepEvent",
".",
"You",
"can",
"change",
"last",
"added",
"to",
"stepStorage",
"step",
"using",
"this",
"method",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java#L78-L83 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java | Allure.fire | public void fire(StepFinishedEvent event) {
Step step = stepStorage.adopt();
event.process(step);
notifier.fire(event);
} | java | public void fire(StepFinishedEvent event) {
Step step = stepStorage.adopt();
event.process(step);
notifier.fire(event);
} | [
"public",
"void",
"fire",
"(",
"StepFinishedEvent",
"event",
")",
"{",
"Step",
"step",
"=",
"stepStorage",
".",
"adopt",
"(",
")",
";",
"event",
".",
"process",
"(",
"step",
")",
";",
"notifier",
".",
"fire",
"(",
"event",
")",
";",
"}"
] | Process StepFinishedEvent. Change last added to stepStorage step
and add it as child of previous step.
@param event to process | [
"Process",
"StepFinishedEvent",
".",
"Change",
"last",
"added",
"to",
"stepStorage",
"step",
"and",
"add",
"it",
"as",
"child",
"of",
"previous",
"step",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java#L91-L96 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java | Allure.fire | public void fire(TestCaseStartedEvent event) {
//init root step in parent thread if needed
stepStorage.get();
TestCaseResult testCase = testCaseStorage.get();
event.process(testCase);
synchronized (TEST_SUITE_ADD_CHILD_LOCK) {
testSuiteStorage.get(event.getSuiteUid(... | java | public void fire(TestCaseStartedEvent event) {
//init root step in parent thread if needed
stepStorage.get();
TestCaseResult testCase = testCaseStorage.get();
event.process(testCase);
synchronized (TEST_SUITE_ADD_CHILD_LOCK) {
testSuiteStorage.get(event.getSuiteUid(... | [
"public",
"void",
"fire",
"(",
"TestCaseStartedEvent",
"event",
")",
"{",
"//init root step in parent thread if needed",
"stepStorage",
".",
"get",
"(",
")",
";",
"TestCaseResult",
"testCase",
"=",
"testCaseStorage",
".",
"get",
"(",
")",
";",
"event",
".",
"proce... | Process TestCaseStartedEvent. New testCase will be created and added
to suite as child.
@param event to process | [
"Process",
"TestCaseStartedEvent",
".",
"New",
"testCase",
"will",
"be",
"created",
"and",
"added",
"to",
"suite",
"as",
"child",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java#L104-L116 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java | Allure.fire | public void fire(TestCaseEvent event) {
TestCaseResult testCase = testCaseStorage.get();
event.process(testCase);
notifier.fire(event);
} | java | public void fire(TestCaseEvent event) {
TestCaseResult testCase = testCaseStorage.get();
event.process(testCase);
notifier.fire(event);
} | [
"public",
"void",
"fire",
"(",
"TestCaseEvent",
"event",
")",
"{",
"TestCaseResult",
"testCase",
"=",
"testCaseStorage",
".",
"get",
"(",
")",
";",
"event",
".",
"process",
"(",
"testCase",
")",
";",
"notifier",
".",
"fire",
"(",
"event",
")",
";",
"}"
] | Process TestCaseEvent. You can change current testCase context
using this method.
@param event to process | [
"Process",
"TestCaseEvent",
".",
"You",
"can",
"change",
"current",
"testCase",
"context",
"using",
"this",
"method",
"."
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java#L124-L129 | train |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java | Allure.fire | public void fire(TestCaseFinishedEvent event) {
TestCaseResult testCase = testCaseStorage.get();
event.process(testCase);
Step root = stepStorage.pollLast();
if (Status.PASSED.equals(testCase.getStatus())) {
new RemoveAttachmentsEvent(AllureConfig.newInstance().getRemoveAtt... | java | public void fire(TestCaseFinishedEvent event) {
TestCaseResult testCase = testCaseStorage.get();
event.process(testCase);
Step root = stepStorage.pollLast();
if (Status.PASSED.equals(testCase.getStatus())) {
new RemoveAttachmentsEvent(AllureConfig.newInstance().getRemoveAtt... | [
"public",
"void",
"fire",
"(",
"TestCaseFinishedEvent",
"event",
")",
"{",
"TestCaseResult",
"testCase",
"=",
"testCaseStorage",
".",
"get",
"(",
")",
";",
"event",
".",
"process",
"(",
"testCase",
")",
";",
"Step",
"root",
"=",
"stepStorage",
".",
"pollLast... | Process TestCaseFinishedEvent. Add steps and attachments from
top step from stepStorage to current testCase, then remove testCase
and step from stores. Also remove attachments matches removeAttachments
config.
@param event to process | [
"Process",
"TestCaseFinishedEvent",
".",
"Add",
"steps",
"and",
"attachments",
"from",
"top",
"step",
"from",
"stepStorage",
"to",
"current",
"testCase",
"then",
"remove",
"testCase",
"and",
"step",
"from",
"stores",
".",
"Also",
"remove",
"attachments",
"matches"... | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/Allure.java#L139-L156 | train |
eBay/parallec | src/main/java/io/parallec/core/util/PcStringUtils.java | PcStringUtils.strMapToStr | public static String strMapToStr(Map<String, String> map) {
StringBuilder sb = new StringBuilder();
if (map == null || map.isEmpty())
return sb.toString();
for (Entry<String, String> entry : map.entrySet()) {
sb.append("< " + entry.getKey() + ", " + entry.getValue() +... | java | public static String strMapToStr(Map<String, String> map) {
StringBuilder sb = new StringBuilder();
if (map == null || map.isEmpty())
return sb.toString();
for (Entry<String, String> entry : map.entrySet()) {
sb.append("< " + entry.getKey() + ", " + entry.getValue() +... | [
"public",
"static",
"String",
"strMapToStr",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"map",
"==",
"null",
"||",
"map",
".",
"isEmpty",
"(",
")",
")"... | Str map to str.
@param map
the map
@return the string | [
"Str",
"map",
"to",
"str",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcStringUtils.java#L54-L67 | train |
eBay/parallec | src/main/java/io/parallec/core/util/PcStringUtils.java | PcStringUtils.getAggregatedResultHuman | public static String getAggregatedResultHuman(Map<String, LinkedHashSet<String>> aggregateResultMap){
StringBuilder res = new StringBuilder();
for (Entry<String, LinkedHashSet<String>> entry : aggregateResultMap
.entrySet()) {
LinkedHashSet<String> valueSet = entry.getValue... | java | public static String getAggregatedResultHuman(Map<String, LinkedHashSet<String>> aggregateResultMap){
StringBuilder res = new StringBuilder();
for (Entry<String, LinkedHashSet<String>> entry : aggregateResultMap
.entrySet()) {
LinkedHashSet<String> valueSet = entry.getValue... | [
"public",
"static",
"String",
"getAggregatedResultHuman",
"(",
"Map",
"<",
"String",
",",
"LinkedHashSet",
"<",
"String",
">",
">",
"aggregateResultMap",
")",
"{",
"StringBuilder",
"res",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
... | Get the aggregated result human readable string for easy display.
@param aggregateResultMap the aggregate result map
@return the aggregated result human | [
"Get",
"the",
"aggregated",
"result",
"human",
"readable",
"string",
"for",
"easy",
"display",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcStringUtils.java#L76-L92 | train |
eBay/parallec | src/main/java/io/parallec/core/util/PcStringUtils.java | PcStringUtils.renderJson | public static String renderJson(Object o) {
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting()
.create();
return gson.toJson(o);
} | java | public static String renderJson(Object o) {
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting()
.create();
return gson.toJson(o);
} | [
"public",
"static",
"String",
"renderJson",
"(",
"Object",
"o",
")",
"{",
"Gson",
"gson",
"=",
"new",
"GsonBuilder",
"(",
")",
".",
"disableHtmlEscaping",
"(",
")",
".",
"setPrettyPrinting",
"(",
")",
".",
"create",
"(",
")",
";",
"return",
"gson",
".",
... | Render json.
@param o
the o
@return the string | [
"Render",
"json",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcStringUtils.java#L101-L106 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/AssistantExecutionManager.java | AssistantExecutionManager.sendMessageUntilStopCount | public void sendMessageUntilStopCount(int stopCount) {
// always send with valid data.
for (int i = processedWorkerCount; i < workers.size(); ++i) {
ActorRef worker = workers.get(i);
try {
/**
* !!! This is a must; without this sleep; stuck occu... | java | public void sendMessageUntilStopCount(int stopCount) {
// always send with valid data.
for (int i = processedWorkerCount; i < workers.size(); ++i) {
ActorRef worker = workers.get(i);
try {
/**
* !!! This is a must; without this sleep; stuck occu... | [
"public",
"void",
"sendMessageUntilStopCount",
"(",
"int",
"stopCount",
")",
"{",
"// always send with valid data.",
"for",
"(",
"int",
"i",
"=",
"processedWorkerCount",
";",
"i",
"<",
"workers",
".",
"size",
"(",
")",
";",
"++",
"i",
")",
"{",
"ActorRef",
"... | Note that if there is sleep in this method.
@param stopCount
the stop count | [
"Note",
"that",
"if",
"there",
"is",
"sleep",
"in",
"this",
"method",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/AssistantExecutionManager.java#L90-L121 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/AssistantExecutionManager.java | AssistantExecutionManager.waitAndRetry | public void waitAndRetry() {
ContinueToSendToBatchSenderAsstManager continueToSendToBatchSenderAsstManager = new ContinueToSendToBatchSenderAsstManager(
processedWorkerCount);
logger.debug("NOW WAIT Another " + asstManagerRetryIntervalMillis
+ " MS. at " + PcDateUtils.ge... | java | public void waitAndRetry() {
ContinueToSendToBatchSenderAsstManager continueToSendToBatchSenderAsstManager = new ContinueToSendToBatchSenderAsstManager(
processedWorkerCount);
logger.debug("NOW WAIT Another " + asstManagerRetryIntervalMillis
+ " MS. at " + PcDateUtils.ge... | [
"public",
"void",
"waitAndRetry",
"(",
")",
"{",
"ContinueToSendToBatchSenderAsstManager",
"continueToSendToBatchSenderAsstManager",
"=",
"new",
"ContinueToSendToBatchSenderAsstManager",
"(",
"processedWorkerCount",
")",
";",
"logger",
".",
"debug",
"(",
"\"NOW WAIT Another \""... | Wait and retry. | [
"Wait",
"and",
"retry",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/AssistantExecutionManager.java#L126-L141 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/poll/HttpPollerProcessor.java | HttpPollerProcessor.getUuidFromResponse | public String getUuidFromResponse(ResponseOnSingeRequest myResponse) {
String uuid = PcConstants.NA;
String responseBody = myResponse.getResponseBody();
Pattern regex = Pattern.compile(getJobIdRegex());
Matcher matcher = regex.matcher(responseBody);
if (matcher.matches()) {
... | java | public String getUuidFromResponse(ResponseOnSingeRequest myResponse) {
String uuid = PcConstants.NA;
String responseBody = myResponse.getResponseBody();
Pattern regex = Pattern.compile(getJobIdRegex());
Matcher matcher = regex.matcher(responseBody);
if (matcher.matches()) {
... | [
"public",
"String",
"getUuidFromResponse",
"(",
"ResponseOnSingeRequest",
"myResponse",
")",
"{",
"String",
"uuid",
"=",
"PcConstants",
".",
"NA",
";",
"String",
"responseBody",
"=",
"myResponse",
".",
"getResponseBody",
"(",
")",
";",
"Pattern",
"regex",
"=",
"... | Gets the uuid from response.
@param myResponse
the my response
@return the uuid from response | [
"Gets",
"the",
"uuid",
"from",
"response",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/poll/HttpPollerProcessor.java#L186-L197 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/poll/HttpPollerProcessor.java | HttpPollerProcessor.getProgressFromResponse | public double getProgressFromResponse(ResponseOnSingeRequest myResponse) {
double progress = 0.0;
try {
if (myResponse == null || myResponse.isFailObtainResponse()) {
return progress;
}
String responseBody = myResponse.getResponseBody();
... | java | public double getProgressFromResponse(ResponseOnSingeRequest myResponse) {
double progress = 0.0;
try {
if (myResponse == null || myResponse.isFailObtainResponse()) {
return progress;
}
String responseBody = myResponse.getResponseBody();
... | [
"public",
"double",
"getProgressFromResponse",
"(",
"ResponseOnSingeRequest",
"myResponse",
")",
"{",
"double",
"progress",
"=",
"0.0",
";",
"try",
"{",
"if",
"(",
"myResponse",
"==",
"null",
"||",
"myResponse",
".",
"isFailObtainResponse",
"(",
")",
")",
"{",
... | Gets the progress from response.
@param myResponse
the my response
@return the progress from response | [
"Gets",
"the",
"progress",
"from",
"response",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/poll/HttpPollerProcessor.java#L206-L229 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/poll/HttpPollerProcessor.java | HttpPollerProcessor.ifTaskCompletedSuccessOrFailureFromResponse | public boolean ifTaskCompletedSuccessOrFailureFromResponse(
ResponseOnSingeRequest myResponse) {
boolean isCompleted = false;
try {
if (myResponse == null || myResponse.isFailObtainResponse()) {
return isCompleted;
}
String responseBody ... | java | public boolean ifTaskCompletedSuccessOrFailureFromResponse(
ResponseOnSingeRequest myResponse) {
boolean isCompleted = false;
try {
if (myResponse == null || myResponse.isFailObtainResponse()) {
return isCompleted;
}
String responseBody ... | [
"public",
"boolean",
"ifTaskCompletedSuccessOrFailureFromResponse",
"(",
"ResponseOnSingeRequest",
"myResponse",
")",
"{",
"boolean",
"isCompleted",
"=",
"false",
";",
"try",
"{",
"if",
"(",
"myResponse",
"==",
"null",
"||",
"myResponse",
".",
"isFailObtainResponse",
... | If task completed success or failure from response.
@param myResponse
the my response
@return true, if successful | [
"If",
"task",
"completed",
"success",
"or",
"failure",
"from",
"response",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/poll/HttpPollerProcessor.java#L250-L271 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/HttpWorker.java | HttpWorker.createRequest | public BoundRequestBuilder createRequest()
throws HttpRequestCreateException {
BoundRequestBuilder builder = null;
getLogger().debug("AHC completeUrl " + requestUrl);
try {
switch (httpMethod) {
case GET:
builder = client.prepareGet(requestU... | java | public BoundRequestBuilder createRequest()
throws HttpRequestCreateException {
BoundRequestBuilder builder = null;
getLogger().debug("AHC completeUrl " + requestUrl);
try {
switch (httpMethod) {
case GET:
builder = client.prepareGet(requestU... | [
"public",
"BoundRequestBuilder",
"createRequest",
"(",
")",
"throws",
"HttpRequestCreateException",
"{",
"BoundRequestBuilder",
"builder",
"=",
"null",
";",
"getLogger",
"(",
")",
".",
"debug",
"(",
"\"AHC completeUrl \"",
"+",
"requestUrl",
")",
";",
"try",
"{",
... | Creates the request.
@return the bound request builder
@throws HttpRequestCreateException
the http request create exception | [
"Creates",
"the",
"request",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/HttpWorker.java#L148-L200 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/HttpWorker.java | HttpWorker.onComplete | public ResponseOnSingeRequest onComplete(Response response) {
cancelCancellable();
try {
Map<String, List<String>> responseHeaders = null;
if (responseHeaderMeta != null) {
responseHeaders = new LinkedHashMap<String, List<String>>();
... | java | public ResponseOnSingeRequest onComplete(Response response) {
cancelCancellable();
try {
Map<String, List<String>> responseHeaders = null;
if (responseHeaderMeta != null) {
responseHeaders = new LinkedHashMap<String, List<String>>();
... | [
"public",
"ResponseOnSingeRequest",
"onComplete",
"(",
"Response",
"response",
")",
"{",
"cancelCancellable",
"(",
")",
";",
"try",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"responseHeaders",
"=",
"null",
";",
"if",
"(",
"responseHead... | On complete.
Save response headers when needed.
@param response
the response
@return the response on single request | [
"On",
"complete",
".",
"Save",
"response",
"headers",
"when",
"needed",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/HttpWorker.java#L374-L414 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/HttpWorker.java | HttpWorker.onThrowable | public void onThrowable(Throwable cause) {
this.cause = cause;
getSelf().tell(RequestWorkerMsgType.PROCESS_ON_EXCEPTION, getSelf());
} | java | public void onThrowable(Throwable cause) {
this.cause = cause;
getSelf().tell(RequestWorkerMsgType.PROCESS_ON_EXCEPTION, getSelf());
} | [
"public",
"void",
"onThrowable",
"(",
"Throwable",
"cause",
")",
"{",
"this",
".",
"cause",
"=",
"cause",
";",
"getSelf",
"(",
")",
".",
"tell",
"(",
"RequestWorkerMsgType",
".",
"PROCESS_ON_EXCEPTION",
",",
"getSelf",
"(",
")",
")",
";",
"}"
] | On throwable.
@param cause
the cause | [
"On",
"throwable",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/HttpWorker.java#L422-L426 | train |
eBay/parallec | src/main/java/io/parallec/core/util/PcTargetHostsUtils.java | PcTargetHostsUtils.getNodeListFromStringLineSeperateOrSpaceSeperate | public static List<String> getNodeListFromStringLineSeperateOrSpaceSeperate(
String listStr, boolean removeDuplicate) {
List<String> nodes = new ArrayList<String>();
for (String token : listStr.split("[\\r?\\n| +]+")) {
// 20131025: fix if fqdn has space in the end.
... | java | public static List<String> getNodeListFromStringLineSeperateOrSpaceSeperate(
String listStr, boolean removeDuplicate) {
List<String> nodes = new ArrayList<String>();
for (String token : listStr.split("[\\r?\\n| +]+")) {
// 20131025: fix if fqdn has space in the end.
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getNodeListFromStringLineSeperateOrSpaceSeperate",
"(",
"String",
"listStr",
",",
"boolean",
"removeDuplicate",
")",
"{",
"List",
"<",
"String",
">",
"nodes",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",... | Gets the node list from string line seperate or space seperate.
@param listStr
the list str
@param removeDuplicate
the remove duplicate
@return the node list from string line seperate or space seperate | [
"Gets",
"the",
"node",
"list",
"from",
"string",
"line",
"seperate",
"or",
"space",
"seperate",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcTargetHostsUtils.java#L44-L65 | train |
eBay/parallec | src/main/java/io/parallec/core/util/PcTargetHostsUtils.java | PcTargetHostsUtils.removeDuplicateNodeList | public static int removeDuplicateNodeList(List<String> list) {
int originCount = list.size();
// add elements to all, including duplicates
HashSet<String> hs = new LinkedHashSet<String>();
hs.addAll(list);
list.clear();
list.addAll(hs);
return originCount - list... | java | public static int removeDuplicateNodeList(List<String> list) {
int originCount = list.size();
// add elements to all, including duplicates
HashSet<String> hs = new LinkedHashSet<String>();
hs.addAll(list);
list.clear();
list.addAll(hs);
return originCount - list... | [
"public",
"static",
"int",
"removeDuplicateNodeList",
"(",
"List",
"<",
"String",
">",
"list",
")",
"{",
"int",
"originCount",
"=",
"list",
".",
"size",
"(",
")",
";",
"// add elements to all, including duplicates",
"HashSet",
"<",
"String",
">",
"hs",
"=",
"n... | Removes the duplicate node list.
@param list
the list
@return the int | [
"Removes",
"the",
"duplicate",
"node",
"list",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcTargetHostsUtils.java#L74-L84 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setResponseContext | public ParallelTaskBuilder setResponseContext(
Map<String, Object> responseContext) {
if (responseContext != null)
this.responseContext = responseContext;
else
logger.error("context cannot be null. skip set.");
return this;
} | java | public ParallelTaskBuilder setResponseContext(
Map<String, Object> responseContext) {
if (responseContext != null)
this.responseContext = responseContext;
else
logger.error("context cannot be null. skip set.");
return this;
} | [
"public",
"ParallelTaskBuilder",
"setResponseContext",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"responseContext",
")",
"{",
"if",
"(",
"responseContext",
"!=",
"null",
")",
"this",
".",
"responseContext",
"=",
"responseContext",
";",
"else",
"logger",
"."... | Sets the response context.
@param responseContext
the response context
@return the parallel task builder | [
"Sets",
"the",
"response",
"context",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L146-L153 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.execute | public ParallelTask execute(ParallecResponseHandler handler) {
ParallelTask task = new ParallelTask();
try {
targetHostMeta = new TargetHostMeta(targetHosts);
final ParallelTask taskReal = new ParallelTask(requestProtocol,
concurrency, httpMeta, targetHostM... | java | public ParallelTask execute(ParallecResponseHandler handler) {
ParallelTask task = new ParallelTask();
try {
targetHostMeta = new TargetHostMeta(targetHosts);
final ParallelTask taskReal = new ParallelTask(requestProtocol,
concurrency, httpMeta, targetHostM... | [
"public",
"ParallelTask",
"execute",
"(",
"ParallecResponseHandler",
"handler",
")",
"{",
"ParallelTask",
"task",
"=",
"new",
"ParallelTask",
"(",
")",
";",
"try",
"{",
"targetHostMeta",
"=",
"new",
"TargetHostMeta",
"(",
"targetHosts",
")",
";",
"final",
"Paral... | key function. first validate if the ACM has adequate data; then execute
it after the validation. the new ParallelTask task guareetee to have the
targethost meta and command meta not null
@param handler
the handler
@return the parallel task | [
"key",
"function",
".",
"first",
"validate",
"if",
"the",
"ACM",
"has",
"adequate",
"data",
";",
"then",
"execute",
"it",
"after",
"the",
"validation",
".",
"the",
"new",
"ParallelTask",
"task",
"guareetee",
"to",
"have",
"the",
"targethost",
"meta",
"and",
... | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L224-L310 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.validation | public boolean validation() throws ParallelTaskInvalidException {
ParallelTask task = new ParallelTask();
targetHostMeta = new TargetHostMeta(targetHosts);
task = new ParallelTask(requestProtocol, concurrency, httpMeta,
targetHostMeta, sshMeta, tcpMeta, udpMeta, pingMeta, null,... | java | public boolean validation() throws ParallelTaskInvalidException {
ParallelTask task = new ParallelTask();
targetHostMeta = new TargetHostMeta(targetHosts);
task = new ParallelTask(requestProtocol, concurrency, httpMeta,
targetHostMeta, sshMeta, tcpMeta, udpMeta, pingMeta, null,... | [
"public",
"boolean",
"validation",
"(",
")",
"throws",
"ParallelTaskInvalidException",
"{",
"ParallelTask",
"task",
"=",
"new",
"ParallelTask",
"(",
")",
";",
"targetHostMeta",
"=",
"new",
"TargetHostMeta",
"(",
"targetHosts",
")",
";",
"task",
"=",
"new",
"Para... | add some validation to see if this miss anything.
@return true, if successful
@throws ParallelTaskInvalidException
the parallel task invalid exception | [
"add",
"some",
"validation",
"to",
"see",
"if",
"this",
"miss",
"anything",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L320-L339 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setTargetHostsFromJsonPath | public ParallelTaskBuilder setTargetHostsFromJsonPath(String jsonPath,
String sourcePath, HostsSourceType sourceType)
throws TargetHostsLoadException {
this.targetHosts = targetHostBuilder.setTargetHostsFromJsonPath(jsonPath, sourcePath,
sourceType);
return this;... | java | public ParallelTaskBuilder setTargetHostsFromJsonPath(String jsonPath,
String sourcePath, HostsSourceType sourceType)
throws TargetHostsLoadException {
this.targetHosts = targetHostBuilder.setTargetHostsFromJsonPath(jsonPath, sourcePath,
sourceType);
return this;... | [
"public",
"ParallelTaskBuilder",
"setTargetHostsFromJsonPath",
"(",
"String",
"jsonPath",
",",
"String",
"sourcePath",
",",
"HostsSourceType",
"sourceType",
")",
"throws",
"TargetHostsLoadException",
"{",
"this",
".",
"targetHosts",
"=",
"targetHostBuilder",
".",
"setTarg... | Sets the target hosts from json path.
@param jsonPath
the json path
@param sourcePath
the source path
@param sourceType
the source type
@return the parallel task builder
@throws TargetHostsLoadException
the target hosts load exception | [
"Sets",
"the",
"target",
"hosts",
"from",
"json",
"path",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L517-L525 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setTargetHostsFromLineByLineText | public ParallelTaskBuilder setTargetHostsFromLineByLineText(
String sourcePath, HostsSourceType sourceType)
throws TargetHostsLoadException {
this.targetHosts = targetHostBuilder.setTargetHostsFromLineByLineText(sourcePath,
sourceType);
return this;
} | java | public ParallelTaskBuilder setTargetHostsFromLineByLineText(
String sourcePath, HostsSourceType sourceType)
throws TargetHostsLoadException {
this.targetHosts = targetHostBuilder.setTargetHostsFromLineByLineText(sourcePath,
sourceType);
return this;
} | [
"public",
"ParallelTaskBuilder",
"setTargetHostsFromLineByLineText",
"(",
"String",
"sourcePath",
",",
"HostsSourceType",
"sourceType",
")",
"throws",
"TargetHostsLoadException",
"{",
"this",
".",
"targetHosts",
"=",
"targetHostBuilder",
".",
"setTargetHostsFromLineByLineText",... | Sets the target hosts from line by line text.
@param sourcePath
the source path
@param sourceType
the source type
@return the parallel task builder
@throws TargetHostsLoadException
the target hosts load exception | [
"Sets",
"the",
"target",
"hosts",
"from",
"line",
"by",
"line",
"text",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L539-L546 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setReplacementVarMapNodeSpecific | public ParallelTaskBuilder setReplacementVarMapNodeSpecific(
Map<String, StrStrMap> replacementVarMapNodeSpecific) {
this.replacementVarMapNodeSpecific.clear();
this.replacementVarMapNodeSpecific
.putAll(replacementVarMapNodeSpecific);
this.requestReplacementType = R... | java | public ParallelTaskBuilder setReplacementVarMapNodeSpecific(
Map<String, StrStrMap> replacementVarMapNodeSpecific) {
this.replacementVarMapNodeSpecific.clear();
this.replacementVarMapNodeSpecific
.putAll(replacementVarMapNodeSpecific);
this.requestReplacementType = R... | [
"public",
"ParallelTaskBuilder",
"setReplacementVarMapNodeSpecific",
"(",
"Map",
"<",
"String",
",",
"StrStrMap",
">",
"replacementVarMapNodeSpecific",
")",
"{",
"this",
".",
"replacementVarMapNodeSpecific",
".",
"clear",
"(",
")",
";",
"this",
".",
"replacementVarMapNo... | Sets the replacement var map node specific.
@param replacementVarMapNodeSpecific
the replacement var map node specific
@return the parallel task builder | [
"Sets",
"the",
"replacement",
"var",
"map",
"node",
"specific",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L686-L696 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setReplaceVarMapToSingleTargetFromMap | public ParallelTaskBuilder setReplaceVarMapToSingleTargetFromMap(
Map<String, StrStrMap> replacementVarMapNodeSpecific,
String uniformTargetHost) {
setReplacementVarMapNodeSpecific(replacementVarMapNodeSpecific);
if (Strings.isNullOrEmpty(uniformTargetHost)) {
logger... | java | public ParallelTaskBuilder setReplaceVarMapToSingleTargetFromMap(
Map<String, StrStrMap> replacementVarMapNodeSpecific,
String uniformTargetHost) {
setReplacementVarMapNodeSpecific(replacementVarMapNodeSpecific);
if (Strings.isNullOrEmpty(uniformTargetHost)) {
logger... | [
"public",
"ParallelTaskBuilder",
"setReplaceVarMapToSingleTargetFromMap",
"(",
"Map",
"<",
"String",
",",
"StrStrMap",
">",
"replacementVarMapNodeSpecific",
",",
"String",
"uniformTargetHost",
")",
"{",
"setReplacementVarMapNodeSpecific",
"(",
"replacementVarMapNodeSpecific",
"... | Sets the replace var map to single target from map.
@param replacementVarMapNodeSpecific
the replacement var map node specific
@param uniformTargetHost
the uniform target host
@return the parallel task builder | [
"Sets",
"the",
"replace",
"var",
"map",
"to",
"single",
"target",
"from",
"map",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L708-L726 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setReplaceVarMapToSingleTargetSingleVar | public ParallelTaskBuilder setReplaceVarMapToSingleTargetSingleVar(
String variable, List<String> replaceList, String uniformTargetHost) {
if (Strings.isNullOrEmpty(uniformTargetHost)) {
logger.error("uniform target host is empty or null. skil setting.");
return this;
... | java | public ParallelTaskBuilder setReplaceVarMapToSingleTargetSingleVar(
String variable, List<String> replaceList, String uniformTargetHost) {
if (Strings.isNullOrEmpty(uniformTargetHost)) {
logger.error("uniform target host is empty or null. skil setting.");
return this;
... | [
"public",
"ParallelTaskBuilder",
"setReplaceVarMapToSingleTargetSingleVar",
"(",
"String",
"variable",
",",
"List",
"<",
"String",
">",
"replaceList",
",",
"String",
"uniformTargetHost",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"uniformTargetHost",
"... | Sets the replace var map to single target single var.
@param variable
the variable
@param replaceList
: the list of strings that will replace the variable
@param uniformTargetHost
the uniform target host
@return the parallel task builder | [
"Sets",
"the",
"replace",
"var",
"map",
"to",
"single",
"target",
"single",
"var",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L739-L772 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setReplaceVarMapToSingleTarget | public ParallelTaskBuilder setReplaceVarMapToSingleTarget(
List<StrStrMap> replacementVarMapList, String uniformTargetHost) {
if (Strings.isNullOrEmpty(uniformTargetHost)) {
logger.error("uniform target host is empty or null. skil setting.");
return this;
}
t... | java | public ParallelTaskBuilder setReplaceVarMapToSingleTarget(
List<StrStrMap> replacementVarMapList, String uniformTargetHost) {
if (Strings.isNullOrEmpty(uniformTargetHost)) {
logger.error("uniform target host is empty or null. skil setting.");
return this;
}
t... | [
"public",
"ParallelTaskBuilder",
"setReplaceVarMapToSingleTarget",
"(",
"List",
"<",
"StrStrMap",
">",
"replacementVarMapList",
",",
"String",
"uniformTargetHost",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"uniformTargetHost",
")",
")",
"{",
"logger",... | Sets the replace var map to single target.
@param replacementVarMapList
the replacement var map list
@param uniformTargetHost
the uniform target host
@return the parallel task builder | [
"Sets",
"the",
"replace",
"var",
"map",
"to",
"single",
"target",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L783-L810 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setReplacementVarMap | public ParallelTaskBuilder setReplacementVarMap(
Map<String, String> replacementVarMap) {
this.replacementVarMap = replacementVarMap;
// TODO Check and warning of overwriting
// set as uniform
this.requestReplacementType = RequestReplacementType.UNIFORM_VAR_REPLACEMENT;
... | java | public ParallelTaskBuilder setReplacementVarMap(
Map<String, String> replacementVarMap) {
this.replacementVarMap = replacementVarMap;
// TODO Check and warning of overwriting
// set as uniform
this.requestReplacementType = RequestReplacementType.UNIFORM_VAR_REPLACEMENT;
... | [
"public",
"ParallelTaskBuilder",
"setReplacementVarMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"replacementVarMap",
")",
"{",
"this",
".",
"replacementVarMap",
"=",
"replacementVarMap",
";",
"// TODO Check and warning of overwriting",
"// set as uniform",
"this",
... | Sets the replacement var map.
@param replacementVarMap
the replacement var map
@return the parallel task builder | [
"Sets",
"the",
"replacement",
"var",
"map",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L829-L837 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setHttpPollerProcessor | public ParallelTaskBuilder setHttpPollerProcessor(
HttpPollerProcessor httpPollerProcessor) {
this.httpMeta.setHttpPollerProcessor(httpPollerProcessor);
this.httpMeta.setPollable(true);
return this;
} | java | public ParallelTaskBuilder setHttpPollerProcessor(
HttpPollerProcessor httpPollerProcessor) {
this.httpMeta.setHttpPollerProcessor(httpPollerProcessor);
this.httpMeta.setPollable(true);
return this;
} | [
"public",
"ParallelTaskBuilder",
"setHttpPollerProcessor",
"(",
"HttpPollerProcessor",
"httpPollerProcessor",
")",
"{",
"this",
".",
"httpMeta",
".",
"setHttpPollerProcessor",
"(",
"httpPollerProcessor",
")",
";",
"this",
".",
"httpMeta",
".",
"setPollable",
"(",
"true"... | Sets the HTTP poller processor to handle Async API.
Will auto enable the pollable mode with this call
@param httpPollerProcessor
the http poller processor
@return the parallel task builder | [
"Sets",
"the",
"HTTP",
"poller",
"processor",
"to",
"handle",
"Async",
"API",
".",
"Will",
"auto",
"enable",
"the",
"pollable",
"mode",
"with",
"this",
"call"
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L900-L905 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setSshPassword | public ParallelTaskBuilder setSshPassword(String password) {
this.sshMeta.setPassword(password);
this.sshMeta.setSshLoginType(SshLoginType.PASSWORD);
return this;
} | java | public ParallelTaskBuilder setSshPassword(String password) {
this.sshMeta.setPassword(password);
this.sshMeta.setSshLoginType(SshLoginType.PASSWORD);
return this;
} | [
"public",
"ParallelTaskBuilder",
"setSshPassword",
"(",
"String",
"password",
")",
"{",
"this",
".",
"sshMeta",
".",
"setPassword",
"(",
"password",
")",
";",
"this",
".",
"sshMeta",
".",
"setSshLoginType",
"(",
"SshLoginType",
".",
"PASSWORD",
")",
";",
"retu... | Sets the ssh password.
@param password
the password
@return the parallel task builder | [
"Sets",
"the",
"ssh",
"password",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L976-L980 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setSshPrivKeyRelativePath | public ParallelTaskBuilder setSshPrivKeyRelativePath(
String privKeyRelativePath) {
this.sshMeta.setPrivKeyRelativePath(privKeyRelativePath);
this.sshMeta.setSshLoginType(SshLoginType.KEY);
return this;
} | java | public ParallelTaskBuilder setSshPrivKeyRelativePath(
String privKeyRelativePath) {
this.sshMeta.setPrivKeyRelativePath(privKeyRelativePath);
this.sshMeta.setSshLoginType(SshLoginType.KEY);
return this;
} | [
"public",
"ParallelTaskBuilder",
"setSshPrivKeyRelativePath",
"(",
"String",
"privKeyRelativePath",
")",
"{",
"this",
".",
"sshMeta",
".",
"setPrivKeyRelativePath",
"(",
"privKeyRelativePath",
")",
";",
"this",
".",
"sshMeta",
".",
"setSshLoginType",
"(",
"SshLoginType"... | Sets the ssh priv key relative path.
Note that must be relative path for now.
This default to no need of passphrase for the private key.
Will also auto set the login type to key based.
@param privKeyRelativePath
the priv key relative path
@return the parallel task builder | [
"Sets",
"the",
"ssh",
"priv",
"key",
"relative",
"path",
".",
"Note",
"that",
"must",
"be",
"relative",
"path",
"for",
"now",
".",
"This",
"default",
"to",
"no",
"need",
"of",
"passphrase",
"for",
"the",
"private",
"key",
".",
"Will",
"also",
"auto",
"... | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L1005-L1010 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTaskBuilder.java | ParallelTaskBuilder.setSshPrivKeyRelativePathWtihPassphrase | public ParallelTaskBuilder setSshPrivKeyRelativePathWtihPassphrase(
String privKeyRelativePath, String passphrase) {
this.sshMeta.setPrivKeyRelativePath(privKeyRelativePath);
this.sshMeta.setPrivKeyUsePassphrase(true);
this.sshMeta.setPassphrase(passphrase);
this.sshMeta.setS... | java | public ParallelTaskBuilder setSshPrivKeyRelativePathWtihPassphrase(
String privKeyRelativePath, String passphrase) {
this.sshMeta.setPrivKeyRelativePath(privKeyRelativePath);
this.sshMeta.setPrivKeyUsePassphrase(true);
this.sshMeta.setPassphrase(passphrase);
this.sshMeta.setS... | [
"public",
"ParallelTaskBuilder",
"setSshPrivKeyRelativePathWtihPassphrase",
"(",
"String",
"privKeyRelativePath",
",",
"String",
"passphrase",
")",
"{",
"this",
".",
"sshMeta",
".",
"setPrivKeyRelativePath",
"(",
"privKeyRelativePath",
")",
";",
"this",
".",
"sshMeta",
... | Sets the ssh priv key relative path wtih passphrase.
@param privKeyRelativePath the priv key relative path
@param passphrase the passphrase
@return the parallel task builder | [
"Sets",
"the",
"ssh",
"priv",
"key",
"relative",
"path",
"wtih",
"passphrase",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTaskBuilder.java#L1020-L1027 | train |
eBay/parallec | src/main/java/io/parallec/core/util/PcDateUtils.java | PcDateUtils.getDateTimeStr | public static String getDateTimeStr(Date d) {
if (d == null)
return "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ");
// 20140315 test will problem +0000
return sdf.format(d);
} | java | public static String getDateTimeStr(Date d) {
if (d == null)
return "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ");
// 20140315 test will problem +0000
return sdf.format(d);
} | [
"public",
"static",
"String",
"getDateTimeStr",
"(",
"Date",
"d",
")",
"{",
"if",
"(",
"d",
"==",
"null",
")",
"return",
"\"\"",
";",
"SimpleDateFormat",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"yyyy-MM-dd HH:mm:ss.SSSZ\"",
")",
";",
"// 20140315 test will... | Gets the date time str.
@param d
the d
@return the date time str | [
"Gets",
"the",
"date",
"time",
"str",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcDateUtils.java#L37-L44 | train |
eBay/parallec | src/main/java/io/parallec/core/util/PcDateUtils.java | PcDateUtils.getDateTimeStrStandard | public static String getDateTimeStrStandard(Date d) {
if (d == null)
return "";
if (d.getTime() == 0L)
return "Never";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss.SSSZ");
return sdf.format(d);
} | java | public static String getDateTimeStrStandard(Date d) {
if (d == null)
return "";
if (d.getTime() == 0L)
return "Never";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss.SSSZ");
return sdf.format(d);
} | [
"public",
"static",
"String",
"getDateTimeStrStandard",
"(",
"Date",
"d",
")",
"{",
"if",
"(",
"d",
"==",
"null",
")",
"return",
"\"\"",
";",
"if",
"(",
"d",
".",
"getTime",
"(",
")",
"==",
"0L",
")",
"return",
"\"Never\"",
";",
"SimpleDateFormat",
"sd... | Gets the date time str standard.
@param d
the d
@return the date time str standard | [
"Gets",
"the",
"date",
"time",
"str",
"standard",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcDateUtils.java#L53-L63 | train |
eBay/parallec | src/main/java/io/parallec/core/util/PcDateUtils.java | PcDateUtils.getDateTimeStrConcise | public static String getDateTimeStrConcise(Date d) {
if (d == null)
return "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSSZ");
return sdf.format(d);
} | java | public static String getDateTimeStrConcise(Date d) {
if (d == null)
return "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSSZ");
return sdf.format(d);
} | [
"public",
"static",
"String",
"getDateTimeStrConcise",
"(",
"Date",
"d",
")",
"{",
"if",
"(",
"d",
"==",
"null",
")",
"return",
"\"\"",
";",
"SimpleDateFormat",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"yyyyMMddHHmmssSSSZ\"",
")",
";",
"return",
"sdf",
... | Gets the date time str concise.
@param d
the d
@return the date time str concise | [
"Gets",
"the",
"date",
"time",
"str",
"concise",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcDateUtils.java#L72-L78 | train |
eBay/parallec | src/main/java/io/parallec/core/util/PcDateUtils.java | PcDateUtils.getDateFromConciseStr | public static Date getDateFromConciseStr(String str) {
Date d = null;
if (str == null || str.isEmpty())
return null;
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSSZ");
d = sdf.parse(str);
} catch (Exception ex) {
lo... | java | public static Date getDateFromConciseStr(String str) {
Date d = null;
if (str == null || str.isEmpty())
return null;
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSSZ");
d = sdf.parse(str);
} catch (Exception ex) {
lo... | [
"public",
"static",
"Date",
"getDateFromConciseStr",
"(",
"String",
"str",
")",
"{",
"Date",
"d",
"=",
"null",
";",
"if",
"(",
"str",
"==",
"null",
"||",
"str",
".",
"isEmpty",
"(",
")",
")",
"return",
"null",
";",
"try",
"{",
"SimpleDateFormat",
"sdf"... | 20130512 Converts the sdsm string generated above to Date format.
@param str
the str
@return the date from concise str | [
"20130512",
"Converts",
"the",
"sdsm",
"string",
"generated",
"above",
"to",
"Date",
"format",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcDateUtils.java#L102-L118 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/OperationWorker.java | OperationWorker.handleHttpWorkerResponse | private final void handleHttpWorkerResponse(
ResponseOnSingeRequest respOnSingleReq) throws Exception {
// Successful response from GenericAsyncHttpWorker
// Jeff 20310411: use generic response
String responseContent = respOnSingleReq.getResponseBody();
response.setResponse... | java | private final void handleHttpWorkerResponse(
ResponseOnSingeRequest respOnSingleReq) throws Exception {
// Successful response from GenericAsyncHttpWorker
// Jeff 20310411: use generic response
String responseContent = respOnSingleReq.getResponseBody();
response.setResponse... | [
"private",
"final",
"void",
"handleHttpWorkerResponse",
"(",
"ResponseOnSingeRequest",
"respOnSingleReq",
")",
"throws",
"Exception",
"{",
"// Successful response from GenericAsyncHttpWorker",
"// Jeff 20310411: use generic response",
"String",
"responseContent",
"=",
"respOnSingleRe... | Handle http worker response.
@param respOnSingleReq
the my response
@throws Exception
the exception | [
"Handle",
"http",
"worker",
"response",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/OperationWorker.java#L220-L336 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/OperationWorker.java | OperationWorker.processMainRequest | private final void processMainRequest() {
sender = getSender();
startTimeMillis = System.currentTimeMillis();
timeoutDuration = Duration.create(
request.getActorMaxOperationTimeoutSec(), TimeUnit.SECONDS);
actorMaxOperationTimeoutSec = request.getActorMaxOperationTimeou... | java | private final void processMainRequest() {
sender = getSender();
startTimeMillis = System.currentTimeMillis();
timeoutDuration = Duration.create(
request.getActorMaxOperationTimeoutSec(), TimeUnit.SECONDS);
actorMaxOperationTimeoutSec = request.getActorMaxOperationTimeou... | [
"private",
"final",
"void",
"processMainRequest",
"(",
")",
"{",
"sender",
"=",
"getSender",
"(",
")",
";",
"startTimeMillis",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"timeoutDuration",
"=",
"Duration",
".",
"create",
"(",
"request",
".",
"ge... | the 1st request from the manager. | [
"the",
"1st",
"request",
"from",
"the",
"manager",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/OperationWorker.java#L341-L393 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/OperationWorker.java | OperationWorker.operationTimeout | @SuppressWarnings("deprecation")
private final void operationTimeout() {
/**
* first kill async http worker; before suicide LESSON: MUST KILL AND
* WAIT FOR CHILDREN to reply back before kill itself.
*/
cancelCancellable();
if (asyncWorker != null && !asyncWorker.... | java | @SuppressWarnings("deprecation")
private final void operationTimeout() {
/**
* first kill async http worker; before suicide LESSON: MUST KILL AND
* WAIT FOR CHILDREN to reply back before kill itself.
*/
cancelCancellable();
if (asyncWorker != null && !asyncWorker.... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"final",
"void",
"operationTimeout",
"(",
")",
"{",
"/**\n * first kill async http worker; before suicide LESSON: MUST KILL AND\n * WAIT FOR CHILDREN to reply back before kill itself.\n */",
"cancelCan... | will trigger workers to cancel then wait for it to report back. | [
"will",
"trigger",
"workers",
"to",
"cancel",
"then",
"wait",
"for",
"it",
"to",
"report",
"back",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/OperationWorker.java#L422-L443 | train |
eBay/parallec | src/main/java/io/parallec/core/actor/OperationWorker.java | OperationWorker.replyErrors | private final void replyErrors(final String errorMessage,
final String stackTrace, final String statusCode,
final int statusCodeInt) {
reply(true, errorMessage, stackTrace, statusCode, statusCodeInt,
PcConstants.NA, null);
} | java | private final void replyErrors(final String errorMessage,
final String stackTrace, final String statusCode,
final int statusCodeInt) {
reply(true, errorMessage, stackTrace, statusCode, statusCodeInt,
PcConstants.NA, null);
} | [
"private",
"final",
"void",
"replyErrors",
"(",
"final",
"String",
"errorMessage",
",",
"final",
"String",
"stackTrace",
",",
"final",
"String",
"statusCode",
",",
"final",
"int",
"statusCodeInt",
")",
"{",
"reply",
"(",
"true",
",",
"errorMessage",
",",
"stac... | Reply used in error cases. set the response header as null.
@param errorMessage the error message
@param stackTrace the stack trace
@param statusCode the status code
@param statusCodeInt the status code int | [
"Reply",
"used",
"in",
"error",
"cases",
".",
"set",
"the",
"response",
"header",
"as",
"null",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/OperationWorker.java#L494-L500 | train |
eBay/parallec | src/main/java/io/parallec/core/util/PcHttpUtils.java | PcHttpUtils.addHeaders | public static void addHeaders(BoundRequestBuilder builder,
Map<String, String> headerMap) {
for (Entry<String, String> entry : headerMap.entrySet()) {
String name = entry.getKey();
String value = entry.getValue();
builder.addHeader(name, value);
}
} | java | public static void addHeaders(BoundRequestBuilder builder,
Map<String, String> headerMap) {
for (Entry<String, String> entry : headerMap.entrySet()) {
String name = entry.getKey();
String value = entry.getValue();
builder.addHeader(name, value);
}
} | [
"public",
"static",
"void",
"addHeaders",
"(",
"BoundRequestBuilder",
"builder",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headerMap",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"headerMap",
".",
"entrySet",
"(",
... | Adds the headers.
@param builder
the builder
@param headerMap
the header map | [
"Adds",
"the",
"headers",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcHttpUtils.java#L104-L112 | train |
eBay/parallec | src/main/java/io/parallec/core/ParallelTask.java | ParallelTask.cancelOnTargetHosts | @SuppressWarnings("deprecation")
public boolean cancelOnTargetHosts(List<String> targetHosts) {
boolean success = false;
try {
switch (state) {
case IN_PROGRESS:
if (executionManager != null
&& !executionManager.isTerminated()) {
... | java | @SuppressWarnings("deprecation")
public boolean cancelOnTargetHosts(List<String> targetHosts) {
boolean success = false;
try {
switch (state) {
case IN_PROGRESS:
if (executionManager != null
&& !executionManager.isTerminated()) {
... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"boolean",
"cancelOnTargetHosts",
"(",
"List",
"<",
"String",
">",
"targetHosts",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"try",
"{",
"switch",
"(",
"state",
")",
"{",
"case",
"IN_PRO... | Cancel on target hosts.
@param targetHosts
the target hosts
@return true, if successful | [
"Cancel",
"on",
"target",
"hosts",
"."
] | 1b4f1628f34fedfb06b24c33a5372d64d3df0952 | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTask.java#L275-L315 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.