id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
13,700 | OpenTSDB/opentsdb | src/uid/UniqueId.java | UniqueId.getTagsFromTSUID | public static List<byte[]> getTagsFromTSUID(final String tsuid) {
if (tsuid == null || tsuid.isEmpty()) {
throw new IllegalArgumentException("Missing TSUID");
}
if (tsuid.length() <= TSDB.metrics_width() * 2) {
throw new IllegalArgumentException(
"TSUID is too short, may be missing tag... | java | public static List<byte[]> getTagsFromTSUID(final String tsuid) {
if (tsuid == null || tsuid.isEmpty()) {
throw new IllegalArgumentException("Missing TSUID");
}
if (tsuid.length() <= TSDB.metrics_width() * 2) {
throw new IllegalArgumentException(
"TSUID is too short, may be missing tag... | [
"public",
"static",
"List",
"<",
"byte",
"[",
"]",
">",
"getTagsFromTSUID",
"(",
"final",
"String",
"tsuid",
")",
"{",
"if",
"(",
"tsuid",
"==",
"null",
"||",
"tsuid",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
... | Extracts a list of tagks and tagvs as individual values in a list
@param tsuid The tsuid to parse
@return A list of tagk/tagv UIDs alternating with tagk, tagv, tagk, tagv
@throws IllegalArgumentException if the TSUID is malformed
@since 2.1 | [
"Extracts",
"a",
"list",
"of",
"tagks",
"and",
"tagvs",
"as",
"individual",
"values",
"in",
"a",
"list"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/uid/UniqueId.java#L1605-L1629 |
13,701 | OpenTSDB/opentsdb | src/uid/UniqueId.java | UniqueId.getUsedUIDs | public static Deferred<Map<String, Long>> getUsedUIDs(final TSDB tsdb,
final byte[][] kinds) {
/**
* Returns a map with 0 if the max ID row hasn't been initialized yet,
* otherwise the map has actual data
*/
final class GetCB implements Callback<Map<String, Long>,
ArrayList<Key... | java | public static Deferred<Map<String, Long>> getUsedUIDs(final TSDB tsdb,
final byte[][] kinds) {
/**
* Returns a map with 0 if the max ID row hasn't been initialized yet,
* otherwise the map has actual data
*/
final class GetCB implements Callback<Map<String, Long>,
ArrayList<Key... | [
"public",
"static",
"Deferred",
"<",
"Map",
"<",
"String",
",",
"Long",
">",
">",
"getUsedUIDs",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"byte",
"[",
"]",
"[",
"]",
"kinds",
")",
"{",
"/**\n * Returns a map with 0 if the max ID row hasn't been initialized ... | Returns a map of max UIDs from storage for the given list of UID types
@param tsdb The TSDB to which we belong
@param kinds A list of qualifiers to fetch
@return A map with the "kind" as the key and the maximum assigned UID as
the value
@since 2.0 | [
"Returns",
"a",
"map",
"of",
"max",
"UIDs",
"from",
"storage",
"for",
"the",
"given",
"list",
"of",
"UID",
"types"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/uid/UniqueId.java#L1700-L1746 |
13,702 | OpenTSDB/opentsdb | src/uid/UniqueId.java | UniqueId.preloadUidCache | public static void preloadUidCache(final TSDB tsdb,
final ByteMap<UniqueId> uid_cache_map) throws HBaseException {
int max_results = tsdb.getConfig().getInt(
"tsd.core.preload_uid_cache.max_entries");
LOG.info("Preloading uid cache with max_results=" + max_results);
if (max_results <= 0) {
... | java | public static void preloadUidCache(final TSDB tsdb,
final ByteMap<UniqueId> uid_cache_map) throws HBaseException {
int max_results = tsdb.getConfig().getInt(
"tsd.core.preload_uid_cache.max_entries");
LOG.info("Preloading uid cache with max_results=" + max_results);
if (max_results <= 0) {
... | [
"public",
"static",
"void",
"preloadUidCache",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"ByteMap",
"<",
"UniqueId",
">",
"uid_cache_map",
")",
"throws",
"HBaseException",
"{",
"int",
"max_results",
"=",
"tsdb",
".",
"getConfig",
"(",
")",
".",
"getInt",
"... | Pre-load UID caches, scanning up to "tsd.core.preload_uid_cache.max_entries"
rows from the UID table.
@param tsdb The TSDB to use
@param uid_cache_map A map of {@link UniqueId} objects keyed on the kind.
@throws HBaseException Passes any HBaseException from HBase scanner.
@throws RuntimeException Wraps any non HBaseExc... | [
"Pre",
"-",
"load",
"UID",
"caches",
"scanning",
"up",
"to",
"tsd",
".",
"core",
".",
"preload_uid_cache",
".",
"max_entries",
"rows",
"from",
"the",
"UID",
"table",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/uid/UniqueId.java#L1757-L1813 |
13,703 | OpenTSDB/opentsdb | src/tsd/TreeRpc.java | TreeRpc.execute | @Override
public void execute(TSDB tsdb, HttpQuery query) throws IOException {
// the uri will be /api/vX/tree/? or /api/tree/?
final String[] uri = query.explodeAPIPath();
final String endpoint = uri.length > 1 ? uri[1] : "";
try {
if (endpoint.isEmpty()) {
handleTree(tsdb, query)... | java | @Override
public void execute(TSDB tsdb, HttpQuery query) throws IOException {
// the uri will be /api/vX/tree/? or /api/tree/?
final String[] uri = query.explodeAPIPath();
final String endpoint = uri.length > 1 ? uri[1] : "";
try {
if (endpoint.isEmpty()) {
handleTree(tsdb, query)... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
"TSDB",
"tsdb",
",",
"HttpQuery",
"query",
")",
"throws",
"IOException",
"{",
"// the uri will be /api/vX/tree/? or /api/tree/?",
"final",
"String",
"[",
"]",
"uri",
"=",
"query",
".",
"explodeAPIPath",
"(",
")",
... | Routes the request to the proper handler
@param tsdb The TSDB to which we belong
@param query The HTTP query to use for parsing and responding | [
"Routes",
"the",
"request",
"to",
"the",
"proper",
"handler"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/TreeRpc.java#L53-L83 |
13,704 | OpenTSDB/opentsdb | src/tsd/TreeRpc.java | TreeRpc.handleBranch | private void handleBranch(TSDB tsdb, HttpQuery query) {
if (query.getAPIMethod() != HttpMethod.GET) {
throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
"Unsupported HTTP request method");
}
try {
final int tree_id = parseTreeId(query, false);
final String branch_h... | java | private void handleBranch(TSDB tsdb, HttpQuery query) {
if (query.getAPIMethod() != HttpMethod.GET) {
throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
"Unsupported HTTP request method");
}
try {
final int tree_id = parseTreeId(query, false);
final String branch_h... | [
"private",
"void",
"handleBranch",
"(",
"TSDB",
"tsdb",
",",
"HttpQuery",
"query",
")",
"{",
"if",
"(",
"query",
".",
"getAPIMethod",
"(",
")",
"!=",
"HttpMethod",
".",
"GET",
")",
"{",
"throw",
"new",
"BadRequestException",
"(",
"HttpResponseStatus",
".",
... | Attempts to retrieve a single branch and return it to the user. If the
requested branch doesn't exist, it returns a 404.
@param tsdb The TSDB to which we belong
@param query The HTTP query to work with
@throws BadRequestException if the request was invalid. | [
"Attempts",
"to",
"retrieve",
"a",
"single",
"branch",
"and",
"return",
"it",
"to",
"the",
"user",
".",
"If",
"the",
"requested",
"branch",
"doesn",
"t",
"exist",
"it",
"returns",
"a",
"404",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/TreeRpc.java#L210-L252 |
13,705 | OpenTSDB/opentsdb | src/tsd/TreeRpc.java | TreeRpc.handleRule | private void handleRule(TSDB tsdb, HttpQuery query) {
final TreeRule rule;
if (query.hasContent()) {
rule = query.serializer().parseTreeRuleV1();
} else {
rule = parseRule(query);
}
try {
// no matter what, we'll need a tree to work with, so make sure it exists
Tr... | java | private void handleRule(TSDB tsdb, HttpQuery query) {
final TreeRule rule;
if (query.hasContent()) {
rule = query.serializer().parseTreeRuleV1();
} else {
rule = parseRule(query);
}
try {
// no matter what, we'll need a tree to work with, so make sure it exists
Tr... | [
"private",
"void",
"handleRule",
"(",
"TSDB",
"tsdb",
",",
"HttpQuery",
"query",
")",
"{",
"final",
"TreeRule",
"rule",
";",
"if",
"(",
"query",
".",
"hasContent",
"(",
")",
")",
"{",
"rule",
"=",
"query",
".",
"serializer",
"(",
")",
".",
"parseTreeRu... | Handles the CRUD calls for a single rule, enabling adding, editing or
deleting the rule
@param tsdb The TSDB to which we belong
@param query The HTTP query to work with
@throws BadRequestException if the request was invalid. | [
"Handles",
"the",
"CRUD",
"calls",
"for",
"a",
"single",
"rule",
"enabling",
"adding",
"editing",
"or",
"deleting",
"the",
"rule"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/TreeRpc.java#L261-L329 |
13,706 | OpenTSDB/opentsdb | src/tsd/TreeRpc.java | TreeRpc.handleRules | private void handleRules(TSDB tsdb, HttpQuery query) {
int tree_id = 0;
List<TreeRule> rules = null;
if (query.hasContent()) {
rules = query.serializer().parseTreeRulesV1();
if (rules == null || rules.isEmpty()) {
throw new BadRequestException("Missing tree rules");
}
... | java | private void handleRules(TSDB tsdb, HttpQuery query) {
int tree_id = 0;
List<TreeRule> rules = null;
if (query.hasContent()) {
rules = query.serializer().parseTreeRulesV1();
if (rules == null || rules.isEmpty()) {
throw new BadRequestException("Missing tree rules");
}
... | [
"private",
"void",
"handleRules",
"(",
"TSDB",
"tsdb",
",",
"HttpQuery",
"query",
")",
"{",
"int",
"tree_id",
"=",
"0",
";",
"List",
"<",
"TreeRule",
">",
"rules",
"=",
"null",
";",
"if",
"(",
"query",
".",
"hasContent",
"(",
")",
")",
"{",
"rules",
... | Handles requests to replace or delete all of the rules in the given tree.
It's an efficiency helper for cases where folks don't want to make a single
call per rule when updating many rules at once.
@param tsdb The TSDB to which we belong
@param query The HTTP query to work with
@throws BadRequestException if the reques... | [
"Handles",
"requests",
"to",
"replace",
"or",
"delete",
"all",
"of",
"the",
"rules",
"in",
"the",
"given",
"tree",
".",
"It",
"s",
"an",
"efficiency",
"helper",
"for",
"cases",
"where",
"folks",
"don",
"t",
"want",
"to",
"make",
"a",
"single",
"call",
... | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/TreeRpc.java#L339-L401 |
13,707 | OpenTSDB/opentsdb | src/tsd/TreeRpc.java | TreeRpc.handleCollisionNotMatched | private void handleCollisionNotMatched(TSDB tsdb, HttpQuery query, final boolean for_collisions) {
final Map<String, Object> map;
if (query.hasContent()) {
map = query.serializer().parseTreeTSUIDsListV1();
} else {
map = parseTSUIDsList(query);
}
final Integer tree_id = (Integer) ma... | java | private void handleCollisionNotMatched(TSDB tsdb, HttpQuery query, final boolean for_collisions) {
final Map<String, Object> map;
if (query.hasContent()) {
map = query.serializer().parseTreeTSUIDsListV1();
} else {
map = parseTSUIDsList(query);
}
final Integer tree_id = (Integer) ma... | [
"private",
"void",
"handleCollisionNotMatched",
"(",
"TSDB",
"tsdb",
",",
"HttpQuery",
"query",
",",
"final",
"boolean",
"for_collisions",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
";",
"if",
"(",
"query",
".",
"hasContent",
"(",
... | Handles requests to fetch collisions or not-matched entries for the given
tree. To cut down on code, this method uses a flag to determine if we want
collisions or not-matched entries, since they both have the same data types.
@param tsdb The TSDB to which we belong
@param query The HTTP query to work with
@param for_co... | [
"Handles",
"requests",
"to",
"fetch",
"collisions",
"or",
"not",
"-",
"matched",
"entries",
"for",
"the",
"given",
"tree",
".",
"To",
"cut",
"down",
"on",
"code",
"this",
"method",
"uses",
"a",
"flag",
"to",
"determine",
"if",
"we",
"want",
"collisions",
... | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/TreeRpc.java#L516-L565 |
13,708 | OpenTSDB/opentsdb | src/tsd/TreeRpc.java | TreeRpc.parseTree | private Tree parseTree(HttpQuery query) {
final Tree tree = new Tree(parseTreeId(query, false));
if (query.hasQueryStringParam("name")) {
tree.setName(query.getQueryStringParam("name"));
}
if (query.hasQueryStringParam("description")) {
tree.setDescription(query.getQueryStringParam("descript... | java | private Tree parseTree(HttpQuery query) {
final Tree tree = new Tree(parseTreeId(query, false));
if (query.hasQueryStringParam("name")) {
tree.setName(query.getQueryStringParam("name"));
}
if (query.hasQueryStringParam("description")) {
tree.setDescription(query.getQueryStringParam("descript... | [
"private",
"Tree",
"parseTree",
"(",
"HttpQuery",
"query",
")",
"{",
"final",
"Tree",
"tree",
"=",
"new",
"Tree",
"(",
"parseTreeId",
"(",
"query",
",",
"false",
")",
")",
";",
"if",
"(",
"query",
".",
"hasQueryStringParam",
"(",
"\"name\"",
")",
")",
... | Parses query string parameters into a blank tree object. Used for updating
tree meta data.
@param query The HTTP query to work with
@return A tree object filled in with changes
@throws BadRequestException if some of the data was invalid | [
"Parses",
"query",
"string",
"parameters",
"into",
"a",
"blank",
"tree",
"object",
".",
"Used",
"for",
"updating",
"tree",
"meta",
"data",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/TreeRpc.java#L574-L610 |
13,709 | OpenTSDB/opentsdb | src/tsd/TreeRpc.java | TreeRpc.parseRule | private TreeRule parseRule(HttpQuery query) {
final TreeRule rule = new TreeRule(parseTreeId(query, true));
if (query.hasQueryStringParam("type")) {
try {
rule.setType(TreeRule.stringToType(query.getQueryStringParam("type")));
} catch (IllegalArgumentException e) {
throw new Bad... | java | private TreeRule parseRule(HttpQuery query) {
final TreeRule rule = new TreeRule(parseTreeId(query, true));
if (query.hasQueryStringParam("type")) {
try {
rule.setType(TreeRule.stringToType(query.getQueryStringParam("type")));
} catch (IllegalArgumentException e) {
throw new Bad... | [
"private",
"TreeRule",
"parseRule",
"(",
"HttpQuery",
"query",
")",
"{",
"final",
"TreeRule",
"rule",
"=",
"new",
"TreeRule",
"(",
"parseTreeId",
"(",
"query",
",",
"true",
")",
")",
";",
"if",
"(",
"query",
".",
"hasQueryStringParam",
"(",
"\"type\"",
")"... | Parses query string parameters into a blank tree rule object. Used for
updating individual rules
@param query The HTTP query to work with
@return A rule object filled in with changes
@throws BadRequestException if some of the data was invalid | [
"Parses",
"query",
"string",
"parameters",
"into",
"a",
"blank",
"tree",
"rule",
"object",
".",
"Used",
"for",
"updating",
"individual",
"rules"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/TreeRpc.java#L619-L683 |
13,710 | OpenTSDB/opentsdb | src/tsd/TreeRpc.java | TreeRpc.parseTreeId | private int parseTreeId(HttpQuery query, final boolean required) {
try{
if (required) {
return Integer.parseInt(query.getRequiredQueryStringParam("treeid"));
} else {
if (query.hasQueryStringParam("treeid")) {
return Integer.parseInt(query.getQueryStringParam("treeid"));
... | java | private int parseTreeId(HttpQuery query, final boolean required) {
try{
if (required) {
return Integer.parseInt(query.getRequiredQueryStringParam("treeid"));
} else {
if (query.hasQueryStringParam("treeid")) {
return Integer.parseInt(query.getQueryStringParam("treeid"));
... | [
"private",
"int",
"parseTreeId",
"(",
"HttpQuery",
"query",
",",
"final",
"boolean",
"required",
")",
"{",
"try",
"{",
"if",
"(",
"required",
")",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"query",
".",
"getRequiredQueryStringParam",
"(",
"\"treeid\"",
... | Parses the tree ID from a query
Used often so it's been broken into it's own method
@param query The HTTP query to work with
@param required Whether or not the ID is required for the given call
@return The tree ID or 0 if not provided | [
"Parses",
"the",
"tree",
"ID",
"from",
"a",
"query",
"Used",
"often",
"so",
"it",
"s",
"been",
"broken",
"into",
"it",
"s",
"own",
"method"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/TreeRpc.java#L692-L706 |
13,711 | OpenTSDB/opentsdb | src/tsd/TreeRpc.java | TreeRpc.parseTSUIDsList | private Map<String, Object> parseTSUIDsList(HttpQuery query) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("treeId", parseTreeId(query, true));
final String tsquery = query.getQueryStringParam("tsuids");
if (tsquery != null) {
final String[] tsuids = tsquery.spl... | java | private Map<String, Object> parseTSUIDsList(HttpQuery query) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("treeId", parseTreeId(query, true));
final String tsquery = query.getQueryStringParam("tsuids");
if (tsquery != null) {
final String[] tsuids = tsquery.spl... | [
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"parseTSUIDsList",
"(",
"HttpQuery",
"query",
")",
"{",
"final",
"HashMap",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"map",
... | Used to parse a list of TSUIDs from the query string for collision or not
matched requests. TSUIDs must be comma separated.
@param query The HTTP query to work with
@return A map with a list of tsuids. If found, the tsuids array will be
under the "tsuid" key. The map is necessary for compatability with POJO
parsing. | [
"Used",
"to",
"parse",
"a",
"list",
"of",
"TSUIDs",
"from",
"the",
"query",
"string",
"for",
"collision",
"or",
"not",
"matched",
"requests",
".",
"TSUIDs",
"must",
"be",
"comma",
"separated",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/TreeRpc.java#L716-L727 |
13,712 | OpenTSDB/opentsdb | src/graph/Plot.java | Plot.setParams | public void setParams(final Map<String, String> params) {
// check "format y" and "format y2"
String[] y_format_keys = {"format y", "format y2"};
for(String k : y_format_keys){
if(params.containsKey(k)){
params.put(k, URLDecoder.decode(params.get(k)));
}
}
this.params = params;
... | java | public void setParams(final Map<String, String> params) {
// check "format y" and "format y2"
String[] y_format_keys = {"format y", "format y2"};
for(String k : y_format_keys){
if(params.containsKey(k)){
params.put(k, URLDecoder.decode(params.get(k)));
}
}
this.params = params;
... | [
"public",
"void",
"setParams",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"// check \"format y\" and \"format y2\"",
"String",
"[",
"]",
"y_format_keys",
"=",
"{",
"\"format y\"",
",",
"\"format y2\"",
"}",
";",
"for",
"(",
"St... | Sets the global parameters for this plot.
@param params Each entry is a Gnuplot setting that will be written as-is
in the Gnuplot script file: {@code set KEY VALUE}.
When the value is {@code null} the script will instead contain
{@code unset KEY}.
<p>
Special parameters with a special meaning (since OpenTSDB 1.1):
<ul>... | [
"Sets",
"the",
"global",
"parameters",
"for",
"this",
"plot",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/graph/Plot.java#L137-L146 |
13,713 | OpenTSDB/opentsdb | src/graph/Plot.java | Plot.add | public void add(final DataPoints datapoints,
final String options) {
// Technically, we could check the number of data points in the
// datapoints argument in order to do something when there are none, but
// this is potentially expensive with a SpanGroup since it requires
// iterating... | java | public void add(final DataPoints datapoints,
final String options) {
// Technically, we could check the number of data points in the
// datapoints argument in order to do something when there are none, but
// this is potentially expensive with a SpanGroup since it requires
// iterating... | [
"public",
"void",
"add",
"(",
"final",
"DataPoints",
"datapoints",
",",
"final",
"String",
"options",
")",
"{",
"// Technically, we could check the number of data points in the",
"// datapoints argument in order to do something when there are none, but",
"// this is potentially expensi... | Adds some data points to this plot.
@param datapoints The data points to plot.
@param options The options to apply to this specific series. | [
"Adds",
"some",
"data",
"points",
"to",
"this",
"plot",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/graph/Plot.java#L175-L185 |
13,714 | OpenTSDB/opentsdb | src/graph/Plot.java | Plot.dumpToFiles | public int dumpToFiles(final String basepath) throws IOException {
int npoints = 0;
final int nseries = datapoints.size();
final String datafiles[] = nseries > 0 ? new String[nseries] : null;
FileSystem.checkDirectory(new File(basepath).getParent(),
Const.MUST_BE_WRITEABLE, Const.CREATE_IF_NEEDE... | java | public int dumpToFiles(final String basepath) throws IOException {
int npoints = 0;
final int nseries = datapoints.size();
final String datafiles[] = nseries > 0 ? new String[nseries] : null;
FileSystem.checkDirectory(new File(basepath).getParent(),
Const.MUST_BE_WRITEABLE, Const.CREATE_IF_NEEDE... | [
"public",
"int",
"dumpToFiles",
"(",
"final",
"String",
"basepath",
")",
"throws",
"IOException",
"{",
"int",
"npoints",
"=",
"0",
";",
"final",
"int",
"nseries",
"=",
"datapoints",
".",
"size",
"(",
")",
";",
"final",
"String",
"datafiles",
"[",
"]",
"=... | Generates the Gnuplot script and data files.
@param basepath The base path to use. A number of new files will be
created and their names will all start with this string.
@return The number of data points sent to Gnuplot. This can be less
than the number of data points involved in the query due to things like
aggregat... | [
"Generates",
"the",
"Gnuplot",
"script",
"and",
"data",
"files",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/graph/Plot.java#L204-L257 |
13,715 | OpenTSDB/opentsdb | src/utils/Exceptions.java | Exceptions.getCause | public static Throwable getCause(final DeferredGroupException e) {
Throwable ex = e;
while (ex.getClass().equals(DeferredGroupException.class)) {
if (ex.getCause() == null) {
break;
} else {
ex = ex.getCause();
}
}
return ex;
} | java | public static Throwable getCause(final DeferredGroupException e) {
Throwable ex = e;
while (ex.getClass().equals(DeferredGroupException.class)) {
if (ex.getCause() == null) {
break;
} else {
ex = ex.getCause();
}
}
return ex;
} | [
"public",
"static",
"Throwable",
"getCause",
"(",
"final",
"DeferredGroupException",
"e",
")",
"{",
"Throwable",
"ex",
"=",
"e",
";",
"while",
"(",
"ex",
".",
"getClass",
"(",
")",
".",
"equals",
"(",
"DeferredGroupException",
".",
"class",
")",
")",
"{",
... | Iterates through the stack trace, looking for the actual cause of the
deferred group exception. These traces can be huge and truncated in the
logs so it's really useful to be able to spit out the source.
@param e A DeferredGroupException to parse
@return The root cause of the exception if found. | [
"Iterates",
"through",
"the",
"stack",
"trace",
"looking",
"for",
"the",
"actual",
"cause",
"of",
"the",
"deferred",
"group",
"exception",
".",
"These",
"traces",
"can",
"be",
"huge",
"and",
"truncated",
"in",
"the",
"logs",
"so",
"it",
"s",
"really",
"use... | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/Exceptions.java#L30-L40 |
13,716 | OpenTSDB/opentsdb | src/core/ByteBufferList.java | ByteBufferList.add | public void add(final byte[] buf, final int offset, final int len) {
segments.add(new BufferSegment(buf, offset, len));
total_length += len;
} | java | public void add(final byte[] buf, final int offset, final int len) {
segments.add(new BufferSegment(buf, offset, len));
total_length += len;
} | [
"public",
"void",
"add",
"(",
"final",
"byte",
"[",
"]",
"buf",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
")",
"{",
"segments",
".",
"add",
"(",
"new",
"BufferSegment",
"(",
"buf",
",",
"offset",
",",
"len",
")",
")",
";",
"total_l... | Add a segment to the buffer list.
@param buf byte array
@param offset offset into buf
@param len length of segment, starting at offset | [
"Add",
"a",
"segment",
"to",
"the",
"buffer",
"list",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/ByteBufferList.java#L56-L59 |
13,717 | OpenTSDB/opentsdb | src/core/ByteBufferList.java | ByteBufferList.getLastSegment | public byte[] getLastSegment() {
if (segments.isEmpty()) {
return null;
}
BufferSegment seg = segments.get(segments.size() - 1);
return Arrays.copyOfRange(seg.buf, seg.offset, seg.offset + seg.len);
} | java | public byte[] getLastSegment() {
if (segments.isEmpty()) {
return null;
}
BufferSegment seg = segments.get(segments.size() - 1);
return Arrays.copyOfRange(seg.buf, seg.offset, seg.offset + seg.len);
} | [
"public",
"byte",
"[",
"]",
"getLastSegment",
"(",
")",
"{",
"if",
"(",
"segments",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"BufferSegment",
"seg",
"=",
"segments",
".",
"get",
"(",
"segments",
".",
"size",
"(",
")",
"-",
"1... | Get the most recently added segment.
@return byte array, a copy of the most recently added segment | [
"Get",
"the",
"most",
"recently",
"added",
"segment",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/ByteBufferList.java#L66-L72 |
13,718 | OpenTSDB/opentsdb | src/utils/ByteArrayPair.java | ByteArrayPair.compareTo | public int compareTo(ByteArrayPair a) {
final int key_compare = Bytes.memcmpMaybeNull(this.key, a.key);
if (key_compare == 0) {
return Bytes.memcmpMaybeNull(this.value, a.value);
}
return key_compare;
} | java | public int compareTo(ByteArrayPair a) {
final int key_compare = Bytes.memcmpMaybeNull(this.key, a.key);
if (key_compare == 0) {
return Bytes.memcmpMaybeNull(this.value, a.value);
}
return key_compare;
} | [
"public",
"int",
"compareTo",
"(",
"ByteArrayPair",
"a",
")",
"{",
"final",
"int",
"key_compare",
"=",
"Bytes",
".",
"memcmpMaybeNull",
"(",
"this",
".",
"key",
",",
"a",
".",
"key",
")",
";",
"if",
"(",
"key_compare",
"==",
"0",
")",
"{",
"return",
... | Sorts on the key first then on the value. Nulls are allowed and are ordered
first.
@param a The value to compare against. | [
"Sorts",
"on",
"the",
"key",
"first",
"then",
"on",
"the",
"value",
".",
"Nulls",
"are",
"allowed",
"and",
"are",
"ordered",
"first",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/ByteArrayPair.java#L45-L51 |
13,719 | OpenTSDB/opentsdb | src/core/AggregationIterator.java | AggregationIterator.hasNextValue | private boolean hasNextValue(boolean update_pos) {
final int size = iterators.length;
for (int i = pos + 1; i < size; i++) {
if (timestamps[i] != 0) {
//LOG.debug("hasNextValue -> true #" + i);
if (update_pos) {
pos = i;
}
return true;
}
}
//LOG.debu... | java | private boolean hasNextValue(boolean update_pos) {
final int size = iterators.length;
for (int i = pos + 1; i < size; i++) {
if (timestamps[i] != 0) {
//LOG.debug("hasNextValue -> true #" + i);
if (update_pos) {
pos = i;
}
return true;
}
}
//LOG.debu... | [
"private",
"boolean",
"hasNextValue",
"(",
"boolean",
"update_pos",
")",
"{",
"final",
"int",
"size",
"=",
"iterators",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"pos",
"+",
"1",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"if",
"(",
... | Returns whether or not there are more values to aggregate.
@param update_pos Whether or not to also move the internal pointer
{@link #pos} to the index of the next value to aggregate.
@return true if there are more values to aggregate, false otherwise. | [
"Returns",
"whether",
"or",
"not",
"there",
"are",
"more",
"values",
"to",
"aggregate",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/AggregationIterator.java#L667-L680 |
13,720 | OpenTSDB/opentsdb | src/core/Span.java | Span.addRow | protected void addRow(final KeyValue row) {
long last_ts = 0;
if (rows.size() != 0) {
// Verify that we have the same metric id and tags.
final byte[] key = row.key();
final iRowSeq last = rows.get(rows.size() - 1);
final short metric_width = tsdb.metrics.width();
final short tags_... | java | protected void addRow(final KeyValue row) {
long last_ts = 0;
if (rows.size() != 0) {
// Verify that we have the same metric id and tags.
final byte[] key = row.key();
final iRowSeq last = rows.get(rows.size() - 1);
final short metric_width = tsdb.metrics.width();
final short tags_... | [
"protected",
"void",
"addRow",
"(",
"final",
"KeyValue",
"row",
")",
"{",
"long",
"last_ts",
"=",
"0",
";",
"if",
"(",
"rows",
".",
"size",
"(",
")",
"!=",
"0",
")",
"{",
"// Verify that we have the same metric id and tags.",
"final",
"byte",
"[",
"]",
"ke... | Adds a compacted row to the span, merging with an existing RowSeq or
creating a new one if necessary.
@param row The compacted row to add to this span.
@throws IllegalArgumentException if the argument and this span are for
two different time series. | [
"Adds",
"a",
"compacted",
"row",
"to",
"the",
"span",
"merging",
"with",
"an",
"existing",
"RowSeq",
"or",
"creating",
"a",
"new",
"one",
"if",
"necessary",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Span.java#L177-L220 |
13,721 | OpenTSDB/opentsdb | src/core/Span.java | Span.seekRow | private int seekRow(final long timestamp) {
checkRowOrder();
int row_index = 0;
iRowSeq row = null;
final int nrows = rows.size();
for (int i = 0; i < nrows; i++) {
row = rows.get(i);
final int sz = row.size();
if (sz < 1) {
row_index++;
} else if (row.timestamp(sz - ... | java | private int seekRow(final long timestamp) {
checkRowOrder();
int row_index = 0;
iRowSeq row = null;
final int nrows = rows.size();
for (int i = 0; i < nrows; i++) {
row = rows.get(i);
final int sz = row.size();
if (sz < 1) {
row_index++;
} else if (row.timestamp(sz - ... | [
"private",
"int",
"seekRow",
"(",
"final",
"long",
"timestamp",
")",
"{",
"checkRowOrder",
"(",
")",
";",
"int",
"row_index",
"=",
"0",
";",
"iRowSeq",
"row",
"=",
"null",
";",
"final",
"int",
"nrows",
"=",
"rows",
".",
"size",
"(",
")",
";",
"for",
... | Finds the index of the row in which the given timestamp should be.
@param timestamp A strictly positive 32-bit integer.
@return A strictly positive index in the {@code rows} array. | [
"Finds",
"the",
"index",
"of",
"the",
"row",
"in",
"which",
"the",
"given",
"timestamp",
"should",
"be",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Span.java#L360-L380 |
13,722 | OpenTSDB/opentsdb | src/core/Span.java | Span.spanIterator | Span.Iterator spanIterator() {
if (!sorted) {
Collections.sort(rows, new RowSeq.RowSeqComparator());
sorted = true;
}
return new Span.Iterator();
} | java | Span.Iterator spanIterator() {
if (!sorted) {
Collections.sort(rows, new RowSeq.RowSeqComparator());
sorted = true;
}
return new Span.Iterator();
} | [
"Span",
".",
"Iterator",
"spanIterator",
"(",
")",
"{",
"if",
"(",
"!",
"sorted",
")",
"{",
"Collections",
".",
"sort",
"(",
"rows",
",",
"new",
"RowSeq",
".",
"RowSeqComparator",
"(",
")",
")",
";",
"sorted",
"=",
"true",
";",
"}",
"return",
"new",
... | Package private iterator method to access it as a Span.Iterator. | [
"Package",
"private",
"iterator",
"method",
"to",
"access",
"it",
"as",
"a",
"Span",
".",
"Iterator",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Span.java#L395-L401 |
13,723 | OpenTSDB/opentsdb | src/core/Span.java | Span.downsampler | Downsampler downsampler(final long start_time,
final long end_time,
final long interval_ms,
final Aggregator downsampler,
final FillPolicy fill_policy) {
if (FillPolicy.NONE == fill_policy) {
// The default... | java | Downsampler downsampler(final long start_time,
final long end_time,
final long interval_ms,
final Aggregator downsampler,
final FillPolicy fill_policy) {
if (FillPolicy.NONE == fill_policy) {
// The default... | [
"Downsampler",
"downsampler",
"(",
"final",
"long",
"start_time",
",",
"final",
"long",
"end_time",
",",
"final",
"long",
"interval_ms",
",",
"final",
"Aggregator",
"downsampler",
",",
"final",
"FillPolicy",
"fill_policy",
")",
"{",
"if",
"(",
"FillPolicy",
".",... | Package private iterator method to access data while downsampling with the
option to force interpolation.
@param start_time The time in milliseconds at which the data begins.
@param end_time The time in milliseconds at which the data ends.
@param interval_ms The interval in milli seconds wanted between each data
point.... | [
"Package",
"private",
"iterator",
"method",
"to",
"access",
"data",
"while",
"downsampling",
"with",
"the",
"option",
"to",
"force",
"interpolation",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Span.java#L493-L508 |
13,724 | OpenTSDB/opentsdb | src/tools/MetaPurge.java | MetaPurge.run | public void run() {
long purged_columns;
try {
purged_columns = purgeUIDMeta().joinUninterruptibly();
LOG.info("Thread [" + thread_id + "] finished. Purged [" +
purged_columns + "] UIDMeta columns from storage");
purged_columns = purgeTSMeta().joinUninterruptibly();
LOG... | java | public void run() {
long purged_columns;
try {
purged_columns = purgeUIDMeta().joinUninterruptibly();
LOG.info("Thread [" + thread_id + "] finished. Purged [" +
purged_columns + "] UIDMeta columns from storage");
purged_columns = purgeTSMeta().joinUninterruptibly();
LOG... | [
"public",
"void",
"run",
"(",
")",
"{",
"long",
"purged_columns",
";",
"try",
"{",
"purged_columns",
"=",
"purgeUIDMeta",
"(",
")",
".",
"joinUninterruptibly",
"(",
")",
";",
"LOG",
".",
"info",
"(",
"\"Thread [\"",
"+",
"thread_id",
"+",
"\"] finished. Purg... | Loops through the entire tsdb-uid table, then the meta data table and exits
when complete. | [
"Loops",
"through",
"the",
"entire",
"tsdb",
"-",
"uid",
"table",
"then",
"the",
"meta",
"data",
"table",
"and",
"exits",
"when",
"complete",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/MetaPurge.java#L81-L95 |
13,725 | OpenTSDB/opentsdb | src/tools/MetaPurge.java | MetaPurge.purgeUIDMeta | public Deferred<Long> purgeUIDMeta() {
// a list to store all pending deletes so we don't exit before they've
// completed
final ArrayList<Deferred<Object>> delete_calls =
new ArrayList<Deferred<Object>>();
final Deferred<Long> result = new Deferred<Long>();
/**
* Scanner call... | java | public Deferred<Long> purgeUIDMeta() {
// a list to store all pending deletes so we don't exit before they've
// completed
final ArrayList<Deferred<Object>> delete_calls =
new ArrayList<Deferred<Object>>();
final Deferred<Long> result = new Deferred<Long>();
/**
* Scanner call... | [
"public",
"Deferred",
"<",
"Long",
">",
"purgeUIDMeta",
"(",
")",
"{",
"// a list to store all pending deletes so we don't exit before they've ",
"// completed",
"final",
"ArrayList",
"<",
"Deferred",
"<",
"Object",
">",
">",
"delete_calls",
"=",
"new",
"ArrayList",
"<"... | Scans the entire UID table and removes any UIDMeta objects found.
@return The total number of columns deleted | [
"Scans",
"the",
"entire",
"UID",
"table",
"and",
"removes",
"any",
"UIDMeta",
"objects",
"found",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/MetaPurge.java#L101-L199 |
13,726 | OpenTSDB/opentsdb | src/tools/MetaPurge.java | MetaPurge.getScanner | private Scanner getScanner(final byte[] table) throws HBaseException {
short metric_width = TSDB.metrics_width();
final byte[] start_row =
Arrays.copyOfRange(Bytes.fromLong(start_id), 8 - metric_width, 8);
final byte[] end_row =
Arrays.copyOfRange(Bytes.fromLong(end_id), 8 - metric_width, 8);
... | java | private Scanner getScanner(final byte[] table) throws HBaseException {
short metric_width = TSDB.metrics_width();
final byte[] start_row =
Arrays.copyOfRange(Bytes.fromLong(start_id), 8 - metric_width, 8);
final byte[] end_row =
Arrays.copyOfRange(Bytes.fromLong(end_id), 8 - metric_width, 8);
... | [
"private",
"Scanner",
"getScanner",
"(",
"final",
"byte",
"[",
"]",
"table",
")",
"throws",
"HBaseException",
"{",
"short",
"metric_width",
"=",
"TSDB",
".",
"metrics_width",
"(",
")",
";",
"final",
"byte",
"[",
"]",
"start_row",
"=",
"Arrays",
".",
"copyO... | Returns a scanner to run over the UID table starting at the given row
@return A scanner configured for the entire table
@throws HBaseException if something goes boom | [
"Returns",
"a",
"scanner",
"to",
"run",
"over",
"the",
"UID",
"table",
"starting",
"at",
"the",
"given",
"row"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/MetaPurge.java#L304-L315 |
13,727 | OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.mainUsage | public static void mainUsage(PrintStream ps) {
StringBuilder b = new StringBuilder("\nUsage: java -jar [opentsdb.jar] [command] [args]\nValid commands:")
.append("\n\ttsd: Starts a new TSDB instance")
.append("\n\tfsck: Searches for and optionally fixes corrupted data in a TSDB")
.append("\n\timpo... | java | public static void mainUsage(PrintStream ps) {
StringBuilder b = new StringBuilder("\nUsage: java -jar [opentsdb.jar] [command] [args]\nValid commands:")
.append("\n\ttsd: Starts a new TSDB instance")
.append("\n\tfsck: Searches for and optionally fixes corrupted data in a TSDB")
.append("\n\timpo... | [
"public",
"static",
"void",
"mainUsage",
"(",
"PrintStream",
"ps",
")",
"{",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
"\"\\nUsage: java -jar [opentsdb.jar] [command] [args]\\nValid commands:\"",
")",
".",
"append",
"(",
"\"\\n\\ttsd: Starts a new TSDB instance\... | Prints the main usage banner | [
"Prints",
"the",
"main",
"usage",
"banner"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L106-L118 |
13,728 | OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.main | public static void main(String[] args) {
log.info("Starting.");
log.info(BuildData.revisionString());
log.info(BuildData.buildString());
try {
System.in.close(); // Release a FD we don't need.
} catch (Exception e) {
log.warn("Failed to close stdin", e);
}
if(a... | java | public static void main(String[] args) {
log.info("Starting.");
log.info(BuildData.revisionString());
log.info(BuildData.buildString());
try {
System.in.close(); // Release a FD we don't need.
} catch (Exception e) {
log.warn("Failed to close stdin", e);
}
if(a... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"log",
".",
"info",
"(",
"\"Starting.\"",
")",
";",
"log",
".",
"info",
"(",
"BuildData",
".",
"revisionString",
"(",
")",
")",
";",
"log",
".",
"info",
"(",
"BuildData",
... | The OpenTSDB fat-jar main entry point
@param args See usage banner {@link OpenTSDBMain#mainUsage(PrintStream)} | [
"The",
"OpenTSDB",
"fat",
"-",
"jar",
"main",
"entry",
"point"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L125-L152 |
13,729 | OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.process | private static void process(String targetTool, String[] args) {
if("mkmetric".equals(targetTool)) {
shift(args);
}
if(!"tsd".equals(targetTool)) {
try {
COMMANDS.get(targetTool).getDeclaredMethod("main", String[].class).invoke(null, new Object[] {args});
} catch(Exception x) ... | java | private static void process(String targetTool, String[] args) {
if("mkmetric".equals(targetTool)) {
shift(args);
}
if(!"tsd".equals(targetTool)) {
try {
COMMANDS.get(targetTool).getDeclaredMethod("main", String[].class).invoke(null, new Object[] {args});
} catch(Exception x) ... | [
"private",
"static",
"void",
"process",
"(",
"String",
"targetTool",
",",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"\"mkmetric\"",
".",
"equals",
"(",
"targetTool",
")",
")",
"{",
"shift",
"(",
"args",
")",
";",
"}",
"if",
"(",
"!",
"\"tsd\""... | Executes the target tool
@param targetTool the name of the target tool to execute
@param args The command line arguments minus the tool name | [
"Executes",
"the",
"target",
"tool"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L159-L173 |
13,730 | OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.applyCommandLine | protected static void applyCommandLine(ConfigArgP cap, ArgP argp) {
// --config, --include-config, --help
if(argp.has("--help")) {
if(cap.hasNonOption("extended")) {
System.out.println(cap.getExtendedUsage("tsd extended usage:"));
} else {
System.out.println(cap.getDefaultUsage("tsd ... | java | protected static void applyCommandLine(ConfigArgP cap, ArgP argp) {
// --config, --include-config, --help
if(argp.has("--help")) {
if(cap.hasNonOption("extended")) {
System.out.println(cap.getExtendedUsage("tsd extended usage:"));
} else {
System.out.println(cap.getDefaultUsage("tsd ... | [
"protected",
"static",
"void",
"applyCommandLine",
"(",
"ConfigArgP",
"cap",
",",
"ArgP",
"argp",
")",
"{",
"// --config, --include-config, --help",
"if",
"(",
"argp",
".",
"has",
"(",
"\"--help\"",
")",
")",
"{",
"if",
"(",
"cap",
".",
"hasNonOption",
"(",
... | Applies and processes the pre-tsd command line
@param cap The main configuration wrapper
@param argp The preped command line argument handler | [
"Applies",
"and",
"processes",
"the",
"pre",
"-",
"tsd",
"command",
"line"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L181-L200 |
13,731 | OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.setJVMName | protected static void setJVMName(final int port, final String iface) {
final Properties p = getAgentProperties();
if(p!=null) {
final String ifc = (iface==null || iface.trim().isEmpty()) ? "" : (iface.trim() + ":");
final String name = "opentsdb[" + ifc + port + "]";
p.setProperty("sun.java.co... | java | protected static void setJVMName(final int port, final String iface) {
final Properties p = getAgentProperties();
if(p!=null) {
final String ifc = (iface==null || iface.trim().isEmpty()) ? "" : (iface.trim() + ":");
final String name = "opentsdb[" + ifc + port + "]";
p.setProperty("sun.java.co... | [
"protected",
"static",
"void",
"setJVMName",
"(",
"final",
"int",
"port",
",",
"final",
"String",
"iface",
")",
"{",
"final",
"Properties",
"p",
"=",
"getAgentProperties",
"(",
")",
";",
"if",
"(",
"p",
"!=",
"null",
")",
"{",
"final",
"String",
"ifc",
... | Attempts to set the vm agent property that identifies the vm's display name.
This is the name displayed for tools such as jconsole and jps when using auto-dicsovery.
When using a fat-jar, this provides a much more identifiable name
@param port The listening port
@param iface The bound interface | [
"Attempts",
"to",
"set",
"the",
"vm",
"agent",
"property",
"that",
"identifies",
"the",
"vm",
"s",
"display",
"name",
".",
"This",
"is",
"the",
"name",
"displayed",
"for",
"tools",
"such",
"as",
"jconsole",
"and",
"jps",
"when",
"using",
"auto",
"-",
"di... | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L449-L459 |
13,732 | OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.getAgentProperties | protected static Properties getAgentProperties() {
try {
Class<?> clazz = Class.forName("sun.misc.VMSupport");
Method m = clazz.getDeclaredMethod("getAgentProperties");
m.setAccessible(true);
Properties p = (Properties)m.invoke(null);
return p;
} catch (Throwable t) {
return ... | java | protected static Properties getAgentProperties() {
try {
Class<?> clazz = Class.forName("sun.misc.VMSupport");
Method m = clazz.getDeclaredMethod("getAgentProperties");
m.setAccessible(true);
Properties p = (Properties)m.invoke(null);
return p;
} catch (Throwable t) {
return ... | [
"protected",
"static",
"Properties",
"getAgentProperties",
"(",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"\"sun.misc.VMSupport\"",
")",
";",
"Method",
"m",
"=",
"clazz",
".",
"getDeclaredMethod",
"(",
"\"getAg... | Returns the agent properties
@return the agent properties or null if reflective call failed | [
"Returns",
"the",
"agent",
"properties"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L465-L475 |
13,733 | OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.insertPattern | protected static String insertPattern(final String logFileName, final String rollPattern) {
int index = logFileName.lastIndexOf('.');
if(index==-1) return logFileName + rollPattern;
return logFileName.substring(0, index) + rollPattern + logFileName.substring(index);
} | java | protected static String insertPattern(final String logFileName, final String rollPattern) {
int index = logFileName.lastIndexOf('.');
if(index==-1) return logFileName + rollPattern;
return logFileName.substring(0, index) + rollPattern + logFileName.substring(index);
} | [
"protected",
"static",
"String",
"insertPattern",
"(",
"final",
"String",
"logFileName",
",",
"final",
"String",
"rollPattern",
")",
"{",
"int",
"index",
"=",
"logFileName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
... | Merges the roll pattern name into the file name
@param logFileName The log file name
@param rollPattern The rolling log file appender roll pattern
@return the merged file pattern | [
"Merges",
"the",
"roll",
"pattern",
"name",
"into",
"the",
"file",
"name"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L526-L530 |
13,734 | OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.setLogbackExternal | protected static void setLogbackExternal(final String fileName) {
try {
final ObjectName logbackObjectName = new ObjectName("ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator");
ManagementFactory.getPlatformMBeanServer().invoke(logbackObjectName, "reloadByFileName", new... | java | protected static void setLogbackExternal(final String fileName) {
try {
final ObjectName logbackObjectName = new ObjectName("ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator");
ManagementFactory.getPlatformMBeanServer().invoke(logbackObjectName, "reloadByFileName", new... | [
"protected",
"static",
"void",
"setLogbackExternal",
"(",
"final",
"String",
"fileName",
")",
"{",
"try",
"{",
"final",
"ObjectName",
"logbackObjectName",
"=",
"new",
"ObjectName",
"(",
"\"ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator\"",
... | Reloads the logback configuration to an external file
@param fileName The logback configuration file | [
"Reloads",
"the",
"logback",
"configuration",
"to",
"an",
"external",
"file"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L537-L545 |
13,735 | OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.shift | private static String[] shift(String[] args) {
if(args==null || args.length==0 | args.length==1) return new String[0];
String[] newArgs = new String[args.length-1];
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
return newArgs;
} | java | private static String[] shift(String[] args) {
if(args==null || args.length==0 | args.length==1) return new String[0];
String[] newArgs = new String[args.length-1];
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
return newArgs;
} | [
"private",
"static",
"String",
"[",
"]",
"shift",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
"||",
"args",
".",
"length",
"==",
"0",
"|",
"args",
".",
"length",
"==",
"1",
")",
"return",
"new",
"String",
"[",
"0",... | Drops the first array item in the passed array.
If the passed array is null or empty, returns an empty array
@param args The array to shift
@return the shifted array | [
"Drops",
"the",
"first",
"array",
"item",
"in",
"the",
"passed",
"array",
".",
"If",
"the",
"passed",
"array",
"is",
"null",
"or",
"empty",
"returns",
"an",
"empty",
"array"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L554-L559 |
13,736 | OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.writePid | private static void writePid(String file, boolean ignorePidFile) {
File pidFile = new File(file);
if(pidFile.exists()) {
Long oldPid = getPid(pidFile);
if(oldPid==null) {
pidFile.delete();
} else {
log.warn("\n\t==================================\n\tThe OpenTSDB P... | java | private static void writePid(String file, boolean ignorePidFile) {
File pidFile = new File(file);
if(pidFile.exists()) {
Long oldPid = getPid(pidFile);
if(oldPid==null) {
pidFile.delete();
} else {
log.warn("\n\t==================================\n\tThe OpenTSDB P... | [
"private",
"static",
"void",
"writePid",
"(",
"String",
"file",
",",
"boolean",
"ignorePidFile",
")",
"{",
"File",
"pidFile",
"=",
"new",
"File",
"(",
"file",
")",
";",
"if",
"(",
"pidFile",
".",
"exists",
"(",
")",
")",
"{",
"Long",
"oldPid",
"=",
"... | Writes the PID to the file at the passed location
@param file The fully qualified pid file name
@param ignorePidFile If true, an existing pid file will be ignored after a warning log | [
"Writes",
"the",
"PID",
"to",
"the",
"file",
"at",
"the",
"passed",
"location"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L797-L836 |
13,737 | OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.getPid | private static Long getPid(File pidFile) {
FileReader reader = null;
BufferedReader lineReader = null;
String pidLine = null;
try {
reader = new FileReader(pidFile);
lineReader = new BufferedReader(reader);
pidLine = lineReader.readLine();
if(pidLine!=null) {
... | java | private static Long getPid(File pidFile) {
FileReader reader = null;
BufferedReader lineReader = null;
String pidLine = null;
try {
reader = new FileReader(pidFile);
lineReader = new BufferedReader(reader);
pidLine = lineReader.readLine();
if(pidLine!=null) {
... | [
"private",
"static",
"Long",
"getPid",
"(",
"File",
"pidFile",
")",
"{",
"FileReader",
"reader",
"=",
"null",
";",
"BufferedReader",
"lineReader",
"=",
"null",
";",
"String",
"pidLine",
"=",
"null",
";",
"try",
"{",
"reader",
"=",
"new",
"FileReader",
"(",... | Reads the pid from the specified pid file
@param pidFile The pid file to read from
@return The read pid or possibly null / blank if failed to read | [
"Reads",
"the",
"pid",
"from",
"the",
"specified",
"pid",
"file"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L843-L864 |
13,738 | OpenTSDB/opentsdb | src/core/HistogramSpan.java | HistogramSpan.getIdxOffsetFor | private long getIdxOffsetFor(final int i) {
checkRowOrder();
int idx = 0;
int offset = 0;
for (final iHistogramRowSeq row : rows) {
final int sz = row.size();
if (offset + sz > i) {
break;
}
offset += sz;
idx++;
}
return ((long) idx << 32) | (i - offset);
... | java | private long getIdxOffsetFor(final int i) {
checkRowOrder();
int idx = 0;
int offset = 0;
for (final iHistogramRowSeq row : rows) {
final int sz = row.size();
if (offset + sz > i) {
break;
}
offset += sz;
idx++;
}
return ((long) idx << 32) | (i - offset);
... | [
"private",
"long",
"getIdxOffsetFor",
"(",
"final",
"int",
"i",
")",
"{",
"checkRowOrder",
"(",
")",
";",
"int",
"idx",
"=",
"0",
";",
"int",
"offset",
"=",
"0",
";",
"for",
"(",
"final",
"iHistogramRowSeq",
"row",
":",
"rows",
")",
"{",
"final",
"in... | Finds the index of the row of the ith data point and the offset in the row.
@param i The index of the data point to find.
@return two ints packed in a long. The first int is the index of the row in
{@code rows} and the second is offset in that {@link RowSeq}
instance. | [
"Finds",
"the",
"index",
"of",
"the",
"row",
"of",
"the",
"ith",
"data",
"point",
"and",
"the",
"offset",
"in",
"the",
"row",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/HistogramSpan.java#L360-L373 |
13,739 | OpenTSDB/opentsdb | src/query/pojo/Timespan.java | Timespan.validate | public void validate() {
if (start == null || start.isEmpty()) {
throw new IllegalArgumentException("missing or empty start");
}
DateTime.parseDateTimeString(start, timezone);
if (end != null && !end.isEmpty()) {
DateTime.parseDateTimeString(end, timezone);
}
if (downsample... | java | public void validate() {
if (start == null || start.isEmpty()) {
throw new IllegalArgumentException("missing or empty start");
}
DateTime.parseDateTimeString(start, timezone);
if (end != null && !end.isEmpty()) {
DateTime.parseDateTimeString(end, timezone);
}
if (downsample... | [
"public",
"void",
"validate",
"(",
")",
"{",
"if",
"(",
"start",
"==",
"null",
"||",
"start",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"missing or empty start\"",
")",
";",
"}",
"DateTime",
".",
"parseDateTimeStr... | Validates the timespan
@throws IllegalArgumentException if one or more parameters were invalid | [
"Validates",
"the",
"timespan"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/pojo/Timespan.java#L124-L147 |
13,740 | OpenTSDB/opentsdb | src/tsd/client/QueryUi.java | QueryUi.makeStylePanel | private Grid makeStylePanel() {
for (Entry<String, Integer> item : stylesMap.entrySet()) {
styles.insertItem(item.getKey(), item.getValue());
}
final Grid grid = new Grid(5, 3);
grid.setText(0, 1, "Smooth");
grid.setWidget(0, 2, smooth);
grid.setText(1, 1, "Style");
grid.setWidget(1, 2... | java | private Grid makeStylePanel() {
for (Entry<String, Integer> item : stylesMap.entrySet()) {
styles.insertItem(item.getKey(), item.getValue());
}
final Grid grid = new Grid(5, 3);
grid.setText(0, 1, "Smooth");
grid.setWidget(0, 2, smooth);
grid.setText(1, 1, "Style");
grid.setWidget(1, 2... | [
"private",
"Grid",
"makeStylePanel",
"(",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"Integer",
">",
"item",
":",
"stylesMap",
".",
"entrySet",
"(",
")",
")",
"{",
"styles",
".",
"insertItem",
"(",
"item",
".",
"getKey",
"(",
")",
",",
"item"... | Additional styling options. | [
"Additional",
"styling",
"options",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/QueryUi.java#L502-L512 |
13,741 | OpenTSDB/opentsdb | src/tsd/client/QueryUi.java | QueryUi.makeAxesPanel | private Grid makeAxesPanel() {
final Grid grid = new Grid(5, 3);
grid.setText(0, 1, "Y");
grid.setText(0, 2, "Y2");
setTextAlignCenter(grid.getRowFormatter().getElement(0));
grid.setText(1, 0, "Label");
grid.setWidget(1, 1, ylabel);
grid.setWidget(1, 2, y2label);
grid.setText(2, 0, "Form... | java | private Grid makeAxesPanel() {
final Grid grid = new Grid(5, 3);
grid.setText(0, 1, "Y");
grid.setText(0, 2, "Y2");
setTextAlignCenter(grid.getRowFormatter().getElement(0));
grid.setText(1, 0, "Label");
grid.setWidget(1, 1, ylabel);
grid.setWidget(1, 2, y2label);
grid.setText(2, 0, "Form... | [
"private",
"Grid",
"makeAxesPanel",
"(",
")",
"{",
"final",
"Grid",
"grid",
"=",
"new",
"Grid",
"(",
"5",
",",
"3",
")",
";",
"grid",
".",
"setText",
"(",
"0",
",",
"1",
",",
"\"Y\"",
")",
";",
"grid",
".",
"setText",
"(",
"0",
",",
"2",
",",
... | Builds the panel containing customizations for the axes of the graph. | [
"Builds",
"the",
"panel",
"containing",
"customizations",
"for",
"the",
"axes",
"of",
"the",
"graph",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/QueryUi.java#L517-L537 |
13,742 | OpenTSDB/opentsdb | src/tsd/client/QueryUi.java | QueryUi.addKeyRadioButton | private RadioButton addKeyRadioButton(final Grid grid,
final int row, final int col,
final String pos) {
final RadioButton rb = new RadioButton("keypos");
rb.addClickHandler(new ClickHandler() {
public void onClick(final Click... | java | private RadioButton addKeyRadioButton(final Grid grid,
final int row, final int col,
final String pos) {
final RadioButton rb = new RadioButton("keypos");
rb.addClickHandler(new ClickHandler() {
public void onClick(final Click... | [
"private",
"RadioButton",
"addKeyRadioButton",
"(",
"final",
"Grid",
"grid",
",",
"final",
"int",
"row",
",",
"final",
"int",
"col",
",",
"final",
"String",
"pos",
")",
"{",
"final",
"RadioButton",
"rb",
"=",
"new",
"RadioButton",
"(",
"\"keypos\"",
")",
"... | Small helper to build a radio button used to change the position of the
key of the graph. | [
"Small",
"helper",
"to",
"build",
"a",
"radio",
"button",
"used",
"to",
"change",
"the",
"position",
"of",
"the",
"key",
"of",
"the",
"graph",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/QueryUi.java#L556-L569 |
13,743 | OpenTSDB/opentsdb | src/tsd/client/QueryUi.java | QueryUi.ensureSameWidgetSize | private static void ensureSameWidgetSize(final DecoratedTabPanel panel) {
if (!panel.isAttached()) {
throw new IllegalArgumentException("panel not attached: " + panel);
}
int maxw = 0;
int maxh = 0;
for (final Widget widget : panel) {
final int w = widget.getOffsetWidth();
final in... | java | private static void ensureSameWidgetSize(final DecoratedTabPanel panel) {
if (!panel.isAttached()) {
throw new IllegalArgumentException("panel not attached: " + panel);
}
int maxw = 0;
int maxh = 0;
for (final Widget widget : panel) {
final int w = widget.getOffsetWidth();
final in... | [
"private",
"static",
"void",
"ensureSameWidgetSize",
"(",
"final",
"DecoratedTabPanel",
"panel",
")",
"{",
"if",
"(",
"!",
"panel",
".",
"isAttached",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"panel not attached: \"",
"+",
"panel",
... | Ensures all the widgets in the given panel have the same size.
Otherwise by default the panel will automatically resize itself to the
contents of the currently active panel's widget, which is annoying
because it makes a number of things move around in the UI.
@param panel The panel containing the widgets to resize. | [
"Ensures",
"all",
"the",
"widgets",
"in",
"the",
"given",
"panel",
"have",
"the",
"same",
"size",
".",
"Otherwise",
"by",
"default",
"the",
"panel",
"will",
"automatically",
"resize",
"itself",
"to",
"the",
"contents",
"of",
"the",
"currently",
"active",
"pa... | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/QueryUi.java#L1384-L1407 |
13,744 | OpenTSDB/opentsdb | src/tsd/client/QueryUi.java | QueryUi.setOffsetWidth | private static void setOffsetWidth(final Widget widget, int width) {
widget.setWidth(width + "px");
final int offset = widget.getOffsetWidth();
if (offset > 0) {
width -= offset - width;
if (width > 0) {
widget.setWidth(width + "px");
}
}
} | java | private static void setOffsetWidth(final Widget widget, int width) {
widget.setWidth(width + "px");
final int offset = widget.getOffsetWidth();
if (offset > 0) {
width -= offset - width;
if (width > 0) {
widget.setWidth(width + "px");
}
}
} | [
"private",
"static",
"void",
"setOffsetWidth",
"(",
"final",
"Widget",
"widget",
",",
"int",
"width",
")",
"{",
"widget",
".",
"setWidth",
"(",
"width",
"+",
"\"px\"",
")",
";",
"final",
"int",
"offset",
"=",
"widget",
".",
"getOffsetWidth",
"(",
")",
";... | Properly sets the total width of a widget.
This takes into account decorations such as border, margin, and padding. | [
"Properly",
"sets",
"the",
"total",
"width",
"of",
"a",
"widget",
".",
"This",
"takes",
"into",
"account",
"decorations",
"such",
"as",
"border",
"margin",
"and",
"padding",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/QueryUi.java#L1413-L1422 |
13,745 | OpenTSDB/opentsdb | src/tsd/client/QueryUi.java | QueryUi.setOffsetHeight | private static void setOffsetHeight(final Widget widget, int height) {
widget.setHeight(height + "px");
final int offset = widget.getOffsetHeight();
if (offset > 0) {
height -= offset - height;
if (height > 0) {
widget.setHeight(height + "px");
}
}
} | java | private static void setOffsetHeight(final Widget widget, int height) {
widget.setHeight(height + "px");
final int offset = widget.getOffsetHeight();
if (offset > 0) {
height -= offset - height;
if (height > 0) {
widget.setHeight(height + "px");
}
}
} | [
"private",
"static",
"void",
"setOffsetHeight",
"(",
"final",
"Widget",
"widget",
",",
"int",
"height",
")",
"{",
"widget",
".",
"setHeight",
"(",
"height",
"+",
"\"px\"",
")",
";",
"final",
"int",
"offset",
"=",
"widget",
".",
"getOffsetHeight",
"(",
")",... | Properly sets the total height of a widget.
This takes into account decorations such as border, margin, and padding. | [
"Properly",
"sets",
"the",
"total",
"height",
"of",
"a",
"widget",
".",
"This",
"takes",
"into",
"account",
"decorations",
"such",
"as",
"border",
"margin",
"and",
"padding",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/QueryUi.java#L1428-L1437 |
13,746 | OpenTSDB/opentsdb | src/core/Tags.java | Tags.parse | public static void parse(final HashMap<String, String> tags,
final String tag) {
final String[] kv = splitString(tag, '=');
if (kv.length != 2 || kv[0].length() <= 0 || kv[1].length() <= 0) {
throw new IllegalArgumentException("invalid tag: " + tag);
}
if (kv[1].equals(t... | java | public static void parse(final HashMap<String, String> tags,
final String tag) {
final String[] kv = splitString(tag, '=');
if (kv.length != 2 || kv[0].length() <= 0 || kv[1].length() <= 0) {
throw new IllegalArgumentException("invalid tag: " + tag);
}
if (kv[1].equals(t... | [
"public",
"static",
"void",
"parse",
"(",
"final",
"HashMap",
"<",
"String",
",",
"String",
">",
"tags",
",",
"final",
"String",
"tag",
")",
"{",
"final",
"String",
"[",
"]",
"kv",
"=",
"splitString",
"(",
"tag",
",",
"'",
"'",
")",
";",
"if",
"(",... | Parses a tag into a HashMap.
@param tags The HashMap into which to store the tag.
@param tag A String of the form "tag=value".
@throws IllegalArgumentException if the tag is malformed.
@throws IllegalArgumentException if the tag was already in tags with a
different value. | [
"Parses",
"a",
"tag",
"into",
"a",
"HashMap",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Tags.java#L87-L101 |
13,747 | OpenTSDB/opentsdb | src/core/Tags.java | Tags.parseWithMetric | public static String parseWithMetric(final String metric,
final List<Pair<String, String>> tags) {
final int curly = metric.indexOf('{');
if (curly < 0) {
if (metric.isEmpty()) {
throw new IllegalArgumentException("Metric string was empty");
}
return metric;
}
final int l... | java | public static String parseWithMetric(final String metric,
final List<Pair<String, String>> tags) {
final int curly = metric.indexOf('{');
if (curly < 0) {
if (metric.isEmpty()) {
throw new IllegalArgumentException("Metric string was empty");
}
return metric;
}
final int l... | [
"public",
"static",
"String",
"parseWithMetric",
"(",
"final",
"String",
"metric",
",",
"final",
"List",
"<",
"Pair",
"<",
"String",
",",
"String",
">",
">",
"tags",
")",
"{",
"final",
"int",
"curly",
"=",
"metric",
".",
"indexOf",
"(",
"'",
"'",
")",
... | Parses an optional metric and tags out of the given string, any of
which may be null. Requires at least one metric, tagk or tagv.
@param metric A string of the form "metric" or "metric{tag=value,...}"
or even "{tag=value,...}" where the metric may be missing.
@param tags The list to populate with parsed tag pairs
@retu... | [
"Parses",
"an",
"optional",
"metric",
"and",
"tags",
"out",
"of",
"the",
"given",
"string",
"any",
"of",
"which",
"may",
"be",
"null",
".",
"Requires",
"at",
"least",
"one",
"metric",
"tagk",
"or",
"tagv",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Tags.java#L175-L208 |
13,748 | OpenTSDB/opentsdb | src/core/Tags.java | Tags.getValue | static String getValue(final TSDB tsdb, final byte[] row,
final String name) throws NoSuchUniqueName {
validateString("tag name", name);
final byte[] id = tsdb.tag_names.getId(name);
final byte[] value_id = getValueId(tsdb, row, id);
if (value_id == null) {
return null;
... | java | static String getValue(final TSDB tsdb, final byte[] row,
final String name) throws NoSuchUniqueName {
validateString("tag name", name);
final byte[] id = tsdb.tag_names.getId(name);
final byte[] value_id = getValueId(tsdb, row, id);
if (value_id == null) {
return null;
... | [
"static",
"String",
"getValue",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"byte",
"[",
"]",
"row",
",",
"final",
"String",
"name",
")",
"throws",
"NoSuchUniqueName",
"{",
"validateString",
"(",
"\"tag name\"",
",",
"name",
")",
";",
"final",
"byte",
"[",... | Extracts the value of the given tag name from the given row key.
@param tsdb The TSDB instance to use for UniqueId lookups.
@param row The row key in which to search the tag name.
@param name The name of the tag to search in the row key.
@return The value associated with the given tag name, or null if this tag
isn't pr... | [
"Extracts",
"the",
"value",
"of",
"the",
"given",
"tag",
"name",
"from",
"the",
"given",
"row",
"key",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Tags.java#L337-L352 |
13,749 | OpenTSDB/opentsdb | src/core/Tags.java | Tags.getValueId | static byte[] getValueId(final TSDB tsdb, final byte[] row,
final byte[] tag_id) {
final short name_width = tsdb.tag_names.width();
final short value_width = tsdb.tag_values.width();
// TODO(tsuna): Can do a binary search.
for (short pos = (short) (Const.SALT_WIDTH() +
... | java | static byte[] getValueId(final TSDB tsdb, final byte[] row,
final byte[] tag_id) {
final short name_width = tsdb.tag_names.width();
final short value_width = tsdb.tag_values.width();
// TODO(tsuna): Can do a binary search.
for (short pos = (short) (Const.SALT_WIDTH() +
... | [
"static",
"byte",
"[",
"]",
"getValueId",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"byte",
"[",
"]",
"row",
",",
"final",
"byte",
"[",
"]",
"tag_id",
")",
"{",
"final",
"short",
"name_width",
"=",
"tsdb",
".",
"tag_names",
".",
"width",
"(",
")",
... | Extracts the value ID of the given tag UD name from the given row key.
@param tsdb The TSDB instance to use for UniqueId lookups.
@param row The row key in which to search the tag name.
@param tag_id The name of the tag to search in the row key.
@return The value ID associated with the given tag ID, or null if this
tag... | [
"Extracts",
"the",
"value",
"ID",
"of",
"the",
"given",
"tag",
"UD",
"name",
"from",
"the",
"given",
"row",
"key",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Tags.java#L362-L377 |
13,750 | OpenTSDB/opentsdb | src/core/Tags.java | Tags.rowContains | private static boolean rowContains(final byte[] row,
short offset, final byte[] bytes) {
for (int pos = bytes.length - 1; pos >= 0; pos--) {
if (row[offset + pos] != bytes[pos]) {
return false;
}
}
return true;
} | java | private static boolean rowContains(final byte[] row,
short offset, final byte[] bytes) {
for (int pos = bytes.length - 1; pos >= 0; pos--) {
if (row[offset + pos] != bytes[pos]) {
return false;
}
}
return true;
} | [
"private",
"static",
"boolean",
"rowContains",
"(",
"final",
"byte",
"[",
"]",
"row",
",",
"short",
"offset",
",",
"final",
"byte",
"[",
"]",
"bytes",
")",
"{",
"for",
"(",
"int",
"pos",
"=",
"bytes",
".",
"length",
"-",
"1",
";",
"pos",
">=",
"0",... | Checks whether or not the row key contains the given byte array at the
given offset.
@param row The row key in which to search.
@param offset The offset in {@code row} at which to start searching.
@param bytes The bytes to search that the given offset.
@return true if {@code bytes} are present in {@code row} at
{@code ... | [
"Checks",
"whether",
"or",
"not",
"the",
"row",
"key",
"contains",
"the",
"given",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Tags.java#L388-L396 |
13,751 | OpenTSDB/opentsdb | src/core/Tags.java | Tags.getTagUids | public static ByteMap<byte[]> getTagUids(final byte[] row) {
final ByteMap<byte[]> uids = new ByteMap<byte[]>();
final short name_width = TSDB.tagk_width();
final short value_width = TSDB.tagv_width();
final short tag_bytes = (short) (name_width + value_width);
final short metric_ts_bytes = (short) ... | java | public static ByteMap<byte[]> getTagUids(final byte[] row) {
final ByteMap<byte[]> uids = new ByteMap<byte[]>();
final short name_width = TSDB.tagk_width();
final short value_width = TSDB.tagv_width();
final short tag_bytes = (short) (name_width + value_width);
final short metric_ts_bytes = (short) ... | [
"public",
"static",
"ByteMap",
"<",
"byte",
"[",
"]",
">",
"getTagUids",
"(",
"final",
"byte",
"[",
"]",
"row",
")",
"{",
"final",
"ByteMap",
"<",
"byte",
"[",
"]",
">",
"uids",
"=",
"new",
"ByteMap",
"<",
"byte",
"[",
"]",
">",
"(",
")",
";",
... | Returns the tag key and value pairs as a byte map given a row key
@param row The row key to parse the UIDs from
@return A byte map with tagk and tagv pairs as raw UIDs
@since 2.2 | [
"Returns",
"the",
"tag",
"key",
"and",
"value",
"pairs",
"as",
"a",
"byte",
"map",
"given",
"a",
"row",
"key"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Tags.java#L524-L541 |
13,752 | OpenTSDB/opentsdb | src/core/Tags.java | Tags.resolveAllAsync | public static Deferred<ArrayList<byte[]>> resolveAllAsync(final TSDB tsdb,
final Map<String, String> tags) {
return resolveAllInternalAsync(tsdb, null, tags, false);
} | java | public static Deferred<ArrayList<byte[]>> resolveAllAsync(final TSDB tsdb,
final Map<String, String> tags) {
return resolveAllInternalAsync(tsdb, null, tags, false);
} | [
"public",
"static",
"Deferred",
"<",
"ArrayList",
"<",
"byte",
"[",
"]",
">",
">",
"resolveAllAsync",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"resolveAllInternalAsync",
"(",
"tsdb",
... | Resolves a set of tag strings to their UIDs asynchronously
@param tsdb the TSDB to use for access
@param tags The tags to resolve
@return A deferred with the list of UIDs in tagk1, tagv1, .. tagkn, tagvn
order
@throws NoSuchUniqueName if one of the elements in the map contained an
unknown tag name or tag value.
@since ... | [
"Resolves",
"a",
"set",
"of",
"tag",
"strings",
"to",
"their",
"UIDs",
"asynchronously"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Tags.java#L598-L601 |
13,753 | OpenTSDB/opentsdb | src/core/ColumnDatapointIterator.java | ColumnDatapointIterator.writeToBuffers | public void writeToBuffers(ByteBufferList compQualifier, ByteBufferList compValue) {
compQualifier.add(qualifier, qualifier_offset, current_qual_length);
compValue.add(value, value_offset, current_val_length);
} | java | public void writeToBuffers(ByteBufferList compQualifier, ByteBufferList compValue) {
compQualifier.add(qualifier, qualifier_offset, current_qual_length);
compValue.add(value, value_offset, current_val_length);
} | [
"public",
"void",
"writeToBuffers",
"(",
"ByteBufferList",
"compQualifier",
",",
"ByteBufferList",
"compValue",
")",
"{",
"compQualifier",
".",
"add",
"(",
"qualifier",
",",
"qualifier_offset",
",",
"current_qual_length",
")",
";",
"compValue",
".",
"add",
"(",
"v... | Copy this value to the output and advance to the next one.
@param compQualifier
@param compValue
@return true if there is more data left in this column | [
"Copy",
"this",
"value",
"to",
"the",
"output",
"and",
"advance",
"to",
"the",
"next",
"one",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/ColumnDatapointIterator.java#L118-L121 |
13,754 | OpenTSDB/opentsdb | src/core/ColumnDatapointIterator.java | ColumnDatapointIterator.compareTo | @Override
public int compareTo(ColumnDatapointIterator o) {
int c = current_timestamp_offset - o.current_timestamp_offset;
if (c == 0) {
// note inverse order of comparison!
c = Long.signum(o.column_timestamp - column_timestamp);
}
return c;
} | java | @Override
public int compareTo(ColumnDatapointIterator o) {
int c = current_timestamp_offset - o.current_timestamp_offset;
if (c == 0) {
// note inverse order of comparison!
c = Long.signum(o.column_timestamp - column_timestamp);
}
return c;
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"ColumnDatapointIterator",
"o",
")",
"{",
"int",
"c",
"=",
"current_timestamp_offset",
"-",
"o",
".",
"current_timestamp_offset",
";",
"if",
"(",
"c",
"==",
"0",
")",
"{",
"// note inverse order of comparison!",
... | entry we are going to keep first, and don't have to copy over it) | [
"entry",
"we",
"are",
"going",
"to",
"keep",
"first",
"and",
"don",
"t",
"have",
"to",
"copy",
"over",
"it",
")"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/ColumnDatapointIterator.java#L191-L199 |
13,755 | OpenTSDB/opentsdb | src/query/expression/ExpressionTree.java | ExpressionTree.addSubMetricQuery | public void addSubMetricQuery(final String metric_query,
final int sub_query_index,
final int param_index) {
if (metric_query == null || metric_query.isEmpty()) {
throw new IllegalArgumentException("Metric query cannot be null or empty");
}
... | java | public void addSubMetricQuery(final String metric_query,
final int sub_query_index,
final int param_index) {
if (metric_query == null || metric_query.isEmpty()) {
throw new IllegalArgumentException("Metric query cannot be null or empty");
}
... | [
"public",
"void",
"addSubMetricQuery",
"(",
"final",
"String",
"metric_query",
",",
"final",
"int",
"sub_query_index",
",",
"final",
"int",
"param_index",
")",
"{",
"if",
"(",
"metric_query",
"==",
"null",
"||",
"metric_query",
".",
"isEmpty",
"(",
")",
")",
... | Sets the metric query key and index, setting the Parameter type to
METRIC_QUERY
@param metric_query The metric query id
@param sub_query_index The index of the metric query
@param param_index The index of the parameter (??) | [
"Sets",
"the",
"metric",
"query",
"key",
"and",
"index",
"setting",
"the",
"Parameter",
"type",
"to",
"METRIC_QUERY"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/expression/ExpressionTree.java#L109-L126 |
13,756 | OpenTSDB/opentsdb | src/query/expression/ExpressionTree.java | ExpressionTree.addFunctionParameter | public void addFunctionParameter(final String param) {
if (param == null || param.isEmpty()) {
throw new IllegalArgumentException("Parameter cannot be null or empty");
}
if (func_params == null) {
func_params = Lists.newArrayList();
}
func_params.add(param);
} | java | public void addFunctionParameter(final String param) {
if (param == null || param.isEmpty()) {
throw new IllegalArgumentException("Parameter cannot be null or empty");
}
if (func_params == null) {
func_params = Lists.newArrayList();
}
func_params.add(param);
} | [
"public",
"void",
"addFunctionParameter",
"(",
"final",
"String",
"param",
")",
"{",
"if",
"(",
"param",
"==",
"null",
"||",
"param",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parameter cannot be null or empty\"",
")... | Adds parameters for the root expression only.
@param param The parameter to add, cannot be null or empty
@throws IllegalArgumentException if the parameter is null or empty | [
"Adds",
"parameters",
"for",
"the",
"root",
"expression",
"only",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/expression/ExpressionTree.java#L133-L141 |
13,757 | OpenTSDB/opentsdb | src/query/expression/ExpressionTree.java | ExpressionTree.clean | private String clean(final Collection<String> values) {
if (values == null || values.size() == 0) {
return "";
}
final List<String> strs = Lists.newArrayList();
for (String v : values) {
final String tmp = v.replaceAll("\\{.*\\}", "");
final int ix = tmp.lastIndexOf(':');
if (ix... | java | private String clean(final Collection<String> values) {
if (values == null || values.size() == 0) {
return "";
}
final List<String> strs = Lists.newArrayList();
for (String v : values) {
final String tmp = v.replaceAll("\\{.*\\}", "");
final int ix = tmp.lastIndexOf(':');
if (ix... | [
"private",
"String",
"clean",
"(",
"final",
"Collection",
"<",
"String",
">",
"values",
")",
"{",
"if",
"(",
"values",
"==",
"null",
"||",
"values",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"\"\"",
";",
"}",
"final",
"List",
"<",
"Stri... | Helper to clean out some characters
@param values The collection of strings to cleanup
@return An empty string if values was empty or a cleaned up string | [
"Helper",
"to",
"clean",
"out",
"some",
"characters"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/expression/ExpressionTree.java#L219-L236 |
13,758 | OpenTSDB/opentsdb | src/tsd/client/EventsHandler.java | EventsHandler.scheduleEvent | private <H extends EventHandler> void scheduleEvent(final DomEvent<H> event) {
DeferredCommand.addCommand(new Command() {
public void execute() {
onEvent(event);
}
});
} | java | private <H extends EventHandler> void scheduleEvent(final DomEvent<H> event) {
DeferredCommand.addCommand(new Command() {
public void execute() {
onEvent(event);
}
});
} | [
"private",
"<",
"H",
"extends",
"EventHandler",
">",
"void",
"scheduleEvent",
"(",
"final",
"DomEvent",
"<",
"H",
">",
"event",
")",
"{",
"DeferredCommand",
".",
"addCommand",
"(",
"new",
"Command",
"(",
")",
"{",
"public",
"void",
"execute",
"(",
")",
"... | Executes the event using a deferred command. | [
"Executes",
"the",
"event",
"using",
"a",
"deferred",
"command",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/EventsHandler.java#L73-L79 |
13,759 | perwendel/spark | src/main/java/spark/TemplateEngine.java | TemplateEngine.render | public String render(Object object) {
ModelAndView modelAndView = (ModelAndView) object;
return render(modelAndView);
} | java | public String render(Object object) {
ModelAndView modelAndView = (ModelAndView) object;
return render(modelAndView);
} | [
"public",
"String",
"render",
"(",
"Object",
"object",
")",
"{",
"ModelAndView",
"modelAndView",
"=",
"(",
"ModelAndView",
")",
"object",
";",
"return",
"render",
"(",
"modelAndView",
")",
";",
"}"
] | Renders the object
@param object the object
@return the rendered model and view | [
"Renders",
"the",
"object"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/TemplateEngine.java#L19-L22 |
13,760 | perwendel/spark | src/main/java/spark/resource/AbstractResourceHandler.java | AbstractResourceHandler.getResource | public AbstractFileResolvingResource getResource(HttpServletRequest request) throws MalformedURLException {
String servletPath;
String pathInfo;
boolean included = request.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI) != null;
if (included) {
servletPath = (String) req... | java | public AbstractFileResolvingResource getResource(HttpServletRequest request) throws MalformedURLException {
String servletPath;
String pathInfo;
boolean included = request.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI) != null;
if (included) {
servletPath = (String) req... | [
"public",
"AbstractFileResolvingResource",
"getResource",
"(",
"HttpServletRequest",
"request",
")",
"throws",
"MalformedURLException",
"{",
"String",
"servletPath",
";",
"String",
"pathInfo",
";",
"boolean",
"included",
"=",
"request",
".",
"getAttribute",
"(",
"Reques... | Gets a resource from a servlet request
@param request the servlet request
@return the resource or null if not found
@throws java.net.MalformedURLException thrown when malformed URL. | [
"Gets",
"a",
"resource",
"from",
"a",
"servlet",
"request"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/resource/AbstractResourceHandler.java#L40-L60 |
13,761 | perwendel/spark | src/main/java/spark/embeddedserver/jetty/JettyServer.java | JettyServer.create | public Server create(int maxThreads, int minThreads, int threadTimeoutMillis) {
Server server;
if (maxThreads > 0) {
int max = maxThreads;
int min = (minThreads > 0) ? minThreads : 8;
int idleTimeout = (threadTimeoutMillis > 0) ? threadTimeoutMillis : 60000;
... | java | public Server create(int maxThreads, int minThreads, int threadTimeoutMillis) {
Server server;
if (maxThreads > 0) {
int max = maxThreads;
int min = (minThreads > 0) ? minThreads : 8;
int idleTimeout = (threadTimeoutMillis > 0) ? threadTimeoutMillis : 60000;
... | [
"public",
"Server",
"create",
"(",
"int",
"maxThreads",
",",
"int",
"minThreads",
",",
"int",
"threadTimeoutMillis",
")",
"{",
"Server",
"server",
";",
"if",
"(",
"maxThreads",
">",
"0",
")",
"{",
"int",
"max",
"=",
"maxThreads",
";",
"int",
"min",
"=",
... | Creates a Jetty server.
@param maxThreads maxThreads
@param minThreads minThreads
@param threadTimeoutMillis threadTimeoutMillis
@return a new jetty server instance | [
"Creates",
"a",
"Jetty",
"server",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/embeddedserver/jetty/JettyServer.java#L36-L50 |
13,762 | perwendel/spark | src/main/java/spark/embeddedserver/jetty/JettyServer.java | JettyServer.create | @Override
public Server create(ThreadPool threadPool) {
return threadPool != null ? new Server(threadPool) : new Server();
} | java | @Override
public Server create(ThreadPool threadPool) {
return threadPool != null ? new Server(threadPool) : new Server();
} | [
"@",
"Override",
"public",
"Server",
"create",
"(",
"ThreadPool",
"threadPool",
")",
"{",
"return",
"threadPool",
"!=",
"null",
"?",
"new",
"Server",
"(",
"threadPool",
")",
":",
"new",
"Server",
"(",
")",
";",
"}"
] | Creates a Jetty server with supplied thread pool
@param threadPool thread pool
@return a new jetty server instance | [
"Creates",
"a",
"Jetty",
"server",
"with",
"supplied",
"thread",
"pool"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/embeddedserver/jetty/JettyServer.java#L57-L60 |
13,763 | perwendel/spark | src/main/java/spark/ExceptionMapper.java | ExceptionMapper.map | public void map(Class<? extends Exception> exceptionClass, ExceptionHandlerImpl handler) {
this.exceptionMap.put(exceptionClass, handler);
} | java | public void map(Class<? extends Exception> exceptionClass, ExceptionHandlerImpl handler) {
this.exceptionMap.put(exceptionClass, handler);
} | [
"public",
"void",
"map",
"(",
"Class",
"<",
"?",
"extends",
"Exception",
">",
"exceptionClass",
",",
"ExceptionHandlerImpl",
"handler",
")",
"{",
"this",
".",
"exceptionMap",
".",
"put",
"(",
"exceptionClass",
",",
"handler",
")",
";",
"}"
] | Maps the given handler to the provided exception type. If a handler was already registered to the same type, the
handler is overwritten.
@param exceptionClass Type of exception
@param handler Handler to map to exception | [
"Maps",
"the",
"given",
"handler",
"to",
"the",
"provided",
"exception",
"type",
".",
"If",
"a",
"handler",
"was",
"already",
"registered",
"to",
"the",
"same",
"type",
"the",
"handler",
"is",
"overwritten",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/ExceptionMapper.java#L65-L67 |
13,764 | perwendel/spark | src/main/java/spark/ExceptionMapper.java | ExceptionMapper.getHandler | public ExceptionHandlerImpl getHandler(Class<? extends Exception> exceptionClass) {
// If the exception map does not contain the provided exception class, it might
// still be that a superclass of the exception class is.
if (!this.exceptionMap.containsKey(exceptionClass)) {
Class<?>... | java | public ExceptionHandlerImpl getHandler(Class<? extends Exception> exceptionClass) {
// If the exception map does not contain the provided exception class, it might
// still be that a superclass of the exception class is.
if (!this.exceptionMap.containsKey(exceptionClass)) {
Class<?>... | [
"public",
"ExceptionHandlerImpl",
"getHandler",
"(",
"Class",
"<",
"?",
"extends",
"Exception",
">",
"exceptionClass",
")",
"{",
"// If the exception map does not contain the provided exception class, it might",
"// still be that a superclass of the exception class is.",
"if",
"(",
... | Returns the handler associated with the provided exception class
@param exceptionClass Type of exception
@return Associated handler | [
"Returns",
"the",
"handler",
"associated",
"with",
"the",
"provided",
"exception",
"class"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/ExceptionMapper.java#L75-L103 |
13,765 | perwendel/spark | src/main/java/spark/CustomErrorPages.java | CustomErrorPages.getFor | public static Object getFor(int status, Request request, Response response) {
Object customRenderer = CustomErrorPages.getInstance().customPages.get(status);
Object customPage = CustomErrorPages.getInstance().getDefaultFor(status);
if (customRenderer instanceof String) {
customPage... | java | public static Object getFor(int status, Request request, Response response) {
Object customRenderer = CustomErrorPages.getInstance().customPages.get(status);
Object customPage = CustomErrorPages.getInstance().getDefaultFor(status);
if (customRenderer instanceof String) {
customPage... | [
"public",
"static",
"Object",
"getFor",
"(",
"int",
"status",
",",
"Request",
"request",
",",
"Response",
"response",
")",
"{",
"Object",
"customRenderer",
"=",
"CustomErrorPages",
".",
"getInstance",
"(",
")",
".",
"customPages",
".",
"get",
"(",
"status",
... | Gets the custom error page for a given status code. If the custom
error page is a route, the output of its handle method is returned.
If the custom error page is a String, it is returned as an Object.
@param status
@param request
@param response
@return Object representing the custom error page | [
"Gets",
"the",
"custom",
"error",
"page",
"for",
"a",
"given",
"status",
"code",
".",
"If",
"the",
"custom",
"error",
"page",
"is",
"a",
"route",
"the",
"output",
"of",
"its",
"handle",
"method",
"is",
"returned",
".",
"If",
"the",
"custom",
"error",
"... | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/CustomErrorPages.java#L54-L71 |
13,766 | perwendel/spark | src/main/java/spark/CustomErrorPages.java | CustomErrorPages.getDefaultFor | public String getDefaultFor(int status){
String defaultPage = defaultPages.get(status);
return (defaultPage != null) ? defaultPage : "<html><body><h2>HTTP Status " + status + "</h2></body></html>";
} | java | public String getDefaultFor(int status){
String defaultPage = defaultPages.get(status);
return (defaultPage != null) ? defaultPage : "<html><body><h2>HTTP Status " + status + "</h2></body></html>";
} | [
"public",
"String",
"getDefaultFor",
"(",
"int",
"status",
")",
"{",
"String",
"defaultPage",
"=",
"defaultPages",
".",
"get",
"(",
"status",
")",
";",
"return",
"(",
"defaultPage",
"!=",
"null",
")",
"?",
"defaultPage",
":",
"\"<html><body><h2>HTTP Status \"",
... | Returns the default error page for a given status code.
Guaranteed to never be null.
@param status
@return String representation of the default error page. | [
"Returns",
"the",
"default",
"error",
"page",
"for",
"a",
"given",
"status",
"code",
".",
"Guaranteed",
"to",
"never",
"be",
"null",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/CustomErrorPages.java#L79-L82 |
13,767 | perwendel/spark | src/main/java/spark/CustomErrorPages.java | CustomErrorPages.add | static void add(int status, String page) {
CustomErrorPages.getInstance().customPages.put(status, page);
} | java | static void add(int status, String page) {
CustomErrorPages.getInstance().customPages.put(status, page);
} | [
"static",
"void",
"add",
"(",
"int",
"status",
",",
"String",
"page",
")",
"{",
"CustomErrorPages",
".",
"getInstance",
"(",
")",
".",
"customPages",
".",
"put",
"(",
"status",
",",
"page",
")",
";",
"}"
] | Add a custom error page as a String
@param status
@param page | [
"Add",
"a",
"custom",
"error",
"page",
"as",
"a",
"String"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/CustomErrorPages.java#L89-L91 |
13,768 | perwendel/spark | src/main/java/spark/CustomErrorPages.java | CustomErrorPages.add | static void add(int status, Route route) {
CustomErrorPages.getInstance().customPages.put(status, route);
} | java | static void add(int status, Route route) {
CustomErrorPages.getInstance().customPages.put(status, route);
} | [
"static",
"void",
"add",
"(",
"int",
"status",
",",
"Route",
"route",
")",
"{",
"CustomErrorPages",
".",
"getInstance",
"(",
")",
".",
"customPages",
".",
"put",
"(",
"status",
",",
"route",
")",
";",
"}"
] | Add a custom error page as a Route handler
@param status
@param route | [
"Add",
"a",
"custom",
"error",
"page",
"as",
"a",
"Route",
"handler"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/CustomErrorPages.java#L98-L100 |
13,769 | perwendel/spark | src/main/java/spark/http/matching/Halt.java | Halt.modify | public static void modify(HttpServletResponse httpResponse, Body body, HaltException halt) {
httpResponse.setStatus(halt.statusCode());
if (halt.body() != null) {
body.set(halt.body());
} else {
body.set("");
}
} | java | public static void modify(HttpServletResponse httpResponse, Body body, HaltException halt) {
httpResponse.setStatus(halt.statusCode());
if (halt.body() != null) {
body.set(halt.body());
} else {
body.set("");
}
} | [
"public",
"static",
"void",
"modify",
"(",
"HttpServletResponse",
"httpResponse",
",",
"Body",
"body",
",",
"HaltException",
"halt",
")",
"{",
"httpResponse",
".",
"setStatus",
"(",
"halt",
".",
"statusCode",
"(",
")",
")",
";",
"if",
"(",
"halt",
".",
"bo... | Modifies the HTTP response and body based on the provided HaltException.
@param httpResponse The HTTP servlet response
@param body The body content
@param halt The halt exception object | [
"Modifies",
"the",
"HTTP",
"response",
"and",
"body",
"based",
"on",
"the",
"provided",
"HaltException",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/http/matching/Halt.java#L35-L44 |
13,770 | perwendel/spark | src/main/java/spark/Session.java | Session.attribute | @SuppressWarnings("unchecked")
public <T> T attribute(String name) {
return (T) session.getAttribute(name);
} | java | @SuppressWarnings("unchecked")
public <T> T attribute(String name) {
return (T) session.getAttribute(name);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"attribute",
"(",
"String",
"name",
")",
"{",
"return",
"(",
"T",
")",
"session",
".",
"getAttribute",
"(",
"name",
")",
";",
"}"
] | Returns the object bound with the specified name in this session, or null if no object is bound under the name.
@param name a string specifying the name of the object
@param <T> The type parameter
@return the object with the specified name | [
"Returns",
"the",
"object",
"bound",
"with",
"the",
"specified",
"name",
"in",
"this",
"session",
"or",
"null",
"if",
"no",
"object",
"is",
"bound",
"under",
"the",
"name",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Session.java#L47-L50 |
13,771 | perwendel/spark | src/main/java/spark/Routable.java | Routable.after | public void after(Filter filter) {
addFilter(HttpMethod.after, FilterImpl.create(SparkUtils.ALL_PATHS, filter));
} | java | public void after(Filter filter) {
addFilter(HttpMethod.after, FilterImpl.create(SparkUtils.ALL_PATHS, filter));
} | [
"public",
"void",
"after",
"(",
"Filter",
"filter",
")",
"{",
"addFilter",
"(",
"HttpMethod",
".",
"after",
",",
"FilterImpl",
".",
"create",
"(",
"SparkUtils",
".",
"ALL_PATHS",
",",
"filter",
")",
")",
";",
"}"
] | Maps a filter to be executed after any matching routes
@param filter The filter | [
"Maps",
"a",
"filter",
"to",
"be",
"executed",
"after",
"any",
"matching",
"routes"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Routable.java#L282-L284 |
13,772 | perwendel/spark | src/main/java/spark/Routable.java | Routable.createRouteImpl | private RouteImpl createRouteImpl(String path, String acceptType, Route route) {
if (defaultResponseTransformer != null) {
return ResponseTransformerRouteImpl.create(path, acceptType, route, defaultResponseTransformer);
}
return RouteImpl.create(path, acceptType, route);
} | java | private RouteImpl createRouteImpl(String path, String acceptType, Route route) {
if (defaultResponseTransformer != null) {
return ResponseTransformerRouteImpl.create(path, acceptType, route, defaultResponseTransformer);
}
return RouteImpl.create(path, acceptType, route);
} | [
"private",
"RouteImpl",
"createRouteImpl",
"(",
"String",
"path",
",",
"String",
"acceptType",
",",
"Route",
"route",
")",
"{",
"if",
"(",
"defaultResponseTransformer",
"!=",
"null",
")",
"{",
"return",
"ResponseTransformerRouteImpl",
".",
"create",
"(",
"path",
... | Create route implementation or use default response transformer
@param path the path
@param acceptType the accept type
@param route the route
@return ResponseTransformerRouteImpl or RouteImpl | [
"Create",
"route",
"implementation",
"or",
"use",
"default",
"response",
"transformer"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Routable.java#L806-L811 |
13,773 | perwendel/spark | src/main/java/spark/embeddedserver/jetty/websocket/WebSocketServletContextHandlerFactory.java | WebSocketServletContextHandlerFactory.create | public static ServletContextHandler create(Map<String, WebSocketHandlerWrapper> webSocketHandlers,
Optional<Integer> webSocketIdleTimeoutMillis) {
ServletContextHandler webSocketServletContextHandler = null;
if (webSocketHandlers != null) {
try ... | java | public static ServletContextHandler create(Map<String, WebSocketHandlerWrapper> webSocketHandlers,
Optional<Integer> webSocketIdleTimeoutMillis) {
ServletContextHandler webSocketServletContextHandler = null;
if (webSocketHandlers != null) {
try ... | [
"public",
"static",
"ServletContextHandler",
"create",
"(",
"Map",
"<",
"String",
",",
"WebSocketHandlerWrapper",
">",
"webSocketHandlers",
",",
"Optional",
"<",
"Integer",
">",
"webSocketIdleTimeoutMillis",
")",
"{",
"ServletContextHandler",
"webSocketServletContextHandler... | Creates a new websocket servlet context handler.
@param webSocketHandlers webSocketHandlers
@param webSocketIdleTimeoutMillis webSocketIdleTimeoutMillis
@return a new websocket servlet context handler or 'null' if creation failed. | [
"Creates",
"a",
"new",
"websocket",
"servlet",
"context",
"handler",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/embeddedserver/jetty/websocket/WebSocketServletContextHandlerFactory.java#L44-L69 |
13,774 | perwendel/spark | src/main/java/spark/embeddedserver/EmbeddedServers.java | EmbeddedServers.create | public static EmbeddedServer create(Object identifier,
Routes routeMatcher,
ExceptionMapper exceptionMapper,
StaticFilesConfiguration staticFilesConfiguration,
... | java | public static EmbeddedServer create(Object identifier,
Routes routeMatcher,
ExceptionMapper exceptionMapper,
StaticFilesConfiguration staticFilesConfiguration,
... | [
"public",
"static",
"EmbeddedServer",
"create",
"(",
"Object",
"identifier",
",",
"Routes",
"routeMatcher",
",",
"ExceptionMapper",
"exceptionMapper",
",",
"StaticFilesConfiguration",
"staticFilesConfiguration",
",",
"boolean",
"multipleHandlers",
")",
"{",
"EmbeddedServerF... | Creates an embedded server of type corresponding to the provided identifier.
@param identifier the identifier
@param routeMatcher the route matcher
@param staticFilesConfiguration the static files configuration object
@param multipleHandlers true if other handlers exist
@return the cr... | [
"Creates",
"an",
"embedded",
"server",
"of",
"type",
"corresponding",
"to",
"the",
"provided",
"identifier",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/embeddedserver/EmbeddedServers.java#L71-L84 |
13,775 | perwendel/spark | src/main/java/spark/Response.java | Response.redirect | public void redirect(String location) {
if (LOG.isDebugEnabled()) {
LOG.debug("Redirecting ({} {} to {}", "Found", HttpServletResponse.SC_FOUND, location);
}
try {
response.sendRedirect(location);
} catch (IOException ioException) {
LOG.warn("Redirect ... | java | public void redirect(String location) {
if (LOG.isDebugEnabled()) {
LOG.debug("Redirecting ({} {} to {}", "Found", HttpServletResponse.SC_FOUND, location);
}
try {
response.sendRedirect(location);
} catch (IOException ioException) {
LOG.warn("Redirect ... | [
"public",
"void",
"redirect",
"(",
"String",
"location",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Redirecting ({} {} to {}\"",
",",
"\"Found\"",
",",
"HttpServletResponse",
".",
"SC_FOUND",
",",
"loc... | Trigger a browser redirect
@param location Where to redirect | [
"Trigger",
"a",
"browser",
"redirect"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Response.java#L117-L126 |
13,776 | perwendel/spark | src/main/java/spark/Response.java | Response.redirect | public void redirect(String location, int httpStatusCode) {
if (LOG.isDebugEnabled()) {
LOG.debug("Redirecting ({} to {}", httpStatusCode, location);
}
response.setStatus(httpStatusCode);
response.setHeader("Location", location);
response.setHeader("Connection", "clos... | java | public void redirect(String location, int httpStatusCode) {
if (LOG.isDebugEnabled()) {
LOG.debug("Redirecting ({} to {}", httpStatusCode, location);
}
response.setStatus(httpStatusCode);
response.setHeader("Location", location);
response.setHeader("Connection", "clos... | [
"public",
"void",
"redirect",
"(",
"String",
"location",
",",
"int",
"httpStatusCode",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Redirecting ({} to {}\"",
",",
"httpStatusCode",
",",
"location",
")",
... | Trigger a browser redirect with specific http 3XX status code.
@param location Where to redirect permanently
@param httpStatusCode the http status code | [
"Trigger",
"a",
"browser",
"redirect",
"with",
"specific",
"http",
"3XX",
"status",
"code",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Response.java#L134-L146 |
13,777 | perwendel/spark | src/main/java/spark/Response.java | Response.removeCookie | public void removeCookie(String path, String name) {
Cookie cookie = new Cookie(name, "");
cookie.setPath(path);
cookie.setMaxAge(0);
response.addCookie(cookie);
} | java | public void removeCookie(String path, String name) {
Cookie cookie = new Cookie(name, "");
cookie.setPath(path);
cookie.setMaxAge(0);
response.addCookie(cookie);
} | [
"public",
"void",
"removeCookie",
"(",
"String",
"path",
",",
"String",
"name",
")",
"{",
"Cookie",
"cookie",
"=",
"new",
"Cookie",
"(",
"name",
",",
"\"\"",
")",
";",
"cookie",
".",
"setPath",
"(",
"path",
")",
";",
"cookie",
".",
"setMaxAge",
"(",
... | Removes the cookie with given path and name.
@param path path of the cookie
@param name name of the cookie | [
"Removes",
"the",
"cookie",
"with",
"given",
"path",
"and",
"name",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Response.java#L269-L274 |
13,778 | perwendel/spark | src/main/java/spark/QueryParamsMap.java | QueryParamsMap.loadQueryString | protected final void loadQueryString(Map<String, String[]> params) {
for (Map.Entry<String, String[]> param : params.entrySet()) {
loadKeys(param.getKey(), param.getValue());
}
} | java | protected final void loadQueryString(Map<String, String[]> params) {
for (Map.Entry<String, String[]> param : params.entrySet()) {
loadKeys(param.getKey(), param.getValue());
}
} | [
"protected",
"final",
"void",
"loadQueryString",
"(",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"params",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
"[",
"]",
">",
"param",
":",
"params",
".",
"entrySet",
"(",
... | loads query string
@param params the parameters | [
"loads",
"query",
"string"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/QueryParamsMap.java#L97-L101 |
13,779 | perwendel/spark | src/main/java/spark/staticfiles/StaticFilesConfiguration.java | StaticFilesConfiguration.consume | public boolean consume(HttpServletRequest httpRequest,
HttpServletResponse httpResponse) throws IOException {
try {
if (consumeWithFileResourceHandlers(httpRequest, httpResponse)) {
return true;
}
} catch (DirectoryTraversal.DirectoryTr... | java | public boolean consume(HttpServletRequest httpRequest,
HttpServletResponse httpResponse) throws IOException {
try {
if (consumeWithFileResourceHandlers(httpRequest, httpResponse)) {
return true;
}
} catch (DirectoryTraversal.DirectoryTr... | [
"public",
"boolean",
"consume",
"(",
"HttpServletRequest",
"httpRequest",
",",
"HttpServletResponse",
"httpResponse",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"consumeWithFileResourceHandlers",
"(",
"httpRequest",
",",
"httpResponse",
")",
")",
"{",
... | Attempt consuming using either static resource handlers or jar resource handlers
@param httpRequest The HTTP servlet request.
@param httpResponse The HTTP servlet response.
@return true if consumed, false otherwise.
@throws IOException in case of IO error. | [
"Attempt",
"consuming",
"using",
"either",
"static",
"resource",
"handlers",
"or",
"jar",
"resource",
"handlers"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/staticfiles/StaticFilesConfiguration.java#L67-L82 |
13,780 | perwendel/spark | src/main/java/spark/staticfiles/StaticFilesConfiguration.java | StaticFilesConfiguration.clear | public void clear() {
if (staticResourceHandlers != null) {
staticResourceHandlers.clear();
staticResourceHandlers = null;
}
staticResourcesSet = false;
externalStaticResourcesSet = false;
} | java | public void clear() {
if (staticResourceHandlers != null) {
staticResourceHandlers.clear();
staticResourceHandlers = null;
}
staticResourcesSet = false;
externalStaticResourcesSet = false;
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"if",
"(",
"staticResourceHandlers",
"!=",
"null",
")",
"{",
"staticResourceHandlers",
".",
"clear",
"(",
")",
";",
"staticResourceHandlers",
"=",
"null",
";",
"}",
"staticResourcesSet",
"=",
"false",
";",
"externalSta... | Clears all static file configuration | [
"Clears",
"all",
"static",
"file",
"configuration"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/staticfiles/StaticFilesConfiguration.java#L116-L125 |
13,781 | perwendel/spark | src/main/java/spark/utils/MimeParse.java | MimeParse.bestMatch | public static String bestMatch(Collection<String> supported, String header) {
List<ParseResults> parseResults = new LinkedList<>();
List<FitnessAndQuality> weightedMatches = new LinkedList<>();
for (String r : header.split(",")) {
parseResults.add(parseMediaRange(r));
}
... | java | public static String bestMatch(Collection<String> supported, String header) {
List<ParseResults> parseResults = new LinkedList<>();
List<FitnessAndQuality> weightedMatches = new LinkedList<>();
for (String r : header.split(",")) {
parseResults.add(parseMediaRange(r));
}
... | [
"public",
"static",
"String",
"bestMatch",
"(",
"Collection",
"<",
"String",
">",
"supported",
",",
"String",
"header",
")",
"{",
"List",
"<",
"ParseResults",
">",
"parseResults",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"List",
"<",
"FitnessAndQuality... | Finds best match
@param supported the supported types
@param header the header
@return the best match | [
"Finds",
"best",
"match"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/utils/MimeParse.java#L173-L189 |
13,782 | perwendel/spark | src/main/java/spark/Redirect.java | Redirect.any | public void any(String fromPath, String toPath, Status status) {
get(fromPath, toPath, status);
post(fromPath, toPath, status);
put(fromPath, toPath, status);
delete(fromPath, toPath, status);
} | java | public void any(String fromPath, String toPath, Status status) {
get(fromPath, toPath, status);
post(fromPath, toPath, status);
put(fromPath, toPath, status);
delete(fromPath, toPath, status);
} | [
"public",
"void",
"any",
"(",
"String",
"fromPath",
",",
"String",
"toPath",
",",
"Status",
"status",
")",
"{",
"get",
"(",
"fromPath",
",",
"toPath",
",",
"status",
")",
";",
"post",
"(",
"fromPath",
",",
"toPath",
",",
"status",
")",
";",
"put",
"(... | Redirects any HTTP request of type GET, POST, PUT, DELETE on 'fromPath' to 'toPath' with the provided redirect
'status' code.
@param fromPath from path
@param toPath to path
@param status status code | [
"Redirects",
"any",
"HTTP",
"request",
"of",
"type",
"GET",
"POST",
"PUT",
"DELETE",
"on",
"fromPath",
"to",
"toPath",
"with",
"the",
"provided",
"redirect",
"status",
"code",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Redirect.java#L120-L125 |
13,783 | perwendel/spark | src/main/java/spark/Redirect.java | Redirect.get | public void get(String fromPath, String toPath, Status status) {
http.get(fromPath, redirectRoute(toPath, status));
} | java | public void get(String fromPath, String toPath, Status status) {
http.get(fromPath, redirectRoute(toPath, status));
} | [
"public",
"void",
"get",
"(",
"String",
"fromPath",
",",
"String",
"toPath",
",",
"Status",
"status",
")",
"{",
"http",
".",
"get",
"(",
"fromPath",
",",
"redirectRoute",
"(",
"toPath",
",",
"status",
")",
")",
";",
"}"
] | Redirects any HTTP request of type GET on 'fromPath' to 'toPath' with the provided redirect 'status' code.
@param fromPath from path
@param toPath to path
@param status status code | [
"Redirects",
"any",
"HTTP",
"request",
"of",
"type",
"GET",
"on",
"fromPath",
"to",
"toPath",
"with",
"the",
"provided",
"redirect",
"status",
"code",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Redirect.java#L134-L136 |
13,784 | perwendel/spark | src/main/java/spark/Redirect.java | Redirect.post | public void post(String fromPath, String toPath, Status status) {
http.post(fromPath, redirectRoute(toPath, status));
} | java | public void post(String fromPath, String toPath, Status status) {
http.post(fromPath, redirectRoute(toPath, status));
} | [
"public",
"void",
"post",
"(",
"String",
"fromPath",
",",
"String",
"toPath",
",",
"Status",
"status",
")",
"{",
"http",
".",
"post",
"(",
"fromPath",
",",
"redirectRoute",
"(",
"toPath",
",",
"status",
")",
")",
";",
"}"
] | Redirects any HTTP request of type POST on 'fromPath' to 'toPath' with the provided redirect 'status' code.
@param fromPath from path
@param toPath to path
@param status status code | [
"Redirects",
"any",
"HTTP",
"request",
"of",
"type",
"POST",
"on",
"fromPath",
"to",
"toPath",
"with",
"the",
"provided",
"redirect",
"status",
"code",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Redirect.java#L145-L147 |
13,785 | perwendel/spark | src/main/java/spark/Redirect.java | Redirect.put | public void put(String fromPath, String toPath, Status status) {
http.put(fromPath, redirectRoute(toPath, status));
} | java | public void put(String fromPath, String toPath, Status status) {
http.put(fromPath, redirectRoute(toPath, status));
} | [
"public",
"void",
"put",
"(",
"String",
"fromPath",
",",
"String",
"toPath",
",",
"Status",
"status",
")",
"{",
"http",
".",
"put",
"(",
"fromPath",
",",
"redirectRoute",
"(",
"toPath",
",",
"status",
")",
")",
";",
"}"
] | Redirects any HTTP request of type PUT on 'fromPath' to 'toPath' with the provided redirect 'status' code.
@param fromPath from path
@param toPath to path
@param status status code | [
"Redirects",
"any",
"HTTP",
"request",
"of",
"type",
"PUT",
"on",
"fromPath",
"to",
"toPath",
"with",
"the",
"provided",
"redirect",
"status",
"code",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Redirect.java#L156-L158 |
13,786 | perwendel/spark | src/main/java/spark/Redirect.java | Redirect.delete | public void delete(String fromPath, String toPath, Status status) {
http.delete(fromPath, redirectRoute(toPath, status));
} | java | public void delete(String fromPath, String toPath, Status status) {
http.delete(fromPath, redirectRoute(toPath, status));
} | [
"public",
"void",
"delete",
"(",
"String",
"fromPath",
",",
"String",
"toPath",
",",
"Status",
"status",
")",
"{",
"http",
".",
"delete",
"(",
"fromPath",
",",
"redirectRoute",
"(",
"toPath",
",",
"status",
")",
")",
";",
"}"
] | Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath' with the provided redirect 'status' code.
@param fromPath from path
@param toPath to path
@param status status code | [
"Redirects",
"any",
"HTTP",
"request",
"of",
"type",
"DELETE",
"on",
"fromPath",
"to",
"toPath",
"with",
"the",
"provided",
"redirect",
"status",
"code",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Redirect.java#L167-L169 |
13,787 | perwendel/spark | src/main/java/spark/Spark.java | Spark.put | public static void put(String path, String acceptType, Route route) {
getInstance().put(path, acceptType, route);
} | java | public static void put(String path, String acceptType, Route route) {
getInstance().put(path, acceptType, route);
} | [
"public",
"static",
"void",
"put",
"(",
"String",
"path",
",",
"String",
"acceptType",
",",
"Route",
"route",
")",
"{",
"getInstance",
"(",
")",
".",
"put",
"(",
"path",
",",
"acceptType",
",",
"route",
")",
";",
"}"
] | Map the route for HTTP PUT requests
@param path the path
@param acceptType the accept type
@param route The route | [
"Map",
"the",
"route",
"for",
"HTTP",
"PUT",
"requests"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Spark.java#L256-L258 |
13,788 | perwendel/spark | src/main/java/spark/Spark.java | Spark.patch | public static void patch(String path, String acceptType, Route route) {
getInstance().patch(path, acceptType, route);
} | java | public static void patch(String path, String acceptType, Route route) {
getInstance().patch(path, acceptType, route);
} | [
"public",
"static",
"void",
"patch",
"(",
"String",
"path",
",",
"String",
"acceptType",
",",
"Route",
"route",
")",
"{",
"getInstance",
"(",
")",
".",
"patch",
"(",
"path",
",",
"acceptType",
",",
"route",
")",
";",
"}"
] | Map the route for HTTP PATCH requests
@param path the path
@param acceptType the accept type
@param route The route | [
"Map",
"the",
"route",
"for",
"HTTP",
"PATCH",
"requests"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Spark.java#L267-L269 |
13,789 | perwendel/spark | src/main/java/spark/Spark.java | Spark.trace | public static void trace(String path, String acceptType, Route route) {
getInstance().trace(path, acceptType, route);
} | java | public static void trace(String path, String acceptType, Route route) {
getInstance().trace(path, acceptType, route);
} | [
"public",
"static",
"void",
"trace",
"(",
"String",
"path",
",",
"String",
"acceptType",
",",
"Route",
"route",
")",
"{",
"getInstance",
"(",
")",
".",
"trace",
"(",
"path",
",",
"acceptType",
",",
"route",
")",
";",
"}"
] | Map the route for HTTP TRACE requests
@param path the path
@param acceptType the accept type
@param route The route | [
"Map",
"the",
"route",
"for",
"HTTP",
"TRACE",
"requests"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Spark.java#L300-L302 |
13,790 | perwendel/spark | src/main/java/spark/Spark.java | Spark.connect | public static void connect(String path, String acceptType, Route route) {
getInstance().connect(path, acceptType, route);
} | java | public static void connect(String path, String acceptType, Route route) {
getInstance().connect(path, acceptType, route);
} | [
"public",
"static",
"void",
"connect",
"(",
"String",
"path",
",",
"String",
"acceptType",
",",
"Route",
"route",
")",
"{",
"getInstance",
"(",
")",
".",
"connect",
"(",
"path",
",",
"acceptType",
",",
"route",
")",
";",
"}"
] | Map the route for HTTP CONNECT requests
@param path the path
@param acceptType the accept type
@param route The route | [
"Map",
"the",
"route",
"for",
"HTTP",
"CONNECT",
"requests"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Spark.java#L311-L313 |
13,791 | perwendel/spark | src/main/java/spark/Spark.java | Spark.options | public static void options(String path, String acceptType, Route route) {
getInstance().options(path, acceptType, route);
} | java | public static void options(String path, String acceptType, Route route) {
getInstance().options(path, acceptType, route);
} | [
"public",
"static",
"void",
"options",
"(",
"String",
"path",
",",
"String",
"acceptType",
",",
"Route",
"route",
")",
"{",
"getInstance",
"(",
")",
".",
"options",
"(",
"path",
",",
"acceptType",
",",
"route",
")",
";",
"}"
] | Map the route for HTTP OPTIONS requests
@param path the path
@param acceptType the accept type
@param route The route | [
"Map",
"the",
"route",
"for",
"HTTP",
"OPTIONS",
"requests"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Spark.java#L322-L324 |
13,792 | perwendel/spark | src/main/java/spark/Spark.java | Spark.before | public static void before(String path, String acceptType, Filter... filters) {
for (Filter filter : filters) {
getInstance().before(path, acceptType, filter);
}
} | java | public static void before(String path, String acceptType, Filter... filters) {
for (Filter filter : filters) {
getInstance().before(path, acceptType, filter);
}
} | [
"public",
"static",
"void",
"before",
"(",
"String",
"path",
",",
"String",
"acceptType",
",",
"Filter",
"...",
"filters",
")",
"{",
"for",
"(",
"Filter",
"filter",
":",
"filters",
")",
"{",
"getInstance",
"(",
")",
".",
"before",
"(",
"path",
",",
"ac... | Maps one or many filters to be executed before any matching routes
@param path the path
@param acceptType the accept type
@param filters The filters | [
"Maps",
"one",
"or",
"many",
"filters",
"to",
"be",
"executed",
"before",
"any",
"matching",
"routes"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Spark.java#L356-L360 |
13,793 | perwendel/spark | src/main/java/spark/Spark.java | Spark.after | public static void after(String path, String acceptType, Filter... filters) {
for (Filter filter : filters) {
getInstance().after(path, acceptType, filter);
}
} | java | public static void after(String path, String acceptType, Filter... filters) {
for (Filter filter : filters) {
getInstance().after(path, acceptType, filter);
}
} | [
"public",
"static",
"void",
"after",
"(",
"String",
"path",
",",
"String",
"acceptType",
",",
"Filter",
"...",
"filters",
")",
"{",
"for",
"(",
"Filter",
"filter",
":",
"filters",
")",
"{",
"getInstance",
"(",
")",
".",
"after",
"(",
"path",
",",
"acce... | Maps one or many filters to be executed after any matching routes
@param path the path
@param acceptType the accept type
@param filters The filters | [
"Maps",
"one",
"or",
"many",
"filters",
"to",
"be",
"executed",
"after",
"any",
"matching",
"routes"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Spark.java#L370-L374 |
13,794 | perwendel/spark | src/main/java/spark/Spark.java | Spark.exception | public static <T extends Exception> void exception(Class<T> exceptionClass, ExceptionHandler<? super T> handler) {
getInstance().exception(exceptionClass, handler);
} | java | public static <T extends Exception> void exception(Class<T> exceptionClass, ExceptionHandler<? super T> handler) {
getInstance().exception(exceptionClass, handler);
} | [
"public",
"static",
"<",
"T",
"extends",
"Exception",
">",
"void",
"exception",
"(",
"Class",
"<",
"T",
">",
"exceptionClass",
",",
"ExceptionHandler",
"<",
"?",
"super",
"T",
">",
"handler",
")",
"{",
"getInstance",
"(",
")",
".",
"exception",
"(",
"exc... | Maps an exception handler to be executed when an exception occurs during routing
@param exceptionClass the exception class
@param handler The handler | [
"Maps",
"an",
"exception",
"handler",
"to",
"be",
"executed",
"when",
"an",
"exception",
"occurs",
"during",
"routing"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Spark.java#L881-L883 |
13,795 | perwendel/spark | src/main/java/spark/resource/ClassPathResource.java | ClassPathResource.exists | @Override
public boolean exists() {
URL url;
if (this.clazz != null) {
url = this.clazz.getResource(this.path);
} else {
url = this.classLoader.getResource(this.path);
}
return (url != null);
} | java | @Override
public boolean exists() {
URL url;
if (this.clazz != null) {
url = this.clazz.getResource(this.path);
} else {
url = this.classLoader.getResource(this.path);
}
return (url != null);
} | [
"@",
"Override",
"public",
"boolean",
"exists",
"(",
")",
"{",
"URL",
"url",
";",
"if",
"(",
"this",
".",
"clazz",
"!=",
"null",
")",
"{",
"url",
"=",
"this",
".",
"clazz",
".",
"getResource",
"(",
"this",
".",
"path",
")",
";",
"}",
"else",
"{",... | This implementation checks for the resolution of a resource URL.
@return if exists.
@see java.lang.ClassLoader#getResource(String)
@see java.lang.Class#getResource(String) | [
"This",
"implementation",
"checks",
"for",
"the",
"resolution",
"of",
"a",
"resource",
"URL",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/resource/ClassPathResource.java#L143-L152 |
13,796 | perwendel/spark | src/main/java/spark/resource/ClassPathResource.java | ClassPathResource.createRelative | @Override
public Resource createRelative(String relativePath) {
String pathToUse = StringUtils.applyRelativePath(this.path, relativePath);
return new ClassPathResource(pathToUse, this.classLoader, this.clazz);
} | java | @Override
public Resource createRelative(String relativePath) {
String pathToUse = StringUtils.applyRelativePath(this.path, relativePath);
return new ClassPathResource(pathToUse, this.classLoader, this.clazz);
} | [
"@",
"Override",
"public",
"Resource",
"createRelative",
"(",
"String",
"relativePath",
")",
"{",
"String",
"pathToUse",
"=",
"StringUtils",
".",
"applyRelativePath",
"(",
"this",
".",
"path",
",",
"relativePath",
")",
";",
"return",
"new",
"ClassPathResource",
... | This implementation creates a ClassPathResource, applying the given path
relative to the path of the underlying resource of this descriptor.
@return the resource.
@see spark.utils.StringUtils#applyRelativePath(String, String) | [
"This",
"implementation",
"creates",
"a",
"ClassPathResource",
"applying",
"the",
"given",
"path",
"relative",
"to",
"the",
"path",
"of",
"the",
"underlying",
"resource",
"of",
"this",
"descriptor",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/resource/ClassPathResource.java#L203-L207 |
13,797 | perwendel/spark | src/main/java/spark/serialization/SerializerChain.java | SerializerChain.process | public void process(OutputStream outputStream, Object element) throws IOException {
this.root.processElement(outputStream, element);
} | java | public void process(OutputStream outputStream, Object element) throws IOException {
this.root.processElement(outputStream, element);
} | [
"public",
"void",
"process",
"(",
"OutputStream",
"outputStream",
",",
"Object",
"element",
")",
"throws",
"IOException",
"{",
"this",
".",
"root",
".",
"processElement",
"(",
"outputStream",
",",
"element",
")",
";",
"}"
] | Process the output.
@param outputStream the output stream to write to.
@param element the element to serialize.
@throws IOException in the case of IO error. | [
"Process",
"the",
"output",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/serialization/SerializerChain.java#L52-L54 |
13,798 | perwendel/spark | src/main/java/spark/http/matching/GeneralError.java | GeneralError.modify | static void modify(HttpServletRequest httpRequest,
HttpServletResponse httpResponse,
Body body,
RequestWrapper requestWrapper,
ResponseWrapper responseWrapper,
ExceptionMapper exceptionMapper,
... | java | static void modify(HttpServletRequest httpRequest,
HttpServletResponse httpResponse,
Body body,
RequestWrapper requestWrapper,
ResponseWrapper responseWrapper,
ExceptionMapper exceptionMapper,
... | [
"static",
"void",
"modify",
"(",
"HttpServletRequest",
"httpRequest",
",",
"HttpServletResponse",
"httpResponse",
",",
"Body",
"body",
",",
"RequestWrapper",
"requestWrapper",
",",
"ResponseWrapper",
"responseWrapper",
",",
"ExceptionMapper",
"exceptionMapper",
",",
"Exce... | Modifies the HTTP response and body based on the provided exception. | [
"Modifies",
"the",
"HTTP",
"response",
"and",
"body",
"based",
"on",
"the",
"provided",
"exception",
"."
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/http/matching/GeneralError.java#L37-L67 |
13,799 | perwendel/spark | src/main/java/spark/route/Routes.java | Routes.add | public void add(HttpMethod httpMethod, RouteImpl route) {
add(httpMethod, route.getPath() , route.getAcceptType(), route);
} | java | public void add(HttpMethod httpMethod, RouteImpl route) {
add(httpMethod, route.getPath() , route.getAcceptType(), route);
} | [
"public",
"void",
"add",
"(",
"HttpMethod",
"httpMethod",
",",
"RouteImpl",
"route",
")",
"{",
"add",
"(",
"httpMethod",
",",
"route",
".",
"getPath",
"(",
")",
",",
"route",
".",
"getAcceptType",
"(",
")",
",",
"route",
")",
";",
"}"
] | Add a route
@param httpMethod the http-method of the route
@param route the route to add | [
"Add",
"a",
"route"
] | 080fb1f9d6e580f6742e9589044c7420d3157b8b | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/route/Routes.java#L61-L63 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.