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,500
OpenTSDB/opentsdb
src/tsd/StatsRpc.java
StatsRpc.printRegionClientStats
private void printRegionClientStats(final TSDB tsdb, final HttpQuery query) { final List<RegionClientStats> region_stats = tsdb.getClient().regionStats(); final List<Map<String, Object>> stats = new ArrayList<Map<String, Object>>(region_stats.size()); for (final RegionClientStats rcs : region_stats...
java
private void printRegionClientStats(final TSDB tsdb, final HttpQuery query) { final List<RegionClientStats> region_stats = tsdb.getClient().regionStats(); final List<Map<String, Object>> stats = new ArrayList<Map<String, Object>>(region_stats.size()); for (final RegionClientStats rcs : region_stats...
[ "private", "void", "printRegionClientStats", "(", "final", "TSDB", "tsdb", ",", "final", "HttpQuery", "query", ")", "{", "final", "List", "<", "RegionClientStats", ">", "region_stats", "=", "tsdb", ".", "getClient", "(", ")", ".", "regionStats", "(", ")", ";...
Display stats for each region client @param tsdb The TSDB to use for fetching stats @param query The query to respond to
[ "Display", "stats", "for", "each", "region", "client" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/StatsRpc.java#L153-L176
13,501
OpenTSDB/opentsdb
src/tsd/StatsRpc.java
StatsRpc.printThreadStats
private void printThreadStats(final HttpQuery query) { final Set<Thread> threads = Thread.getAllStackTraces().keySet(); final List<Map<String, Object>> output = new ArrayList<Map<String, Object>>(threads.size()); for (final Thread thread : threads) { final Map<String, Object> status = new Has...
java
private void printThreadStats(final HttpQuery query) { final Set<Thread> threads = Thread.getAllStackTraces().keySet(); final List<Map<String, Object>> output = new ArrayList<Map<String, Object>>(threads.size()); for (final Thread thread : threads) { final Map<String, Object> status = new Has...
[ "private", "void", "printThreadStats", "(", "final", "HttpQuery", "query", ")", "{", "final", "Set", "<", "Thread", ">", "threads", "=", "Thread", ".", "getAllStackTraces", "(", ")", ".", "keySet", "(", ")", ";", "final", "List", "<", "Map", "<", "String...
Grabs a snapshot of all JVM thread states and formats it in a manner to be displayed via API. @param query The query to respond to
[ "Grabs", "a", "snapshot", "of", "all", "JVM", "thread", "states", "and", "formats", "it", "in", "a", "manner", "to", "be", "displayed", "via", "API", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/StatsRpc.java#L184-L205
13,502
OpenTSDB/opentsdb
src/tsd/StatsRpc.java
StatsRpc.collectThreadStats
private void collectThreadStats(final StatsCollector collector) { final Set<Thread> threads = Thread.getAllStackTraces().keySet(); final Map<String, Integer> states = new HashMap<String, Integer>(6); states.put("new", 0); states.put("runnable", 0); states.put("blocked", 0); states.put("waiting",...
java
private void collectThreadStats(final StatsCollector collector) { final Set<Thread> threads = Thread.getAllStackTraces().keySet(); final Map<String, Integer> states = new HashMap<String, Integer>(6); states.put("new", 0); states.put("runnable", 0); states.put("blocked", 0); states.put("waiting",...
[ "private", "void", "collectThreadStats", "(", "final", "StatsCollector", "collector", ")", "{", "final", "Set", "<", "Thread", ">", "threads", "=", "Thread", ".", "getAllStackTraces", "(", ")", ".", "keySet", "(", ")", ";", "final", "Map", "<", "String", "...
Runs through the live threads and counts captures a coune of their states for dumping in the stats page. @param collector The collector to write to
[ "Runs", "through", "the", "live", "threads", "and", "counts", "captures", "a", "coune", "of", "their", "states", "for", "dumping", "in", "the", "stats", "page", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/StatsRpc.java#L288-L307
13,503
OpenTSDB/opentsdb
src/tsd/StatsRpc.java
StatsRpc.formatStatName
private static String formatStatName(final String stat) { if (stat == null || stat.isEmpty()) { return stat; } String name = stat.replace(" ", ""); return name.substring(0, 1).toLowerCase() + name.substring(1); }
java
private static String formatStatName(final String stat) { if (stat == null || stat.isEmpty()) { return stat; } String name = stat.replace(" ", ""); return name.substring(0, 1).toLowerCase() + name.substring(1); }
[ "private", "static", "String", "formatStatName", "(", "final", "String", "stat", ")", "{", "if", "(", "stat", "==", "null", "||", "stat", ".", "isEmpty", "(", ")", ")", "{", "return", "stat", ";", "}", "String", "name", "=", "stat", ".", "replace", "...
Little helper to convert the first character to lowercase and remove any spaces @param stat The name to cleanup @return a clean name or null if the original string was null or empty
[ "Little", "helper", "to", "convert", "the", "first", "character", "to", "lowercase", "and", "remove", "any", "spaces" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/StatsRpc.java#L315-L321
13,504
OpenTSDB/opentsdb
src/tsd/StatsRpc.java
StatsRpc.printQueryStats
private void printQueryStats(final HttpQuery query) { switch (query.apiVersion()) { case 0: case 1: query.sendReply(query.serializer().formatQueryStatsV1( QueryStats.getRunningAndCompleteStats())); break; default: throw new BadRequestException(HttpResponseStatus.NOT_IMPLEMEN...
java
private void printQueryStats(final HttpQuery query) { switch (query.apiVersion()) { case 0: case 1: query.sendReply(query.serializer().formatQueryStatsV1( QueryStats.getRunningAndCompleteStats())); break; default: throw new BadRequestException(HttpResponseStatus.NOT_IMPLEMEN...
[ "private", "void", "printQueryStats", "(", "final", "HttpQuery", "query", ")", "{", "switch", "(", "query", ".", "apiVersion", "(", ")", ")", "{", "case", "0", ":", "case", "1", ":", "query", ".", "sendReply", "(", "query", ".", "serializer", "(", ")",...
Print the detailed query stats to the caller using the proper serializer @param query The query to answer to @throws BadRequestException if the API version hasn't been implemented yet
[ "Print", "the", "detailed", "query", "stats", "to", "the", "caller", "using", "the", "proper", "serializer" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/StatsRpc.java#L329-L341
13,505
OpenTSDB/opentsdb
src/tsd/DropCachesRpc.java
DropCachesRpc.dropCaches
private void dropCaches(final TSDB tsdb, final Channel chan) { LOG.warn(chan + " Dropping all in-memory caches."); tsdb.dropCaches(); }
java
private void dropCaches(final TSDB tsdb, final Channel chan) { LOG.warn(chan + " Dropping all in-memory caches."); tsdb.dropCaches(); }
[ "private", "void", "dropCaches", "(", "final", "TSDB", "tsdb", ",", "final", "Channel", "chan", ")", "{", "LOG", ".", "warn", "(", "chan", "+", "\" Dropping all in-memory caches.\"", ")", ";", "tsdb", ".", "dropCaches", "(", ")", ";", "}" ]
Drops in memory caches.
[ "Drops", "in", "memory", "caches", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/DropCachesRpc.java#L84-L87
13,506
OpenTSDB/opentsdb
src/core/WriteableDataPointFilterPlugin.java
WriteableDataPointFilterPlugin.allowHistogramPoint
public Deferred<Boolean> allowHistogramPoint( final String metric, final long timestamp, final byte[] value, final Map<String, String> tags) { throw new UnsupportedOperationException("Not yet implemented."); }
java
public Deferred<Boolean> allowHistogramPoint( final String metric, final long timestamp, final byte[] value, final Map<String, String> tags) { throw new UnsupportedOperationException("Not yet implemented."); }
[ "public", "Deferred", "<", "Boolean", ">", "allowHistogramPoint", "(", "final", "String", "metric", ",", "final", "long", "timestamp", ",", "final", "byte", "[", "]", "value", ",", "final", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "thr...
Determine whether or not the data point should be stored. If the data should not be stored, the implementation can return false or an exception in the deferred object. Otherwise it should return true and the data point will be written to storage. @param metric The metric name for the data point @param timestamp The tim...
[ "Determine", "whether", "or", "not", "the", "data", "point", "should", "be", "stored", ".", "If", "the", "data", "should", "not", "be", "stored", "the", "implementation", "can", "return", "false", "or", "an", "exception", "in", "the", "deferred", "object", ...
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/WriteableDataPointFilterPlugin.java#L104-L110
13,507
OpenTSDB/opentsdb
src/query/filter/TagVFilter.java
TagVFilter.getFilter
public static TagVFilter getFilter(final String tagk, final String filter) { if (tagk == null || tagk.isEmpty()) { throw new IllegalArgumentException("Tagk cannot be null or empty"); } if (filter == null || filter.isEmpty()) { throw new IllegalArgumentException("Filter cannot be null or empty");...
java
public static TagVFilter getFilter(final String tagk, final String filter) { if (tagk == null || tagk.isEmpty()) { throw new IllegalArgumentException("Tagk cannot be null or empty"); } if (filter == null || filter.isEmpty()) { throw new IllegalArgumentException("Filter cannot be null or empty");...
[ "public", "static", "TagVFilter", "getFilter", "(", "final", "String", "tagk", ",", "final", "String", "filter", ")", "{", "if", "(", "tagk", "==", "null", "||", "tagk", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", ...
Parses the tag value and determines if it's a group by, a literal or a filter. @param tagk The tag key associated with this value @param filter The tag value, possibly a filter @return Null if the value was a group by or a literal, a valid filter object if it looked to be a filter. @throws IllegalArgumentException if t...
[ "Parses", "the", "tag", "value", "and", "determines", "if", "it", "s", "a", "group", "by", "a", "literal", "or", "a", "filter", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/filter/TagVFilter.java#L199-L224
13,508
OpenTSDB/opentsdb
src/query/filter/TagVFilter.java
TagVFilter.initializeFilterMap
public static void initializeFilterMap(final TSDB tsdb) throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException, IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException { final List<TagVFilter> filter_plugins = PluginLoader.load...
java
public static void initializeFilterMap(final TSDB tsdb) throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException, IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException { final List<TagVFilter> filter_plugins = PluginLoader.load...
[ "public", "static", "void", "initializeFilterMap", "(", "final", "TSDB", "tsdb", ")", "throws", "ClassNotFoundException", ",", "NoSuchMethodException", ",", "NoSuchFieldException", ",", "IllegalArgumentException", ",", "SecurityException", ",", "IllegalAccessException", ","...
Loads plugins from the plugin directory and loads them into the map. Built-in filters don't need to go through this process. @param tsdb A TSDB to use to initialize plugins @throws ClassNotFoundException If we found a class that we didn't... find? @throws NoSuchMethodException If the discovered plugin didn't have the p...
[ "Loads", "plugins", "from", "the", "plugin", "directory", "and", "loads", "them", "into", "the", "map", ".", "Built", "-", "in", "filters", "don", "t", "need", "to", "go", "through", "this", "process", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/filter/TagVFilter.java#L260-L295
13,509
OpenTSDB/opentsdb
src/query/filter/TagVFilter.java
TagVFilter.tagsToFilters
public static void tagsToFilters(final Map<String, String> tags, final List<TagVFilter> filters) { mapToFilters(tags, filters, true); }
java
public static void tagsToFilters(final Map<String, String> tags, final List<TagVFilter> filters) { mapToFilters(tags, filters, true); }
[ "public", "static", "void", "tagsToFilters", "(", "final", "Map", "<", "String", ",", "String", ">", "tags", ",", "final", "List", "<", "TagVFilter", ">", "filters", ")", "{", "mapToFilters", "(", "tags", ",", "filters", ",", "true", ")", ";", "}" ]
Converts the tag map to a filter list. If a filter already exists for a tag group by, then the duplicate is skipped. @param tags A set of tag keys and values. May be null or empty. @param filters A set of filters to add the converted filters to. This may not be null.
[ "Converts", "the", "tag", "map", "to", "a", "filter", "list", ".", "If", "a", "filter", "already", "exists", "for", "a", "tag", "group", "by", "then", "the", "duplicate", "is", "skipped", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/filter/TagVFilter.java#L304-L307
13,510
OpenTSDB/opentsdb
src/query/filter/TagVFilter.java
TagVFilter.mapToFilters
public static void mapToFilters(final Map<String, String> map, final List<TagVFilter> filters, final boolean group_by) { if (map == null || map.isEmpty()) { return; } for (final Map.Entry<String, String> entry : map.entrySet()) { TagVFilter filter = getFilter(entry.getKey(), entry.getVal...
java
public static void mapToFilters(final Map<String, String> map, final List<TagVFilter> filters, final boolean group_by) { if (map == null || map.isEmpty()) { return; } for (final Map.Entry<String, String> entry : map.entrySet()) { TagVFilter filter = getFilter(entry.getKey(), entry.getVal...
[ "public", "static", "void", "mapToFilters", "(", "final", "Map", "<", "String", ",", "String", ">", "map", ",", "final", "List", "<", "TagVFilter", ">", "filters", ",", "final", "boolean", "group_by", ")", "{", "if", "(", "map", "==", "null", "||", "ma...
Converts the map to a filter list. If a filter already exists for a tag group by and we're told to process group bys, then the duplicate is skipped. @param map A set of tag keys and values. May be null or empty. @param filters A set of filters to add the converted filters to. This may not be null. @param group_by Whet...
[ "Converts", "the", "map", "to", "a", "filter", "list", ".", "If", "a", "filter", "already", "exists", "for", "a", "tag", "group", "by", "and", "we", "re", "told", "to", "process", "group", "bys", "then", "the", "duplicate", "is", "skipped", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/filter/TagVFilter.java#L318-L352
13,511
OpenTSDB/opentsdb
src/query/filter/TagVFilter.java
TagVFilter.loadedFilters
public static Map<String, Map<String, String>> loadedFilters() { final Map<String, Map<String, String>> filters = new HashMap<String, Map<String, String>>(tagv_filter_map.size()); for (final Pair<Class<?>, Constructor<? extends TagVFilter>> pair : tagv_filter_map.values()) { final Map<St...
java
public static Map<String, Map<String, String>> loadedFilters() { final Map<String, Map<String, String>> filters = new HashMap<String, Map<String, String>>(tagv_filter_map.size()); for (final Pair<Class<?>, Constructor<? extends TagVFilter>> pair : tagv_filter_map.values()) { final Map<St...
[ "public", "static", "Map", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "loadedFilters", "(", ")", "{", "final", "Map", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "filters", "=", "new", "HashMap", "<", ...
Runs through the loaded plugin map and dumps the names, description and examples into a map to serialize via the API. @return A map of filter meta data.
[ "Runs", "through", "the", "loaded", "plugin", "map", "and", "dumps", "the", "names", "description", "and", "examples", "into", "a", "map", "to", "serialize", "via", "the", "API", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/filter/TagVFilter.java#L359-L392
13,512
OpenTSDB/opentsdb
src/tools/Fsck.java
Fsck.runQueries
public void runQueries(final List<Query> queries) throws Exception { final long start_time = System.currentTimeMillis() / 1000; // TODO - threadify it. We *could* have hundreds of queries and we don't // want to create that many threads. For now we'll just execute each one // serially final Thread ...
java
public void runQueries(final List<Query> queries) throws Exception { final long start_time = System.currentTimeMillis() / 1000; // TODO - threadify it. We *could* have hundreds of queries and we don't // want to create that many threads. For now we'll just execute each one // serially final Thread ...
[ "public", "void", "runQueries", "(", "final", "List", "<", "Query", ">", "queries", ")", "throws", "Exception", "{", "final", "long", "start_time", "=", "System", ".", "currentTimeMillis", "(", ")", "/", "1000", ";", "// TODO - threadify it. We *could* have hundre...
Scans the rows matching one or more standard queries. An aggregator is still required though it's ignored. @param queries The queries to execute @throws Exception If something goes pear shaped.
[ "Scans", "the", "rows", "matching", "one", "or", "more", "standard", "queries", ".", "An", "aggregator", "is", "still", "required", "though", "it", "s", "ignored", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/Fsck.java#L183-L213
13,513
OpenTSDB/opentsdb
src/tools/Fsck.java
Fsck.usage
private static void usage(final ArgP argp, final String errmsg, final int retval) { System.err.println(errmsg); System.err.println("Usage: fsck" + " [flags] [START-DATE [END-DATE] query [queries...]] \n" + "Scans the OpenTSDB data table for errors. Use the --full-scan...
java
private static void usage(final ArgP argp, final String errmsg, final int retval) { System.err.println(errmsg); System.err.println("Usage: fsck" + " [flags] [START-DATE [END-DATE] query [queries...]] \n" + "Scans the OpenTSDB data table for errors. Use the --full-scan...
[ "private", "static", "void", "usage", "(", "final", "ArgP", "argp", ",", "final", "String", "errmsg", ",", "final", "int", "retval", ")", "{", "System", ".", "err", ".", "println", "(", "errmsg", ")", ";", "System", ".", "err", ".", "println", "(", "...
Prints usage and exits with the given retval.
[ "Prints", "usage", "and", "exits", "with", "the", "given", "retval", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/Fsck.java#L1216-L1230
13,514
OpenTSDB/opentsdb
src/tools/Fsck.java
Fsck.logResults
private void logResults() { LOG.info("Key Values Processed: " + kvs_processed.get()); LOG.info("Rows Processed: " + rows_processed.get()); LOG.info("Valid Datapoints: " + valid_datapoints.get()); LOG.info("Annotations: " + annotations.get()); LOG.info("Invalid Row Keys Found: " + bad_key.get()); ...
java
private void logResults() { LOG.info("Key Values Processed: " + kvs_processed.get()); LOG.info("Rows Processed: " + rows_processed.get()); LOG.info("Valid Datapoints: " + valid_datapoints.get()); LOG.info("Annotations: " + annotations.get()); LOG.info("Invalid Row Keys Found: " + bad_key.get()); ...
[ "private", "void", "logResults", "(", ")", "{", "LOG", ".", "info", "(", "\"Key Values Processed: \"", "+", "kvs_processed", ".", "get", "(", ")", ")", ";", "LOG", ".", "info", "(", "\"Rows Processed: \"", "+", "rows_processed", ".", "get", "(", ")", ")", ...
Helper to dump the atomic counters to the log after a completed FSCK
[ "Helper", "to", "dump", "the", "atomic", "counters", "to", "the", "log", "after", "a", "completed", "FSCK" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/Fsck.java#L1235-L1263
13,515
OpenTSDB/opentsdb
src/tools/Fsck.java
Fsck.main
public static void main(String[] args) throws Exception { ArgP argp = new ArgP(); argp.addOption("--help", "Print help information."); CliOptions.addCommon(argp); FsckOptions.addDataOptions(argp); args = CliOptions.parse(argp, args); if (argp.has("--help")) { usage(argp, "", 0); } ...
java
public static void main(String[] args) throws Exception { ArgP argp = new ArgP(); argp.addOption("--help", "Print help information."); CliOptions.addCommon(argp); FsckOptions.addDataOptions(argp); args = CliOptions.parse(argp, args); if (argp.has("--help")) { usage(argp, "", 0); } ...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "ArgP", "argp", "=", "new", "ArgP", "(", ")", ";", "argp", ".", "addOption", "(", "\"--help\"", ",", "\"Print help information.\"", ")", ";", "CliOptions"...
The main class executed from the "tsdb" script @param args Command line arguments to parse @throws Exception If something goes pear shaped
[ "The", "main", "class", "executed", "from", "the", "tsdb", "script" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/Fsck.java#L1270-L1305
13,516
OpenTSDB/opentsdb
src/query/filter/TagVLiteralOrFilter.java
TagVLiteralOrFilter.resolveTagkName
@Override public Deferred<byte[]> resolveTagkName(final TSDB tsdb) { final Config config = tsdb.getConfig(); // resolve tag values if the filter is NOT case insensitive and there are // fewer literals than the expansion limit if (!case_insensitive && literals.size() <= config.getInt("ts...
java
@Override public Deferred<byte[]> resolveTagkName(final TSDB tsdb) { final Config config = tsdb.getConfig(); // resolve tag values if the filter is NOT case insensitive and there are // fewer literals than the expansion limit if (!case_insensitive && literals.size() <= config.getInt("ts...
[ "@", "Override", "public", "Deferred", "<", "byte", "[", "]", ">", "resolveTagkName", "(", "final", "TSDB", "tsdb", ")", "{", "final", "Config", "config", "=", "tsdb", ".", "getConfig", "(", ")", ";", "// resolve tag values if the filter is NOT case insensitive an...
Overridden here so that we can resolve the literal values if we don't have too many of them AND we're not searching with case insensitivity.
[ "Overridden", "here", "so", "that", "we", "can", "resolve", "the", "literal", "values", "if", "we", "don", "t", "have", "too", "many", "of", "them", "AND", "we", "re", "not", "searching", "with", "case", "insensitivity", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/filter/TagVLiteralOrFilter.java#L100-L112
13,517
OpenTSDB/opentsdb
src/tools/GnuplotInstaller.java
GnuplotInstaller.installMyGnuPlot
public static void installMyGnuPlot() { if(!FOUND_GP) { LOG.warn("Skipping Gnuplot Shell Script Install since Gnuplot executable was not found"); return; } if(!GP_FILE.exists()) { if(!GP_FILE.getParentFile().exists()) { GP_FILE.getParentFile().mkdirs(); } ...
java
public static void installMyGnuPlot() { if(!FOUND_GP) { LOG.warn("Skipping Gnuplot Shell Script Install since Gnuplot executable was not found"); return; } if(!GP_FILE.exists()) { if(!GP_FILE.getParentFile().exists()) { GP_FILE.getParentFile().mkdirs(); } ...
[ "public", "static", "void", "installMyGnuPlot", "(", ")", "{", "if", "(", "!", "FOUND_GP", ")", "{", "LOG", ".", "warn", "(", "\"Skipping Gnuplot Shell Script Install since Gnuplot executable was not found\"", ")", ";", "return", ";", "}", "if", "(", "!", "GP_FILE...
Installs the mygnuplot shell file
[ "Installs", "the", "mygnuplot", "shell", "file" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/GnuplotInstaller.java#L78-L105
13,518
OpenTSDB/opentsdb
src/core/IncomingDataPoint.java
IncomingDataPoint.validate
public boolean validate(final List<Map<String, Object>> details) { if (this.getMetric() == null || this.getMetric().isEmpty()) { if (details != null) { details.add(getHttpDetails("Metric name was empty")); } LOG.warn("Metric name was empty: " + this); return false; } //TODO ...
java
public boolean validate(final List<Map<String, Object>> details) { if (this.getMetric() == null || this.getMetric().isEmpty()) { if (details != null) { details.add(getHttpDetails("Metric name was empty")); } LOG.warn("Metric name was empty: " + this); return false; } //TODO ...
[ "public", "boolean", "validate", "(", "final", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "details", ")", "{", "if", "(", "this", ".", "getMetric", "(", ")", "==", "null", "||", "this", ".", "getMetric", "(", ")", ".", "isEmpty", "...
Pre-validation of the various fields to make sure they're valid @param details a map to hold detailed error message. If null then the errors will be logged @return true if data point is valid, otherwise false
[ "Pre", "-", "validation", "of", "the", "various", "fields", "to", "make", "sure", "they", "re", "valid" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/IncomingDataPoint.java#L175-L210
13,519
OpenTSDB/opentsdb
src/core/IncomingDataPoint.java
IncomingDataPoint.getHttpDetails
protected final Map<String, Object> getHttpDetails(final String message) { final Map<String, Object> map = new HashMap<String, Object>(); map.put("error", message); map.put("datapoint", this); return map; }
java
protected final Map<String, Object> getHttpDetails(final String message) { final Map<String, Object> map = new HashMap<String, Object>(); map.put("error", message); map.put("datapoint", this); return map; }
[ "protected", "final", "Map", "<", "String", ",", "Object", ">", "getHttpDetails", "(", "final", "String", "message", ")", "{", "final", "Map", "<", "String", ",", "Object", ">", "map", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")",...
Creates a map with an error message and this data point to return to the HTTP put data point RPC handler @param message The message to log @return A map to append to the HTTP response
[ "Creates", "a", "map", "with", "an", "error", "message", "and", "this", "data", "point", "to", "return", "to", "the", "HTTP", "put", "data", "point", "RPC", "handler" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/IncomingDataPoint.java#L218-L223
13,520
OpenTSDB/opentsdb
src/stats/Histogram.java
Histogram.printAsciiBucket
final void printAsciiBucket(final StringBuilder out, final int i) { out.append('[') .append(bucketLowInterval(i)) .append('-') .append(i == buckets.length - 1 ? "Inf" : bucketHighInterval(i)) .append("): ") .append(buckets[i]) .append('\n'); }
java
final void printAsciiBucket(final StringBuilder out, final int i) { out.append('[') .append(bucketLowInterval(i)) .append('-') .append(i == buckets.length - 1 ? "Inf" : bucketHighInterval(i)) .append("): ") .append(buckets[i]) .append('\n'); }
[ "final", "void", "printAsciiBucket", "(", "final", "StringBuilder", "out", ",", "final", "int", "i", ")", "{", "out", ".", "append", "(", "'", "'", ")", ".", "append", "(", "bucketLowInterval", "(", "i", ")", ")", ".", "append", "(", "'", "'", ")", ...
Prints a bucket of this histogram in a human readable ASCII format. @param out The buffer to which to write the output. @see #printAscii
[ "Prints", "a", "bucket", "of", "this", "histogram", "in", "a", "human", "readable", "ASCII", "format", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/stats/Histogram.java#L216-L224
13,521
OpenTSDB/opentsdb
src/stats/Histogram.java
Histogram.bucketIndexFor
private int bucketIndexFor(final int value) { if (value < cutoff) { return value / interval; } int bucket = num_linear_buckets // Skip all linear buckets. // And find which bucket the rest (after `cutoff') should be in. // Reminder: the first exponential bucket ends at 2^exp_bucket_shift....
java
private int bucketIndexFor(final int value) { if (value < cutoff) { return value / interval; } int bucket = num_linear_buckets // Skip all linear buckets. // And find which bucket the rest (after `cutoff') should be in. // Reminder: the first exponential bucket ends at 2^exp_bucket_shift....
[ "private", "int", "bucketIndexFor", "(", "final", "int", "value", ")", "{", "if", "(", "value", "<", "cutoff", ")", "{", "return", "value", "/", "interval", ";", "}", "int", "bucket", "=", "num_linear_buckets", "// Skip all linear buckets.", "// And find which b...
Finds the index of the bucket in which the given value should be.
[ "Finds", "the", "index", "of", "the", "bucket", "in", "which", "the", "given", "value", "should", "be", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/stats/Histogram.java#L232-L244
13,522
OpenTSDB/opentsdb
src/query/expression/TimeSyncedIterator.java
TimeSyncedIterator.setupEmitters
private void setupEmitters() { // set the iterators for (int i = 0; i < dps.length; i++) { iterators[i] = dps[i].iterator(); if (!iterators[i].hasNext()) { current_values[i] = null; emitter_values[i] = null; } else { current_values[i] = iterators[i].next(); emit...
java
private void setupEmitters() { // set the iterators for (int i = 0; i < dps.length; i++) { iterators[i] = dps[i].iterator(); if (!iterators[i].hasNext()) { current_values[i] = null; emitter_values[i] = null; } else { current_values[i] = iterators[i].next(); emit...
[ "private", "void", "setupEmitters", "(", ")", "{", "// set the iterators", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dps", ".", "length", ";", "i", "++", ")", "{", "iterators", "[", "i", "]", "=", "dps", "[", "i", "]", ".", "iterator", "(...
Iterates over the values and sets up the current and emitter values
[ "Iterates", "over", "the", "values", "and", "sets", "up", "the", "current", "and", "emitter", "values" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/expression/TimeSyncedIterator.java#L234-L247
13,523
OpenTSDB/opentsdb
src/query/pojo/Validatable.java
Validatable.validateCollection
<T extends Validatable> void validateCollection(final Collection<T> collection, final String name) { Iterator<T> iterator = collection.iterator(); int i = 0; while (iterator.hasNext()) { try { iterator.next().validate(); } catch (final Il...
java
<T extends Validatable> void validateCollection(final Collection<T> collection, final String name) { Iterator<T> iterator = collection.iterator(); int i = 0; while (iterator.hasNext()) { try { iterator.next().validate(); } catch (final Il...
[ "<", "T", "extends", "Validatable", ">", "void", "validateCollection", "(", "final", "Collection", "<", "T", ">", "collection", ",", "final", "String", "name", ")", "{", "Iterator", "<", "T", ">", "iterator", "=", "collection", ".", "iterator", "(", ")", ...
Iterate through a field that is a collection of POJOs and validate each of them. Inherit member POJO's error message. @param collection the validatable POJO collection @param name name of the field
[ "Iterate", "through", "a", "field", "that", "is", "a", "collection", "of", "POJOs", "and", "validate", "each", "of", "them", ".", "Inherit", "member", "POJO", "s", "error", "message", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/pojo/Validatable.java#L32-L45
13,524
OpenTSDB/opentsdb
src/query/pojo/Validatable.java
Validatable.validatePOJO
<T extends Validatable> void validatePOJO(final T pojo, final String name) { try { pojo.validate(); } catch (final IllegalArgumentException e) { throw new IllegalArgumentException("Invalid " + name, e); } }
java
<T extends Validatable> void validatePOJO(final T pojo, final String name) { try { pojo.validate(); } catch (final IllegalArgumentException e) { throw new IllegalArgumentException("Invalid " + name, e); } }
[ "<", "T", "extends", "Validatable", ">", "void", "validatePOJO", "(", "final", "T", "pojo", ",", "final", "String", "name", ")", "{", "try", "{", "pojo", ".", "validate", "(", ")", ";", "}", "catch", "(", "final", "IllegalArgumentException", "e", ")", ...
Validate a single POJO validate @param pojo The POJO object to validate @param name name of the field
[ "Validate", "a", "single", "POJO", "validate" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/pojo/Validatable.java#L52-L58
13,525
OpenTSDB/opentsdb
src/tsd/RpcManager.java
RpcManager.shutdown
public Deferred<ArrayList<Object>> shutdown() { // Clear shared instance. INSTANCE.set(null); final Collection<Deferred<Object>> deferreds = Lists.newArrayList(); if (http_plugin_commands != null) { for (final Map.Entry<String, HttpRpcPlugin> entry : http_plugin_commands.entrySet()) { de...
java
public Deferred<ArrayList<Object>> shutdown() { // Clear shared instance. INSTANCE.set(null); final Collection<Deferred<Object>> deferreds = Lists.newArrayList(); if (http_plugin_commands != null) { for (final Map.Entry<String, HttpRpcPlugin> entry : http_plugin_commands.entrySet()) { de...
[ "public", "Deferred", "<", "ArrayList", "<", "Object", ">", ">", "shutdown", "(", ")", "{", "// Clear shared instance.", "INSTANCE", ".", "set", "(", "null", ")", ";", "final", "Collection", "<", "Deferred", "<", "Object", ">", ">", "deferreds", "=", "List...
Called to gracefully shutdown the plugin. Implementations should close any IO they have open @return A deferred object that indicates the completion of the request. The {@link Object} has not special meaning and can be {@code null} (think of it as {@code Deferred<Void>}).
[ "Called", "to", "gracefully", "shutdown", "the", "plugin", ".", "Implementations", "should", "close", "any", "IO", "they", "have", "open" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/RpcManager.java#L482-L501
13,526
OpenTSDB/opentsdb
src/tsd/RpcHandler.java
RpcHandler.handleTelnetRpc
private void handleTelnetRpc(final Channel chan, final String[] command) { TelnetRpc rpc = rpc_manager.lookupTelnetRpc(command[0]); if (rpc == null) { rpc = unknown_cmd; } telnet_rpcs_received.incrementAndGet(); rpc.execute(tsdb, chan, command); }
java
private void handleTelnetRpc(final Channel chan, final String[] command) { TelnetRpc rpc = rpc_manager.lookupTelnetRpc(command[0]); if (rpc == null) { rpc = unknown_cmd; } telnet_rpcs_received.incrementAndGet(); rpc.execute(tsdb, chan, command); }
[ "private", "void", "handleTelnetRpc", "(", "final", "Channel", "chan", ",", "final", "String", "[", "]", "command", ")", "{", "TelnetRpc", "rpc", "=", "rpc_manager", ".", "lookupTelnetRpc", "(", "command", "[", "0", "]", ")", ";", "if", "(", "rpc", "==",...
Finds the right handler for a telnet-style RPC and executes it. @param chan The channel on which the RPC was received. @param command The split telnet-style command.
[ "Finds", "the", "right", "handler", "for", "a", "telnet", "-", "style", "RPC", "and", "executes", "it", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/RpcHandler.java#L155-L162
13,527
OpenTSDB/opentsdb
src/tsd/RpcHandler.java
RpcHandler.createQueryInstance
private AbstractHttpQuery createQueryInstance(final TSDB tsdb, final HttpRequest request, final Channel chan) throws BadRequestException { final String uri = request.getUri(); if (Strings.isNullOrEmpty(uri)) { throw new BadRequestException("Request URI is empty"); } else i...
java
private AbstractHttpQuery createQueryInstance(final TSDB tsdb, final HttpRequest request, final Channel chan) throws BadRequestException { final String uri = request.getUri(); if (Strings.isNullOrEmpty(uri)) { throw new BadRequestException("Request URI is empty"); } else i...
[ "private", "AbstractHttpQuery", "createQueryInstance", "(", "final", "TSDB", "tsdb", ",", "final", "HttpRequest", "request", ",", "final", "Channel", "chan", ")", "throws", "BadRequestException", "{", "final", "String", "uri", "=", "request", ".", "getUri", "(", ...
Using the request URI, creates a query instance capable of handling the given request. @param tsdb the TSDB instance we are running within @param request the incoming HTTP request @param chan the {@link Channel} the request came in on. @return a subclass of {@link AbstractHttpQuery} @throws BadRequestException if the r...
[ "Using", "the", "request", "URI", "creates", "a", "query", "instance", "capable", "of", "handling", "the", "given", "request", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/RpcHandler.java#L174-L191
13,528
OpenTSDB/opentsdb
src/tsd/RpcHandler.java
RpcHandler.applyCorsConfig
private boolean applyCorsConfig(final HttpRequest req, final AbstractHttpQuery query) throws BadRequestException { final String domain = req.headers().get("Origin"); // catch CORS requests and add the header or refuse them if the domain // list has been configured if (query.method() == Htt...
java
private boolean applyCorsConfig(final HttpRequest req, final AbstractHttpQuery query) throws BadRequestException { final String domain = req.headers().get("Origin"); // catch CORS requests and add the header or refuse them if the domain // list has been configured if (query.method() == Htt...
[ "private", "boolean", "applyCorsConfig", "(", "final", "HttpRequest", "req", ",", "final", "AbstractHttpQuery", "query", ")", "throws", "BadRequestException", "{", "final", "String", "domain", "=", "req", ".", "headers", "(", ")", ".", "get", "(", "\"Origin\"", ...
Helper method to apply CORS configuration to a request, either a built-in RPC or a user plugin. @return <code>true</code> if a status reply was sent (in the the case of certain HTTP methods); <code>false</code> otherwise.
[ "Helper", "method", "to", "apply", "CORS", "configuration", "to", "a", "request", "either", "a", "built", "-", "in", "RPC", "or", "a", "user", "plugin", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/RpcHandler.java#L199-L241
13,529
OpenTSDB/opentsdb
src/tsd/RpcHandler.java
RpcHandler.getDirectoryFromSystemProp
static String getDirectoryFromSystemProp(final String prop) { final String dir = System.getProperty(prop); String err = null; if (dir == null) { err = "' is not set."; } else if (dir.isEmpty()) { err = "' is empty."; } else if (dir.charAt(dir.length() - 1) != '/') { // Screw Windows. ...
java
static String getDirectoryFromSystemProp(final String prop) { final String dir = System.getProperty(prop); String err = null; if (dir == null) { err = "' is not set."; } else if (dir.isEmpty()) { err = "' is empty."; } else if (dir.charAt(dir.length() - 1) != '/') { // Screw Windows. ...
[ "static", "String", "getDirectoryFromSystemProp", "(", "final", "String", "prop", ")", "{", "final", "String", "dir", "=", "System", ".", "getProperty", "(", "prop", ")", ";", "String", "err", "=", "null", ";", "if", "(", "dir", "==", "null", ")", "{", ...
Returns the directory path stored in the given system property. @param prop The name of the system property. @return The directory path. @throws IllegalStateException if the system property is not set or has an invalid value.
[ "Returns", "the", "directory", "path", "stored", "in", "the", "given", "system", "property", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/RpcHandler.java#L343-L357
13,530
OpenTSDB/opentsdb
src/tree/Branch.java
Branch.addChild
public boolean addChild(final Branch branch) { if (branch == null) { throw new IllegalArgumentException("Null branches are not allowed"); } if (branches == null) { branches = new TreeSet<Branch>(); branches.add(branch); return true; } if (branches.contains(branch)) { ...
java
public boolean addChild(final Branch branch) { if (branch == null) { throw new IllegalArgumentException("Null branches are not allowed"); } if (branches == null) { branches = new TreeSet<Branch>(); branches.add(branch); return true; } if (branches.contains(branch)) { ...
[ "public", "boolean", "addChild", "(", "final", "Branch", "branch", ")", "{", "if", "(", "branch", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Null branches are not allowed\"", ")", ";", "}", "if", "(", "branches", "==", "null", ...
Adds a child branch to the local branch set if it doesn't exist. Also initializes the set if it hasn't been initialized yet @param branch The branch to add @return True if the branch did not exist in the set previously @throws IllegalArgumentException if the incoming branch is null
[ "Adds", "a", "child", "branch", "to", "the", "local", "branch", "set", "if", "it", "doesn", "t", "exist", ".", "Also", "initializes", "the", "set", "if", "it", "hasn", "t", "been", "initialized", "yet" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tree/Branch.java#L203-L218
13,531
OpenTSDB/opentsdb
src/tree/Branch.java
Branch.addLeaf
public boolean addLeaf(final Leaf leaf, final Tree tree) { if (leaf == null) { throw new IllegalArgumentException("Null leaves are not allowed"); } if (leaves == null) { leaves = new HashMap<Integer, Leaf>(); leaves.put(leaf.hashCode(), leaf); return true; } if (leaves.c...
java
public boolean addLeaf(final Leaf leaf, final Tree tree) { if (leaf == null) { throw new IllegalArgumentException("Null leaves are not allowed"); } if (leaves == null) { leaves = new HashMap<Integer, Leaf>(); leaves.put(leaf.hashCode(), leaf); return true; } if (leaves.c...
[ "public", "boolean", "addLeaf", "(", "final", "Leaf", "leaf", ",", "final", "Tree", "tree", ")", "{", "if", "(", "leaf", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Null leaves are not allowed\"", ")", ";", "}", "if", "(", "...
Adds a leaf to the local branch, looking for collisions @param leaf The leaf to add @param tree The tree to report to with collisions @return True if the leaf was new, false if the leaf already exists or would cause a collision @throws IllegalArgumentException if the incoming leaf is null
[ "Adds", "a", "leaf", "to", "the", "local", "branch", "looking", "for", "collisions" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tree/Branch.java#L228-L258
13,532
OpenTSDB/opentsdb
src/tree/Branch.java
Branch.storeBranch
public Deferred<ArrayList<Boolean>> storeBranch(final TSDB tsdb, final Tree tree, final boolean store_leaves) { if (tree_id < 1 || tree_id > 65535) { throw new IllegalArgumentException("Missing or invalid tree ID"); } final ArrayList<Deferred<Boolean>> storage_results = new ArrayList<...
java
public Deferred<ArrayList<Boolean>> storeBranch(final TSDB tsdb, final Tree tree, final boolean store_leaves) { if (tree_id < 1 || tree_id > 65535) { throw new IllegalArgumentException("Missing or invalid tree ID"); } final ArrayList<Deferred<Boolean>> storage_results = new ArrayList<...
[ "public", "Deferred", "<", "ArrayList", "<", "Boolean", ">", ">", "storeBranch", "(", "final", "TSDB", "tsdb", ",", "final", "Tree", "tree", ",", "final", "boolean", "store_leaves", ")", "{", "if", "(", "tree_id", "<", "1", "||", "tree_id", ">", "65535",...
Attempts to write the branch definition and optionally child leaves to storage via CompareAndSets. Each returned deferred will be a boolean regarding whether the CAS call was successful or not. This will be a mix of the branch call and leaves. Some of these may be false, which is OK, because if the branch definition al...
[ "Attempts", "to", "write", "the", "branch", "definition", "and", "optionally", "child", "leaves", "to", "storage", "via", "CompareAndSets", ".", "Each", "returned", "deferred", "will", "be", "a", "boolean", "regarding", "whether", "the", "CAS", "call", "was", ...
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tree/Branch.java#L342-L372
13,533
OpenTSDB/opentsdb
src/tree/Branch.java
Branch.setupBranchScanner
private static Scanner setupBranchScanner(final TSDB tsdb, final byte[] branch_id) { final byte[] start = branch_id; final byte[] end = Arrays.copyOf(branch_id, branch_id.length); final Scanner scanner = tsdb.getClient().newScanner(tsdb.treeTable()); scanner.setStartKey(start); // increm...
java
private static Scanner setupBranchScanner(final TSDB tsdb, final byte[] branch_id) { final byte[] start = branch_id; final byte[] end = Arrays.copyOf(branch_id, branch_id.length); final Scanner scanner = tsdb.getClient().newScanner(tsdb.treeTable()); scanner.setStartKey(start); // increm...
[ "private", "static", "Scanner", "setupBranchScanner", "(", "final", "TSDB", "tsdb", ",", "final", "byte", "[", "]", "branch_id", ")", "{", "final", "byte", "[", "]", "start", "=", "branch_id", ";", "final", "byte", "[", "]", "end", "=", "Arrays", ".", ...
Configures an HBase scanner to fetch the requested branch and all child branches. It uses a row key regex filter to match any rows starting with the given branch and another INT_WIDTH bytes deep. Deeper branches are ignored. @param tsdb The TSDB to use for storage access @param branch_id ID of the branch to fetch @retu...
[ "Configures", "an", "HBase", "scanner", "to", "fetch", "the", "requested", "branch", "and", "all", "child", "branches", ".", "It", "uses", "a", "row", "key", "regex", "filter", "to", "match", "any", "rows", "starting", "with", "the", "given", "branch", "an...
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tree/Branch.java#L651-L690
13,534
OpenTSDB/opentsdb
src/tools/TreeSync.java
TreeSync.purgeTree
public int purgeTree(final int tree_id, final boolean delete_definition) throws Exception { if (delete_definition) { LOG.info("Deleting tree branches and definition for: " + tree_id); } else { LOG.info("Deleting tree branches for: " + tree_id); } Tree.deleteTree(tsdb, tree_id, delete_de...
java
public int purgeTree(final int tree_id, final boolean delete_definition) throws Exception { if (delete_definition) { LOG.info("Deleting tree branches and definition for: " + tree_id); } else { LOG.info("Deleting tree branches for: " + tree_id); } Tree.deleteTree(tsdb, tree_id, delete_de...
[ "public", "int", "purgeTree", "(", "final", "int", "tree_id", ",", "final", "boolean", "delete_definition", ")", "throws", "Exception", "{", "if", "(", "delete_definition", ")", "{", "LOG", ".", "info", "(", "\"Deleting tree branches and definition for: \"", "+", ...
Attempts to delete all data generated by the given tree, and optionally, the tree definition itself. @param tree_id The tree with data to delete @param delete_definition Whether or not the tree definition itself should be removed from the system @return 0 if completed successfully, something else if an error occurred
[ "Attempts", "to", "delete", "all", "data", "generated", "by", "the", "given", "tree", "and", "optionally", "the", "tree", "definition", "itself", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/TreeSync.java#L324-L334
13,535
OpenTSDB/opentsdb
src/tools/TreeSync.java
TreeSync.getScanner
private Scanner getScanner() throws HBaseException { final 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); LOG.deb...
java
private Scanner getScanner() throws HBaseException { final 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); LOG.deb...
[ "private", "Scanner", "getScanner", "(", ")", "throws", "HBaseException", "{", "final", "short", "metric_width", "=", "TSDB", ".", "metrics_width", "(", ")", ";", "final", "byte", "[", "]", "start_row", "=", "Arrays", ".", "copyOfRange", "(", "Bytes", ".", ...
Returns a scanner set to scan the range configured for this thread @return A scanner on the "name" CF configured for the specified range @throws HBaseException if something goes boom
[ "Returns", "a", "scanner", "set", "to", "scan", "the", "range", "configured", "for", "this", "thread" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/TreeSync.java#L341-L356
13,536
OpenTSDB/opentsdb
src/rollup/RollupConfig.java
RollupConfig.getRollupInterval
public RollupInterval getRollupInterval(final String interval) { if (interval == null || interval.isEmpty()) { throw new IllegalArgumentException("Interval cannot be null or empty"); } final RollupInterval rollup = forward_intervals.get(interval); if (rollup == null) { throw new NoSuchRollup...
java
public RollupInterval getRollupInterval(final String interval) { if (interval == null || interval.isEmpty()) { throw new IllegalArgumentException("Interval cannot be null or empty"); } final RollupInterval rollup = forward_intervals.get(interval); if (rollup == null) { throw new NoSuchRollup...
[ "public", "RollupInterval", "getRollupInterval", "(", "final", "String", "interval", ")", "{", "if", "(", "interval", "==", "null", "||", "interval", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Interval cannot be null or...
Fetches the RollupInterval corresponding to the forward interval string map @param interval The interval to lookup @return The RollupInterval object configured for the given interval @throws IllegalArgumentException if the interval is null or empty @throws NoSuchRollupForIntervalException if the interval was not config...
[ "Fetches", "the", "RollupInterval", "corresponding", "to", "the", "forward", "interval", "string", "map" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/rollup/RollupConfig.java#L140-L149
13,537
OpenTSDB/opentsdb
src/rollup/RollupConfig.java
RollupConfig.getRollupInterval
public List<RollupInterval> getRollupInterval(final long interval, final String str_interval) { if (interval <= 0) { throw new IllegalArgumentException("Interval cannot be null or empty"); } final Map<Long, RollupInterval> rollups = n...
java
public List<RollupInterval> getRollupInterval(final long interval, final String str_interval) { if (interval <= 0) { throw new IllegalArgumentException("Interval cannot be null or empty"); } final Map<Long, RollupInterval> rollups = n...
[ "public", "List", "<", "RollupInterval", ">", "getRollupInterval", "(", "final", "long", "interval", ",", "final", "String", "str_interval", ")", "{", "if", "(", "interval", "<=", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Interval cannot...
Fetches the RollupInterval corresponding to the integer interval in seconds. It returns a list of matching RollupInterval and best next matches in the order. It will help to search on the next best rollup tables. It is guaranteed that it return a non-empty list For example if the interval is 1 day then it may return Ro...
[ "Fetches", "the", "RollupInterval", "corresponding", "to", "the", "integer", "interval", "in", "seconds", ".", "It", "returns", "a", "list", "of", "matching", "RollupInterval", "and", "best", "next", "matches", "in", "the", "order", ".", "It", "will", "help", ...
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/rollup/RollupConfig.java#L165-L200
13,538
OpenTSDB/opentsdb
src/rollup/RollupConfig.java
RollupConfig.getRollupIntervalForTable
public RollupInterval getRollupIntervalForTable(final String table) { if (table == null || table.isEmpty()) { throw new IllegalArgumentException("The table name cannot be null or empty"); } final RollupInterval rollup = reverse_intervals.get(table); if (rollup == null) { throw new NoSuchRoll...
java
public RollupInterval getRollupIntervalForTable(final String table) { if (table == null || table.isEmpty()) { throw new IllegalArgumentException("The table name cannot be null or empty"); } final RollupInterval rollup = reverse_intervals.get(table); if (rollup == null) { throw new NoSuchRoll...
[ "public", "RollupInterval", "getRollupIntervalForTable", "(", "final", "String", "table", ")", "{", "if", "(", "table", "==", "null", "||", "table", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The table name cannot be nu...
Fetches the RollupInterval corresponding to the rollup or pre-agg table name. @param table The name of the table to fetch @return The RollupInterval object matching the table @throws IllegalArgumentException if the table is null or empty @throws NoSuchRollupForTableException if the interval was not configured for the g...
[ "Fetches", "the", "RollupInterval", "corresponding", "to", "the", "rollup", "or", "pre", "-", "agg", "table", "name", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/rollup/RollupConfig.java#L211-L220
13,539
OpenTSDB/opentsdb
src/rollup/RollupConfig.java
RollupConfig.ensureTablesExist
public void ensureTablesExist(final TSDB tsdb) { final List<Deferred<Object>> deferreds = new ArrayList<Deferred<Object>>(forward_intervals.size() * 2); for (RollupInterval interval : forward_intervals.values()) { deferreds.add(tsdb.getClient() .ensureTableExists(interval.getTempor...
java
public void ensureTablesExist(final TSDB tsdb) { final List<Deferred<Object>> deferreds = new ArrayList<Deferred<Object>>(forward_intervals.size() * 2); for (RollupInterval interval : forward_intervals.values()) { deferreds.add(tsdb.getClient() .ensureTableExists(interval.getTempor...
[ "public", "void", "ensureTablesExist", "(", "final", "TSDB", "tsdb", ")", "{", "final", "List", "<", "Deferred", "<", "Object", ">", ">", "deferreds", "=", "new", "ArrayList", "<", "Deferred", "<", "Object", ">", ">", "(", "forward_intervals", ".", "size",...
Makes sure each of the rollup tables exists @param tsdb The TSDB to use for fetching the HBase client
[ "Makes", "sure", "each", "of", "the", "rollup", "tables", "exists" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/rollup/RollupConfig.java#L226-L247
13,540
OpenTSDB/opentsdb
src/utils/FileSystem.java
FileSystem.checkDirectory
public static void checkDirectory(final String dir, final boolean need_write, final boolean create) { if (dir.isEmpty()) throw new IllegalArgumentException("Directory path is empty"); final File f = new File(dir); if (!f.exists() && !(create && f.mkdirs())) { throw new IllegalArgumentExcep...
java
public static void checkDirectory(final String dir, final boolean need_write, final boolean create) { if (dir.isEmpty()) throw new IllegalArgumentException("Directory path is empty"); final File f = new File(dir); if (!f.exists() && !(create && f.mkdirs())) { throw new IllegalArgumentExcep...
[ "public", "static", "void", "checkDirectory", "(", "final", "String", "dir", ",", "final", "boolean", "need_write", ",", "final", "boolean", "create", ")", "{", "if", "(", "dir", ".", "isEmpty", "(", ")", ")", "throw", "new", "IllegalArgumentException", "(",...
Verifies a directory and checks to see if it's writeable or not if configured @param dir The path to check on @param need_write Set to true if the path needs write access @param create Set to true if the directory should be created if it does not exist @throws IllegalArgumentException if the path is empty, if it's not ...
[ "Verifies", "a", "directory", "and", "checks", "to", "see", "if", "it", "s", "writeable", "or", "not", "if", "configured" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/FileSystem.java#L29-L42
13,541
OpenTSDB/opentsdb
src/utils/JSON.java
JSON.parseToObject
@SuppressWarnings("unchecked") public static final <T> T parseToObject(final String json, final TypeReference<T> type) { if (json == null || json.isEmpty()) throw new IllegalArgumentException("Incoming data was null or empty"); if (type == null) throw new IllegalArgumentException("Missing ty...
java
@SuppressWarnings("unchecked") public static final <T> T parseToObject(final String json, final TypeReference<T> type) { if (json == null || json.isEmpty()) throw new IllegalArgumentException("Incoming data was null or empty"); if (type == null) throw new IllegalArgumentException("Missing ty...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "final", "<", "T", ">", "T", "parseToObject", "(", "final", "String", "json", ",", "final", "TypeReference", "<", "T", ">", "type", ")", "{", "if", "(", "json", "==", "null", "||", ...
Deserializes a JSON formatted string to a specific class type @param json The string to deserialize @param type A type definition for a complex object @return An object of the {@code pojo} type @throws IllegalArgumentException if the data or type was null or parsing failed @throws JSONException if the data could not be...
[ "Deserializes", "a", "JSON", "formatted", "string", "to", "a", "specific", "class", "type" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/JSON.java#L155-L171
13,542
OpenTSDB/opentsdb
src/utils/JSON.java
JSON.serializeToString
public static final String serializeToString(final Object object) { if (object == null) throw new IllegalArgumentException("Object was null"); try { return jsonMapper.writeValueAsString(object); } catch (JsonProcessingException e) { throw new JSONException(e); } }
java
public static final String serializeToString(final Object object) { if (object == null) throw new IllegalArgumentException("Object was null"); try { return jsonMapper.writeValueAsString(object); } catch (JsonProcessingException e) { throw new JSONException(e); } }
[ "public", "static", "final", "String", "serializeToString", "(", "final", "Object", "object", ")", "{", "if", "(", "object", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Object was null\"", ")", ";", "try", "{", "return", "jsonMapper", ...
Serializes the given object to a JSON string @param object The object to serialize @return A JSON formatted string @throws IllegalArgumentException if the object was null @throws JSONException if the object could not be serialized
[ "Serializes", "the", "given", "object", "to", "a", "JSON", "string" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/JSON.java#L273-L281
13,543
OpenTSDB/opentsdb
src/utils/JSON.java
JSON.serializeToBytes
public static final byte[] serializeToBytes(final Object object) { if (object == null) throw new IllegalArgumentException("Object was null"); try { return jsonMapper.writeValueAsBytes(object); } catch (JsonProcessingException e) { throw new JSONException(e); } }
java
public static final byte[] serializeToBytes(final Object object) { if (object == null) throw new IllegalArgumentException("Object was null"); try { return jsonMapper.writeValueAsBytes(object); } catch (JsonProcessingException e) { throw new JSONException(e); } }
[ "public", "static", "final", "byte", "[", "]", "serializeToBytes", "(", "final", "Object", "object", ")", "{", "if", "(", "object", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Object was null\"", ")", ";", "try", "{", "return", "js...
Serializes the given object to a JSON byte array @param object The object to serialize @return A JSON formatted byte array @throws IllegalArgumentException if the object was null @throws JSONException if the object could not be serialized
[ "Serializes", "the", "given", "object", "to", "a", "JSON", "byte", "array" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/JSON.java#L290-L298
13,544
OpenTSDB/opentsdb
src/query/expression/ExpressionIterator.java
ExpressionIterator.compile
public void compile() { if (LOG.isDebugEnabled()) { LOG.debug("Compiling " + this); } if (results.size() < 1) { throw new IllegalArgumentException("No results for any variables in " + "the expression: " + this); } if (results.size() < names.size()) { throw new IllegalArgu...
java
public void compile() { if (LOG.isDebugEnabled()) { LOG.debug("Compiling " + this); } if (results.size() < 1) { throw new IllegalArgumentException("No results for any variables in " + "the expression: " + this); } if (results.size() < names.size()) { throw new IllegalArgu...
[ "public", "void", "compile", "(", ")", "{", "if", "(", "LOG", ".", "isDebugEnabled", "(", ")", ")", "{", "LOG", ".", "debug", "(", "\"Compiling \"", "+", "this", ")", ";", "}", "if", "(", "results", ".", "size", "(", ")", "<", "1", ")", "{", "t...
Builds the iterator by computing the intersection of all series in all sets and sets up the output. @throws IllegalArgumentException if there aren't any results, or we don't have a result for each variable, or something else is wrong. @throws IllegalDataException if no series were left after computing the intersection.
[ "Builds", "the", "iterator", "by", "computing", "the", "intersection", "of", "all", "series", "in", "all", "sets", "and", "sets", "up", "the", "output", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/expression/ExpressionIterator.java#L237-L302
13,545
OpenTSDB/opentsdb
src/utils/PluginLoader.java
PluginLoader.loadJAR
public static void loadJAR(String jar) throws IOException, SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { if (!jar.toLowerCase().endsWith(".jar")) { throw new IllegalArgumentException( "File specified did not end with .ja...
java
public static void loadJAR(String jar) throws IOException, SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { if (!jar.toLowerCase().endsWith(".jar")) { throw new IllegalArgumentException( "File specified did not end with .ja...
[ "public", "static", "void", "loadJAR", "(", "String", "jar", ")", "throws", "IOException", ",", "SecurityException", ",", "IllegalArgumentException", ",", "NoSuchMethodException", ",", "IllegalAccessException", ",", "InvocationTargetException", "{", "if", "(", "!", "j...
Attempts to load the given jar into the class path @param jar Full path to a .jar file @throws IOException if the file does not exist or cannot be accessed @throws SecurityException if there is a security manager present and the operation is denied @throws IllegalArgumentException if the filename did not end with .jar ...
[ "Attempts", "to", "load", "the", "given", "jar", "into", "the", "class", "path" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/PluginLoader.java#L168-L180
13,546
OpenTSDB/opentsdb
src/utils/PluginLoader.java
PluginLoader.searchForJars
private static void searchForJars(final File file, List<File> jars) { if (file.isFile()) { if (file.getAbsolutePath().toLowerCase().endsWith(".jar")) { jars.add(file); LOG.debug("Found a jar: " + file.getAbsolutePath()); } } else if (file.isDirectory()) { File[] files = file.li...
java
private static void searchForJars(final File file, List<File> jars) { if (file.isFile()) { if (file.getAbsolutePath().toLowerCase().endsWith(".jar")) { jars.add(file); LOG.debug("Found a jar: " + file.getAbsolutePath()); } } else if (file.isDirectory()) { File[] files = file.li...
[ "private", "static", "void", "searchForJars", "(", "final", "File", "file", ",", "List", "<", "File", ">", "jars", ")", "{", "if", "(", "file", ".", "isFile", "(", ")", ")", "{", "if", "(", "file", ".", "getAbsolutePath", "(", ")", ".", "toLowerCase"...
Recursive method to search for JAR files starting at a given level @param file The directory to search in @param jars A list of file objects that will be loaded with discovered jar files @throws SecurityException if a security manager exists and prevents reading
[ "Recursive", "method", "to", "search", "for", "JAR", "files", "starting", "at", "a", "given", "level" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/PluginLoader.java#L227-L244
13,547
OpenTSDB/opentsdb
src/utils/PluginLoader.java
PluginLoader.addFile
private static void addFile(File f) throws IOException, SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { addURL(f.toURI().toURL()); }
java
private static void addFile(File f) throws IOException, SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { addURL(f.toURI().toURL()); }
[ "private", "static", "void", "addFile", "(", "File", "f", ")", "throws", "IOException", ",", "SecurityException", ",", "IllegalArgumentException", ",", "NoSuchMethodException", ",", "IllegalAccessException", ",", "InvocationTargetException", "{", "addURL", "(", "f", "...
Attempts to add the given file object to the class loader @param f The JAR file object to load @throws IOException if the file does not exist or cannot be accessed @throws SecurityException if there is a security manager present and the operation is denied @throws IllegalArgumentException if the file was invalid @throw...
[ "Attempts", "to", "add", "the", "given", "file", "object", "to", "the", "class", "loader" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/PluginLoader.java#L258-L262
13,548
OpenTSDB/opentsdb
src/query/expression/Scale.java
Scale.scale
private DataPoints scale(final DataPoints points, final double scale_factor) { // TODO(cl) - Using an array as the size function may not return the exact // results and we should figure a way to avoid copying data anyway. final List<DataPoint> dps = new ArrayList<DataPoint>(); final boolean scale_is_int...
java
private DataPoints scale(final DataPoints points, final double scale_factor) { // TODO(cl) - Using an array as the size function may not return the exact // results and we should figure a way to avoid copying data anyway. final List<DataPoint> dps = new ArrayList<DataPoint>(); final boolean scale_is_int...
[ "private", "DataPoints", "scale", "(", "final", "DataPoints", "points", ",", "final", "double", "scale_factor", ")", "{", "// TODO(cl) - Using an array as the size function may not return the exact", "// results and we should figure a way to avoid copying data anyway.", "final", "Lis...
Multiplies each data point in the series by the scale factor, maintaining integers if both the data point and scale are integers. @param points The data points to factor @param scale_factor The factor to multiply by @return The resulting data points
[ "Multiplies", "each", "data", "point", "in", "the", "series", "by", "the", "scale", "factor", "maintaining", "integers", "if", "both", "the", "data", "point", "and", "scale", "are", "integers", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/expression/Scale.java#L81-L102
13,549
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseSuggestV1
@Override public HashMap<String, String> parseSuggestV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your req...
java
@Override public HashMap<String, String> parseSuggestV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your req...
[ "@", "Override", "public", "HashMap", "<", "String", ",", "String", ">", "parseSuggestV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", "...
Parses a suggestion query @return a hash map of key/value pairs @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "a", "suggestion", "query" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L202-L216
13,550
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseUidRenameV1
public HashMap<String, String> parseUidRenameV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); ...
java
public HashMap<String, String> parseUidRenameV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); ...
[ "public", "HashMap", "<", "String", ",", "String", ">", "parseUidRenameV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", ...
Parses metric, tagk or tagv, and name to rename UID @return as hash map of type and name @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "metric", "tagk", "or", "tagv", "and", "name", "to", "rename", "UID" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L244-L256
13,551
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseQueryV1
public TSQuery parseQueryV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } try { ...
java
public TSQuery parseQueryV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } try { ...
[ "public", "TSQuery", "parseQueryV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "BadRequestException", "("...
Parses a timeseries data query @return A TSQuery with data ready to validate @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "a", "timeseries", "data", "query" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L264-L281
13,552
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseLastPointQueryV1
public LastPointQuery parseLastPointQueryV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ...
java
public LastPointQuery parseLastPointQueryV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ...
[ "public", "LastPointQuery", "parseLastPointQueryV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "BadRequestE...
Parses a last data point query @return A LastPointQuery to work with @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "a", "last", "data", "point", "query" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L289-L301
13,553
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseUidMetaV1
public UIDMeta parseUidMetaV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } try { ...
java
public UIDMeta parseUidMetaV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } try { ...
[ "public", "UIDMeta", "parseUidMetaV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "BadRequestException", "...
Parses a single UIDMeta object @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "a", "single", "UIDMeta", "object" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L308-L320
13,554
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseTSMetaV1
public TSMeta parseTSMetaV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } try { ...
java
public TSMeta parseTSMetaV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } try { ...
[ "public", "TSMeta", "parseTSMetaV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "BadRequestException", "("...
Parses a single TSMeta object @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "a", "single", "TSMeta", "object" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L327-L339
13,555
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseTreeRuleV1
public TreeRule parseTreeRuleV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ret...
java
public TreeRule parseTreeRuleV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ret...
[ "public", "TreeRule", "parseTreeRuleV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "BadRequestException", ...
Parses a single TreeRule object @return A parsed tree rule @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "a", "single", "TreeRule", "object" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L410-L419
13,556
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseTreeRulesV1
public List<TreeRule> parseTreeRulesV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ...
java
public List<TreeRule> parseTreeRulesV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ...
[ "public", "List", "<", "TreeRule", ">", "parseTreeRulesV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", ...
Parses one or more tree rules @return A list of one or more rules @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "one", "or", "more", "tree", "rules" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L427-L436
13,557
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseTreeTSUIDsListV1
public Map<String, Object> parseTreeTSUIDsListV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); ...
java
public Map<String, Object> parseTreeTSUIDsListV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); ...
[ "public", "Map", "<", "String", ",", "Object", ">", "parseTreeTSUIDsListV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", ...
Parses a tree ID and optional list of TSUIDs to search for collisions or not matched TSUIDs. @return A map with "treeId" as an integer and optionally "tsuids" as a List<String> @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "a", "tree", "ID", "and", "optional", "list", "of", "TSUIDs", "to", "search", "for", "collisions", "or", "not", "matched", "TSUIDs", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L446-L455
13,558
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseAnnotationV1
public Annotation parseAnnotationV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ...
java
public Annotation parseAnnotationV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ...
[ "public", "Annotation", "parseAnnotationV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "BadRequestException...
Parses an annotation object @return An annotation object @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "an", "annotation", "object" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L463-L472
13,559
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseAnnotationsV1
public List<Annotation> parseAnnotationsV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ...
java
public List<Annotation> parseAnnotationsV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ...
[ "public", "List", "<", "Annotation", ">", "parseAnnotationsV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", "throw", "new...
Parses a list of annotation objects @return A list of annotation object @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "a", "list", "of", "annotation", "objects" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L480-L489
13,560
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseAnnotationBulkDeleteV1
public AnnotationBulkDelete parseAnnotationBulkDeleteV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your reque...
java
public AnnotationBulkDelete parseAnnotationBulkDeleteV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your reque...
[ "public", "AnnotationBulkDelete", "parseAnnotationBulkDeleteV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", ...
Parses a bulk annotation deletion query object @return Settings used to bulk delete annotations @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "a", "bulk", "annotation", "deletion", "query", "object" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L497-L506
13,561
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.parseSearchQueryV1
public SearchQuery parseSearchQueryV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ...
java
public SearchQuery parseSearchQueryV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } ...
[ "public", "SearchQuery", "parseSearchQueryV1", "(", ")", "{", "final", "String", "json", "=", "query", ".", "getContent", "(", ")", ";", "if", "(", "json", "==", "null", "||", "json", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "BadRequestExcepti...
Parses a SearchQuery request @return The parsed search query @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
[ "Parses", "a", "SearchQuery", "request" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L514-L523
13,562
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.formatConfigV1
public ChannelBuffer formatConfigV1(final Config config) { TreeMap<String, String> map = new TreeMap<String, String>(config.getMap()); for (Map.Entry<String, String> entry : map.entrySet()) { if (entry.getKey().toUpperCase().contains("PASS")) { map.put(entry.getKey(), "********"); } } ...
java
public ChannelBuffer formatConfigV1(final Config config) { TreeMap<String, String> map = new TreeMap<String, String>(config.getMap()); for (Map.Entry<String, String> entry : map.entrySet()) { if (entry.getKey().toUpperCase().contains("PASS")) { map.put(entry.getKey(), "********"); } } ...
[ "public", "ChannelBuffer", "formatConfigV1", "(", "final", "Config", "config", ")", "{", "TreeMap", "<", "String", ",", "String", ">", "map", "=", "new", "TreeMap", "<", "String", ",", "String", ">", "(", "config", ".", "getMap", "(", ")", ")", ";", "f...
Format the running configuration @param config The running config to serialize @return A ChannelBuffer object to pass on to the caller @throws JSONException if serialization failed
[ "Format", "the", "running", "configuration" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L1190-L1198
13,563
OpenTSDB/opentsdb
src/tsd/HttpJsonSerializer.java
HttpJsonSerializer.serializeJSON
private ChannelBuffer serializeJSON(final Object obj) { if (query.hasQueryStringParam("jsonp")) { return ChannelBuffers.wrappedBuffer( JSON.serializeToJSONPBytes(query.getQueryStringParam("jsonp"), obj)); } return ChannelBuffers.wrappedBuffer(JSON.serializeToBytes(obj)); }
java
private ChannelBuffer serializeJSON(final Object obj) { if (query.hasQueryStringParam("jsonp")) { return ChannelBuffers.wrappedBuffer( JSON.serializeToJSONPBytes(query.getQueryStringParam("jsonp"), obj)); } return ChannelBuffers.wrappedBuffer(JSON.serializeToBytes(obj)); }
[ "private", "ChannelBuffer", "serializeJSON", "(", "final", "Object", "obj", ")", "{", "if", "(", "query", ".", "hasQueryStringParam", "(", "\"jsonp\"", ")", ")", "{", "return", "ChannelBuffers", ".", "wrappedBuffer", "(", "JSON", ".", "serializeToJSONPBytes", "(...
Helper object for the format calls to wrap the JSON response in a JSONP function if requested. Used for code dedupe. @param obj The object to serialize @return A ChannelBuffer to pass on to the query @throws JSONException if serialization failed
[ "Helper", "object", "for", "the", "format", "calls", "to", "wrap", "the", "JSON", "response", "in", "a", "JSONP", "function", "if", "requested", ".", "Used", "for", "code", "dedupe", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L1218-L1225
13,564
OpenTSDB/opentsdb
src/core/SaltScanner.java
SaltScanner.scan
public Deferred<TreeMap<byte[], Span>> scan() { start_time = System.currentTimeMillis(); int i = 0; for (final Scanner scanner: scanners) { new ScannerCB(scanner, i++).scan(); } return results; }
java
public Deferred<TreeMap<byte[], Span>> scan() { start_time = System.currentTimeMillis(); int i = 0; for (final Scanner scanner: scanners) { new ScannerCB(scanner, i++).scan(); } return results; }
[ "public", "Deferred", "<", "TreeMap", "<", "byte", "[", "]", ",", "Span", ">", ">", "scan", "(", ")", "{", "start_time", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "int", "i", "=", "0", ";", "for", "(", "final", "Scanner", "scanner", "...
Starts all of the scanners asynchronously and returns the data fetched once all of the scanners have completed. Note that the result may be an exception if one or more of the scanners encountered an exception. The first error will be returned, others will be logged. @return A deferred to wait on for results.
[ "Starts", "all", "of", "the", "scanners", "asynchronously", "and", "returns", "the", "data", "fetched", "once", "all", "of", "the", "scanners", "have", "completed", ".", "Note", "that", "the", "result", "may", "be", "an", "exception", "if", "one", "or", "m...
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/SaltScanner.java#L267-L274
13,565
OpenTSDB/opentsdb
src/core/SaltScanner.java
SaltScanner.validateAndTriggerCallback
private void validateAndTriggerCallback( final List<KeyValue> kvs, final Map<byte[], List<Annotation>> annotations, final List<SimpleEntry<byte[], List<HistogramDataPoint>>> histograms) { countdown.countDown(); final long count = countdown.getCount(); if (kvs.size() > 0) { kv_map.p...
java
private void validateAndTriggerCallback( final List<KeyValue> kvs, final Map<byte[], List<Annotation>> annotations, final List<SimpleEntry<byte[], List<HistogramDataPoint>>> histograms) { countdown.countDown(); final long count = countdown.getCount(); if (kvs.size() > 0) { kv_map.p...
[ "private", "void", "validateAndTriggerCallback", "(", "final", "List", "<", "KeyValue", ">", "kvs", ",", "final", "Map", "<", "byte", "[", "]", ",", "List", "<", "Annotation", ">", ">", "annotations", ",", "final", "List", "<", "SimpleEntry", "<", "byte", ...
Called each time a scanner completes with valid or empty data. @param kvs The compacted columns fetched by the scanner @param annotations The annotations fetched by the scanners
[ "Called", "each", "time", "a", "scanner", "completes", "with", "valid", "or", "empty", "data", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/SaltScanner.java#L922-L952
13,566
OpenTSDB/opentsdb
src/tsd/GraphHandler.java
GraphHandler.getGnuplotBasePath
private String getGnuplotBasePath(final TSDB tsdb, final HttpQuery query) { final Map<String, List<String>> q = query.getQueryString(); q.remove("ignore"); // Super cheap caching mechanism: hash the query string. final HashMap<String, List<String>> qs = new HashMap<String, List<String>>(q); //...
java
private String getGnuplotBasePath(final TSDB tsdb, final HttpQuery query) { final Map<String, List<String>> q = query.getQueryString(); q.remove("ignore"); // Super cheap caching mechanism: hash the query string. final HashMap<String, List<String>> qs = new HashMap<String, List<String>>(q); //...
[ "private", "String", "getGnuplotBasePath", "(", "final", "TSDB", "tsdb", ",", "final", "HttpQuery", "query", ")", "{", "final", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "q", "=", "query", ".", "getQueryString", "(", ")", ";", "q", "....
Returns the base path to use for the Gnuplot files.
[ "Returns", "the", "base", "path", "to", "use", "for", "the", "Gnuplot", "files", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/GraphHandler.java#L398-L410
13,567
OpenTSDB/opentsdb
src/tsd/GraphHandler.java
GraphHandler.isDiskCacheHit
private boolean isDiskCacheHit(final HttpQuery query, final long end_time, final int max_age, final String basepath) throws IOException { final String cachepath = basepath + (query.hasQueryStringParam("ascii") ...
java
private boolean isDiskCacheHit(final HttpQuery query, final long end_time, final int max_age, final String basepath) throws IOException { final String cachepath = basepath + (query.hasQueryStringParam("ascii") ...
[ "private", "boolean", "isDiskCacheHit", "(", "final", "HttpQuery", "query", ",", "final", "long", "end_time", ",", "final", "int", "max_age", ",", "final", "String", "basepath", ")", "throws", "IOException", "{", "final", "String", "cachepath", "=", "basepath", ...
Checks whether or not it's possible to re-serve this query from disk. @param query The query to serve. @param end_time The end time on the query (32-bit unsigned int, seconds). @param max_age The maximum time (in seconds) we wanna allow clients to cache the result in case of a cache hit. @param basepath The base path u...
[ "Checks", "whether", "or", "not", "it", "s", "possible", "to", "re", "-", "serve", "this", "query", "from", "disk", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/GraphHandler.java#L423-L484
13,568
OpenTSDB/opentsdb
src/tsd/GraphHandler.java
GraphHandler.staleCacheFile
private static boolean staleCacheFile(final HttpQuery query, final long end_time, final long max_age, final File cachedfile) { final long mtime = cachedfile.lastModified() / 1000; if (mtime <=...
java
private static boolean staleCacheFile(final HttpQuery query, final long end_time, final long max_age, final File cachedfile) { final long mtime = cachedfile.lastModified() / 1000; if (mtime <=...
[ "private", "static", "boolean", "staleCacheFile", "(", "final", "HttpQuery", "query", ",", "final", "long", "end_time", ",", "final", "long", "max_age", ",", "final", "File", "cachedfile", ")", "{", "final", "long", "mtime", "=", "cachedfile", ".", "lastModifi...
Returns whether or not the given cache file can be used or is stale. @param query The query to serve. @param end_time The end time on the query (32-bit unsigned int, seconds). @param max_age The maximum time (in seconds) we wanna allow clients to cache the result in case of a cache hit. If the file is exactly that old...
[ "Returns", "whether", "or", "not", "the", "given", "cache", "file", "can", "be", "used", "or", "is", "stale", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/GraphHandler.java#L495-L534
13,569
OpenTSDB/opentsdb
src/tsd/GraphHandler.java
GraphHandler.writeFile
private static void writeFile(final HttpQuery query, final String path, final byte[] contents) { try { final FileOutputStream out = new FileOutputStream(path); try { out.write(contents); } finally { out.close(); ...
java
private static void writeFile(final HttpQuery query, final String path, final byte[] contents) { try { final FileOutputStream out = new FileOutputStream(path); try { out.write(contents); } finally { out.close(); ...
[ "private", "static", "void", "writeFile", "(", "final", "HttpQuery", "query", ",", "final", "String", "path", ",", "final", "byte", "[", "]", "contents", ")", "{", "try", "{", "final", "FileOutputStream", "out", "=", "new", "FileOutputStream", "(", "path", ...
Writes the given byte array into a file. This function logs an error but doesn't throw if it fails. @param query The query being handled (for logging purposes). @param path The path to write to. @param contents The contents to write into the file.
[ "Writes", "the", "given", "byte", "array", "into", "a", "file", ".", "This", "function", "logs", "an", "error", "but", "doesn", "t", "throw", "if", "it", "fails", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/GraphHandler.java#L543-L558
13,570
OpenTSDB/opentsdb
src/tsd/GraphHandler.java
GraphHandler.readFile
private static byte[] readFile(final HttpQuery query, final File file, final int max_length) { final int length = (int) file.length(); if (length <= 0) { return null; } FileInputStream in; try { in = new FileInputStream(fi...
java
private static byte[] readFile(final HttpQuery query, final File file, final int max_length) { final int length = (int) file.length(); if (length <= 0) { return null; } FileInputStream in; try { in = new FileInputStream(fi...
[ "private", "static", "byte", "[", "]", "readFile", "(", "final", "HttpQuery", "query", ",", "final", "File", "file", ",", "final", "int", "max_length", ")", "{", "final", "int", "length", "=", "(", "int", ")", "file", ".", "length", "(", ")", ";", "i...
Reads a file into a byte array. @param query The query being handled (for logging purposes). @param file The file to read. @param max_length The maximum number of bytes to read from the file. @return {@code null} if the file doesn't exist or is empty or couldn't be read, otherwise a byte array of up to {@code max_lengt...
[ "Reads", "a", "file", "into", "a", "byte", "array", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/GraphHandler.java#L568-L600
13,571
OpenTSDB/opentsdb
src/tsd/GraphHandler.java
GraphHandler.stringify
private static String stringify(final String s) { final StringBuilder buf = new StringBuilder(1 + s.length() + 1); buf.append('"'); HttpQuery.escapeJson(s, buf); // Abusing this function gets the job done. buf.append('"'); return buf.toString(); }
java
private static String stringify(final String s) { final StringBuilder buf = new StringBuilder(1 + s.length() + 1); buf.append('"'); HttpQuery.escapeJson(s, buf); // Abusing this function gets the job done. buf.append('"'); return buf.toString(); }
[ "private", "static", "String", "stringify", "(", "final", "String", "s", ")", "{", "final", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", "1", "+", "s", ".", "length", "(", ")", "+", "1", ")", ";", "buf", ".", "append", "(", "'", "'", "...
Formats and quotes the given string so it's a suitable Gnuplot string. @param s The string to stringify. @return A string suitable for use as a literal string in Gnuplot.
[ "Formats", "and", "quotes", "the", "given", "string", "so", "it", "s", "a", "suitable", "Gnuplot", "string", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/GraphHandler.java#L675-L681
13,572
OpenTSDB/opentsdb
src/tsd/GraphHandler.java
GraphHandler.popParam
private static String popParam(final Map<String, List<String>> querystring, final String param) { final List<String> params = querystring.remove(param); if (params == null) { return null; } final String given = params.get(params.size() - 1); // TODO - far f...
java
private static String popParam(final Map<String, List<String>> querystring, final String param) { final List<String> params = querystring.remove(param); if (params == null) { return null; } final String given = params.get(params.size() - 1); // TODO - far f...
[ "private", "static", "String", "popParam", "(", "final", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "querystring", ",", "final", "String", "param", ")", "{", "final", "List", "<", "String", ">", "params", "=", "querystring", ".", "remove...
Pops out of the query string the given parameter. @param querystring The query string. @param param The name of the parameter to pop out. @return {@code null} if the parameter wasn't passed, otherwise the value of the last occurrence of the parameter.
[ "Pops", "out", "of", "the", "query", "string", "the", "given", "parameter", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/GraphHandler.java#L690-L704
13,573
OpenTSDB/opentsdb
src/tsd/GraphHandler.java
GraphHandler.setPlotParams
static void setPlotParams(final HttpQuery query, final Plot plot) { final HashMap<String, String> params = new HashMap<String, String>(); final Map<String, List<String>> querystring = query.getQueryString(); String value; if ((value = popParam(querystring, "yrange")) != null) { params.put("yrange"...
java
static void setPlotParams(final HttpQuery query, final Plot plot) { final HashMap<String, String> params = new HashMap<String, String>(); final Map<String, List<String>> querystring = query.getQueryString(); String value; if ((value = popParam(querystring, "yrange")) != null) { params.put("yrange"...
[ "static", "void", "setPlotParams", "(", "final", "HttpQuery", "query", ",", "final", "Plot", "plot", ")", "{", "final", "HashMap", "<", "String", ",", "String", ">", "params", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "fi...
Applies the plot parameters from the query to the given plot. @param query The query from which to get the query string. @param plot The plot on which to apply the parameters.
[ "Applies", "the", "plot", "parameters", "from", "the", "query", "to", "the", "given", "plot", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/GraphHandler.java#L711-L766
13,574
OpenTSDB/opentsdb
src/tsd/GraphHandler.java
GraphHandler.printMetricHeader
private static void printMetricHeader(final PrintWriter writer, final String metric, final long timestamp) { writer.print(metric); writer.print(' '); writer.print(timestamp / 1000L); writer.print(' '); }
java
private static void printMetricHeader(final PrintWriter writer, final String metric, final long timestamp) { writer.print(metric); writer.print(' '); writer.print(timestamp / 1000L); writer.print(' '); }
[ "private", "static", "void", "printMetricHeader", "(", "final", "PrintWriter", "writer", ",", "final", "String", "metric", ",", "final", "long", "timestamp", ")", "{", "writer", ".", "print", "(", "metric", ")", ";", "writer", ".", "print", "(", "'", "'", ...
Helper method to write metric name and timestamp. @param writer The writer to which to write. @param metric The metric name. @param timestamp The timestamp.
[ "Helper", "method", "to", "write", "metric", "name", "and", "timestamp", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/GraphHandler.java#L901-L907
13,575
OpenTSDB/opentsdb
src/tsd/GraphHandler.java
GraphHandler.findGnuplotHelperScript
private static String findGnuplotHelperScript() { if(!GnuplotInstaller.FOUND_GP) { LOG.warn("Skipping Gnuplot Shell Script Install since Gnuplot executable was not found"); return null; } if(!GnuplotInstaller.GP_FILE.exists()) { GnuplotInstaller.installMyGnuPlot(); } if(GnuplotInst...
java
private static String findGnuplotHelperScript() { if(!GnuplotInstaller.FOUND_GP) { LOG.warn("Skipping Gnuplot Shell Script Install since Gnuplot executable was not found"); return null; } if(!GnuplotInstaller.GP_FILE.exists()) { GnuplotInstaller.installMyGnuPlot(); } if(GnuplotInst...
[ "private", "static", "String", "findGnuplotHelperScript", "(", ")", "{", "if", "(", "!", "GnuplotInstaller", ".", "FOUND_GP", ")", "{", "LOG", ".", "warn", "(", "\"Skipping Gnuplot Shell Script Install since Gnuplot executable was not found\"", ")", ";", "return", "null...
Iterate through the class path and look for the Gnuplot helper script. @return The path to the wrapper script.
[ "Iterate", "through", "the", "class", "path", "and", "look", "for", "the", "Gnuplot", "helper", "script", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/GraphHandler.java#L933-L967
13,576
OpenTSDB/opentsdb
src/meta/TSMeta.java
TSMeta.parseFromColumn
public static Deferred<TSMeta> parseFromColumn(final TSDB tsdb, final KeyValue column, final boolean load_uidmetas) { if (column.value() == null || column.value().length < 1) { throw new IllegalArgumentException("Empty column value"); } final TSMeta parsed_meta = JSON.parseToObject(column.valu...
java
public static Deferred<TSMeta> parseFromColumn(final TSDB tsdb, final KeyValue column, final boolean load_uidmetas) { if (column.value() == null || column.value().length < 1) { throw new IllegalArgumentException("Empty column value"); } final TSMeta parsed_meta = JSON.parseToObject(column.valu...
[ "public", "static", "Deferred", "<", "TSMeta", ">", "parseFromColumn", "(", "final", "TSDB", "tsdb", ",", "final", "KeyValue", "column", ",", "final", "boolean", "load_uidmetas", ")", "{", "if", "(", "column", ".", "value", "(", ")", "==", "null", "||", ...
Parses a TSMeta object from the given column, optionally loading the UIDMeta objects @param tsdb The TSDB to use for storage access @param column The KeyValue column to parse @param load_uidmetas Whether or not UIDmeta objects should be loaded @return A TSMeta if parsed successfully @throws NoSuchUniqueName if one of t...
[ "Parses", "a", "TSMeta", "object", "from", "the", "given", "column", "optionally", "loading", "the", "UIDMeta", "objects" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/meta/TSMeta.java#L404-L424
13,577
OpenTSDB/opentsdb
src/meta/TSMeta.java
TSMeta.metaExistsInStorage
public static Deferred<Boolean> metaExistsInStorage(final TSDB tsdb, final String tsuid) { final GetRequest get = new GetRequest(tsdb.metaTable(), UniqueId.stringToUid(tsuid)); get.family(FAMILY); get.qualifier(META_QUALIFIER); /** * Callback from the GetRequest that simply det...
java
public static Deferred<Boolean> metaExistsInStorage(final TSDB tsdb, final String tsuid) { final GetRequest get = new GetRequest(tsdb.metaTable(), UniqueId.stringToUid(tsuid)); get.family(FAMILY); get.qualifier(META_QUALIFIER); /** * Callback from the GetRequest that simply det...
[ "public", "static", "Deferred", "<", "Boolean", ">", "metaExistsInStorage", "(", "final", "TSDB", "tsdb", ",", "final", "String", "tsuid", ")", "{", "final", "GetRequest", "get", "=", "new", "GetRequest", "(", "tsdb", ".", "metaTable", "(", ")", ",", "Uniq...
Determines if an entry exists in storage or not. This is used by the UID Manager tool to determine if we need to write a new TSUID entry or not. It will not attempt to verify if the stored data is valid, just checks to see if something is stored in the proper column. @param tsdb The TSDB to use for storage access @par...
[ "Determines", "if", "an", "entry", "exists", "in", "storage", "or", "not", ".", "This", "is", "used", "by", "the", "UID", "Manager", "tool", "to", "determine", "if", "we", "need", "to", "write", "a", "new", "TSUID", "entry", "or", "not", ".", "It", "...
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/meta/TSMeta.java#L436-L460
13,578
OpenTSDB/opentsdb
src/meta/TSMeta.java
TSMeta.counterExistsInStorage
public static Deferred<Boolean> counterExistsInStorage(final TSDB tsdb, final byte[] tsuid) { final GetRequest get = new GetRequest(tsdb.metaTable(), tsuid); get.family(FAMILY); get.qualifier(COUNTER_QUALIFIER); /** * Callback from the GetRequest that simply determines if the row is emp...
java
public static Deferred<Boolean> counterExistsInStorage(final TSDB tsdb, final byte[] tsuid) { final GetRequest get = new GetRequest(tsdb.metaTable(), tsuid); get.family(FAMILY); get.qualifier(COUNTER_QUALIFIER); /** * Callback from the GetRequest that simply determines if the row is emp...
[ "public", "static", "Deferred", "<", "Boolean", ">", "counterExistsInStorage", "(", "final", "TSDB", "tsdb", ",", "final", "byte", "[", "]", "tsuid", ")", "{", "final", "GetRequest", "get", "=", "new", "GetRequest", "(", "tsdb", ".", "metaTable", "(", ")",...
Determines if the counter column exists for the TSUID. This is used by the UID Manager tool to determine if we need to write a new TSUID entry or not. It will not attempt to verify if the stored data is valid, just checks to see if something is stored in the proper column. @param tsdb The TSDB to use for storage access...
[ "Determines", "if", "the", "counter", "column", "exists", "for", "the", "TSUID", ".", "This", "is", "used", "by", "the", "UID", "Manager", "tool", "to", "determine", "if", "we", "need", "to", "write", "a", "new", "TSUID", "entry", "or", "not", ".", "It...
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/meta/TSMeta.java#L472-L495
13,579
OpenTSDB/opentsdb
src/query/pojo/Query.java
Query.validate
public void validate() { if (time == null) { throw new IllegalArgumentException("missing time"); } validatePOJO(time, "time"); if (metrics == null || metrics.isEmpty()) { throw new IllegalArgumentException("missing or empty metrics"); } final Set<String> variable_ids = new HashSet...
java
public void validate() { if (time == null) { throw new IllegalArgumentException("missing time"); } validatePOJO(time, "time"); if (metrics == null || metrics.isEmpty()) { throw new IllegalArgumentException("missing or empty metrics"); } final Set<String> variable_ids = new HashSet...
[ "public", "void", "validate", "(", ")", "{", "if", "(", "time", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"missing time\"", ")", ";", "}", "validatePOJO", "(", "time", ",", "\"time\"", ")", ";", "if", "(", "metrics", "=="...
Validates the query @throws IllegalArgumentException if one or more parameters were invalid
[ "Validates", "the", "query" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/pojo/Query.java#L103-L169
13,580
OpenTSDB/opentsdb
src/query/pojo/Query.java
Query.validateFilters
private void validateFilters() { Set<String> ids = new HashSet<String>(); for (Filter filter : filters) { ids.add(filter.getId()); } for(Metric metric : metrics) { if (metric.getFilter() != null && !metric.getFilter().isEmpty() && !ids.contains(metric.getFilter())) { ...
java
private void validateFilters() { Set<String> ids = new HashSet<String>(); for (Filter filter : filters) { ids.add(filter.getId()); } for(Metric metric : metrics) { if (metric.getFilter() != null && !metric.getFilter().isEmpty() && !ids.contains(metric.getFilter())) { ...
[ "private", "void", "validateFilters", "(", ")", "{", "Set", "<", "String", ">", "ids", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "for", "(", "Filter", "filter", ":", "filters", ")", "{", "ids", ".", "add", "(", "filter", ".", "getId...
Validates the filters, making sure each metric has a filter @throws IllegalArgumentException if one or more parameters were invalid
[ "Validates", "the", "filters", "making", "sure", "each", "metric", "has", "a", "filter" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/pojo/Query.java#L174-L189
13,581
OpenTSDB/opentsdb
src/query/pojo/Query.java
Query.validateId
public static void validateId(final String id) { if (id == null || id.isEmpty()) { throw new IllegalArgumentException("The ID cannot be null or empty"); } for (int i = 0; i < id.length(); i++) { final char c = id.charAt(i); if (!(Character.isLetterOrDigit(c))) { throw new IllegalAr...
java
public static void validateId(final String id) { if (id == null || id.isEmpty()) { throw new IllegalArgumentException("The ID cannot be null or empty"); } for (int i = 0; i < id.length(); i++) { final char c = id.charAt(i); if (!(Character.isLetterOrDigit(c))) { throw new IllegalAr...
[ "public", "static", "void", "validateId", "(", "final", "String", "id", ")", "{", "if", "(", "id", "==", "null", "||", "id", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The ID cannot be null or empty\"", ")", ";", ...
Makes sure the ID has only letters and characters @param id The ID to parse @throws IllegalArgumentException if the ID is invalid
[ "Makes", "sure", "the", "ID", "has", "only", "letters", "and", "characters" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/pojo/Query.java#L196-L212
13,582
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.loadPluginPath
public static void loadPluginPath(final String plugin_path) { if (plugin_path != null && !plugin_path.isEmpty()) { try { PluginLoader.loadJARs(plugin_path); } catch (Exception e) { LOG.error("Error loading plugins from plugin path: " + plugin_path, e); throw new RuntimeException(...
java
public static void loadPluginPath(final String plugin_path) { if (plugin_path != null && !plugin_path.isEmpty()) { try { PluginLoader.loadJARs(plugin_path); } catch (Exception e) { LOG.error("Error loading plugins from plugin path: " + plugin_path, e); throw new RuntimeException(...
[ "public", "static", "void", "loadPluginPath", "(", "final", "String", "plugin_path", ")", "{", "if", "(", "plugin_path", "!=", "null", "&&", "!", "plugin_path", ".", "isEmpty", "(", ")", ")", "{", "try", "{", "PluginLoader", ".", "loadJARs", "(", "plugin_p...
Called by initializePlugins, also used to load startup plugins. @since 2.3
[ "Called", "by", "initializePlugins", "also", "used", "to", "load", "startup", "plugins", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L368-L378
13,583
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.getUidName
public Deferred<String> getUidName(final UniqueIdType type, final byte[] uid) { if (uid == null) { throw new IllegalArgumentException("Missing UID"); } switch (type) { case METRIC: return this.metrics.getNameAsync(uid); case TAGK: return this.tag_names.getNameAsync(uid); ...
java
public Deferred<String> getUidName(final UniqueIdType type, final byte[] uid) { if (uid == null) { throw new IllegalArgumentException("Missing UID"); } switch (type) { case METRIC: return this.metrics.getNameAsync(uid); case TAGK: return this.tag_names.getNameAsync(uid); ...
[ "public", "Deferred", "<", "String", ">", "getUidName", "(", "final", "UniqueIdType", "type", ",", "final", "byte", "[", "]", "uid", ")", "{", "if", "(", "uid", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Missing UID\"", ")"...
Attempts to find the name for a unique identifier given a type @param type The type of UID @param uid The UID to search for @return The name of the UID object if found @throws IllegalArgumentException if the type is not valid @throws NoSuchUniqueId if the UID was not found @since 2.0
[ "Attempts", "to", "find", "the", "name", "for", "a", "unique", "identifier", "given", "a", "type" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L642-L657
13,584
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.checkNecessaryTablesExist
public Deferred<ArrayList<Object>> checkNecessaryTablesExist() { final ArrayList<Deferred<Object>> checks = new ArrayList<Deferred<Object>>(2); checks.add(client.ensureTableExists( config.getString("tsd.storage.hbase.data_table"))); checks.add(client.ensureTableExists( config.getString...
java
public Deferred<ArrayList<Object>> checkNecessaryTablesExist() { final ArrayList<Deferred<Object>> checks = new ArrayList<Deferred<Object>>(2); checks.add(client.ensureTableExists( config.getString("tsd.storage.hbase.data_table"))); checks.add(client.ensureTableExists( config.getString...
[ "public", "Deferred", "<", "ArrayList", "<", "Object", ">", ">", "checkNecessaryTablesExist", "(", ")", "{", "final", "ArrayList", "<", "Deferred", "<", "Object", ">", ">", "checks", "=", "new", "ArrayList", "<", "Deferred", "<", "Object", ">", ">", "(", ...
Verifies that the data and UID tables exist in HBase and optionally the tree and meta data tables if the user has enabled meta tracking or tree building @return An ArrayList of objects to wait for @throws TableNotFoundException @since 2.0
[ "Verifies", "that", "the", "data", "and", "UID", "tables", "exist", "in", "HBase", "and", "optionally", "the", "tree", "and", "meta", "data", "tables", "if", "the", "user", "has", "enabled", "meta", "tracking", "or", "tree", "building" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L712-L729
13,585
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.addHistogramPoint
public Deferred<Object> addHistogramPoint(final String metric, final long timestamp, final byte[] raw_data, final Map<String, String> tags) { if (raw_data == null || raw_data.length < ...
java
public Deferred<Object> addHistogramPoint(final String metric, final long timestamp, final byte[] raw_data, final Map<String, String> tags) { if (raw_data == null || raw_data.length < ...
[ "public", "Deferred", "<", "Object", ">", "addHistogramPoint", "(", "final", "String", "metric", ",", "final", "long", "timestamp", ",", "final", "byte", "[", "]", "raw_data", ",", "final", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "if"...
Adds an encoded Histogram data point in the TSDB. @param metric A non-empty string. @param timestamp The timestamp associated with the value. @param raw_data The encoded data blob of the Histogram point. @param tags The tags on this series. This map must be non-empty. @return A deferred object that indicates the compl...
[ "Adds", "an", "encoded", "Histogram", "data", "point", "in", "the", "TSDB", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L1124-L1140
13,586
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.suggestMetrics
public List<String> suggestMetrics(final String search, final int max_results) { return metrics.suggest(search, max_results); }
java
public List<String> suggestMetrics(final String search, final int max_results) { return metrics.suggest(search, max_results); }
[ "public", "List", "<", "String", ">", "suggestMetrics", "(", "final", "String", "search", ",", "final", "int", "max_results", ")", "{", "return", "metrics", ".", "suggest", "(", "search", ",", "max_results", ")", ";", "}" ]
Given a prefix search, returns matching metric names. @param search A prefix to search. @param max_results Maximum number of results to return. @since 2.0
[ "Given", "a", "prefix", "search", "returns", "matching", "metric", "names", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L1764-L1767
13,587
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.suggestTagNames
public List<String> suggestTagNames(final String search, final int max_results) { return tag_names.suggest(search, max_results); }
java
public List<String> suggestTagNames(final String search, final int max_results) { return tag_names.suggest(search, max_results); }
[ "public", "List", "<", "String", ">", "suggestTagNames", "(", "final", "String", "search", ",", "final", "int", "max_results", ")", "{", "return", "tag_names", ".", "suggest", "(", "search", ",", "max_results", ")", ";", "}" ]
Given a prefix search, returns matching tagk names. @param search A prefix to search. @param max_results Maximum number of results to return. @since 2.0
[ "Given", "a", "prefix", "search", "returns", "matching", "tagk", "names", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L1783-L1786
13,588
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.suggestTagValues
public List<String> suggestTagValues(final String search, final int max_results) { return tag_values.suggest(search, max_results); }
java
public List<String> suggestTagValues(final String search, final int max_results) { return tag_values.suggest(search, max_results); }
[ "public", "List", "<", "String", ">", "suggestTagValues", "(", "final", "String", "search", ",", "final", "int", "max_results", ")", "{", "return", "tag_values", ".", "suggest", "(", "search", ",", "max_results", ")", ";", "}" ]
Given a prefix search, returns matching tag values. @param search A prefix to search. @param max_results Maximum number of results to return. @since 2.0
[ "Given", "a", "prefix", "search", "returns", "matching", "tag", "values", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L1802-L1805
13,589
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.assignUid
public byte[] assignUid(final String type, final String name) { Tags.validateString(type, name); if (type.toLowerCase().equals("metric")) { try { final byte[] uid = this.metrics.getId(name); throw new IllegalArgumentException("Name already exists with UID: " + UniqueId.uidToStr...
java
public byte[] assignUid(final String type, final String name) { Tags.validateString(type, name); if (type.toLowerCase().equals("metric")) { try { final byte[] uid = this.metrics.getId(name); throw new IllegalArgumentException("Name already exists with UID: " + UniqueId.uidToStr...
[ "public", "byte", "[", "]", "assignUid", "(", "final", "String", "type", ",", "final", "String", "name", ")", "{", "Tags", ".", "validateString", "(", "type", ",", "name", ")", ";", "if", "(", "type", ".", "toLowerCase", "(", ")", ".", "equals", "(",...
Attempts to assign a UID to a name for the given type Used by the UniqueIdRpc call to generate IDs for new metrics, tagks or tagvs. The name must pass validation and if it's already assigned a UID, this method will throw an error with the proper UID. Otherwise if it can create the UID, it will be returned @param type T...
[ "Attempts", "to", "assign", "a", "UID", "to", "a", "name", "for", "the", "given", "type", "Used", "by", "the", "UniqueIdRpc", "call", "to", "generate", "IDs", "for", "new", "metrics", "tagks", "or", "tagvs", ".", "The", "name", "must", "pass", "validatio...
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L1830-L1860
13,590
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.deleteUidAsync
public Deferred<Object> deleteUidAsync(final String type, final String name) { final UniqueIdType uid_type = UniqueId.stringToUniqueIdType(type); switch (uid_type) { case METRIC: return metrics.deleteAsync(name); case TAGK: return tag_names.deleteAsync(name); case TAGV: return tag_...
java
public Deferred<Object> deleteUidAsync(final String type, final String name) { final UniqueIdType uid_type = UniqueId.stringToUniqueIdType(type); switch (uid_type) { case METRIC: return metrics.deleteAsync(name); case TAGK: return tag_names.deleteAsync(name); case TAGV: return tag_...
[ "public", "Deferred", "<", "Object", ">", "deleteUidAsync", "(", "final", "String", "type", ",", "final", "String", "name", ")", "{", "final", "UniqueIdType", "uid_type", "=", "UniqueId", ".", "stringToUniqueIdType", "(", "type", ")", ";", "switch", "(", "ui...
Attempts to delete the given UID name mapping from the storage table as well as the local cache. @param type The type of UID to delete. Must be "metrics", "tagk" or "tagv" @param name The name of the UID to delete @return A deferred to wait on for completion, or an exception if thrown @throws IllegalArgumentException i...
[ "Attempts", "to", "delete", "the", "given", "UID", "name", "mapping", "from", "the", "storage", "table", "as", "well", "as", "the", "local", "cache", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L1871-L1883
13,591
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.renameUid
public void renameUid(final String type, final String oldname, final String newname) { Tags.validateString(type, oldname); Tags.validateString(type, newname); if (type.toLowerCase().equals("metric")) { try { this.metrics.getId(oldname); this.metrics.rename(oldname, newname); ...
java
public void renameUid(final String type, final String oldname, final String newname) { Tags.validateString(type, oldname); Tags.validateString(type, newname); if (type.toLowerCase().equals("metric")) { try { this.metrics.getId(oldname); this.metrics.rename(oldname, newname); ...
[ "public", "void", "renameUid", "(", "final", "String", "type", ",", "final", "String", "oldname", ",", "final", "String", "newname", ")", "{", "Tags", ".", "validateString", "(", "type", ",", "oldname", ")", ";", "Tags", ".", "validateString", "(", "type",...
Attempts to rename a UID from existing name to the given name Used by the UniqueIdRpc call to rename name of existing metrics, tagks or tagvs. The name must pass validation. If the UID doesn't exist, the method will throw an error. Chained IllegalArgumentException is directly exposed to caller. If the rename was succes...
[ "Attempts", "to", "rename", "a", "UID", "from", "existing", "name", "to", "the", "given", "name", "Used", "by", "the", "UniqueIdRpc", "call", "to", "rename", "name", "of", "existing", "metrics", "tagks", "or", "tagvs", ".", "The", "name", "must", "pass", ...
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L1897-L1929
13,592
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.indexTSMeta
public void indexTSMeta(final TSMeta meta) { if (search != null) { search.indexTSMeta(meta).addErrback(new PluginError()); } }
java
public void indexTSMeta(final TSMeta meta) { if (search != null) { search.indexTSMeta(meta).addErrback(new PluginError()); } }
[ "public", "void", "indexTSMeta", "(", "final", "TSMeta", "meta", ")", "{", "if", "(", "search", "!=", "null", ")", "{", "search", ".", "indexTSMeta", "(", "meta", ")", ".", "addErrback", "(", "new", "PluginError", "(", ")", ")", ";", "}", "}" ]
Index the given timeseries meta object via the configured search plugin @param meta The meta data object to index @since 2.0
[ "Index", "the", "given", "timeseries", "meta", "object", "via", "the", "configured", "search", "plugin" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L1956-L1960
13,593
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.deleteTSMeta
public void deleteTSMeta(final String tsuid) { if (search != null) { search.deleteTSMeta(tsuid).addErrback(new PluginError()); } }
java
public void deleteTSMeta(final String tsuid) { if (search != null) { search.deleteTSMeta(tsuid).addErrback(new PluginError()); } }
[ "public", "void", "deleteTSMeta", "(", "final", "String", "tsuid", ")", "{", "if", "(", "search", "!=", "null", ")", "{", "search", ".", "deleteTSMeta", "(", "tsuid", ")", ".", "addErrback", "(", "new", "PluginError", "(", ")", ")", ";", "}", "}" ]
Delete the timeseries meta object from the search index @param tsuid The TSUID to delete @since 2.0
[ "Delete", "the", "timeseries", "meta", "object", "from", "the", "search", "index" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L1967-L1971
13,594
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.indexUIDMeta
public void indexUIDMeta(final UIDMeta meta) { if (search != null) { search.indexUIDMeta(meta).addErrback(new PluginError()); } }
java
public void indexUIDMeta(final UIDMeta meta) { if (search != null) { search.indexUIDMeta(meta).addErrback(new PluginError()); } }
[ "public", "void", "indexUIDMeta", "(", "final", "UIDMeta", "meta", ")", "{", "if", "(", "search", "!=", "null", ")", "{", "search", ".", "indexUIDMeta", "(", "meta", ")", ".", "addErrback", "(", "new", "PluginError", "(", ")", ")", ";", "}", "}" ]
Index the given UID meta object via the configured search plugin @param meta The meta data object to index @since 2.0
[ "Index", "the", "given", "UID", "meta", "object", "via", "the", "configured", "search", "plugin" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L1978-L1982
13,595
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.deleteUIDMeta
public void deleteUIDMeta(final UIDMeta meta) { if (search != null) { search.deleteUIDMeta(meta).addErrback(new PluginError()); } }
java
public void deleteUIDMeta(final UIDMeta meta) { if (search != null) { search.deleteUIDMeta(meta).addErrback(new PluginError()); } }
[ "public", "void", "deleteUIDMeta", "(", "final", "UIDMeta", "meta", ")", "{", "if", "(", "search", "!=", "null", ")", "{", "search", ".", "deleteUIDMeta", "(", "meta", ")", ".", "addErrback", "(", "new", "PluginError", "(", ")", ")", ";", "}", "}" ]
Delete the UID meta object from the search index @param meta The UID meta object to delete @since 2.0
[ "Delete", "the", "UID", "meta", "object", "from", "the", "search", "index" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L1989-L1993
13,596
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.indexAnnotation
public void indexAnnotation(final Annotation note) { if (search != null) { search.indexAnnotation(note).addErrback(new PluginError()); } if( rt_publisher != null ) { rt_publisher.publishAnnotation(note); } }
java
public void indexAnnotation(final Annotation note) { if (search != null) { search.indexAnnotation(note).addErrback(new PluginError()); } if( rt_publisher != null ) { rt_publisher.publishAnnotation(note); } }
[ "public", "void", "indexAnnotation", "(", "final", "Annotation", "note", ")", "{", "if", "(", "search", "!=", "null", ")", "{", "search", ".", "indexAnnotation", "(", "note", ")", ".", "addErrback", "(", "new", "PluginError", "(", ")", ")", ";", "}", "...
Index the given Annotation object via the configured search plugin @param note The annotation object to index @since 2.0
[ "Index", "the", "given", "Annotation", "object", "via", "the", "configured", "search", "plugin" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L2000-L2007
13,597
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.deleteAnnotation
public void deleteAnnotation(final Annotation note) { if (search != null) { search.deleteAnnotation(note).addErrback(new PluginError()); } }
java
public void deleteAnnotation(final Annotation note) { if (search != null) { search.deleteAnnotation(note).addErrback(new PluginError()); } }
[ "public", "void", "deleteAnnotation", "(", "final", "Annotation", "note", ")", "{", "if", "(", "search", "!=", "null", ")", "{", "search", ".", "deleteAnnotation", "(", "note", ")", ".", "addErrback", "(", "new", "PluginError", "(", ")", ")", ";", "}", ...
Delete the annotation object from the search index @param note The annotation object to delete @since 2.0
[ "Delete", "the", "annotation", "object", "from", "the", "search", "index" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L2014-L2018
13,598
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.processTSMetaThroughTrees
public Deferred<Boolean> processTSMetaThroughTrees(final TSMeta meta) { if (config.enable_tree_processing()) { return TreeBuilder.processAllTrees(this, meta); } return Deferred.fromResult(false); }
java
public Deferred<Boolean> processTSMetaThroughTrees(final TSMeta meta) { if (config.enable_tree_processing()) { return TreeBuilder.processAllTrees(this, meta); } return Deferred.fromResult(false); }
[ "public", "Deferred", "<", "Boolean", ">", "processTSMetaThroughTrees", "(", "final", "TSMeta", "meta", ")", "{", "if", "(", "config", ".", "enable_tree_processing", "(", ")", ")", "{", "return", "TreeBuilder", ".", "processAllTrees", "(", "this", ",", "meta",...
Processes the TSMeta through all of the trees if configured to do so @param meta The meta data to process @since 2.0
[ "Processes", "the", "TSMeta", "through", "all", "of", "the", "trees", "if", "configured", "to", "do", "so" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L2025-L2030
13,599
OpenTSDB/opentsdb
src/core/TSDB.java
TSDB.executeSearch
public Deferred<SearchQuery> executeSearch(final SearchQuery query) { if (search == null) { throw new IllegalStateException( "Searching has not been enabled on this TSD"); } return search.executeQuery(query); }
java
public Deferred<SearchQuery> executeSearch(final SearchQuery query) { if (search == null) { throw new IllegalStateException( "Searching has not been enabled on this TSD"); } return search.executeQuery(query); }
[ "public", "Deferred", "<", "SearchQuery", ">", "executeSearch", "(", "final", "SearchQuery", "query", ")", "{", "if", "(", "search", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Searching has not been enabled on this TSD\"", ")", ";", "...
Executes a search query using the search plugin @param query The query to execute @return A deferred object to wait on for the results to be fetched @throws IllegalStateException if the search plugin has not been enabled or configured @since 2.0
[ "Executes", "a", "search", "query", "using", "the", "search", "plugin" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L2040-L2047