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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
121,100 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Producer.java | Producer.enqueue | public <T extends Serializable> int enqueue(final String topic, List<T> objects) {
int messagesBuffered = 0;
for (T object : objects) {
final String value;
if (String.class.isAssignableFrom(object.getClass())) {
value = String.class.cast(object);
} e... | java | public <T extends Serializable> int enqueue(final String topic, List<T> objects) {
int messagesBuffered = 0;
for (T object : objects) {
final String value;
if (String.class.isAssignableFrom(object.getClass())) {
value = String.class.cast(object);
} e... | [
"public",
"<",
"T",
"extends",
"Serializable",
">",
"int",
"enqueue",
"(",
"final",
"String",
"topic",
",",
"List",
"<",
"T",
">",
"objects",
")",
"{",
"int",
"messagesBuffered",
"=",
"0",
";",
"for",
"(",
"T",
"object",
":",
"objects",
")",
"{",
"fi... | Adds the messages to the Producer Buffer which will later be batched by Kafka and sent to the brokers.
@param <T> The value type.
@param topic The topic to produce onto.
@param objects The list of objects to enqueue.
@return The number of objects that were successfully added to the Producer Buffer. | [
"Adds",
"the",
"messages",
"to",
"the",
"Producer",
"Buffer",
"which",
"will",
"later",
"be",
"batched",
"by",
"Kafka",
"and",
"sent",
"to",
"the",
"brokers",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Producer.java#L137-L167 |
121,101 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Producer.java | Producer.shutdown | public void shutdown() {
if (_producer != null) {
_producer.close();
}
_executorService.shutdown();
try {
if (!_executorService.awaitTermination(10, TimeUnit.SECONDS)) {
_logger.warn("Shutdown of Kafka executor service timed out after 10 seconds.")... | java | public void shutdown() {
if (_producer != null) {
_producer.close();
}
_executorService.shutdown();
try {
if (!_executorService.awaitTermination(10, TimeUnit.SECONDS)) {
_logger.warn("Shutdown of Kafka executor service timed out after 10 seconds.")... | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"if",
"(",
"_producer",
"!=",
"null",
")",
"{",
"_producer",
".",
"close",
"(",
")",
";",
"}",
"_executorService",
".",
"shutdown",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"_executorService",
".",
"awai... | Shuts down the producer. | [
"Shuts",
"down",
"the",
"producer",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Producer.java#L170-L184 |
121,102 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java | Notification.getMetricToAnnotate | public static Metric getMetricToAnnotate(String metric) {
Metric result = null;
if (metric != null && !metric.isEmpty()) {
Pattern pattern = Pattern.compile(
"([\\w,\\-,\\.,/]+):([\\w,\\-,\\.,/]+)(\\{(?:[\\w,\\-,\\.,/]+=[\\w,\\-,\\.,/,\\*,|]+)(?:,[\\w,\\-,\\.,/]+=[\\w,\\-,\\... | java | public static Metric getMetricToAnnotate(String metric) {
Metric result = null;
if (metric != null && !metric.isEmpty()) {
Pattern pattern = Pattern.compile(
"([\\w,\\-,\\.,/]+):([\\w,\\-,\\.,/]+)(\\{(?:[\\w,\\-,\\.,/]+=[\\w,\\-,\\.,/,\\*,|]+)(?:,[\\w,\\-,\\.,/]+=[\\w,\\-,\\... | [
"public",
"static",
"Metric",
"getMetricToAnnotate",
"(",
"String",
"metric",
")",
"{",
"Metric",
"result",
"=",
"null",
";",
"if",
"(",
"metric",
"!=",
"null",
"&&",
"!",
"metric",
".",
"isEmpty",
"(",
")",
")",
"{",
"Pattern",
"pattern",
"=",
"Pattern"... | Given a metric to annotate expression, return a corresponding metric object.
@param metric The metric to annotate expression.
@return The corresponding metric or null if the metric to annotate expression is invalid. | [
"Given",
"a",
"metric",
"to",
"annotate",
"expression",
"return",
"a",
"corresponding",
"metric",
"object",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java#L367-L394 |
121,103 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java | Notification.setSubscriptions | public void setSubscriptions(List<String> subscriptions) {
this.subscriptions.clear();
if(subscriptions == null) return;
for(String currentSubscription: subscriptions) {
if (this.getNotifierName().equals(AlertService.SupportedNotifier.GUS.getName())) {
if (currentSubs... | java | public void setSubscriptions(List<String> subscriptions) {
this.subscriptions.clear();
if(subscriptions == null) return;
for(String currentSubscription: subscriptions) {
if (this.getNotifierName().equals(AlertService.SupportedNotifier.GUS.getName())) {
if (currentSubs... | [
"public",
"void",
"setSubscriptions",
"(",
"List",
"<",
"String",
">",
"subscriptions",
")",
"{",
"this",
".",
"subscriptions",
".",
"clear",
"(",
")",
";",
"if",
"(",
"subscriptions",
"==",
"null",
")",
"return",
";",
"for",
"(",
"String",
"currentSubscri... | Replaces the subscriptions used by the notifier to send the notifications.
@param subscriptions The subscription list. | [
"Replaces",
"the",
"subscriptions",
"used",
"by",
"the",
"notifier",
"to",
"send",
"the",
"notifications",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java#L449-L470 |
121,104 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java | Notification.getCooldownExpirationByTriggerAndMetric | public long getCooldownExpirationByTriggerAndMetric(Trigger trigger, Metric metric) {
String key = _hashTriggerAndMetric(trigger, metric);
return this.cooldownExpirationByTriggerAndMetric.containsKey(key) ? this.cooldownExpirationByTriggerAndMetric.get(key) : 0;
} | java | public long getCooldownExpirationByTriggerAndMetric(Trigger trigger, Metric metric) {
String key = _hashTriggerAndMetric(trigger, metric);
return this.cooldownExpirationByTriggerAndMetric.containsKey(key) ? this.cooldownExpirationByTriggerAndMetric.get(key) : 0;
} | [
"public",
"long",
"getCooldownExpirationByTriggerAndMetric",
"(",
"Trigger",
"trigger",
",",
"Metric",
"metric",
")",
"{",
"String",
"key",
"=",
"_hashTriggerAndMetric",
"(",
"trigger",
",",
"metric",
")",
";",
"return",
"this",
".",
"cooldownExpirationByTriggerAndMet... | Returns the cool down expiration time of the notification given a metric,trigger combination.
@param trigger The trigger
@param metric The metric
@return cool down expiration time in milliseconds | [
"Returns",
"the",
"cool",
"down",
"expiration",
"time",
"of",
"the",
"notification",
"given",
"a",
"metric",
"trigger",
"combination",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java#L498-L501 |
121,105 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java | Notification.setCooldownExpirationByTriggerAndMetric | public void setCooldownExpirationByTriggerAndMetric(Trigger trigger, Metric metric, long cooldownExpiration) {
requireArgument(cooldownExpiration >= 0, "Cool down expiration time cannot be negative.");
String key = _hashTriggerAndMetric(trigger, metric);
this.cooldownExpirationByTriggerAndMetric.put(key, c... | java | public void setCooldownExpirationByTriggerAndMetric(Trigger trigger, Metric metric, long cooldownExpiration) {
requireArgument(cooldownExpiration >= 0, "Cool down expiration time cannot be negative.");
String key = _hashTriggerAndMetric(trigger, metric);
this.cooldownExpirationByTriggerAndMetric.put(key, c... | [
"public",
"void",
"setCooldownExpirationByTriggerAndMetric",
"(",
"Trigger",
"trigger",
",",
"Metric",
"metric",
",",
"long",
"cooldownExpiration",
")",
"{",
"requireArgument",
"(",
"cooldownExpiration",
">=",
"0",
",",
"\"Cool down expiration time cannot be negative.\"",
"... | Sets the cool down expiration time of the notification given a metric,trigger combination.
@param trigger The trigger
@param metric The metric
@param cooldownExpiration cool down expiration time in milliseconds | [
"Sets",
"the",
"cool",
"down",
"expiration",
"time",
"of",
"the",
"notification",
"given",
"a",
"metric",
"trigger",
"combination",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java#L510-L515 |
121,106 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java | Notification.setMetricsToAnnotate | public void setMetricsToAnnotate(List<String> metricsToAnnotate) {
this.metricsToAnnotate.clear();
if (metricsToAnnotate != null && !metricsToAnnotate.isEmpty()) {
for (String metric : metricsToAnnotate) {
requireArgument(getMetricToAnnotate(metric) != null, "Metrics to annot... | java | public void setMetricsToAnnotate(List<String> metricsToAnnotate) {
this.metricsToAnnotate.clear();
if (metricsToAnnotate != null && !metricsToAnnotate.isEmpty()) {
for (String metric : metricsToAnnotate) {
requireArgument(getMetricToAnnotate(metric) != null, "Metrics to annot... | [
"public",
"void",
"setMetricsToAnnotate",
"(",
"List",
"<",
"String",
">",
"metricsToAnnotate",
")",
"{",
"this",
".",
"metricsToAnnotate",
".",
"clear",
"(",
")",
";",
"if",
"(",
"metricsToAnnotate",
"!=",
"null",
"&&",
"!",
"metricsToAnnotate",
".",
"isEmpty... | Sets metrics to be annotated.
@param metricsToAnnotate list of metrics. | [
"Sets",
"metrics",
"to",
"be",
"annotated",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java#L539-L547 |
121,107 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java | Notification.setTriggers | public void setTriggers(List<Trigger> triggers) {
this.triggers.clear();
if (triggers != null) {
this.triggers.addAll(triggers);
}
} | java | public void setTriggers(List<Trigger> triggers) {
this.triggers.clear();
if (triggers != null) {
this.triggers.addAll(triggers);
}
} | [
"public",
"void",
"setTriggers",
"(",
"List",
"<",
"Trigger",
">",
"triggers",
")",
"{",
"this",
".",
"triggers",
".",
"clear",
"(",
")",
";",
"if",
"(",
"triggers",
"!=",
"null",
")",
"{",
"this",
".",
"triggers",
".",
"addAll",
"(",
"triggers",
")"... | Replaces the triggers associated with the notification.
@param triggers The triggers associated with the notification. | [
"Replaces",
"the",
"triggers",
"associated",
"with",
"the",
"notification",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java#L585-L590 |
121,108 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java | Notification.isActiveForTriggerAndMetric | public boolean isActiveForTriggerAndMetric(Trigger trigger, Metric metric) {
String key = _hashTriggerAndMetric(trigger, metric);
return this.activeStatusByTriggerAndMetric.containsKey(key) ? activeStatusByTriggerAndMetric.get(key) : false;
} | java | public boolean isActiveForTriggerAndMetric(Trigger trigger, Metric metric) {
String key = _hashTriggerAndMetric(trigger, metric);
return this.activeStatusByTriggerAndMetric.containsKey(key) ? activeStatusByTriggerAndMetric.get(key) : false;
} | [
"public",
"boolean",
"isActiveForTriggerAndMetric",
"(",
"Trigger",
"trigger",
",",
"Metric",
"metric",
")",
"{",
"String",
"key",
"=",
"_hashTriggerAndMetric",
"(",
"trigger",
",",
"metric",
")",
";",
"return",
"this",
".",
"activeStatusByTriggerAndMetric",
".",
... | Given a metric,notification combination, indicates whether a triggering condition associated with this notification is still in a triggering state.
@param trigger The Trigger that caused this notification
@param metric The metric that caused this notification
@return True if the triggering condition is still in a tri... | [
"Given",
"a",
"metric",
"notification",
"combination",
"indicates",
"whether",
"a",
"triggering",
"condition",
"associated",
"with",
"this",
"notification",
"is",
"still",
"in",
"a",
"triggering",
"state",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java#L600-L603 |
121,109 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java | Notification.setActiveForTriggerAndMetric | public void setActiveForTriggerAndMetric(Trigger trigger, Metric metric, boolean active) {
String key = _hashTriggerAndMetric(trigger, metric);
this.activeStatusByTriggerAndMetric.put(key, active);
} | java | public void setActiveForTriggerAndMetric(Trigger trigger, Metric metric, boolean active) {
String key = _hashTriggerAndMetric(trigger, metric);
this.activeStatusByTriggerAndMetric.put(key, active);
} | [
"public",
"void",
"setActiveForTriggerAndMetric",
"(",
"Trigger",
"trigger",
",",
"Metric",
"metric",
",",
"boolean",
"active",
")",
"{",
"String",
"key",
"=",
"_hashTriggerAndMetric",
"(",
"trigger",
",",
"metric",
")",
";",
"this",
".",
"activeStatusByTriggerAnd... | When a notification is sent out when a metric violates the trigger threshold, set this notification active for that trigger,metric combination
@param trigger The Trigger that caused this notification
@param metric The metric that caused this notification
@param active Whether to set the notification to active | [
"When",
"a",
"notification",
"is",
"sent",
"out",
"when",
"a",
"metric",
"violates",
"the",
"trigger",
"threshold",
"set",
"this",
"notification",
"active",
"for",
"that",
"trigger",
"metric",
"combination"
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java#L612-L615 |
121,110 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java | Option.createFlag | public static Option createFlag(String name, String description) {
return new Option(Type.FLAG, name, 0, description);
} | java | public static Option createFlag(String name, String description) {
return new Option(Type.FLAG, name, 0, description);
} | [
"public",
"static",
"Option",
"createFlag",
"(",
"String",
"name",
",",
"String",
"description",
")",
"{",
"return",
"new",
"Option",
"(",
"Type",
".",
"FLAG",
",",
"name",
",",
"0",
",",
"description",
")",
";",
"}"
] | Creates a new flag type option. These types of options are used to indicate some application switch is either on or off.
@param name The name of the option
@param description The description of the option used to display usage
@return The option | [
"Creates",
"a",
"new",
"flag",
"type",
"option",
".",
"These",
"types",
"of",
"options",
"are",
"used",
"to",
"indicate",
"some",
"application",
"switch",
"is",
"either",
"on",
"or",
"off",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java#L97-L99 |
121,111 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java | Option.createOption | public static Option createOption(String name, String description) {
return new Option(Type.OPTION, name, 1, description);
} | java | public static Option createOption(String name, String description) {
return new Option(Type.OPTION, name, 1, description);
} | [
"public",
"static",
"Option",
"createOption",
"(",
"String",
"name",
",",
"String",
"description",
")",
"{",
"return",
"new",
"Option",
"(",
"Type",
".",
"OPTION",
",",
"name",
",",
"1",
",",
"description",
")",
";",
"}"
] | Returns a named option having one value. An example may be a logfile option for a program.
<p>program -log <logfile></p>
<p>In this case the -log option has a length of one value of <logfile>.</p>
@param name The name of the option.
@param description The description of the option used to di... | [
"Returns",
"a",
"named",
"option",
"having",
"one",
"value",
".",
"An",
"example",
"may",
"be",
"a",
"logfile",
"option",
"for",
"a",
"program",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java#L124-L126 |
121,112 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java | Option.findListOption | public static Option findListOption(Option[] options) {
for (int i = 0; i < options.length; i++) {
if (options[i].getType() == Type.LIST) {
return options[i];
}
}
return null;
} | java | public static Option findListOption(Option[] options) {
for (int i = 0; i < options.length; i++) {
if (options[i].getType() == Type.LIST) {
return options[i];
}
}
return null;
} | [
"public",
"static",
"Option",
"findListOption",
"(",
"Option",
"[",
"]",
"options",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"options",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"options",
"[",
"i",
"]",
".",
"getType"... | Returns a list type application option if one exists in the list provided.
@param options The options to search through.
@return The first list type application option or null if none are found. | [
"Returns",
"a",
"list",
"type",
"application",
"option",
"if",
"one",
"exists",
"in",
"the",
"list",
"provided",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java#L153-L160 |
121,113 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java | Option.findOption | public static Option findOption(String name, Option[] options) {
for (int i = 0; i < options.length; i++) {
if (options[i].getName().equals(name)) {
return options[i];
}
}
return null;
} | java | public static Option findOption(String name, Option[] options) {
for (int i = 0; i < options.length; i++) {
if (options[i].getName().equals(name)) {
return options[i];
}
}
return null;
} | [
"public",
"static",
"Option",
"findOption",
"(",
"String",
"name",
",",
"Option",
"[",
"]",
"options",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"options",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"options",
"[",
"i",
... | Returns an option with the given name.
@param name The option name to search for
@param options The list of options to search through
@return The named option from the list or null if it doesn't exist | [
"Returns",
"an",
"option",
"with",
"the",
"given",
"name",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java#L170-L177 |
121,114 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java | Option.parseCLArgs | public static Option[] parseCLArgs(String[] args, Option[] templates) {
int i = 0;
List<Option> options = new ArrayList<Option>(args.length);
try {
while (i < args.length) {
String name = args[i++];
Option template = findTemplate(name, templates);
... | java | public static Option[] parseCLArgs(String[] args, Option[] templates) {
int i = 0;
List<Option> options = new ArrayList<Option>(args.length);
try {
while (i < args.length) {
String name = args[i++];
Option template = findTemplate(name, templates);
... | [
"public",
"static",
"Option",
"[",
"]",
"parseCLArgs",
"(",
"String",
"[",
"]",
"args",
",",
"Option",
"[",
"]",
"templates",
")",
"{",
"int",
"i",
"=",
"0",
";",
"List",
"<",
"Option",
">",
"options",
"=",
"new",
"ArrayList",
"<",
"Option",
">",
"... | Parses the command line arguments of an application and compares those options against a list of expected options.
@param args The command line arguments to parse
@param templates The template list of application options.
@return A list of options that are present on the command line, are valid for the ap... | [
"Parses",
"the",
"command",
"line",
"arguments",
"of",
"an",
"application",
"and",
"compares",
"those",
"options",
"against",
"a",
"list",
"of",
"expected",
"options",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java#L189-L224 |
121,115 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java | Option.findTemplate | private static Option findTemplate(String name, Option[] templates) {
boolean listAllowed = false;
Option listOption = null;
for (int i = 0; i < templates.length; i++) {
if (templates[i].getName().equals(name)) {
return templates[i];
}
if (Typ... | java | private static Option findTemplate(String name, Option[] templates) {
boolean listAllowed = false;
Option listOption = null;
for (int i = 0; i < templates.length; i++) {
if (templates[i].getName().equals(name)) {
return templates[i];
}
if (Typ... | [
"private",
"static",
"Option",
"findTemplate",
"(",
"String",
"name",
",",
"Option",
"[",
"]",
"templates",
")",
"{",
"boolean",
"listAllowed",
"=",
"false",
";",
"Option",
"listOption",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<"... | Searches an array of option templates and returns an option matching the supplied name or null if no match is found.
@param name The name of the option to search for
@param templates An array of option templates in which to search
@return An Option object matching the supplied option name or null if no ma... | [
"Searches",
"an",
"array",
"of",
"option",
"templates",
"and",
"returns",
"an",
"option",
"matching",
"the",
"supplied",
"name",
"or",
"null",
"if",
"no",
"match",
"is",
"found",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java#L234-L251 |
121,116 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java | Option.getValues | public String[] getValues() {
return value == null || value.isEmpty() ? new String[0] : len == 1 ? new String[] { value } : value.split("\\s+");
} | java | public String[] getValues() {
return value == null || value.isEmpty() ? new String[0] : len == 1 ? new String[] { value } : value.split("\\s+");
} | [
"public",
"String",
"[",
"]",
"getValues",
"(",
")",
"{",
"return",
"value",
"==",
"null",
"||",
"value",
".",
"isEmpty",
"(",
")",
"?",
"new",
"String",
"[",
"0",
"]",
":",
"len",
"==",
"1",
"?",
"new",
"String",
"[",
"]",
"{",
"value",
"}",
"... | Returns the value of this option as an array. This array will be empty for flag options, contain a single value for a simple option or a list
of values for list type options.
@return An array containing the option values. | [
"Returns",
"the",
"value",
"of",
"this",
"option",
"as",
"an",
"array",
".",
"This",
"array",
"will",
"be",
"empty",
"for",
"flag",
"options",
"contain",
"a",
"single",
"value",
"for",
"a",
"simple",
"option",
"or",
"a",
"list",
"of",
"values",
"for",
... | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java#L331-L333 |
121,117 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/notifier/RefocusNotifier.java | RefocusNotifier.sendMessage | private void sendMessage(String aspectPath, boolean fired) {
if (Boolean.valueOf(_config.getValue(SystemConfiguration.Property.REFOCUS_ENABLED))) {
int refreshMaxTimes = Integer.parseInt(_config.getValue(Property.REFOCUS_CONNECTION_REFRESH_MAX_TIMES.getName(), Property.REFOCUS_CONNECTION_REFRESH_MAX_TIMES.getDefau... | java | private void sendMessage(String aspectPath, boolean fired) {
if (Boolean.valueOf(_config.getValue(SystemConfiguration.Property.REFOCUS_ENABLED))) {
int refreshMaxTimes = Integer.parseInt(_config.getValue(Property.REFOCUS_CONNECTION_REFRESH_MAX_TIMES.getName(), Property.REFOCUS_CONNECTION_REFRESH_MAX_TIMES.getDefau... | [
"private",
"void",
"sendMessage",
"(",
"String",
"aspectPath",
",",
"boolean",
"fired",
")",
"{",
"if",
"(",
"Boolean",
".",
"valueOf",
"(",
"_config",
".",
"getValue",
"(",
"SystemConfiguration",
".",
"Property",
".",
"REFOCUS_ENABLED",
")",
")",
")",
"{",
... | Sends an Refocus sample.
@param aspectPath The Refocus aspect path.
@param fired If the trigger is fired or not. | [
"Sends",
"an",
"Refocus",
"sample",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/notifier/RefocusNotifier.java#L117-L165 |
121,118 | salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NamespaceDto.java | NamespaceDto.transformToDto | public static NamespaceDto transformToDto(Namespace namespace) {
if (namespace == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
NamespaceDto result = createDtoObject(NamespaceDto.class, namespace);... | java | public static NamespaceDto transformToDto(Namespace namespace) {
if (namespace == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
NamespaceDto result = createDtoObject(NamespaceDto.class, namespace);... | [
"public",
"static",
"NamespaceDto",
"transformToDto",
"(",
"Namespace",
"namespace",
")",
"{",
"if",
"(",
"namespace",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto object.\"",
",",
"Status",
"."... | Converts a namespace entity to a DTO.
@param namespace The entity to convert.
@return The namespace DTO.
@throws WebApplicationException If an error occurs. | [
"Converts",
"a",
"namespace",
"entity",
"to",
"a",
"DTO",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NamespaceDto.java#L74-L85 |
121,119 | salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NamespaceDto.java | NamespaceDto.addUsername | public void addUsername(String username) {
SystemAssert.requireArgument(username != null && !username.isEmpty(), "Username cannot be null or empty.");
this.usernames.add(username);
} | java | public void addUsername(String username) {
SystemAssert.requireArgument(username != null && !username.isEmpty(), "Username cannot be null or empty.");
this.usernames.add(username);
} | [
"public",
"void",
"addUsername",
"(",
"String",
"username",
")",
"{",
"SystemAssert",
".",
"requireArgument",
"(",
"username",
"!=",
"null",
"&&",
"!",
"username",
".",
"isEmpty",
"(",
")",
",",
"\"Username cannot be null or empty.\"",
")",
";",
"this",
".",
"... | Adds an authorized user.
@param username The authorized user to add. | [
"Adds",
"an",
"authorized",
"user",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NamespaceDto.java#L152-L155 |
121,120 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetricSchemaRecordQuery.java | MetricSchemaRecordQuery.setScope | public void setScope(String scope) {
SystemAssert.requireArgument(scope != null && !scope.isEmpty(), "Scope cannot be null or empty.");
this.scope = scope;
} | java | public void setScope(String scope) {
SystemAssert.requireArgument(scope != null && !scope.isEmpty(), "Scope cannot be null or empty.");
this.scope = scope;
} | [
"public",
"void",
"setScope",
"(",
"String",
"scope",
")",
"{",
"SystemAssert",
".",
"requireArgument",
"(",
"scope",
"!=",
"null",
"&&",
"!",
"scope",
".",
"isEmpty",
"(",
")",
",",
"\"Scope cannot be null or empty.\"",
")",
";",
"this",
".",
"scope",
"=",
... | Specifies the scope of the query.
@param scope The scope of the query. Cannot be null or empty. | [
"Specifies",
"the",
"scope",
"of",
"the",
"query",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetricSchemaRecordQuery.java#L112-L115 |
121,121 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetricSchemaRecordQuery.java | MetricSchemaRecordQuery.setMetric | public void setMetric(String metric) {
SystemAssert.requireArgument(metric != null && !metric.isEmpty(), "Metric cannot be null or empty.");
this.metric = metric;
} | java | public void setMetric(String metric) {
SystemAssert.requireArgument(metric != null && !metric.isEmpty(), "Metric cannot be null or empty.");
this.metric = metric;
} | [
"public",
"void",
"setMetric",
"(",
"String",
"metric",
")",
"{",
"SystemAssert",
".",
"requireArgument",
"(",
"metric",
"!=",
"null",
"&&",
"!",
"metric",
".",
"isEmpty",
"(",
")",
",",
"\"Metric cannot be null or empty.\"",
")",
";",
"this",
".",
"metric",
... | Specifies the metric name of the query.
@param metric The metric name of the query. Cannot be null or empty. | [
"Specifies",
"the",
"metric",
"name",
"of",
"the",
"query",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetricSchemaRecordQuery.java#L131-L134 |
121,122 | salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AlertResources.java | AlertResources.getSharedAlertsObj | private List<Alert> getSharedAlertsObj(boolean populateMetaFieldsOnly, PrincipalUser owner, Integer limit) {
Set<Alert> result = new HashSet<>();
result.addAll(populateMetaFieldsOnly ? alertService.findSharedAlerts(true, owner, limit) : alertService.findSharedAlerts(false, owner, limit));
return new ArrayList<... | java | private List<Alert> getSharedAlertsObj(boolean populateMetaFieldsOnly, PrincipalUser owner, Integer limit) {
Set<Alert> result = new HashSet<>();
result.addAll(populateMetaFieldsOnly ? alertService.findSharedAlerts(true, owner, limit) : alertService.findSharedAlerts(false, owner, limit));
return new ArrayList<... | [
"private",
"List",
"<",
"Alert",
">",
"getSharedAlertsObj",
"(",
"boolean",
"populateMetaFieldsOnly",
",",
"PrincipalUser",
"owner",
",",
"Integer",
"limit",
")",
"{",
"Set",
"<",
"Alert",
">",
"result",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"result",
... | Returns list of shared alerts.
@return The list of shared alerts. | [
"Returns",
"list",
"of",
"shared",
"alerts",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AlertResources.java#L133-L138 |
121,123 | salesforce/Argus | ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/entity/Audit.java | Audit.setCreatedDate | public void setCreatedDate(Date createdDate) {
_createdDate = createdDate == null ? null : new Date(createdDate.getTime());
} | java | public void setCreatedDate(Date createdDate) {
_createdDate = createdDate == null ? null : new Date(createdDate.getTime());
} | [
"public",
"void",
"setCreatedDate",
"(",
"Date",
"createdDate",
")",
"{",
"_createdDate",
"=",
"createdDate",
"==",
"null",
"?",
"null",
":",
"new",
"Date",
"(",
"createdDate",
".",
"getTime",
"(",
")",
")",
";",
"}"
] | Specifies the created date.
@param createdDate The created date. | [
"Specifies",
"the",
"created",
"date",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/entity/Audit.java#L90-L92 |
121,124 | salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/TriggerDto.java | TriggerDto.transformToDto | public static TriggerDto transformToDto(Trigger trigger) {
TriggerDto result = createDtoObject(TriggerDto.class, trigger);
// Now copy ID fields
result.setAlertId(trigger.getAlert().getId());
for (Notification notification : trigger.getNotifications()) {
result.addNotificati... | java | public static TriggerDto transformToDto(Trigger trigger) {
TriggerDto result = createDtoObject(TriggerDto.class, trigger);
// Now copy ID fields
result.setAlertId(trigger.getAlert().getId());
for (Notification notification : trigger.getNotifications()) {
result.addNotificati... | [
"public",
"static",
"TriggerDto",
"transformToDto",
"(",
"Trigger",
"trigger",
")",
"{",
"TriggerDto",
"result",
"=",
"createDtoObject",
"(",
"TriggerDto",
".",
"class",
",",
"trigger",
")",
";",
"// Now copy ID fields",
"result",
".",
"setAlertId",
"(",
"trigger"... | Converts trigger entity to triggerDto object.
@param trigger trigger entity. Cannot be null.
@return triggerDto. | [
"Converts",
"trigger",
"entity",
"to",
"triggerDto",
"object",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/TriggerDto.java#L71-L80 |
121,125 | salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/TriggerDto.java | TriggerDto.transformToDto | public static List<TriggerDto> transformToDto(List<Trigger> triggers) {
List<TriggerDto> result = new ArrayList<TriggerDto>();
for (Trigger trigger : triggers) {
result.add(transformToDto(trigger));
}
return result;
} | java | public static List<TriggerDto> transformToDto(List<Trigger> triggers) {
List<TriggerDto> result = new ArrayList<TriggerDto>();
for (Trigger trigger : triggers) {
result.add(transformToDto(trigger));
}
return result;
} | [
"public",
"static",
"List",
"<",
"TriggerDto",
">",
"transformToDto",
"(",
"List",
"<",
"Trigger",
">",
"triggers",
")",
"{",
"List",
"<",
"TriggerDto",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"TriggerDto",
">",
"(",
")",
";",
"for",
"(",
"Trigger",... | Converts list of trigger entity objects to list of triggerDto objects.
@param triggers list of trigger entities.
@return list of triggerDto. | [
"Converts",
"list",
"of",
"trigger",
"entity",
"objects",
"to",
"list",
"of",
"triggerDto",
"objects",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/TriggerDto.java#L89-L96 |
121,126 | salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/HistoryDTO.java | HistoryDTO.transformToDto | public static HistoryDTO transformToDto(History history) {
if (history == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
HistoryDTO historyDto = new HistoryDTO();
try {
BeanUtil... | java | public static HistoryDTO transformToDto(History history) {
if (history == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
HistoryDTO historyDto = new HistoryDTO();
try {
BeanUtil... | [
"public",
"static",
"HistoryDTO",
"transformToDto",
"(",
"History",
"history",
")",
"{",
"if",
"(",
"history",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto object.\"",
",",
"Status",
".",
"INT... | Converts a history object to DTO.
@param history The history object.
@return The history DTO.
@throws WebApplicationException If an error occurs. | [
"Converts",
"a",
"history",
"object",
"to",
"DTO",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/HistoryDTO.java#L77-L90 |
121,127 | salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/HistoryDTO.java | HistoryDTO.transformToDto | public static List<HistoryDTO> transformToDto(List<History> list) {
if (list == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
List<HistoryDTO> result = new ArrayList<HistoryDTO>();
for (Hi... | java | public static List<HistoryDTO> transformToDto(List<History> list) {
if (list == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
List<HistoryDTO> result = new ArrayList<HistoryDTO>();
for (Hi... | [
"public",
"static",
"List",
"<",
"HistoryDTO",
">",
"transformToDto",
"(",
"List",
"<",
"History",
">",
"list",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto ob... | Converts a list of history entities to DTOs.
@param list The list of entities.
@return The list of DTOs.
@throws WebApplicationException If an error occurs. | [
"Converts",
"a",
"list",
"of",
"history",
"entities",
"to",
"DTOs",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/HistoryDTO.java#L101-L112 |
121,128 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java | DefaultJPAService.mergeEntity | public <E extends Identifiable> E mergeEntity(EntityManager em, E entity) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(entity != null, "The entity cannot be null.");
E ret = em.merge(entity);
return ret;
} | java | public <E extends Identifiable> E mergeEntity(EntityManager em, E entity) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(entity != null, "The entity cannot be null.");
E ret = em.merge(entity);
return ret;
} | [
"public",
"<",
"E",
"extends",
"Identifiable",
">",
"E",
"mergeEntity",
"(",
"EntityManager",
"em",
",",
"E",
"entity",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"The entity manager cannot be null.\"",
")",
";",
"requireArgument",
"(",
"entity... | Persists an entity to the database.
@param <E> The entity type.
@param em The entity manager to use. Cannot be null.
@param entity The entity to persist. Cannot be null.
@return The persisted entity having all updates applied. | [
"Persists",
"an",
"entity",
"to",
"the",
"database",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java#L88-L93 |
121,129 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java | DefaultJPAService.deleteEntity | protected <E extends Identifiable> void deleteEntity(EntityManager em, E entity) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(entity != null, "The entity cannot be null.");
if (!em.contains(entity)) {
Identifiable attached = findEntity(em, entity.getId(), entity.getClass... | java | protected <E extends Identifiable> void deleteEntity(EntityManager em, E entity) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(entity != null, "The entity cannot be null.");
if (!em.contains(entity)) {
Identifiable attached = findEntity(em, entity.getId(), entity.getClass... | [
"protected",
"<",
"E",
"extends",
"Identifiable",
">",
"void",
"deleteEntity",
"(",
"EntityManager",
"em",
",",
"E",
"entity",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"The entity manager cannot be null.\"",
")",
";",
"requireArgument",
"(",
... | Removes an entity from the database.
@param <E> The entity type.
@param em The entity manager to use. Cannot be null.
@param entity The entity to remove. Cannot be null. | [
"Removes",
"an",
"entity",
"from",
"the",
"database",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java#L102-L111 |
121,130 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java | DefaultJPAService.findEntity | protected <E extends Identifiable> E findEntity(EntityManager em, BigInteger id, Class<E> type) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(id != null && id.compareTo(ZERO) > 0, "ID must be positive and non-zero");
requireArgument(type != null, "The entity cannot be null."... | java | protected <E extends Identifiable> E findEntity(EntityManager em, BigInteger id, Class<E> type) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(id != null && id.compareTo(ZERO) > 0, "ID must be positive and non-zero");
requireArgument(type != null, "The entity cannot be null."... | [
"protected",
"<",
"E",
"extends",
"Identifiable",
">",
"E",
"findEntity",
"(",
"EntityManager",
"em",
",",
"BigInteger",
"id",
",",
"Class",
"<",
"E",
">",
"type",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"The entity manager cannot be null.... | Locates an entity based on it's primary key value.
@param <E> The type of the entity.
@param em The entity manager to use. Cannot be null.
@param id The primary key of the entity. Cannot be null and must be a positive non-zero number.
@param type The runtime type of the entity. Cannot be null.
@retur... | [
"Locates",
"an",
"entity",
"based",
"on",
"it",
"s",
"primary",
"key",
"value",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java#L137-L143 |
121,131 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java | DefaultJPAService.findEntitiesMarkedForDeletion | protected <E extends Identifiable> List<E> findEntitiesMarkedForDeletion(EntityManager em, Class<E> type, final int limit) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(type != null, "The entity cannot be null.");
requireArgument(limit == -1 || limit > 0, "Limit if not -1, m... | java | protected <E extends Identifiable> List<E> findEntitiesMarkedForDeletion(EntityManager em, Class<E> type, final int limit) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(type != null, "The entity cannot be null.");
requireArgument(limit == -1 || limit > 0, "Limit if not -1, m... | [
"protected",
"<",
"E",
"extends",
"Identifiable",
">",
"List",
"<",
"E",
">",
"findEntitiesMarkedForDeletion",
"(",
"EntityManager",
"em",
",",
"Class",
"<",
"E",
">",
"type",
",",
"final",
"int",
"limit",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"nul... | Returns a list of entities of the given type that are marked for deletion, but have not yet been physically deleted.
@param <E> The entity type.
@param em The entity manager to use. Cannot be null.
@param type The runtime type of the values to return.
@param limit The number of entities to find. If -1,... | [
"Returns",
"a",
"list",
"of",
"entities",
"of",
"the",
"given",
"type",
"that",
"are",
"marked",
"for",
"deletion",
"but",
"have",
"not",
"yet",
"been",
"physically",
"deleted",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java#L155-L162 |
121,132 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/AnomalyDetectionGaussianTransform.java | AnomalyDetectionGaussianTransform.fitParameters | private void fitParameters(Map<Long, Double> metricData) {
mean = getMetricMean(metricData);
variance = getMetricVariance(metricData);
} | java | private void fitParameters(Map<Long, Double> metricData) {
mean = getMetricMean(metricData);
variance = getMetricVariance(metricData);
} | [
"private",
"void",
"fitParameters",
"(",
"Map",
"<",
"Long",
",",
"Double",
">",
"metricData",
")",
"{",
"mean",
"=",
"getMetricMean",
"(",
"metricData",
")",
";",
"variance",
"=",
"getMetricVariance",
"(",
"metricData",
")",
";",
"}"
] | Fits the mean and variance parameters to the data | [
"Fits",
"the",
"mean",
"and",
"variance",
"parameters",
"to",
"the",
"data"
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/AnomalyDetectionGaussianTransform.java#L83-L86 |
121,133 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/AnomalyDetectionGaussianTransform.java | AnomalyDetectionGaussianTransform.predictAnomalies | private Metric predictAnomalies(Map<Long, Double> metricData) {
Metric predictions = new Metric(getResultScopeName(), getResultMetricName());
Map<Long, Double> predictionDatapoints = new HashMap<>();
if (variance == 0.0) {
/**
* If variance is 0, there are no anomalies.... | java | private Metric predictAnomalies(Map<Long, Double> metricData) {
Metric predictions = new Metric(getResultScopeName(), getResultMetricName());
Map<Long, Double> predictionDatapoints = new HashMap<>();
if (variance == 0.0) {
/**
* If variance is 0, there are no anomalies.... | [
"private",
"Metric",
"predictAnomalies",
"(",
"Map",
"<",
"Long",
",",
"Double",
">",
"metricData",
")",
"{",
"Metric",
"predictions",
"=",
"new",
"Metric",
"(",
"getResultScopeName",
"(",
")",
",",
"getResultMetricName",
"(",
")",
")",
";",
"Map",
"<",
"L... | Assigns an anomaly score to each data point, indicating how likely it is
to be an anomaly relative to other points. | [
"Assigns",
"an",
"anomaly",
"score",
"to",
"each",
"data",
"point",
"indicating",
"how",
"likely",
"it",
"is",
"to",
"be",
"an",
"anomaly",
"relative",
"to",
"other",
"points",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/AnomalyDetectionGaussianTransform.java#L92-L121 |
121,134 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/warden/DefaultWardenService.java | DefaultWardenService._constructWardenAlertForUser | private Alert _constructWardenAlertForUser(PrincipalUser user, PolicyCounter counter) {
String metricExp = _constructWardenMetricExpression("-1h", user, counter);
Alert alert = new Alert(_adminUser, _adminUser, _constructWardenAlertName(user, counter), metricExp, "*/5 * * * *");
List<Trigger> tr... | java | private Alert _constructWardenAlertForUser(PrincipalUser user, PolicyCounter counter) {
String metricExp = _constructWardenMetricExpression("-1h", user, counter);
Alert alert = new Alert(_adminUser, _adminUser, _constructWardenAlertName(user, counter), metricExp, "*/5 * * * *");
List<Trigger> tr... | [
"private",
"Alert",
"_constructWardenAlertForUser",
"(",
"PrincipalUser",
"user",
",",
"PolicyCounter",
"counter",
")",
"{",
"String",
"metricExp",
"=",
"_constructWardenMetricExpression",
"(",
"\"-1h\"",
",",
"user",
",",
"counter",
")",
";",
"Alert",
"alert",
"=",... | Create a warden alert which will annotate the corresponding warden metric with suspension events.
@param user The user for which the notification should be created. Cannot be null.
@param counter The policy counter for which the notification should be created. Cannot be null.
@return The warden alert. | [
"Create",
"a",
"warden",
"alert",
"which",
"will",
"annotate",
"the",
"corresponding",
"warden",
"metric",
"with",
"suspension",
"events",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/warden/DefaultWardenService.java#L441-L466 |
121,135 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/warden/DefaultWardenService.java | DefaultWardenService._startScheduledExecutorService | private void _startScheduledExecutorService() {
DisableWardenAlertsThread disableWardenAlertThread = new DisableWardenAlertsThread();
_scheduledExecutorService.scheduleAtFixedRate(disableWardenAlertThread, 0L, TIME_BETWEEN_WARDEN_ALERT_DISABLEMENT_MILLIS,
TimeUnit.MILLISECONDS);
} | java | private void _startScheduledExecutorService() {
DisableWardenAlertsThread disableWardenAlertThread = new DisableWardenAlertsThread();
_scheduledExecutorService.scheduleAtFixedRate(disableWardenAlertThread, 0L, TIME_BETWEEN_WARDEN_ALERT_DISABLEMENT_MILLIS,
TimeUnit.MILLISECONDS);
} | [
"private",
"void",
"_startScheduledExecutorService",
"(",
")",
"{",
"DisableWardenAlertsThread",
"disableWardenAlertThread",
"=",
"new",
"DisableWardenAlertsThread",
"(",
")",
";",
"_scheduledExecutorService",
".",
"scheduleAtFixedRate",
"(",
"disableWardenAlertThread",
",",
... | Starts the scheduled executor service. | [
"Starts",
"the",
"scheduled",
"executor",
"service",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/warden/DefaultWardenService.java#L548-L553 |
121,136 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/warden/DefaultWardenService.java | DefaultWardenService._shutdownScheduledExecutorService | private void _shutdownScheduledExecutorService() {
_logger.info("Shutting down scheduled disable warden alerts executor service");
_scheduledExecutorService.shutdown();
try {
if (!_scheduledExecutorService.awaitTermination(5, TimeUnit.SECONDS)) {
_logger.warn("Shutdow... | java | private void _shutdownScheduledExecutorService() {
_logger.info("Shutting down scheduled disable warden alerts executor service");
_scheduledExecutorService.shutdown();
try {
if (!_scheduledExecutorService.awaitTermination(5, TimeUnit.SECONDS)) {
_logger.warn("Shutdow... | [
"private",
"void",
"_shutdownScheduledExecutorService",
"(",
")",
"{",
"_logger",
".",
"info",
"(",
"\"Shutting down scheduled disable warden alerts executor service\"",
")",
";",
"_scheduledExecutorService",
".",
"shutdown",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
... | Shuts down the scheduled executor service. | [
"Shuts",
"down",
"the",
"scheduled",
"executor",
"service",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/warden/DefaultWardenService.java#L556-L568 |
121,137 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/notifier/GOCNotifier.java | GOCNotifier._sendAdditionalNotification | protected void _sendAdditionalNotification(NotificationContext context, NotificationStatus status) {
requireArgument(context != null, "Notification context cannot be null.");
if(status == NotificationStatus.TRIGGERED) {
super.sendAdditionalNotification(context);
}else {
super.clearAdditionalNotificati... | java | protected void _sendAdditionalNotification(NotificationContext context, NotificationStatus status) {
requireArgument(context != null, "Notification context cannot be null.");
if(status == NotificationStatus.TRIGGERED) {
super.sendAdditionalNotification(context);
}else {
super.clearAdditionalNotificati... | [
"protected",
"void",
"_sendAdditionalNotification",
"(",
"NotificationContext",
"context",
",",
"NotificationStatus",
"status",
")",
"{",
"requireArgument",
"(",
"context",
"!=",
"null",
",",
"\"Notification context cannot be null.\"",
")",
";",
"if",
"(",
"status",
"==... | Update the state of the notification to indicate whether the triggering condition exists or has been cleared.
@param context The notification context. Cannot be null.
@param status The notification status. If null, will set the notification severity to <tt>ERROR</tt> | [
"Update",
"the",
"state",
"of",
"the",
"notification",
"to",
"indicate",
"whether",
"the",
"triggering",
"condition",
"exists",
"or",
"has",
"been",
"cleared",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/notifier/GOCNotifier.java#L232-L264 |
121,138 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/JPAEntity.java | JPAEntity.findByPrimaryKey | public static <E extends Identifiable> E findByPrimaryKey(EntityManager em, BigInteger id, Class<E> type) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(id != null && id.compareTo(ZERO) > 0, "ID cannot be null and must be positive and non-zero");
requireArgu... | java | public static <E extends Identifiable> E findByPrimaryKey(EntityManager em, BigInteger id, Class<E> type) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(id != null && id.compareTo(ZERO) > 0, "ID cannot be null and must be positive and non-zero");
requireArgu... | [
"public",
"static",
"<",
"E",
"extends",
"Identifiable",
">",
"E",
"findByPrimaryKey",
"(",
"EntityManager",
"em",
",",
"BigInteger",
"id",
",",
"Class",
"<",
"E",
">",
"type",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"The entity manager ... | Finds a JPA entity by its primary key.
@param <E> The JPA entity type.
@param em The entity manager to use. Cannot be null.
@param id The ID of the entity to find. Must be a positive, non-zero integer.
@param type The runtime type to cast the result value to.
@return The corresponding entity or nu... | [
"Finds",
"a",
"JPA",
"entity",
"by",
"its",
"primary",
"key",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/JPAEntity.java#L181-L196 |
121,139 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/JPAEntity.java | JPAEntity.findByPrimaryKeys | public static <E extends Identifiable> List<E> findByPrimaryKeys(EntityManager em, List<BigInteger> ids, Class<E> type) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(ids != null && !ids.isEmpty(), "IDs cannot be null or empty.");
requireArgument(type != nul... | java | public static <E extends Identifiable> List<E> findByPrimaryKeys(EntityManager em, List<BigInteger> ids, Class<E> type) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(ids != null && !ids.isEmpty(), "IDs cannot be null or empty.");
requireArgument(type != nul... | [
"public",
"static",
"<",
"E",
"extends",
"Identifiable",
">",
"List",
"<",
"E",
">",
"findByPrimaryKeys",
"(",
"EntityManager",
"em",
",",
"List",
"<",
"BigInteger",
">",
"ids",
",",
"Class",
"<",
"E",
">",
"type",
")",
"{",
"requireArgument",
"(",
"em",... | Finds JPA entities by their primary keys.
@param <E> The JPA entity type.
@param em The entity manager to use. Cannot be null.
@param ids The list of IDs of the entities to find. Must be a non-null non-empty list.
@param type The runtime type to cast the result value to.
@return The corresponding ... | [
"Finds",
"JPA",
"entities",
"by",
"their",
"primary",
"keys",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/JPAEntity.java#L208-L223 |
121,140 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/JPAEntity.java | JPAEntity.findEntitiesMarkedForDeletion | public static <E extends Identifiable> List<E> findEntitiesMarkedForDeletion(EntityManager em, Class<E> type, final int limit) {
requireArgument(em != null, "Entity Manager cannot be null");
requireArgument(limit == -1 || limit > 0, "Limit if not -1, must be greater than 0.");
TypedQuery<E> que... | java | public static <E extends Identifiable> List<E> findEntitiesMarkedForDeletion(EntityManager em, Class<E> type, final int limit) {
requireArgument(em != null, "Entity Manager cannot be null");
requireArgument(limit == -1 || limit > 0, "Limit if not -1, must be greater than 0.");
TypedQuery<E> que... | [
"public",
"static",
"<",
"E",
"extends",
"Identifiable",
">",
"List",
"<",
"E",
">",
"findEntitiesMarkedForDeletion",
"(",
"EntityManager",
"em",
",",
"Class",
"<",
"E",
">",
"type",
",",
"final",
"int",
"limit",
")",
"{",
"requireArgument",
"(",
"em",
"!=... | Finds all entities that have been marked for deletion.
@param <E> The JPA entity type.
@param em The entity manager to use. Cannot be null.
@param type The runtime type to cast the result value to.
@param limit The number of entities to find. If -1, finds all such entities.
@return The list of mat... | [
"Finds",
"all",
"entities",
"that",
"have",
"been",
"marked",
"for",
"deletion",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/JPAEntity.java#L235-L251 |
121,141 | salesforce/Argus | ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/AnnotationService.java | AnnotationService.putAnnotations | public PutResult putAnnotations(List<Annotation> annotations) throws IOException, TokenExpiredException {
String requestUrl = COLLECTION_RESOURCE + RESOURCE;
ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.POST, requestUrl, annotations);
assertValidResponse(r... | java | public PutResult putAnnotations(List<Annotation> annotations) throws IOException, TokenExpiredException {
String requestUrl = COLLECTION_RESOURCE + RESOURCE;
ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.POST, requestUrl, annotations);
assertValidResponse(r... | [
"public",
"PutResult",
"putAnnotations",
"(",
"List",
"<",
"Annotation",
">",
"annotations",
")",
"throws",
"IOException",
",",
"TokenExpiredException",
"{",
"String",
"requestUrl",
"=",
"COLLECTION_RESOURCE",
"+",
"RESOURCE",
";",
"ArgusResponse",
"response",
"=",
... | Submits annotations.
@param annotations The annotations to submit. Cannot be null or empty.
@return A description of the operation result.
@throws IOException If the server cannot be reached.
@throws TokenExpiredException If the token sent along with the request has expired | [
"Submits",
"annotations",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/AnnotationService.java#L103-L114 |
121,142 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/DownsampleTransform.java | DownsampleTransform.downsamplerReducer | public static Double downsamplerReducer(List<Double> values, String reducerType) {
List<Double> operands = new ArrayList<Double>();
for (Double value : values) {
if (value == null) {
operands.add(0.0);
} else {
operands.add(value);
}
}
InternalReducerType type = InternalReducerType.fromString... | java | public static Double downsamplerReducer(List<Double> values, String reducerType) {
List<Double> operands = new ArrayList<Double>();
for (Double value : values) {
if (value == null) {
operands.add(0.0);
} else {
operands.add(value);
}
}
InternalReducerType type = InternalReducerType.fromString... | [
"public",
"static",
"Double",
"downsamplerReducer",
"(",
"List",
"<",
"Double",
">",
"values",
",",
"String",
"reducerType",
")",
"{",
"List",
"<",
"Double",
">",
"operands",
"=",
"new",
"ArrayList",
"<",
"Double",
">",
"(",
")",
";",
"for",
"(",
"Double... | Implements down sampling.
@param values The values to down sample.
@param reducerType The type of down sampling to perform.
@return The down sampled result.
@throws UnsupportedOperationException If an unknown down sampling type is specified. | [
"Implements",
"down",
"sampling",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/DownsampleTransform.java#L76-L107 |
121,143 | salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/filter/AuthFilter.java | AuthFilter.doFilter | @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
String user = null;
if (HttpServletRequest.class.isAssignableFrom(request.getClass())) {
HttpServletRequest req = HttpServletRequest.class... | java | @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
String user = null;
if (HttpServletRequest.class.isAssignableFrom(request.getClass())) {
HttpServletRequest req = HttpServletRequest.class... | [
"@",
"Override",
"public",
"void",
"doFilter",
"(",
"ServletRequest",
"request",
",",
"ServletResponse",
"response",
",",
"FilterChain",
"chain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"String",
"user",
"=",
"null",
";",
"if",
"(",
"HttpServ... | Authenticates a user if required.
@param request The HTTP request.
@param response The HTTP response.
@param chain The filter chain to execute.
@throws IOException If an I/O error occurs.
@throws ServletException If an unknown error occurs. | [
"Authenticates",
"a",
"user",
"if",
"required",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/filter/AuthFilter.java#L82-L130 |
121,144 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java | SubsystemSuspensionLevels.findBySubsystem | public static SubsystemSuspensionLevels findBySubsystem(EntityManager em, SubSystem subSystem) {
SystemAssert.requireArgument(em != null, "Entity manager can not be null.");
SystemAssert.requireArgument(subSystem != null, "Subsystem cannot be null.");
TypedQuery<SubsystemSuspensionLevels> query... | java | public static SubsystemSuspensionLevels findBySubsystem(EntityManager em, SubSystem subSystem) {
SystemAssert.requireArgument(em != null, "Entity manager can not be null.");
SystemAssert.requireArgument(subSystem != null, "Subsystem cannot be null.");
TypedQuery<SubsystemSuspensionLevels> query... | [
"public",
"static",
"SubsystemSuspensionLevels",
"findBySubsystem",
"(",
"EntityManager",
"em",
",",
"SubSystem",
"subSystem",
")",
"{",
"SystemAssert",
".",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"Entity manager can not be null.\"",
")",
";",
"SystemAssert"... | Retrieves the SubsystemSuspensionLevels object for the given subsystem.
@param em The EntityManager to use.
@param subSystem The subsystem for which to retrieve suspension level.
@return The SubsystemSuspensionLevels object for the given subsystem. Throws a runtime exception if no such record exists. Th... | [
"Retrieves",
"the",
"SubsystemSuspensionLevels",
"object",
"for",
"the",
"given",
"subsystem",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java#L123-L146 |
121,145 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java | SubsystemSuspensionLevels.getSuspensionLevelsBySubsystem | public static Map<Integer, Long> getSuspensionLevelsBySubsystem(EntityManager em, SubSystem subSystem) {
return findBySubsystem(em, subSystem).getLevels();
} | java | public static Map<Integer, Long> getSuspensionLevelsBySubsystem(EntityManager em, SubSystem subSystem) {
return findBySubsystem(em, subSystem).getLevels();
} | [
"public",
"static",
"Map",
"<",
"Integer",
",",
"Long",
">",
"getSuspensionLevelsBySubsystem",
"(",
"EntityManager",
"em",
",",
"SubSystem",
"subSystem",
")",
"{",
"return",
"findBySubsystem",
"(",
"em",
",",
"subSystem",
")",
".",
"getLevels",
"(",
")",
";",
... | Retrieves the suspension levels for the given subsystem.
@param em The EntityManager to use.
@param subSystem The subsystem for which to retrieve suspension levels.
@return The suspension levels for the given subsystem. | [
"Retrieves",
"the",
"suspension",
"levels",
"for",
"the",
"given",
"subsystem",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java#L156-L158 |
121,146 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java | SubsystemSuspensionLevels.setLevels | public void setLevels(Map<Integer, Long> levels) {
SystemAssert.requireArgument(levels != null, "Levels cannot be null");
this.levels.clear();
this.levels.putAll(levels);
} | java | public void setLevels(Map<Integer, Long> levels) {
SystemAssert.requireArgument(levels != null, "Levels cannot be null");
this.levels.clear();
this.levels.putAll(levels);
} | [
"public",
"void",
"setLevels",
"(",
"Map",
"<",
"Integer",
",",
"Long",
">",
"levels",
")",
"{",
"SystemAssert",
".",
"requireArgument",
"(",
"levels",
"!=",
"null",
",",
"\"Levels cannot be null\"",
")",
";",
"this",
".",
"levels",
".",
"clear",
"(",
")",... | Sets the suspension time in milliseconds for the corresponding infraction count.
@param levels The map of infraction counts to suspension times. | [
"Sets",
"the",
"suspension",
"time",
"in",
"milliseconds",
"for",
"the",
"corresponding",
"infraction",
"count",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java#L195-L199 |
121,147 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/system/SystemMain.java | SystemMain.getInstance | public static SystemMain getInstance(Properties config) {
return Guice.createInjector(new SystemInitializer(config)).getInstance(SystemMain.class);
} | java | public static SystemMain getInstance(Properties config) {
return Guice.createInjector(new SystemInitializer(config)).getInstance(SystemMain.class);
} | [
"public",
"static",
"SystemMain",
"getInstance",
"(",
"Properties",
"config",
")",
"{",
"return",
"Guice",
".",
"createInjector",
"(",
"new",
"SystemInitializer",
"(",
"config",
")",
")",
".",
"getInstance",
"(",
"SystemMain",
".",
"class",
")",
";",
"}"
] | Returns an instance of the system. Configuration is read from the supplied properties file.
@param config If null, configuration is read from the default location.
@return An instance of the system.
@see SystemConfiguration | [
"Returns",
"an",
"instance",
"of",
"the",
"system",
".",
"Configuration",
"is",
"read",
"from",
"the",
"supplied",
"properties",
"file",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/system/SystemMain.java#L95-L97 |
121,148 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/system/SystemMain.java | SystemMain.doStart | @Override
protected void doStart() {
try {
String build = _configuration.getValue(SystemConfiguration.Property.BUILD);
String version = _configuration.getValue(SystemConfiguration.Property.VERSION);
String year = new SimpleDateFormat("yyyy").format(new Date());
... | java | @Override
protected void doStart() {
try {
String build = _configuration.getValue(SystemConfiguration.Property.BUILD);
String version = _configuration.getValue(SystemConfiguration.Property.VERSION);
String year = new SimpleDateFormat("yyyy").format(new Date());
... | [
"@",
"Override",
"protected",
"void",
"doStart",
"(",
")",
"{",
"try",
"{",
"String",
"build",
"=",
"_configuration",
".",
"getValue",
"(",
"SystemConfiguration",
".",
"Property",
".",
"BUILD",
")",
";",
"String",
"version",
"=",
"_configuration",
".",
"getV... | Starts the system. | [
"Starts",
"the",
"system",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/system/SystemMain.java#L103-L123 |
121,149 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/system/SystemMain.java | SystemMain.doStop | @Override
protected void doStop() {
try {
_dispose(_serviceFactory.getWardenService());
_dispose(_serviceFactory.getMonitorService());
_dispose(_serviceFactory.getSchedulingService());
_dispose(_serviceFactory.getGlobalInterlockService());
_dispose... | java | @Override
protected void doStop() {
try {
_dispose(_serviceFactory.getWardenService());
_dispose(_serviceFactory.getMonitorService());
_dispose(_serviceFactory.getSchedulingService());
_dispose(_serviceFactory.getGlobalInterlockService());
_dispose... | [
"@",
"Override",
"protected",
"void",
"doStop",
"(",
")",
"{",
"try",
"{",
"_dispose",
"(",
"_serviceFactory",
".",
"getWardenService",
"(",
")",
")",
";",
"_dispose",
"(",
"_serviceFactory",
".",
"getMonitorService",
"(",
")",
")",
";",
"_dispose",
"(",
"... | Stops the system. | [
"Stops",
"the",
"system",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/system/SystemMain.java#L128-L145 |
121,150 | salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/MetricDto.java | MetricDto.transformToDto | public static MetricDto transformToDto(Metric metric) {
if (metric == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
MetricDto result = createDtoObject(MetricDto.class, metric);
return resu... | java | public static MetricDto transformToDto(Metric metric) {
if (metric == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
MetricDto result = createDtoObject(MetricDto.class, metric);
return resu... | [
"public",
"static",
"MetricDto",
"transformToDto",
"(",
"Metric",
"metric",
")",
"{",
"if",
"(",
"metric",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto object.\"",
",",
"Status",
".",
"INTERNA... | Converts a metric entity to a DTO.
@param metric The metric to convert.
@return The corresponding DTO.
@throws WebApplicationException If an error occurs. | [
"Converts",
"a",
"metric",
"entity",
"to",
"a",
"DTO",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/MetricDto.java#L72-L80 |
121,151 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/util/HBaseUtils.java | HBaseUtils._9sComplement | public static long _9sComplement(long creationTime) {
String time = String.valueOf(creationTime);
char[] timeArr = time.toCharArray();
StringBuilder sb = new StringBuilder();
for(char c : timeArr) {
sb.append(9 - Character.getNumericValue(c));
}
return Long.parseLong(sb.toString());
} | java | public static long _9sComplement(long creationTime) {
String time = String.valueOf(creationTime);
char[] timeArr = time.toCharArray();
StringBuilder sb = new StringBuilder();
for(char c : timeArr) {
sb.append(9 - Character.getNumericValue(c));
}
return Long.parseLong(sb.toString());
} | [
"public",
"static",
"long",
"_9sComplement",
"(",
"long",
"creationTime",
")",
"{",
"String",
"time",
"=",
"String",
".",
"valueOf",
"(",
"creationTime",
")",
";",
"char",
"[",
"]",
"timeArr",
"=",
"time",
".",
"toCharArray",
"(",
")",
";",
"StringBuilder"... | Return a 9's complement of the given timestamp. Since AsyncHBase doesn't allow a reverse scan and we want to scan data in descending order
of creation time.
@param creationTime creation time
@return The 9's complement of the given timestamp. | [
"Return",
"a",
"9",
"s",
"complement",
"of",
"the",
"given",
"timestamp",
".",
"Since",
"AsyncHBase",
"doesn",
"t",
"allow",
"a",
"reverse",
"scan",
"and",
"we",
"want",
"to",
"scan",
"data",
"in",
"descending",
"order",
"of",
"creation",
"time",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/HBaseUtils.java#L12-L21 |
121,152 | salesforce/Argus | ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/DashboardService.java | DashboardService.getDashboard | public Dashboard getDashboard(BigInteger dashboardId) throws IOException, TokenExpiredException {
String requestUrl = RESOURCE + "/" + dashboardId.toString();
ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null);
assertValidResponse(response... | java | public Dashboard getDashboard(BigInteger dashboardId) throws IOException, TokenExpiredException {
String requestUrl = RESOURCE + "/" + dashboardId.toString();
ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null);
assertValidResponse(response... | [
"public",
"Dashboard",
"getDashboard",
"(",
"BigInteger",
"dashboardId",
")",
"throws",
"IOException",
",",
"TokenExpiredException",
"{",
"String",
"requestUrl",
"=",
"RESOURCE",
"+",
"\"/\"",
"+",
"dashboardId",
".",
"toString",
"(",
")",
";",
"ArgusResponse",
"r... | Returns the batch for the given ID.
@param dashboardId The ID of the dashboard to retrieve.
@return The dashboard.
@throws IOException If the server cannot be reached.
@throws TokenExpiredException If the token sent along with the request has expired | [
"Returns",
"the",
"batch",
"for",
"the",
"given",
"ID",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/DashboardService.java#L129-L135 |
121,153 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricFilterWithInteralReducerTransform.java | MetricFilterWithInteralReducerTransform.internalReducer | public static String internalReducer(Metric metric, String reducerType) {
Map<Long, Double> sortedDatapoints = new TreeMap<>();
List<Double> operands = new ArrayList<Double>();
if(!reducerType.equals(InternalReducerType.NAME.getName())) {
if(metric.getDatapoints()!=null && metric.getDatapoints().size()>0) {
... | java | public static String internalReducer(Metric metric, String reducerType) {
Map<Long, Double> sortedDatapoints = new TreeMap<>();
List<Double> operands = new ArrayList<Double>();
if(!reducerType.equals(InternalReducerType.NAME.getName())) {
if(metric.getDatapoints()!=null && metric.getDatapoints().size()>0) {
... | [
"public",
"static",
"String",
"internalReducer",
"(",
"Metric",
"metric",
",",
"String",
"reducerType",
")",
"{",
"Map",
"<",
"Long",
",",
"Double",
">",
"sortedDatapoints",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"List",
"<",
"Double",
">",
"operands"... | Reduces the give metric to a single value based on the specified reducer.
@param metric The metric to reduce.
@param reducerType The type of reduction to perform.
@return The reduced value.
@throws UnsupportedOperationException If an unknown reducer type is specified. | [
"Reduces",
"the",
"give",
"metric",
"to",
"a",
"single",
"value",
"based",
"on",
"the",
"specified",
"reducer",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricFilterWithInteralReducerTransform.java#L92-L135 |
121,154 | salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricFilterWithInteralReducerTransform.java | MetricFilterWithInteralReducerTransform.sortByValue | public static Map<Metric, String> sortByValue(Map<Metric, String> map, final String reducerType) {
List<Map.Entry<Metric, String>> list = new LinkedList<>(map.entrySet());
Collections.sort(list, new Comparator<Map.Entry<Metric, String>>() {
@Override
public int compare(Map.Entry<Metric, String> o1, Map.Entr... | java | public static Map<Metric, String> sortByValue(Map<Metric, String> map, final String reducerType) {
List<Map.Entry<Metric, String>> list = new LinkedList<>(map.entrySet());
Collections.sort(list, new Comparator<Map.Entry<Metric, String>>() {
@Override
public int compare(Map.Entry<Metric, String> o1, Map.Entr... | [
"public",
"static",
"Map",
"<",
"Metric",
",",
"String",
">",
"sortByValue",
"(",
"Map",
"<",
"Metric",
",",
"String",
">",
"map",
",",
"final",
"String",
"reducerType",
")",
"{",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Metric",
",",
"String",
">",
"... | Sorts a metric.
@param map The metrics to sort.
@param reducerType Sort key / reducer to use
@return The sorted metrics. | [
"Sorts",
"a",
"metric",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricFilterWithInteralReducerTransform.java#L144-L167 |
121,155 | salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NotificationDto.java | NotificationDto.transformToDto | public static NotificationDto transformToDto(Notification notification) {
if (notification == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
NotificationDto result = createDtoObject(NotificationDto.... | java | public static NotificationDto transformToDto(Notification notification) {
if (notification == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
NotificationDto result = createDtoObject(NotificationDto.... | [
"public",
"static",
"NotificationDto",
"transformToDto",
"(",
"Notification",
"notification",
")",
"{",
"if",
"(",
"notification",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto object.\"",
",",
"St... | Converts notification entity object to notificationDto object.
@param notification notification entity. Cannot be null.
@return notificationDto.
@throws WebApplicationException If an error occurs. | [
"Converts",
"notification",
"entity",
"object",
"to",
"notificationDto",
"object",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NotificationDto.java#L78-L90 |
121,156 | salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NotificationDto.java | NotificationDto.transformToDto | public static List<NotificationDto> transformToDto(List<Notification> notifications) {
if (notifications == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
List<NotificationDto> result = new ArrayLis... | java | public static List<NotificationDto> transformToDto(List<Notification> notifications) {
if (notifications == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
List<NotificationDto> result = new ArrayLis... | [
"public",
"static",
"List",
"<",
"NotificationDto",
">",
"transformToDto",
"(",
"List",
"<",
"Notification",
">",
"notifications",
")",
"{",
"if",
"(",
"notifications",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object c... | Converts list of notification entity objects to list of notificationDto objects.
@param notifications list of notification objects. Cannot be null.
@return list of notificationDto objects
@throws WebApplicationException If an error occurs. | [
"Converts",
"list",
"of",
"notification",
"entity",
"objects",
"to",
"list",
"of",
"notificationDto",
"objects",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NotificationDto.java#L101-L112 |
121,157 | messenger4j/messenger4j | src/main/java/com/github/messenger4j/webhook/SignatureUtil.java | SignatureUtil.isSignatureValid | public static boolean isSignatureValid(String payload, String signature, String appSecret) {
try {
final Mac mac = Mac.getInstance(HMAC_SHA1);
mac.init(new SecretKeySpec(appSecret.getBytes(), HMAC_SHA1));
final byte[] rawHmac = mac.doFinal(payload.getBytes());
fi... | java | public static boolean isSignatureValid(String payload, String signature, String appSecret) {
try {
final Mac mac = Mac.getInstance(HMAC_SHA1);
mac.init(new SecretKeySpec(appSecret.getBytes(), HMAC_SHA1));
final byte[] rawHmac = mac.doFinal(payload.getBytes());
fi... | [
"public",
"static",
"boolean",
"isSignatureValid",
"(",
"String",
"payload",
",",
"String",
"signature",
",",
"String",
"appSecret",
")",
"{",
"try",
"{",
"final",
"Mac",
"mac",
"=",
"Mac",
".",
"getInstance",
"(",
"HMAC_SHA1",
")",
";",
"mac",
".",
"init"... | Verifies the provided signature of the payload.
@param payload the request body {@code JSON payload}
@param signature the SHA1 signature of the request payload
@param appSecret the {@code Application Secret} of the Facebook App
@return {@code true} if the verification was successful, otherwise {@code false} | [
"Verifies",
"the",
"provided",
"signature",
"of",
"the",
"payload",
"."
] | b45d3dad035e683fcec749c463b645e5567fcf72 | https://github.com/messenger4j/messenger4j/blob/b45d3dad035e683fcec749c463b645e5567fcf72/src/main/java/com/github/messenger4j/webhook/SignatureUtil.java#L28-L41 |
121,158 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java | ProxyDataSourceBuilder.autoRetrieveGeneratedKeys | public ProxyDataSourceBuilder autoRetrieveGeneratedKeys(boolean autoClose, ResultSetProxyLogicFactory factory) {
this.autoRetrieveGeneratedKeys = true;
this.autoCloseGeneratedKeys = autoClose;
this.generatedKeysProxyLogicFactory = factory;
return this;
} | java | public ProxyDataSourceBuilder autoRetrieveGeneratedKeys(boolean autoClose, ResultSetProxyLogicFactory factory) {
this.autoRetrieveGeneratedKeys = true;
this.autoCloseGeneratedKeys = autoClose;
this.generatedKeysProxyLogicFactory = factory;
return this;
} | [
"public",
"ProxyDataSourceBuilder",
"autoRetrieveGeneratedKeys",
"(",
"boolean",
"autoClose",
",",
"ResultSetProxyLogicFactory",
"factory",
")",
"{",
"this",
".",
"autoRetrieveGeneratedKeys",
"=",
"true",
";",
"this",
".",
"autoCloseGeneratedKeys",
"=",
"autoClose",
";",
... | Enable auto retrieval of generated keys with proxy created by specified factory.
See detail on {@link #autoRetrieveGeneratedKeys(boolean)}.
@param autoClose set {@code true} to close the generated-keys {@link java.sql.ResultSet} after query listener execution
@param factory a factory to create a generated-keys prox... | [
"Enable",
"auto",
"retrieval",
"of",
"generated",
"keys",
"with",
"proxy",
"created",
"by",
"specified",
"factory",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java#L769-L774 |
121,159 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/AbstractQueryLogEntryCreator.java | AbstractQueryLogEntryCreator.getParametersToDisplay | protected SortedMap<String, String> getParametersToDisplay(List<ParameterSetOperation> params) {
// populate param map with sorted by key: key=index/name, value=first value
SortedMap<String, String> paramMap = new TreeMap<String, String>(new StringAsIntegerComparator());
for (ParameterSetOperati... | java | protected SortedMap<String, String> getParametersToDisplay(List<ParameterSetOperation> params) {
// populate param map with sorted by key: key=index/name, value=first value
SortedMap<String, String> paramMap = new TreeMap<String, String>(new StringAsIntegerComparator());
for (ParameterSetOperati... | [
"protected",
"SortedMap",
"<",
"String",
",",
"String",
">",
"getParametersToDisplay",
"(",
"List",
"<",
"ParameterSetOperation",
">",
"params",
")",
"{",
"// populate param map with sorted by key: key=index/name, value=first value",
"SortedMap",
"<",
"String",
",",
"String... | populate param map with sorted by key.
@param params list of ParameterSetOperation
@return a map: key=index/name as string, value=first value
@since 1.4 | [
"populate",
"param",
"map",
"with",
"sorted",
"by",
"key",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/AbstractQueryLogEntryCreator.java#L90-L99 |
121,160 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/QueryUtils.java | QueryUtils.getQueryType | public static QueryType getQueryType(String query) {
final String trimmedQuery = removeCommentAndWhiteSpace(query);
if (trimmedQuery == null || trimmedQuery.length() < 1) {
return QueryType.OTHER;
}
final char firstChar = trimmedQuery.charAt(0);
final QueryType type... | java | public static QueryType getQueryType(String query) {
final String trimmedQuery = removeCommentAndWhiteSpace(query);
if (trimmedQuery == null || trimmedQuery.length() < 1) {
return QueryType.OTHER;
}
final char firstChar = trimmedQuery.charAt(0);
final QueryType type... | [
"public",
"static",
"QueryType",
"getQueryType",
"(",
"String",
"query",
")",
"{",
"final",
"String",
"trimmedQuery",
"=",
"removeCommentAndWhiteSpace",
"(",
"query",
")",
";",
"if",
"(",
"trimmedQuery",
"==",
"null",
"||",
"trimmedQuery",
".",
"length",
"(",
... | Returns type of query from given query string.
@param query a query string
@return type of query
@since 1.4 | [
"Returns",
"type",
"of",
"query",
"from",
"given",
"query",
"string",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/QueryUtils.java#L23-L53 |
121,161 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeConnectionIdEntry | protected void writeConnectionIdEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Connection:");
sb.append(execInfo.getConnectionId());
sb.append(", ");
} | java | protected void writeConnectionIdEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Connection:");
sb.append(execInfo.getConnectionId());
sb.append(", ");
} | [
"protected",
"void",
"writeConnectionIdEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"Connection:\"",
")",
";",
"sb",
".",
"append",
"(",
"execIn... | Write connection ID when enabled.
<p>default: Connection: 1,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
@since 1.4.2 | [
"Write",
"connection",
"ID",
"when",
"enabled",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L107-L111 |
121,162 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeTimeEntry | protected void writeTimeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Time:");
sb.append(execInfo.getElapsedTime());
sb.append(", ");
} | java | protected void writeTimeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Time:");
sb.append(execInfo.getElapsedTime());
sb.append(", ");
} | [
"protected",
"void",
"writeTimeEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"Time:\"",
")",
";",
"sb",
".",
"append",
"(",
"execInfo",
".",
... | Write elapsed time.
<p>default: Time: 123,
The unit of time is determined by underlying {@link net.ttddyy.dsproxy.proxy.Stopwatch} implementation.
(milli vs nano seconds)
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
@since 1.3.3 | [
"Write",
"elapsed",
"time",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L126-L130 |
121,163 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeResultEntry | protected void writeResultEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Success:");
sb.append(execInfo.isSuccess() ? "True" : "False");
sb.append(", ");
} | java | protected void writeResultEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Success:");
sb.append(execInfo.isSuccess() ? "True" : "False");
sb.append(", ");
} | [
"protected",
"void",
"writeResultEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"Success:\"",
")",
";",
"sb",
".",
"append",
"(",
"execInfo",
".... | Write query result whether successful or not.
<p>default: Success: True,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
@since 1.3.3 | [
"Write",
"query",
"result",
"whether",
"successful",
"or",
"not",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L142-L146 |
121,164 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeTypeEntry | protected void writeTypeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Type:");
sb.append(getStatementType(execInfo.getStatementType()));
sb.append(", ");
} | java | protected void writeTypeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Type:");
sb.append(getStatementType(execInfo.getStatementType()));
sb.append(", ");
} | [
"protected",
"void",
"writeTypeEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"Type:\"",
")",
";",
"sb",
".",
"append",
"(",
"getStatementType",
... | Write statement type.
<p>default: Type: Prepared,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
@since 1.3.3 | [
"Write",
"statement",
"type",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L158-L162 |
121,165 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeParamsEntry | protected void writeParamsEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
boolean isPrepared = execInfo.getStatementType() == StatementType.PREPARED;
sb.append("Params:[");
for (QueryInfo queryInfo : queryInfoList) {
for (List<ParameterSetOperation... | java | protected void writeParamsEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
boolean isPrepared = execInfo.getStatementType() == StatementType.PREPARED;
sb.append("Params:[");
for (QueryInfo queryInfo : queryInfoList) {
for (List<ParameterSetOperation... | [
"protected",
"void",
"writeParamsEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"boolean",
"isPrepared",
"=",
"execInfo",
".",
"getStatementType",
"(",
")",
"==",
"StatementType"... | Write query parameters.
<p>default for prepared: Params:[(foo,100),(bar,101)],
<p>default for callable: Params:[(1=foo,key=100),(1=bar,key=101)],
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
@since 1.3.3 | [
"Write",
"query",
"parameters",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L258-L282 |
121,166 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeParamsForSinglePreparedEntry | protected void writeParamsForSinglePreparedEntry(StringBuilder sb, SortedMap<String, String> paramMap, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("(");
for (Map.Entry<String, String> paramEntry : paramMap.entrySet()) {
sb.append(paramEntry.getValue());
sb.... | java | protected void writeParamsForSinglePreparedEntry(StringBuilder sb, SortedMap<String, String> paramMap, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("(");
for (Map.Entry<String, String> paramEntry : paramMap.entrySet()) {
sb.append(paramEntry.getValue());
sb.... | [
"protected",
"void",
"writeParamsForSinglePreparedEntry",
"(",
"StringBuilder",
"sb",
",",
"SortedMap",
"<",
"String",
",",
"String",
">",
"paramMap",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"ap... | Write query parameters for PreparedStatement.
<p>default: Params:[(foo,100),(bar,101)],
@param sb StringBuilder to write
@param paramMap sorted parameters map
@param execInfo execution info
@param queryInfoList query info list
@since 1.4 | [
"Write",
"query",
"parameters",
"for",
"PreparedStatement",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L295-L303 |
121,167 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/TracingMethodListener.java | TracingMethodListener.getArguments | protected String getArguments(Object[] args) {
if (args == null || args.length == 0) {
return "";
}
StringBuilder sb = new StringBuilder();
if (args.length == 1) {
Object arg = args[0];
String param = getSingleArgParameterAsString(arg);
... | java | protected String getArguments(Object[] args) {
if (args == null || args.length == 0) {
return "";
}
StringBuilder sb = new StringBuilder();
if (args.length == 1) {
Object arg = args[0];
String param = getSingleArgParameterAsString(arg);
... | [
"protected",
"String",
"getArguments",
"(",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
"||",
"args",
".",
"length",
"==",
"0",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
... | Convert method parameters to a string.
@param args argument for the invoked method
@return message string | [
"Convert",
"method",
"parameters",
"to",
"a",
"string",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/TracingMethodListener.java#L94-L134 |
121,168 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/TracingMethodListener.java | TracingMethodListener.getDisplayParameter | protected String getDisplayParameter(String parameter) {
if (parameter.length() <= this.parameterDisplayLength) {
return parameter;
}
return parameter.substring(0, this.parameterDisplayLength - 3) + "...";
} | java | protected String getDisplayParameter(String parameter) {
if (parameter.length() <= this.parameterDisplayLength) {
return parameter;
}
return parameter.substring(0, this.parameterDisplayLength - 3) + "...";
} | [
"protected",
"String",
"getDisplayParameter",
"(",
"String",
"parameter",
")",
"{",
"if",
"(",
"parameter",
".",
"length",
"(",
")",
"<=",
"this",
".",
"parameterDisplayLength",
")",
"{",
"return",
"parameter",
";",
"}",
"return",
"parameter",
".",
"substring"... | Construct parameter value to display.
This method is called when invoked method takes multiple arguments.
Default implementation truncate the parameter string if it is too long.
@param parameter parameter value as string
@return parameter value to display | [
"Construct",
"parameter",
"value",
"to",
"display",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/TracingMethodListener.java#L189-L194 |
121,169 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/TracingMethodListener.java | TracingMethodListener.constructMessage | protected String constructMessage(long seq, Throwable thrown, long execTime,
String connectionId, Class<?> targetClass, Method method, String args) {
StringBuilder sb = new StringBuilder();
sb.append("[");
sb.append(seq);
sb.append("]");
sb.... | java | protected String constructMessage(long seq, Throwable thrown, long execTime,
String connectionId, Class<?> targetClass, Method method, String args) {
StringBuilder sb = new StringBuilder();
sb.append("[");
sb.append(seq);
sb.append("]");
sb.... | [
"protected",
"String",
"constructMessage",
"(",
"long",
"seq",
",",
"Throwable",
"thrown",
",",
"long",
"execTime",
",",
"String",
"connectionId",
",",
"Class",
"<",
"?",
">",
"targetClass",
",",
"Method",
"method",
",",
"String",
"args",
")",
"{",
"StringBu... | Construct a message to log.
@param seq sequence number
@param thrown thrown exception
@param execTime time took to perform the method
@param connectionId connection id
@param targetClass invoked class
@param method invoked method
@param args method arguments(parameters)
@return messag... | [
"Construct",
"a",
"message",
"to",
"log",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/TracingMethodListener.java#L208-L242 |
121,170 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/transform/ParameterReplacer.java | ParameterReplacer.setRowId | public void setRowId(String parameterName, RowId x) {
recordByName(parameterName, getDeclaredMethod(CallableStatement.class, "setRowId", String.class, RowId.class), parameterName, x);
} | java | public void setRowId(String parameterName, RowId x) {
recordByName(parameterName, getDeclaredMethod(CallableStatement.class, "setRowId", String.class, RowId.class), parameterName, x);
} | [
"public",
"void",
"setRowId",
"(",
"String",
"parameterName",
",",
"RowId",
"x",
")",
"{",
"recordByName",
"(",
"parameterName",
",",
"getDeclaredMethod",
"(",
"CallableStatement",
".",
"class",
",",
"\"setRowId\"",
",",
"String",
".",
"class",
",",
"RowId",
"... | since 1.6 | [
"since",
"1",
".",
"6"
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/transform/ParameterReplacer.java#L376-L378 |
121,171 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java | DefaultJsonQueryLogEntryCreator.writeDataSourceNameEntry | protected void writeDataSourceNameEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
String name = execInfo.getDataSourceName();
sb.append("\"name\":\"");
sb.append(name == null ? "" : escapeSpecialCharacter(name));
sb.append("\", ");
} | java | protected void writeDataSourceNameEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
String name = execInfo.getDataSourceName();
sb.append("\"name\":\"");
sb.append(name == null ? "" : escapeSpecialCharacter(name));
sb.append("\", ");
} | [
"protected",
"void",
"writeDataSourceNameEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"String",
"name",
"=",
"execInfo",
".",
"getDataSourceName",
"(",
")",
";",
"sb",
".",
... | Write datasource name when enabled as json.
<p>default: "name":"myDS",
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list | [
"Write",
"datasource",
"name",
"when",
"enabled",
"as",
"json",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java#L70-L75 |
121,172 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java | DefaultJsonQueryLogEntryCreator.writeBatchEntry | protected void writeBatchEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("\"batch\":");
sb.append(execInfo.isBatch() ? "true" : "false");
sb.append(", ");
} | java | protected void writeBatchEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("\"batch\":");
sb.append(execInfo.isBatch() ? "true" : "false");
sb.append(", ");
} | [
"protected",
"void",
"writeBatchEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"\\\"batch\\\":\"",
")",
";",
"sb",
".",
"append",
"(",
"execInfo",... | Write whether batch execution or not as json.
<p>default: "batch": true,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list | [
"Write",
"whether",
"batch",
"execution",
"or",
"not",
"as",
"json",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java#L152-L156 |
121,173 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java | DefaultJsonQueryLogEntryCreator.writeQuerySizeEntry | protected void writeQuerySizeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("\"querySize\":");
sb.append(queryInfoList.size());
sb.append(", ");
} | java | protected void writeQuerySizeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("\"querySize\":");
sb.append(queryInfoList.size());
sb.append(", ");
} | [
"protected",
"void",
"writeQuerySizeEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"\\\"querySize\\\":\"",
")",
";",
"sb",
".",
"append",
"(",
"qu... | Write query size as json.
<p>default: "querySize":1,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list | [
"Write",
"query",
"size",
"as",
"json",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java#L167-L171 |
121,174 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java | DefaultJsonQueryLogEntryCreator.writeBatchSizeEntry | protected void writeBatchSizeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("\"batchSize\":");
sb.append(execInfo.getBatchSize());
sb.append(", ");
} | java | protected void writeBatchSizeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("\"batchSize\":");
sb.append(execInfo.getBatchSize());
sb.append(", ");
} | [
"protected",
"void",
"writeBatchSizeEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"\\\"batchSize\\\":\"",
")",
";",
"sb",
".",
"append",
"(",
"ex... | Write batch size as json.
<p>default: "batchSize":1,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list | [
"Write",
"batch",
"size",
"as",
"json",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java#L182-L186 |
121,175 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java | DefaultJsonQueryLogEntryCreator.writeQueriesEntry | protected void writeQueriesEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("\"query\":[");
for (QueryInfo queryInfo : queryInfoList) {
sb.append("\"");
sb.append(escapeSpecialCharacter(queryInfo.getQuery()));
sb.append("\",")... | java | protected void writeQueriesEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("\"query\":[");
for (QueryInfo queryInfo : queryInfoList) {
sb.append("\"");
sb.append(escapeSpecialCharacter(queryInfo.getQuery()));
sb.append("\",")... | [
"protected",
"void",
"writeQueriesEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"\\\"query\\\":[\"",
")",
";",
"for",
"(",
"QueryInfo",
"queryInfo"... | Write queries as json.
<p>default: "query":["select 1","select 2"],
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list | [
"Write",
"queries",
"as",
"json",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java#L197-L206 |
121,176 | ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java | DefaultJsonQueryLogEntryCreator.writeParamsForSinglePreparedEntry | protected void writeParamsForSinglePreparedEntry(StringBuilder sb, SortedMap<String, String> paramMap, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("[");
for (Map.Entry<String, String> paramEntry : paramMap.entrySet()) {
Object value = paramEntry.getValue();
... | java | protected void writeParamsForSinglePreparedEntry(StringBuilder sb, SortedMap<String, String> paramMap, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("[");
for (Map.Entry<String, String> paramEntry : paramMap.entrySet()) {
Object value = paramEntry.getValue();
... | [
"protected",
"void",
"writeParamsForSinglePreparedEntry",
"(",
"StringBuilder",
"sb",
",",
"SortedMap",
"<",
"String",
",",
"String",
">",
"paramMap",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"ap... | Write parameters for single execution as json.
<p>default: ["foo","100"],
@param sb StringBuilder to write
@param paramMap sorted parameters map
@param execInfo execution info
@param queryInfoList query info list | [
"Write",
"parameters",
"for",
"single",
"execution",
"as",
"json",
"."
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java#L248-L263 |
121,177 | Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.populateFilterBuilder | public QueryBuilder populateFilterBuilder(Expression condtionalExp, EntityMetadata m)
{
log.info("Populating filter for expression: " + condtionalExp);
QueryBuilder filter = null;
if (condtionalExp instanceof SubExpression)
{
filter = populateFilterBuilder(((SubExpressio... | java | public QueryBuilder populateFilterBuilder(Expression condtionalExp, EntityMetadata m)
{
log.info("Populating filter for expression: " + condtionalExp);
QueryBuilder filter = null;
if (condtionalExp instanceof SubExpression)
{
filter = populateFilterBuilder(((SubExpressio... | [
"public",
"QueryBuilder",
"populateFilterBuilder",
"(",
"Expression",
"condtionalExp",
",",
"EntityMetadata",
"m",
")",
"{",
"log",
".",
"info",
"(",
"\"Populating filter for expression: \"",
"+",
"condtionalExp",
")",
";",
"QueryBuilder",
"filter",
"=",
"null",
";",
... | Populate filter builder.
@param condtionalExp
the condtional exp
@param m
the m
@param entity
the entity
@return the filter builder | [
"Populate",
"filter",
"builder",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L102-L139 |
121,178 | Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.populateLikeQuery | private QueryBuilder populateLikeQuery(LikeExpression likeExpression, EntityMetadata metadata)
{
Expression patternValue = likeExpression.getPatternValue();
String field = likeExpression.getStringExpression().toString();
String likePattern = (patternValue instanceof InputParameter) ? kunder... | java | private QueryBuilder populateLikeQuery(LikeExpression likeExpression, EntityMetadata metadata)
{
Expression patternValue = likeExpression.getPatternValue();
String field = likeExpression.getStringExpression().toString();
String likePattern = (patternValue instanceof InputParameter) ? kunder... | [
"private",
"QueryBuilder",
"populateLikeQuery",
"(",
"LikeExpression",
"likeExpression",
",",
"EntityMetadata",
"metadata",
")",
"{",
"Expression",
"patternValue",
"=",
"likeExpression",
".",
"getPatternValue",
"(",
")",
";",
"String",
"field",
"=",
"likeExpression",
... | Populate like query.
@param likeExpression
the like expression
@param metadata
the metadata
@return the filter builder | [
"Populate",
"like",
"query",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L150-L164 |
121,179 | Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.populateInQuery | private QueryBuilder populateInQuery(InExpression inExpression, EntityMetadata metadata)
{
String property = getField(inExpression.getExpression().toParsedText());
Expression inItemsParameter = inExpression.getInItems();
log.debug("IN query parameters for field " + property + " is: " + inIt... | java | private QueryBuilder populateInQuery(InExpression inExpression, EntityMetadata metadata)
{
String property = getField(inExpression.getExpression().toParsedText());
Expression inItemsParameter = inExpression.getInItems();
log.debug("IN query parameters for field " + property + " is: " + inIt... | [
"private",
"QueryBuilder",
"populateInQuery",
"(",
"InExpression",
"inExpression",
",",
"EntityMetadata",
"metadata",
")",
"{",
"String",
"property",
"=",
"getField",
"(",
"inExpression",
".",
"getExpression",
"(",
")",
".",
"toParsedText",
"(",
")",
")",
";",
"... | Populate IN query filter.
@param inExpression
the in expression
@param metadata
the metadata
@return the filter builder | [
"Populate",
"IN",
"query",
"filter",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L175-L184 |
121,180 | Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.getInValuesCollection | private Collection getInValuesCollection(Expression inClauseValues)
{
Collection inParameterCollection = new ArrayList<>();
if (inClauseValues instanceof NullExpression)
{
log.debug("No items passed in IN clause values, returning blank IN values list");
return inParam... | java | private Collection getInValuesCollection(Expression inClauseValues)
{
Collection inParameterCollection = new ArrayList<>();
if (inClauseValues instanceof NullExpression)
{
log.debug("No items passed in IN clause values, returning blank IN values list");
return inParam... | [
"private",
"Collection",
"getInValuesCollection",
"(",
"Expression",
"inClauseValues",
")",
"{",
"Collection",
"inParameterCollection",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"inClauseValues",
"instanceof",
"NullExpression",
")",
"{",
"log",
".",
... | Returns the collection of IN clause values.
@param inClauseValues
the in clause values
@return the in values collection | [
"Returns",
"the",
"collection",
"of",
"IN",
"clause",
"values",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L193-L228 |
121,181 | Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.populateBetweenFilter | private QueryBuilder populateBetweenFilter(BetweenExpression betweenExpression, EntityMetadata m)
{
String lowerBoundExpression = getBetweenBoundaryValues(betweenExpression.getLowerBoundExpression());
String upperBoundExpression = getBetweenBoundaryValues(betweenExpression.getUpperBoundExpression())... | java | private QueryBuilder populateBetweenFilter(BetweenExpression betweenExpression, EntityMetadata m)
{
String lowerBoundExpression = getBetweenBoundaryValues(betweenExpression.getLowerBoundExpression());
String upperBoundExpression = getBetweenBoundaryValues(betweenExpression.getUpperBoundExpression())... | [
"private",
"QueryBuilder",
"populateBetweenFilter",
"(",
"BetweenExpression",
"betweenExpression",
",",
"EntityMetadata",
"m",
")",
"{",
"String",
"lowerBoundExpression",
"=",
"getBetweenBoundaryValues",
"(",
"betweenExpression",
".",
"getLowerBoundExpression",
"(",
")",
")... | Populate between filter.
@param betweenExpression
the between expression
@param m
the m
@param entity
the entity
@return the filter builder | [
"Populate",
"between",
"filter",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L253-L265 |
121,182 | Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.getBetweenBoundaryValues | private String getBetweenBoundaryValues(Expression boundExpression)
{
if (boundExpression instanceof IdentificationVariable || boundExpression instanceof NumericLiteral
|| boundExpression instanceof InputParameter)
{
Object value = (boundExpression instanceof InputParamet... | java | private String getBetweenBoundaryValues(Expression boundExpression)
{
if (boundExpression instanceof IdentificationVariable || boundExpression instanceof NumericLiteral
|| boundExpression instanceof InputParameter)
{
Object value = (boundExpression instanceof InputParamet... | [
"private",
"String",
"getBetweenBoundaryValues",
"(",
"Expression",
"boundExpression",
")",
"{",
"if",
"(",
"boundExpression",
"instanceof",
"IdentificationVariable",
"||",
"boundExpression",
"instanceof",
"NumericLiteral",
"||",
"boundExpression",
"instanceof",
"InputParamet... | Gets the between boundary values.
@param boundExpression
the bound expression
@return the between boundry values | [
"Gets",
"the",
"between",
"boundary",
"values",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L274-L313 |
121,183 | Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.checkInputParameter | private String checkInputParameter(Expression expression)
{
return (expression instanceof InputParameter) ? kunderaQuery.getParametersMap()
.get((expression).toParsedText()).toString() : expression.toParsedText().toString();
} | java | private String checkInputParameter(Expression expression)
{
return (expression instanceof InputParameter) ? kunderaQuery.getParametersMap()
.get((expression).toParsedText()).toString() : expression.toParsedText().toString();
} | [
"private",
"String",
"checkInputParameter",
"(",
"Expression",
"expression",
")",
"{",
"return",
"(",
"expression",
"instanceof",
"InputParameter",
")",
"?",
"kunderaQuery",
".",
"getParametersMap",
"(",
")",
".",
"get",
"(",
"(",
"expression",
")",
".",
"toPars... | Check input parameter.
@param expression
the expression
@return the string | [
"Check",
"input",
"parameter",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L322-L326 |
121,184 | Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.populateLogicalFilterBuilder | private QueryBuilder populateLogicalFilterBuilder(Expression logicalExp, EntityMetadata m)
{
String identifier = ((LogicalExpression) logicalExp).getIdentifier();
return (identifier.equalsIgnoreCase(LogicalExpression.AND)) ? getAndFilterBuilder(logicalExp, m) : (identifier
.equalsIg... | java | private QueryBuilder populateLogicalFilterBuilder(Expression logicalExp, EntityMetadata m)
{
String identifier = ((LogicalExpression) logicalExp).getIdentifier();
return (identifier.equalsIgnoreCase(LogicalExpression.AND)) ? getAndFilterBuilder(logicalExp, m) : (identifier
.equalsIg... | [
"private",
"QueryBuilder",
"populateLogicalFilterBuilder",
"(",
"Expression",
"logicalExp",
",",
"EntityMetadata",
"m",
")",
"{",
"String",
"identifier",
"=",
"(",
"(",
"LogicalExpression",
")",
"logicalExp",
")",
".",
"getIdentifier",
"(",
")",
";",
"return",
"("... | Populate logical filter builder.
@param logicalExp
the logical exp
@param m
the m
@param entity
the entity
@return the filter builder | [
"Populate",
"logical",
"filter",
"builder",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L339-L345 |
121,185 | Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.getAndFilterBuilder | private AndQueryBuilder getAndFilterBuilder(Expression logicalExp, EntityMetadata m)
{
AndExpression andExp = (AndExpression) logicalExp;
Expression leftExpression = andExp.getLeftExpression();
Expression rightExpression = andExp.getRightExpression();
return new AndQueryBuilder(popu... | java | private AndQueryBuilder getAndFilterBuilder(Expression logicalExp, EntityMetadata m)
{
AndExpression andExp = (AndExpression) logicalExp;
Expression leftExpression = andExp.getLeftExpression();
Expression rightExpression = andExp.getRightExpression();
return new AndQueryBuilder(popu... | [
"private",
"AndQueryBuilder",
"getAndFilterBuilder",
"(",
"Expression",
"logicalExp",
",",
"EntityMetadata",
"m",
")",
"{",
"AndExpression",
"andExp",
"=",
"(",
"AndExpression",
")",
"logicalExp",
";",
"Expression",
"leftExpression",
"=",
"andExp",
".",
"getLeftExpres... | Gets the and filter builder.
@param logicalExp
the logical exp
@param m
the m
@param entity
the entity
@return the and filter builder | [
"Gets",
"the",
"and",
"filter",
"builder",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L358-L365 |
121,186 | Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.getOrFilterBuilder | private OrQueryBuilder getOrFilterBuilder(Expression logicalExp, EntityMetadata m)
{
OrExpression orExp = (OrExpression) logicalExp;
Expression leftExpression = orExp.getLeftExpression();
Expression rightExpression = orExp.getRightExpression();
return new OrQueryBuilder(populateFilt... | java | private OrQueryBuilder getOrFilterBuilder(Expression logicalExp, EntityMetadata m)
{
OrExpression orExp = (OrExpression) logicalExp;
Expression leftExpression = orExp.getLeftExpression();
Expression rightExpression = orExp.getRightExpression();
return new OrQueryBuilder(populateFilt... | [
"private",
"OrQueryBuilder",
"getOrFilterBuilder",
"(",
"Expression",
"logicalExp",
",",
"EntityMetadata",
"m",
")",
"{",
"OrExpression",
"orExp",
"=",
"(",
"OrExpression",
")",
"logicalExp",
";",
"Expression",
"leftExpression",
"=",
"orExp",
".",
"getLeftExpression",... | Gets the or filter builder.
@param logicalExp
the logical exp
@param m
the m
@param entity
the entity
@return the or filter builder | [
"Gets",
"the",
"or",
"filter",
"builder",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L378-L385 |
121,187 | Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.populateFilterClause | private FilterClause populateFilterClause(ComparisonExpression conditionalExpression)
{
String property = ((StateFieldPathExpression) conditionalExpression.getLeftExpression()).getPath(1);
String condition = conditionalExpression.getComparisonOperator();
Expression rightExpression = conditio... | java | private FilterClause populateFilterClause(ComparisonExpression conditionalExpression)
{
String property = ((StateFieldPathExpression) conditionalExpression.getLeftExpression()).getPath(1);
String condition = conditionalExpression.getComparisonOperator();
Expression rightExpression = conditio... | [
"private",
"FilterClause",
"populateFilterClause",
"(",
"ComparisonExpression",
"conditionalExpression",
")",
"{",
"String",
"property",
"=",
"(",
"(",
"StateFieldPathExpression",
")",
"conditionalExpression",
".",
"getLeftExpression",
"(",
")",
")",
".",
"getPath",
"("... | Populate filter clause.
@param conditionalExpression
the conditional expression
@return the filter clause | [
"Populate",
"filter",
"clause",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L394-L404 |
121,188 | Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/validator/EntityValidatorImpl.java | EntityValidatorImpl.validate | @Override
// TODO: reduce Cyclomatic complexity
public final void validate(final Class<?> clazz)
{
if (classes.contains(clazz))
{
return;
}
if (log.isDebugEnabled())
log.debug("Validating " + clazz.getName());
// Is Entity?
// ... | java | @Override
// TODO: reduce Cyclomatic complexity
public final void validate(final Class<?> clazz)
{
if (classes.contains(clazz))
{
return;
}
if (log.isDebugEnabled())
log.debug("Validating " + clazz.getName());
// Is Entity?
// ... | [
"@",
"Override",
"// TODO: reduce Cyclomatic complexity\r",
"public",
"final",
"void",
"validate",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"classes",
".",
"contains",
"(",
"clazz",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
... | Checks the validity of a class for Cassandra entity.
@param clazz
validates this class
@return returns 'true' if valid | [
"Checks",
"the",
"validity",
"of",
"a",
"class",
"for",
"Cassandra",
"entity",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/validator/EntityValidatorImpl.java#L80-L164 |
121,189 | Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/classreading/ClasspathReader.java | ClasspathReader.findResourcesInUrls | private URL[] findResourcesInUrls(String classRelativePath, URL[] urls)
{
List<URL> list = new ArrayList<URL>();
for (URL url : urls)
{
if (AllowedProtocol.isValidProtocol(url.getProtocol().toUpperCase()) && url.getPath().endsWith(".jar"))
{
try
... | java | private URL[] findResourcesInUrls(String classRelativePath, URL[] urls)
{
List<URL> list = new ArrayList<URL>();
for (URL url : urls)
{
if (AllowedProtocol.isValidProtocol(url.getProtocol().toUpperCase()) && url.getPath().endsWith(".jar"))
{
try
... | [
"private",
"URL",
"[",
"]",
"findResourcesInUrls",
"(",
"String",
"classRelativePath",
",",
"URL",
"[",
"]",
"urls",
")",
"{",
"List",
"<",
"URL",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"URL",
">",
"(",
")",
";",
"for",
"(",
"URL",
"url",
":",
... | Scan class resource in the provided urls with the additional Class-Path
of each jar checking
@param classRelativePath
relative path to a class resource
@param urls
urls to be checked
@return list of class path included in the base package | [
"Scan",
"class",
"resource",
"in",
"the",
"provided",
"urls",
"with",
"the",
"additional",
"Class",
"-",
"Path",
"of",
"each",
"jar",
"checking"
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/classreading/ClasspathReader.java#L145-L218 |
121,190 | Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/classreading/ClasspathReader.java | ClasspathReader.findResourcesByContextLoader | private final URL[] findResourcesByContextLoader()
{
List<URL> list = new ArrayList<URL>();
ClassLoader classLoader = this.getClass().getClassLoader();
assert classLoader != null;
URL[] urls = ((URLClassLoader) classLoader).getURLs();
for (String fullyQualifi... | java | private final URL[] findResourcesByContextLoader()
{
List<URL> list = new ArrayList<URL>();
ClassLoader classLoader = this.getClass().getClassLoader();
assert classLoader != null;
URL[] urls = ((URLClassLoader) classLoader).getURLs();
for (String fullyQualifi... | [
"private",
"final",
"URL",
"[",
"]",
"findResourcesByContextLoader",
"(",
")",
"{",
"List",
"<",
"URL",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"URL",
">",
"(",
")",
";",
"ClassLoader",
"classLoader",
"=",
"this",
".",
"getClass",
"(",
")",
".",
"ge... | Scan class resources into a basePackagetoScan path.
@return list of class path included in the base package | [
"Scan",
"class",
"resources",
"into",
"a",
"basePackagetoScan",
"path",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/classreading/ClasspathReader.java#L226-L240 |
121,191 | Impetus/Kundera | src/kundera-rest/src/main/java/com/impetus/kundera/rest/common/StreamUtils.java | StreamUtils.toInputStream | public static InputStream toInputStream(String s)
{
InputStream is = new ByteArrayInputStream(s.getBytes());
return is;
} | java | public static InputStream toInputStream(String s)
{
InputStream is = new ByteArrayInputStream(s.getBytes());
return is;
} | [
"public",
"static",
"InputStream",
"toInputStream",
"(",
"String",
"s",
")",
"{",
"InputStream",
"is",
"=",
"new",
"ByteArrayInputStream",
"(",
"s",
".",
"getBytes",
"(",
")",
")",
";",
"return",
"is",
";",
"}"
] | Converts String to Input Stream
@param s
@return | [
"Converts",
"String",
"to",
"Input",
"Stream"
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-rest/src/main/java/com/impetus/kundera/rest/common/StreamUtils.java#L61-L65 |
121,192 | Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClientFactory.java | MongoDBClientFactory.onSetMongoServerProperties | private MongoClient onSetMongoServerProperties(String contactNode, String defaultPort, String poolSize,
List<ServerAddress> addrs, List<MongoCredential> credentials)
{
MongoClientOptions mo;
MongoDBSchemaMetadata metadata = MongoDBPropertyReader.msmd;
ClientProperties cp = metada... | java | private MongoClient onSetMongoServerProperties(String contactNode, String defaultPort, String poolSize,
List<ServerAddress> addrs, List<MongoCredential> credentials)
{
MongoClientOptions mo;
MongoDBSchemaMetadata metadata = MongoDBPropertyReader.msmd;
ClientProperties cp = metada... | [
"private",
"MongoClient",
"onSetMongoServerProperties",
"(",
"String",
"contactNode",
",",
"String",
"defaultPort",
",",
"String",
"poolSize",
",",
"List",
"<",
"ServerAddress",
">",
"addrs",
",",
"List",
"<",
"MongoCredential",
">",
"credentials",
")",
"{",
"Mong... | On set mongo server properties.
@param contactNode
the contact node
@param defaultPort
the default port
@param poolSize
the pool size
@param addrs
the addrs
@return the mongo client
@throws UnknownHostException
the unknown host exception | [
"On",
"set",
"mongo",
"server",
"properties",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClientFactory.java#L236-L288 |
121,193 | Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/service/HostConfiguration.java | HostConfiguration.buildHosts | private void buildHosts(Map externalProperties, List<Server> servers, String persistenceUnit,
final KunderaMetadata kunderaMetadata)
{
persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit);
Properties props = persistenceUnitMetadat... | java | private void buildHosts(Map externalProperties, List<Server> servers, String persistenceUnit,
final KunderaMetadata kunderaMetadata)
{
persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit);
Properties props = persistenceUnitMetadat... | [
"private",
"void",
"buildHosts",
"(",
"Map",
"externalProperties",
",",
"List",
"<",
"Server",
">",
"servers",
",",
"String",
"persistenceUnit",
",",
"final",
"KunderaMetadata",
"kunderaMetadata",
")",
"{",
"persistenceUnitMetadata",
"=",
"kunderaMetadata",
".",
"ge... | Build host array.
@param externalProperties
@param servers
@param persistenceUnit | [
"Build",
"host",
"array",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/service/HostConfiguration.java#L76-L107 |
121,194 | Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java | ResultIterator.onCheckRelation | private void onCheckRelation()
{
try
{
results = populateEntities(entityMetadata, client);
if (entityMetadata.isRelationViaJoinTable()
|| (entityMetadata.getRelationNames() != null && !(entityMetadata.getRelationNames().isEmpty())))
{
... | java | private void onCheckRelation()
{
try
{
results = populateEntities(entityMetadata, client);
if (entityMetadata.isRelationViaJoinTable()
|| (entityMetadata.getRelationNames() != null && !(entityMetadata.getRelationNames().isEmpty())))
{
... | [
"private",
"void",
"onCheckRelation",
"(",
")",
"{",
"try",
"{",
"results",
"=",
"populateEntities",
"(",
"entityMetadata",
",",
"client",
")",
";",
"if",
"(",
"entityMetadata",
".",
"isRelationViaJoinTable",
"(",
")",
"||",
"(",
"entityMetadata",
".",
"getRel... | on check relation event, invokes populate entities and set relational
entities, in case relations are present. | [
"on",
"check",
"relation",
"event",
"invokes",
"populate",
"entities",
"and",
"set",
"relational",
"entities",
"in",
"case",
"relations",
"are",
"present",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java#L238-L254 |
121,195 | Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java | ResultIterator.appendWhereClauseWithScroll | private String appendWhereClauseWithScroll(String parsedQuery)
{
String queryWithoutLimit = parsedQuery.replaceAll(
parsedQuery.substring(parsedQuery.lastIndexOf(CQLTranslator.LIMIT), parsedQuery.length()), "");
CQLTranslator translator = new CQLTranslator();
final String ... | java | private String appendWhereClauseWithScroll(String parsedQuery)
{
String queryWithoutLimit = parsedQuery.replaceAll(
parsedQuery.substring(parsedQuery.lastIndexOf(CQLTranslator.LIMIT), parsedQuery.length()), "");
CQLTranslator translator = new CQLTranslator();
final String ... | [
"private",
"String",
"appendWhereClauseWithScroll",
"(",
"String",
"parsedQuery",
")",
"{",
"String",
"queryWithoutLimit",
"=",
"parsedQuery",
".",
"replaceAll",
"(",
"parsedQuery",
".",
"substring",
"(",
"parsedQuery",
".",
"lastIndexOf",
"(",
"CQLTranslator",
".",
... | Appends where claues and prepare for next fetch. Method to be called in
case cql3 enabled.
@param parsedQuery
parsed query.
@return cql3 query to be executed. | [
"Appends",
"where",
"claues",
"and",
"prepare",
"for",
"next",
"fetch",
".",
"Method",
"to",
"be",
"called",
"in",
"case",
"cql3",
"enabled",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java#L351-L383 |
121,196 | Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java | ResultIterator.replaceAndAppendLimit | private String replaceAndAppendLimit(String parsedQuery)
{
StringBuilder builder = new StringBuilder(parsedQuery);
onLimit(builder);
parsedQuery = builder.toString();
return parsedQuery;
} | java | private String replaceAndAppendLimit(String parsedQuery)
{
StringBuilder builder = new StringBuilder(parsedQuery);
onLimit(builder);
parsedQuery = builder.toString();
return parsedQuery;
} | [
"private",
"String",
"replaceAndAppendLimit",
"(",
"String",
"parsedQuery",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"parsedQuery",
")",
";",
"onLimit",
"(",
"builder",
")",
";",
"parsedQuery",
"=",
"builder",
".",
"toString",
"(",... | Replace and append limit.
@param parsedQuery
parsed cql3 query.
@return cql3 query appended with limit clause. | [
"Replace",
"and",
"append",
"limit",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java#L393-L399 |
121,197 | Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java | ResultIterator.onLimit | private void onLimit(StringBuilder builder)
{
builder.append(CQLTranslator.LIMIT);
builder.append(this.maxResult);
} | java | private void onLimit(StringBuilder builder)
{
builder.append(CQLTranslator.LIMIT);
builder.append(this.maxResult);
} | [
"private",
"void",
"onLimit",
"(",
"StringBuilder",
"builder",
")",
"{",
"builder",
".",
"append",
"(",
"CQLTranslator",
".",
"LIMIT",
")",
";",
"builder",
".",
"append",
"(",
"this",
".",
"maxResult",
")",
";",
"}"
] | Append limit to sql3 query.
@param builder
builder instance. | [
"Append",
"limit",
"to",
"sql3",
"query",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java#L407-L411 |
121,198 | Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java | ResultIterator.getConditionOnIdColumn | private Map<Boolean, String> getConditionOnIdColumn(String idColumn)
{
Map<Boolean, String> filterIdResult = new HashMap<Boolean, String>();
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
entityMetadata.getPersistenceUnit());
... | java | private Map<Boolean, String> getConditionOnIdColumn(String idColumn)
{
Map<Boolean, String> filterIdResult = new HashMap<Boolean, String>();
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
entityMetadata.getPersistenceUnit());
... | [
"private",
"Map",
"<",
"Boolean",
",",
"String",
">",
"getConditionOnIdColumn",
"(",
"String",
"idColumn",
")",
"{",
"Map",
"<",
"Boolean",
",",
"String",
">",
"filterIdResult",
"=",
"new",
"HashMap",
"<",
"Boolean",
",",
"String",
">",
"(",
")",
";",
"M... | Gets the condition on id column.
@param idColumn
the id column
@return the condition on id column | [
"Gets",
"the",
"condition",
"on",
"id",
"column",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java#L556-L587 |
121,199 | Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java | ResultIterator.idValueInByteArr | private byte[] idValueInByteArr()
{
Object entity = results.get(results.size() - 1);
Object id = PropertyAccessorHelper.getId(entity, entityMetadata);
String idName = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();
Class idClazz = ((AbstractAttribute) entity... | java | private byte[] idValueInByteArr()
{
Object entity = results.get(results.size() - 1);
Object id = PropertyAccessorHelper.getId(entity, entityMetadata);
String idName = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();
Class idClazz = ((AbstractAttribute) entity... | [
"private",
"byte",
"[",
"]",
"idValueInByteArr",
"(",
")",
"{",
"Object",
"entity",
"=",
"results",
".",
"get",
"(",
"results",
".",
"size",
"(",
")",
"-",
"1",
")",
";",
"Object",
"id",
"=",
"PropertyAccessorHelper",
".",
"getId",
"(",
"entity",
",",
... | Id value in byte arr.
@return the byte[] | [
"Id",
"value",
"in",
"byte",
"arr",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java#L594-L620 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.