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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
25,400 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/TopologyMetricContext.java | TopologyMetricContext.mergeMeters | public void mergeMeters(MetricInfo metricInfo, String meta, Map<Integer, MetricSnapshot> data) {
Map<Integer, MetricSnapshot> existing = metricInfo.get_metrics().get(meta);
if (existing == null) {
metricInfo.put_to_metrics(meta, data);
} else {
for (Map.Entry<Integer, Met... | java | public void mergeMeters(MetricInfo metricInfo, String meta, Map<Integer, MetricSnapshot> data) {
Map<Integer, MetricSnapshot> existing = metricInfo.get_metrics().get(meta);
if (existing == null) {
metricInfo.put_to_metrics(meta, data);
} else {
for (Map.Entry<Integer, Met... | [
"public",
"void",
"mergeMeters",
"(",
"MetricInfo",
"metricInfo",
",",
"String",
"meta",
",",
"Map",
"<",
"Integer",
",",
"MetricSnapshot",
">",
"data",
")",
"{",
"Map",
"<",
"Integer",
",",
"MetricSnapshot",
">",
"existing",
"=",
"metricInfo",
".",
"get_met... | meters are not sampled. | [
"meters",
"are",
"not",
"sampled",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/TopologyMetricContext.java#L309-L331 |
25,401 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/TopologyMetricContext.java | TopologyMetricContext.mergeHistograms | public void mergeHistograms(MetricInfo metricInfo, String meta, Map<Integer, MetricSnapshot> data,
Map<String, Integer> metaCounters, Map<String, Map<Integer, Histogram>> histograms) {
Map<Integer, MetricSnapshot> existing = metricInfo.get_metrics().get(meta);
if (existin... | java | public void mergeHistograms(MetricInfo metricInfo, String meta, Map<Integer, MetricSnapshot> data,
Map<String, Integer> metaCounters, Map<String, Map<Integer, Histogram>> histograms) {
Map<Integer, MetricSnapshot> existing = metricInfo.get_metrics().get(meta);
if (existin... | [
"public",
"void",
"mergeHistograms",
"(",
"MetricInfo",
"metricInfo",
",",
"String",
"meta",
",",
"Map",
"<",
"Integer",
",",
"MetricSnapshot",
">",
"data",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
"metaCounters",
",",
"Map",
"<",
"String",
",",
"Ma... | histograms are sampled, but we just update points | [
"histograms",
"are",
"sampled",
"but",
"we",
"just",
"update",
"points"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/TopologyMetricContext.java#L336-L371 |
25,402 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/TopologyMetricContext.java | TopologyMetricContext.updateMetricCounters | protected void updateMetricCounters(String metricName, Map<String, Integer> metricNameCounters) {
if (metricNameCounters.containsKey(metricName)) {
metricNameCounters.put(metricName, metricNameCounters.get(metricName) + 1);
} else {
metricNameCounters.put(metricName, 1);
... | java | protected void updateMetricCounters(String metricName, Map<String, Integer> metricNameCounters) {
if (metricNameCounters.containsKey(metricName)) {
metricNameCounters.put(metricName, metricNameCounters.get(metricName) + 1);
} else {
metricNameCounters.put(metricName, 1);
... | [
"protected",
"void",
"updateMetricCounters",
"(",
"String",
"metricName",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
"metricNameCounters",
")",
"{",
"if",
"(",
"metricNameCounters",
".",
"containsKey",
"(",
"metricName",
")",
")",
"{",
"metricNameCounters",
... | computes occurrences of specified metric name | [
"computes",
"occurrences",
"of",
"specified",
"metric",
"name"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/TopologyMetricContext.java#L393-L399 |
25,403 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/TopologyMetricContext.java | TopologyMetricContext.mergeCounters | private void mergeCounters(Map<String, Map<Integer, MetricSnapshot>> newCounters,
Map<String, Map<Integer, MetricSnapshot>> oldCounters) {
for (Map.Entry<String, Map<Integer, MetricSnapshot>> entry : newCounters.entrySet()) {
String metricName = entry.getKey();
... | java | private void mergeCounters(Map<String, Map<Integer, MetricSnapshot>> newCounters,
Map<String, Map<Integer, MetricSnapshot>> oldCounters) {
for (Map.Entry<String, Map<Integer, MetricSnapshot>> entry : newCounters.entrySet()) {
String metricName = entry.getKey();
... | [
"private",
"void",
"mergeCounters",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"Integer",
",",
"MetricSnapshot",
">",
">",
"newCounters",
",",
"Map",
"<",
"String",
",",
"Map",
"<",
"Integer",
",",
"MetricSnapshot",
">",
">",
"oldCounters",
")",
"{",
"f... | sum old counter snapshots and new counter snapshots, sums are stored in new snapshots. | [
"sum",
"old",
"counter",
"snapshots",
"and",
"new",
"counter",
"snapshots",
"sums",
"are",
"stored",
"in",
"new",
"snapshots",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/TopologyMetricContext.java#L493-L510 |
25,404 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/windowing/WindowManager.java | WindowManager.track | private void track(Event<T> windowEvent) {
evictionPolicy.track(windowEvent);
triggerPolicy.track(windowEvent);
} | java | private void track(Event<T> windowEvent) {
evictionPolicy.track(windowEvent);
triggerPolicy.track(windowEvent);
} | [
"private",
"void",
"track",
"(",
"Event",
"<",
"T",
">",
"windowEvent",
")",
"{",
"evictionPolicy",
".",
"track",
"(",
"windowEvent",
")",
";",
"triggerPolicy",
".",
"track",
"(",
"windowEvent",
")",
";",
"}"
] | feed the event to the eviction and trigger policies
for bookkeeping and optionally firing the trigger. | [
"feed",
"the",
"event",
"to",
"the",
"eviction",
"and",
"trigger",
"policies",
"for",
"bookkeeping",
"and",
"optionally",
"firing",
"the",
"trigger",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/windowing/WindowManager.java#L172-L175 |
25,405 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/windowing/WindowManager.java | WindowManager.scanEvents | private List<Event<T>> scanEvents(boolean fullScan) {
LOG.debug("Scan events, eviction policy {}", evictionPolicy);
List<T> eventsToExpire = new ArrayList<>();
List<Event<T>> eventsToProcess = new ArrayList<>();
try {
lock.lock();
Iterator<Event<T>> it = queue.ite... | java | private List<Event<T>> scanEvents(boolean fullScan) {
LOG.debug("Scan events, eviction policy {}", evictionPolicy);
List<T> eventsToExpire = new ArrayList<>();
List<Event<T>> eventsToProcess = new ArrayList<>();
try {
lock.lock();
Iterator<Event<T>> it = queue.ite... | [
"private",
"List",
"<",
"Event",
"<",
"T",
">",
">",
"scanEvents",
"(",
"boolean",
"fullScan",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Scan events, eviction policy {}\"",
",",
"evictionPolicy",
")",
";",
"List",
"<",
"T",
">",
"eventsToExpire",
"=",
"new",
... | Scan events in the queue, using the expiration policy to check
if the event should be evicted or not.
@param fullScan if set, will scan the entire queue; if not set, will stop
as soon as an event not satisfying the expiration policy is found
@return the list of events to be processed as a part of the current window | [
"Scan",
"events",
"in",
"the",
"queue",
"using",
"the",
"expiration",
"policy",
"to",
"check",
"if",
"the",
"event",
"should",
"be",
"evicted",
"or",
"not",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/windowing/WindowManager.java#L185-L215 |
25,406 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/windowing/WindowManager.java | WindowManager.getEarliestEventTs | public long getEarliestEventTs(long startTs, long endTs) {
long minTs = Long.MAX_VALUE;
for (Event<T> event : queue) {
if (event.getTimestamp() > startTs && event.getTimestamp() <= endTs) {
minTs = Math.min(minTs, event.getTimestamp());
}
}
return ... | java | public long getEarliestEventTs(long startTs, long endTs) {
long minTs = Long.MAX_VALUE;
for (Event<T> event : queue) {
if (event.getTimestamp() > startTs && event.getTimestamp() <= endTs) {
minTs = Math.min(minTs, event.getTimestamp());
}
}
return ... | [
"public",
"long",
"getEarliestEventTs",
"(",
"long",
"startTs",
",",
"long",
"endTs",
")",
"{",
"long",
"minTs",
"=",
"Long",
".",
"MAX_VALUE",
";",
"for",
"(",
"Event",
"<",
"T",
">",
"event",
":",
"queue",
")",
"{",
"if",
"(",
"event",
".",
"getTim... | Scans the event queue and returns the next earliest event ts
between the startTs and endTs
@param startTs the start ts (exclusive)
@param endTs the end ts (inclusive)
@return the earliest event ts between startTs and endTs | [
"Scans",
"the",
"event",
"queue",
"and",
"returns",
"the",
"next",
"earliest",
"event",
"ts",
"between",
"the",
"startTs",
"and",
"endTs"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/windowing/WindowManager.java#L225-L233 |
25,407 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/windowing/WindowManager.java | WindowManager.getEventCount | public int getEventCount(long referenceTime) {
int count = 0;
for (Event<T> event : queue) {
if (event.getTimestamp() <= referenceTime) {
++count;
}
}
return count;
} | java | public int getEventCount(long referenceTime) {
int count = 0;
for (Event<T> event : queue) {
if (event.getTimestamp() <= referenceTime) {
++count;
}
}
return count;
} | [
"public",
"int",
"getEventCount",
"(",
"long",
"referenceTime",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"Event",
"<",
"T",
">",
"event",
":",
"queue",
")",
"{",
"if",
"(",
"event",
".",
"getTimestamp",
"(",
")",
"<=",
"referenceTime",
")... | Scans the event queue and returns number of events having
timestamp less than or equal to the reference time.
@param referenceTime the reference timestamp in millis
@return the count of events with timestamp less than or equal to referenceTime | [
"Scans",
"the",
"event",
"queue",
"and",
"returns",
"number",
"of",
"events",
"having",
"timestamp",
"less",
"than",
"or",
"equal",
"to",
"the",
"reference",
"time",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/windowing/WindowManager.java#L242-L250 |
25,408 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/NimbusServer.java | NimbusServer.mkRefreshConfThread | private void mkRefreshConfThread(final NimbusData nimbusData) {
nimbusData.getScheduExec().scheduleAtFixedRate(new RunnableCallback() {
@Override
public void run() {
LOG.debug("checking changes in storm.yaml...");
Map newConf = Utils.readStormConfig();
... | java | private void mkRefreshConfThread(final NimbusData nimbusData) {
nimbusData.getScheduExec().scheduleAtFixedRate(new RunnableCallback() {
@Override
public void run() {
LOG.debug("checking changes in storm.yaml...");
Map newConf = Utils.readStormConfig();
... | [
"private",
"void",
"mkRefreshConfThread",
"(",
"final",
"NimbusData",
"nimbusData",
")",
"{",
"nimbusData",
".",
"getScheduExec",
"(",
")",
".",
"scheduleAtFixedRate",
"(",
"new",
"RunnableCallback",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
... | handle manual conf changes, check every 15 sec | [
"handle",
"manual",
"conf",
"changes",
"check",
"every",
"15",
"sec"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/NimbusServer.java#L141-L168 |
25,409 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/ZookeeperUtils.java | ZookeeperUtils.splitToHostsAndPorts | public static List<HostAndPort> splitToHostsAndPorts(String hostPortQuorumList) {
// split an address hot
String[] strings = StringUtils.getStrings(hostPortQuorumList);
int len = 0;
if (strings != null) {
len = strings.length;
}
List<HostAndPort> list = new ArrayList<HostAndPort>(len);
... | java | public static List<HostAndPort> splitToHostsAndPorts(String hostPortQuorumList) {
// split an address hot
String[] strings = StringUtils.getStrings(hostPortQuorumList);
int len = 0;
if (strings != null) {
len = strings.length;
}
List<HostAndPort> list = new ArrayList<HostAndPort>(len);
... | [
"public",
"static",
"List",
"<",
"HostAndPort",
">",
"splitToHostsAndPorts",
"(",
"String",
"hostPortQuorumList",
")",
"{",
"// split an address hot",
"String",
"[",
"]",
"strings",
"=",
"StringUtils",
".",
"getStrings",
"(",
"hostPortQuorumList",
")",
";",
"int",
... | Split a quorum list into a list of hostnames and ports
@param hostPortQuorumList split to a list of hosts and ports
@return a list of values | [
"Split",
"a",
"quorum",
"list",
"into",
"a",
"list",
"of",
"hostnames",
"and",
"ports"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/ZookeeperUtils.java#L65-L79 |
25,410 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/ZookeeperUtils.java | ZookeeperUtils.buildHostsOnlyList | public static String buildHostsOnlyList(List<HostAndPort> hostAndPorts) {
StringBuilder sb = new StringBuilder();
for (HostAndPort hostAndPort : hostAndPorts) {
sb.append(hostAndPort.getHostText()).append(",");
}
if (sb.length() > 0) {
sb.delete(sb.length() - 1, sb.length());
}
retur... | java | public static String buildHostsOnlyList(List<HostAndPort> hostAndPorts) {
StringBuilder sb = new StringBuilder();
for (HostAndPort hostAndPort : hostAndPorts) {
sb.append(hostAndPort.getHostText()).append(",");
}
if (sb.length() > 0) {
sb.delete(sb.length() - 1, sb.length());
}
retur... | [
"public",
"static",
"String",
"buildHostsOnlyList",
"(",
"List",
"<",
"HostAndPort",
">",
"hostAndPorts",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"HostAndPort",
"hostAndPort",
":",
"hostAndPorts",
")",
"{",
"sb"... | Build up to a hosts only list
@param hostAndPorts
@return a list of the hosts only | [
"Build",
"up",
"to",
"a",
"hosts",
"only",
"list"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/ZookeeperUtils.java#L86-L95 |
25,411 | alibaba/jstorm | jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java | FluxBuilder.buildConfig | public static Config buildConfig(TopologyDef topologyDef) {
// merge contents of `config` into topology config
Config conf = new Config();
conf.putAll(topologyDef.getConfig());
return conf;
} | java | public static Config buildConfig(TopologyDef topologyDef) {
// merge contents of `config` into topology config
Config conf = new Config();
conf.putAll(topologyDef.getConfig());
return conf;
} | [
"public",
"static",
"Config",
"buildConfig",
"(",
"TopologyDef",
"topologyDef",
")",
"{",
"// merge contents of `config` into topology config",
"Config",
"conf",
"=",
"new",
"Config",
"(",
")",
";",
"conf",
".",
"putAll",
"(",
"topologyDef",
".",
"getConfig",
"(",
... | Given a topology definition, return a populated `org.apache.storm.Config` instance.
@param topologyDef
@return | [
"Given",
"a",
"topology",
"definition",
"return",
"a",
"populated",
"org",
".",
"apache",
".",
"storm",
".",
"Config",
"instance",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java#L44-L49 |
25,412 | alibaba/jstorm | jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java | FluxBuilder.buildTopology | public static StormTopology buildTopology(ExecutionContext context) throws IllegalAccessException,
InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException {
StormTopology topology = null;
TopologyDef topologyDef = context.getTopologyDef();
i... | java | public static StormTopology buildTopology(ExecutionContext context) throws IllegalAccessException,
InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException {
StormTopology topology = null;
TopologyDef topologyDef = context.getTopologyDef();
i... | [
"public",
"static",
"StormTopology",
"buildTopology",
"(",
"ExecutionContext",
"context",
")",
"throws",
"IllegalAccessException",
",",
"InstantiationException",
",",
"ClassNotFoundException",
",",
"NoSuchMethodException",
",",
"InvocationTargetException",
"{",
"StormTopology",... | Given a topology definition, return a Storm topology that can be run either locally or remotely.
@param context
@return
@throws IllegalAccessException
@throws InstantiationException
@throws ClassNotFoundException
@throws NoSuchMethodException
@throws InvocationTargetException | [
"Given",
"a",
"topology",
"definition",
"return",
"a",
"Storm",
"topology",
"that",
"can",
"be",
"run",
"either",
"locally",
"or",
"remotely",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java#L62-L103 |
25,413 | alibaba/jstorm | jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java | FluxBuilder.buildComponents | private static void buildComponents(ExecutionContext context) throws ClassNotFoundException, NoSuchMethodException,
IllegalAccessException, InvocationTargetException, InstantiationException {
Collection<BeanDef> cDefs = context.getTopologyDef().getComponents();
if (cDefs != null) {
... | java | private static void buildComponents(ExecutionContext context) throws ClassNotFoundException, NoSuchMethodException,
IllegalAccessException, InvocationTargetException, InstantiationException {
Collection<BeanDef> cDefs = context.getTopologyDef().getComponents();
if (cDefs != null) {
... | [
"private",
"static",
"void",
"buildComponents",
"(",
"ExecutionContext",
"context",
")",
"throws",
"ClassNotFoundException",
",",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
"InstantiationException",
"{",
"Collection",
"<",
... | Given a topology definition, resolve and instantiate all components found and return a map
keyed by the component id. | [
"Given",
"a",
"topology",
"definition",
"resolve",
"and",
"instantiate",
"all",
"components",
"found",
"and",
"return",
"a",
"map",
"keyed",
"by",
"the",
"component",
"id",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java#L351-L360 |
25,414 | alibaba/jstorm | jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java | FluxBuilder.buildSpout | private static IRichSpout buildSpout(SpoutDef def, ExecutionContext context) throws ClassNotFoundException,
IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
return (IRichSpout)buildObject(def, context);
} | java | private static IRichSpout buildSpout(SpoutDef def, ExecutionContext context) throws ClassNotFoundException,
IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
return (IRichSpout)buildObject(def, context);
} | [
"private",
"static",
"IRichSpout",
"buildSpout",
"(",
"SpoutDef",
"def",
",",
"ExecutionContext",
"context",
")",
"throws",
"ClassNotFoundException",
",",
"IllegalAccessException",
",",
"InstantiationException",
",",
"NoSuchMethodException",
",",
"InvocationTargetException",
... | Given a spout definition, return a Storm spout implementation by attempting to find a matching constructor
in the given spout class. Perform list to array conversion as necessary. | [
"Given",
"a",
"spout",
"definition",
"return",
"a",
"Storm",
"spout",
"implementation",
"by",
"attempting",
"to",
"find",
"a",
"matching",
"constructor",
"in",
"the",
"given",
"spout",
"class",
".",
"Perform",
"list",
"to",
"array",
"conversion",
"as",
"necess... | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java#L376-L379 |
25,415 | alibaba/jstorm | jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java | FluxBuilder.buildBolts | private static void buildBolts(ExecutionContext context) throws ClassNotFoundException, IllegalAccessException,
InstantiationException, NoSuchMethodException, InvocationTargetException {
for (BoltDef def : context.getTopologyDef().getBolts()) {
Class clazz = Class.forName(def.getClassNam... | java | private static void buildBolts(ExecutionContext context) throws ClassNotFoundException, IllegalAccessException,
InstantiationException, NoSuchMethodException, InvocationTargetException {
for (BoltDef def : context.getTopologyDef().getBolts()) {
Class clazz = Class.forName(def.getClassNam... | [
"private",
"static",
"void",
"buildBolts",
"(",
"ExecutionContext",
"context",
")",
"throws",
"ClassNotFoundException",
",",
"IllegalAccessException",
",",
"InstantiationException",
",",
"NoSuchMethodException",
",",
"InvocationTargetException",
"{",
"for",
"(",
"BoltDef",
... | Given a list of bolt definitions, build a map of Storm bolts with the bolt definition id as the key.
Attempt to coerce the given constructor arguments to a matching bolt constructor as much as possible. | [
"Given",
"a",
"list",
"of",
"bolt",
"definitions",
"build",
"a",
"map",
"of",
"Storm",
"bolts",
"with",
"the",
"bolt",
"definition",
"id",
"as",
"the",
"key",
".",
"Attempt",
"to",
"coerce",
"the",
"given",
"constructor",
"arguments",
"to",
"a",
"matching"... | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/FluxBuilder.java#L385-L392 |
25,416 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/NimbusUtils.java | NimbusUtils.mapifySerializations | private static Map mapifySerializations(List sers) {
Map rtn = new HashMap();
if (sers != null) {
int size = sers.size();
for (int i = 0; i < size; i++) {
if (sers.get(i) instanceof Map) {
rtn.putAll((Map) sers.get(i));
} else {... | java | private static Map mapifySerializations(List sers) {
Map rtn = new HashMap();
if (sers != null) {
int size = sers.size();
for (int i = 0; i < size; i++) {
if (sers.get(i) instanceof Map) {
rtn.putAll((Map) sers.get(i));
} else {... | [
"private",
"static",
"Map",
"mapifySerializations",
"(",
"List",
"sers",
")",
"{",
"Map",
"rtn",
"=",
"new",
"HashMap",
"(",
")",
";",
"if",
"(",
"sers",
"!=",
"null",
")",
"{",
"int",
"size",
"=",
"sers",
".",
"size",
"(",
")",
";",
"for",
"(",
... | add custom KRYO serialization | [
"add",
"custom",
"KRYO",
"serialization"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/NimbusUtils.java#L76-L90 |
25,417 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/NimbusUtils.java | NimbusUtils.normalizeTopology | public static StormTopology normalizeTopology(Map stormConf, StormTopology topology, boolean fromConf) {
StormTopology ret = topology.deepCopy();
Map<String, Object> rawComponents = ThriftTopologyUtils.getComponents(topology);
Map<String, Object> components = ThriftTopologyUtils.getComponents(... | java | public static StormTopology normalizeTopology(Map stormConf, StormTopology topology, boolean fromConf) {
StormTopology ret = topology.deepCopy();
Map<String, Object> rawComponents = ThriftTopologyUtils.getComponents(topology);
Map<String, Object> components = ThriftTopologyUtils.getComponents(... | [
"public",
"static",
"StormTopology",
"normalizeTopology",
"(",
"Map",
"stormConf",
",",
"StormTopology",
"topology",
",",
"boolean",
"fromConf",
")",
"{",
"StormTopology",
"ret",
"=",
"topology",
".",
"deepCopy",
"(",
")",
";",
"Map",
"<",
"String",
",",
"Obje... | finalize component's task parallelism
@param stormConf storm conf
@param topology storm topology
@param fromConf means if the parallelism is read from conf file instead of reading from topology code
@return normalized topology | [
"finalize",
"component",
"s",
"task",
"parallelism"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/NimbusUtils.java#L227-L295 |
25,418 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/NimbusUtils.java | NimbusUtils.cleanupCorruptTopologies | public static void cleanupCorruptTopologies(NimbusData data) throws Exception {
BlobStore blobStore = data.getBlobStore();
// we have only topology relative files , so we don't need filter
Set<String> code_ids = Sets.newHashSet(BlobStoreUtils.code_ids(blobStore.listKeys()));
// get topo... | java | public static void cleanupCorruptTopologies(NimbusData data) throws Exception {
BlobStore blobStore = data.getBlobStore();
// we have only topology relative files , so we don't need filter
Set<String> code_ids = Sets.newHashSet(BlobStoreUtils.code_ids(blobStore.listKeys()));
// get topo... | [
"public",
"static",
"void",
"cleanupCorruptTopologies",
"(",
"NimbusData",
"data",
")",
"throws",
"Exception",
"{",
"BlobStore",
"blobStore",
"=",
"data",
".",
"getBlobStore",
"(",
")",
";",
"// we have only topology relative files , so we don't need filter",
"Set",
"<",
... | clean the topology which is in ZK but not in local dir | [
"clean",
"the",
"topology",
"which",
"is",
"in",
"ZK",
"but",
"not",
"in",
"local",
"dir"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/NimbusUtils.java#L313-L338 |
25,419 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/ShellBasedGroupsMapping.java | ShellBasedGroupsMapping.getGroups | @Override
public Set<String> getGroups(String user) throws IOException {
if (cachedGroups.containsKey(user)) {
return cachedGroups.get(user);
}
Set<String> groups = getUnixGroups(user);
if (!groups.isEmpty())
cachedGroups.put(user, groups);
return grou... | java | @Override
public Set<String> getGroups(String user) throws IOException {
if (cachedGroups.containsKey(user)) {
return cachedGroups.get(user);
}
Set<String> groups = getUnixGroups(user);
if (!groups.isEmpty())
cachedGroups.put(user, groups);
return grou... | [
"@",
"Override",
"public",
"Set",
"<",
"String",
">",
"getGroups",
"(",
"String",
"user",
")",
"throws",
"IOException",
"{",
"if",
"(",
"cachedGroups",
".",
"containsKey",
"(",
"user",
")",
")",
"{",
"return",
"cachedGroups",
".",
"get",
"(",
"user",
")"... | Returns list of groups for a user
@param user get groups for this user
@return list of groups for a given user | [
"Returns",
"list",
"of",
"groups",
"for",
"a",
"user"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/ShellBasedGroupsMapping.java#L56-L65 |
25,420 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/ShellBasedGroupsMapping.java | ShellBasedGroupsMapping.getUnixGroups | private static Set<String> getUnixGroups(final String user) throws IOException {
String result = "";
try {
result = ShellUtils.execCommand(ShellUtils.getGroupsForUserCommand(user));
} catch (ExitCodeException e) {
// if we didn't get the group - just return empty list;
... | java | private static Set<String> getUnixGroups(final String user) throws IOException {
String result = "";
try {
result = ShellUtils.execCommand(ShellUtils.getGroupsForUserCommand(user));
} catch (ExitCodeException e) {
// if we didn't get the group - just return empty list;
... | [
"private",
"static",
"Set",
"<",
"String",
">",
"getUnixGroups",
"(",
"final",
"String",
"user",
")",
"throws",
"IOException",
"{",
"String",
"result",
"=",
"\"\"",
";",
"try",
"{",
"result",
"=",
"ShellUtils",
".",
"execCommand",
"(",
"ShellUtils",
".",
"... | Get the current user's group list from Unix by running the command 'groups' NOTE. For non-existing user it will return EMPTY list
@param user user name
@return the groups set that the <code>user</code> belongs to
@throws IOException if encounter any error when running the command | [
"Get",
"the",
"current",
"user",
"s",
"group",
"list",
"from",
"Unix",
"by",
"running",
"the",
"command",
"groups",
"NOTE",
".",
"For",
"non",
"-",
"existing",
"user",
"it",
"will",
"return",
"EMPTY",
"list"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/ShellBasedGroupsMapping.java#L74-L90 |
25,421 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/metric/uploader/TopologyMetricDataInfo.java | TopologyMetricDataInfo.toMap | public Map<String, Object> toMap() {
Map<String, Object> ret = new HashMap<>();
ret.put(MetricUploader.METRIC_TIME, timestamp);
ret.put(MetricUploader.METRIC_TYPE, type);
return ret;
} | java | public Map<String, Object> toMap() {
Map<String, Object> ret = new HashMap<>();
ret.put(MetricUploader.METRIC_TIME, timestamp);
ret.put(MetricUploader.METRIC_TYPE, type);
return ret;
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"toMap",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"ret",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"ret",
".",
"put",
"(",
"MetricUploader",
".",
"METRIC_TIME",
",",
"timestamp",
... | metrics report time | [
"metrics",
"report",
"time"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/metric/uploader/TopologyMetricDataInfo.java#L34-L40 |
25,422 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/old/window/Metric.java | Metric.update | @Override
public void update(Number obj) {
if (enable == false) {
return;
}
if (intervalCheck.check()) {
flush();
}
synchronized (this) {
unflushed = updater.update(obj, unflushed);
}
} | java | @Override
public void update(Number obj) {
if (enable == false) {
return;
}
if (intervalCheck.check()) {
flush();
}
synchronized (this) {
unflushed = updater.update(obj, unflushed);
}
} | [
"@",
"Override",
"public",
"void",
"update",
"(",
"Number",
"obj",
")",
"{",
"if",
"(",
"enable",
"==",
"false",
")",
"{",
"return",
";",
"}",
"if",
"(",
"intervalCheck",
".",
"check",
"(",
")",
")",
"{",
"flush",
"(",
")",
";",
"}",
"synchronized"... | In order to improve performance Do | [
"In",
"order",
"to",
"improve",
"performance",
"Do"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/old/window/Metric.java#L119-L131 |
25,423 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/utils/DisruptorRunable.java | DisruptorRunable.onEvent | @Override
public void onEvent(Object event, long sequence, boolean endOfBatch) throws Exception {
if (event == null) {
return;
}
handleEvent(event, endOfBatch);
} | java | @Override
public void onEvent(Object event, long sequence, boolean endOfBatch) throws Exception {
if (event == null) {
return;
}
handleEvent(event, endOfBatch);
} | [
"@",
"Override",
"public",
"void",
"onEvent",
"(",
"Object",
"event",
",",
"long",
"sequence",
",",
"boolean",
"endOfBatch",
")",
"throws",
"Exception",
"{",
"if",
"(",
"event",
"==",
"null",
")",
"{",
"return",
";",
"}",
"handleEvent",
"(",
"event",
","... | This function need to be implements
@see com.lmax.disruptor.EventHandler#onEvent(java.lang.Object, long, boolean) | [
"This",
"function",
"need",
"to",
"be",
"implements"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/DisruptorRunable.java#L52-L58 |
25,424 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/metric/refresh/RefreshEvent.java | RefreshEvent.refreshTopologies | public void refreshTopologies() {
TimeTicker ticker = new TimeTicker(TimeUnit.MILLISECONDS, true);
try {
doRefreshTopologies();
LOG.debug("Refresh topologies, cost:{}", ticker.stopAndRestart());
if (!context.getNimbusData().isLeader()) { // won't hit...
... | java | public void refreshTopologies() {
TimeTicker ticker = new TimeTicker(TimeUnit.MILLISECONDS, true);
try {
doRefreshTopologies();
LOG.debug("Refresh topologies, cost:{}", ticker.stopAndRestart());
if (!context.getNimbusData().isLeader()) { // won't hit...
... | [
"public",
"void",
"refreshTopologies",
"(",
")",
"{",
"TimeTicker",
"ticker",
"=",
"new",
"TimeTicker",
"(",
"TimeUnit",
".",
"MILLISECONDS",
",",
"true",
")",
";",
"try",
"{",
"doRefreshTopologies",
"(",
")",
";",
"LOG",
".",
"debug",
"(",
"\"Refresh topolo... | refresh metric settings of topologies & metric meta | [
"refresh",
"metric",
"settings",
"of",
"topologies",
"&",
"metric",
"meta"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/metric/refresh/RefreshEvent.java#L83-L96 |
25,425 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/metric/refresh/RefreshEvent.java | RefreshEvent.syncMetaFromCache | private void syncMetaFromCache(String topology, TopologyMetricContext tmContext) {
if (!tmContext.syncMeta()) {
Map<String, Long> meta = context.getMetricCache().getMeta(topology);
if (meta != null) {
tmContext.getMemMeta().putAll(meta);
}
tmContex... | java | private void syncMetaFromCache(String topology, TopologyMetricContext tmContext) {
if (!tmContext.syncMeta()) {
Map<String, Long> meta = context.getMetricCache().getMeta(topology);
if (meta != null) {
tmContext.getMemMeta().putAll(meta);
}
tmContex... | [
"private",
"void",
"syncMetaFromCache",
"(",
"String",
"topology",
",",
"TopologyMetricContext",
"tmContext",
")",
"{",
"if",
"(",
"!",
"tmContext",
".",
"syncMeta",
"(",
")",
")",
"{",
"Map",
"<",
"String",
",",
"Long",
">",
"meta",
"=",
"context",
".",
... | sync metric meta from rocks db into mem cache on startup | [
"sync",
"metric",
"meta",
"from",
"rocks",
"db",
"into",
"mem",
"cache",
"on",
"startup"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/metric/refresh/RefreshEvent.java#L221-L229 |
25,426 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/metric/refresh/RefreshEvent.java | RefreshEvent.syncSysMetaFromRemote | private void syncSysMetaFromRemote() {
for (String topology : JStormMetrics.SYS_TOPOLOGIES) {
if (context.getTopologyMetricContexts().containsKey(topology)) {
syncMetaFromRemote(topology,
context.getTopologyMetricContexts().get(topology),
... | java | private void syncSysMetaFromRemote() {
for (String topology : JStormMetrics.SYS_TOPOLOGIES) {
if (context.getTopologyMetricContexts().containsKey(topology)) {
syncMetaFromRemote(topology,
context.getTopologyMetricContexts().get(topology),
... | [
"private",
"void",
"syncSysMetaFromRemote",
"(",
")",
"{",
"for",
"(",
"String",
"topology",
":",
"JStormMetrics",
".",
"SYS_TOPOLOGIES",
")",
"{",
"if",
"(",
"context",
".",
"getTopologyMetricContexts",
"(",
")",
".",
"containsKey",
"(",
"topology",
")",
")",... | sync sys topologies from remote because we want to keep all historic metric data
thus metric id cannot be changed. | [
"sync",
"sys",
"topologies",
"from",
"remote",
"because",
"we",
"want",
"to",
"keep",
"all",
"historic",
"metric",
"data",
"thus",
"metric",
"id",
"cannot",
"be",
"changed",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/metric/refresh/RefreshEvent.java#L235-L243 |
25,427 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/registry/SlotPortsView.java | SlotPortsView.tryHostLock | private void tryHostLock(String hostPath) throws Exception {
//if path has created 60 seconds ago, then delete
if (registryOperations.exists(hostPath)) {
try {
ServiceRecord host = registryOperations.resolve(hostPath);
Long cTime = Long.parseLong(host.get(JOY... | java | private void tryHostLock(String hostPath) throws Exception {
//if path has created 60 seconds ago, then delete
if (registryOperations.exists(hostPath)) {
try {
ServiceRecord host = registryOperations.resolve(hostPath);
Long cTime = Long.parseLong(host.get(JOY... | [
"private",
"void",
"tryHostLock",
"(",
"String",
"hostPath",
")",
"throws",
"Exception",
"{",
"//if path has created 60 seconds ago, then delete",
"if",
"(",
"registryOperations",
".",
"exists",
"(",
"hostPath",
")",
")",
"{",
"try",
"{",
"ServiceRecord",
"host",
"=... | see if anyone is updating host's port list, if not start , update this host itself
timeout is 45 seconds
@param hostPath
@throws InterruptedException
@throws IOException | [
"see",
"if",
"anyone",
"is",
"updating",
"host",
"s",
"port",
"list",
"if",
"not",
"start",
"update",
"this",
"host",
"itself",
"timeout",
"is",
"45",
"seconds"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/registry/SlotPortsView.java#L193-L225 |
25,428 | alibaba/jstorm | jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java | UIUtils.getTaskEntities | public static List<TaskEntity> getTaskEntities(TopologyInfo topologyInfo) {
Map<Integer, TaskEntity> tasks = new HashMap<>();
for (TaskSummary ts : topologyInfo.get_tasks()) {
tasks.put(ts.get_taskId(), new TaskEntity(ts));
}
for (ComponentSummary cs : topologyInfo.get_compon... | java | public static List<TaskEntity> getTaskEntities(TopologyInfo topologyInfo) {
Map<Integer, TaskEntity> tasks = new HashMap<>();
for (TaskSummary ts : topologyInfo.get_tasks()) {
tasks.put(ts.get_taskId(), new TaskEntity(ts));
}
for (ComponentSummary cs : topologyInfo.get_compon... | [
"public",
"static",
"List",
"<",
"TaskEntity",
">",
"getTaskEntities",
"(",
"TopologyInfo",
"topologyInfo",
")",
"{",
"Map",
"<",
"Integer",
",",
"TaskEntity",
">",
"tasks",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"TaskSummary",
"ts",
":",
... | get all task entities in the specific topology
@param topologyInfo topology info
@return the list of task entities | [
"get",
"all",
"task",
"entities",
"in",
"the",
"specific",
"topology"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java#L228-L246 |
25,429 | alibaba/jstorm | jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java | UIUtils.getTaskEntities | public static List<TaskEntity> getTaskEntities(TopologyInfo topologyInfo, String componentName) {
TreeMap<Integer, TaskEntity> tasks = new TreeMap<>();
for (ComponentSummary cs : topologyInfo.get_components()) {
String compName = cs.get_name();
String type = cs.get_type();
... | java | public static List<TaskEntity> getTaskEntities(TopologyInfo topologyInfo, String componentName) {
TreeMap<Integer, TaskEntity> tasks = new TreeMap<>();
for (ComponentSummary cs : topologyInfo.get_components()) {
String compName = cs.get_name();
String type = cs.get_type();
... | [
"public",
"static",
"List",
"<",
"TaskEntity",
">",
"getTaskEntities",
"(",
"TopologyInfo",
"topologyInfo",
",",
"String",
"componentName",
")",
"{",
"TreeMap",
"<",
"Integer",
",",
"TaskEntity",
">",
"tasks",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"for... | get the task entities in the specific component
@param topologyInfo topology info
@param componentName component name
@return the list of task entities | [
"get",
"the",
"task",
"entities",
"in",
"the",
"specific",
"component"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java#L254-L279 |
25,430 | alibaba/jstorm | jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java | UIUtils.getTaskEntity | public static TaskEntity getTaskEntity(List<TaskSummary> tasks, int taskId) {
TaskEntity entity = null;
for (TaskSummary task : tasks) {
if (task.get_taskId() == taskId) {
entity = new TaskEntity(task);
break;
}
}
return entity;
... | java | public static TaskEntity getTaskEntity(List<TaskSummary> tasks, int taskId) {
TaskEntity entity = null;
for (TaskSummary task : tasks) {
if (task.get_taskId() == taskId) {
entity = new TaskEntity(task);
break;
}
}
return entity;
... | [
"public",
"static",
"TaskEntity",
"getTaskEntity",
"(",
"List",
"<",
"TaskSummary",
">",
"tasks",
",",
"int",
"taskId",
")",
"{",
"TaskEntity",
"entity",
"=",
"null",
";",
"for",
"(",
"TaskSummary",
"task",
":",
"tasks",
")",
"{",
"if",
"(",
"task",
".",... | get the specific task entity
@param tasks list of task summaries
@param taskId task id
@return | [
"get",
"the",
"specific",
"task",
"entity"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java#L288-L297 |
25,431 | alibaba/jstorm | jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java | UIUtils.resetZKConfig | public static Map resetZKConfig(Map conf, String clusterName) {
ClusterConfig nimbus = clusterConfig.get(clusterName);
if (nimbus == null) return conf;
conf.put(Config.STORM_ZOOKEEPER_ROOT, nimbus.getZkRoot());
conf.put(Config.STORM_ZOOKEEPER_SERVERS, nimbus.getZkServers());
conf... | java | public static Map resetZKConfig(Map conf, String clusterName) {
ClusterConfig nimbus = clusterConfig.get(clusterName);
if (nimbus == null) return conf;
conf.put(Config.STORM_ZOOKEEPER_ROOT, nimbus.getZkRoot());
conf.put(Config.STORM_ZOOKEEPER_SERVERS, nimbus.getZkServers());
conf... | [
"public",
"static",
"Map",
"resetZKConfig",
"(",
"Map",
"conf",
",",
"String",
"clusterName",
")",
"{",
"ClusterConfig",
"nimbus",
"=",
"clusterConfig",
".",
"get",
"(",
"clusterName",
")",
";",
"if",
"(",
"nimbus",
"==",
"null",
")",
"return",
"conf",
";"... | to get nimbus client, we should reset ZK config | [
"to",
"get",
"nimbus",
"client",
"we",
"should",
"reset",
"ZK",
"config"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java#L417-L424 |
25,432 | alibaba/jstorm | jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java | UIUtils.prettyUptime | public static String prettyUptime(int secs) {
String[][] PRETTYSECDIVIDERS = { new String[] { "s", "60" }, new String[] { "m", "60" }, new String[] { "h", "24" },
new String[] { "d", null } };
int diversize = PRETTYSECDIVIDERS.length;
LinkedList<String> tmp = new LinkedList<>();... | java | public static String prettyUptime(int secs) {
String[][] PRETTYSECDIVIDERS = { new String[] { "s", "60" }, new String[] { "m", "60" }, new String[] { "h", "24" },
new String[] { "d", null } };
int diversize = PRETTYSECDIVIDERS.length;
LinkedList<String> tmp = new LinkedList<>();... | [
"public",
"static",
"String",
"prettyUptime",
"(",
"int",
"secs",
")",
"{",
"String",
"[",
"]",
"[",
"]",
"PRETTYSECDIVIDERS",
"=",
"{",
"new",
"String",
"[",
"]",
"{",
"\"s\"",
",",
"\"60\"",
"}",
",",
"new",
"String",
"[",
"]",
"{",
"\"m\"",
",",
... | seconds to string like '30m 40s' and '1d 20h 30m 40s'
@param secs
@return | [
"seconds",
"to",
"string",
"like",
"30m",
"40s",
"and",
"1d",
"20h",
"30m",
"40s"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java#L458-L478 |
25,433 | alibaba/jstorm | jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java | UIUtils.parseLong | public static Long parseLong(String s, long defaultValue) {
try {
Long value = Long.parseLong(s);
return value;
} catch (NumberFormatException e) {
//do nothing
}
return defaultValue;
} | java | public static Long parseLong(String s, long defaultValue) {
try {
Long value = Long.parseLong(s);
return value;
} catch (NumberFormatException e) {
//do nothing
}
return defaultValue;
} | [
"public",
"static",
"Long",
"parseLong",
"(",
"String",
"s",
",",
"long",
"defaultValue",
")",
"{",
"try",
"{",
"Long",
"value",
"=",
"Long",
".",
"parseLong",
"(",
"s",
")",
";",
"return",
"value",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
... | return the default value instead of throw an exception | [
"return",
"the",
"default",
"value",
"instead",
"of",
"throw",
"an",
"exception"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java#L497-L505 |
25,434 | alibaba/jstorm | jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java | UIUtils.fillValue2Node | private static void fillValue2Node(List<MetricInfo> componentMetrics, Map<String, TopologyNode> nodes) {
String NODE_DIM = MetricDef.EMMITTED_NUM;
List<String> FILTER = Arrays.asList(MetricDef.EMMITTED_NUM, MetricDef.SEND_TPS, MetricDef.RECV_TPS);
for (MetricInfo info : componentMetrics) {
... | java | private static void fillValue2Node(List<MetricInfo> componentMetrics, Map<String, TopologyNode> nodes) {
String NODE_DIM = MetricDef.EMMITTED_NUM;
List<String> FILTER = Arrays.asList(MetricDef.EMMITTED_NUM, MetricDef.SEND_TPS, MetricDef.RECV_TPS);
for (MetricInfo info : componentMetrics) {
... | [
"private",
"static",
"void",
"fillValue2Node",
"(",
"List",
"<",
"MetricInfo",
">",
"componentMetrics",
",",
"Map",
"<",
"String",
",",
"TopologyNode",
">",
"nodes",
")",
"{",
"String",
"NODE_DIM",
"=",
"MetricDef",
".",
"EMMITTED_NUM",
";",
"List",
"<",
"St... | fill emitted num to nodes | [
"fill",
"emitted",
"num",
"to",
"nodes"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java#L752-L784 |
25,435 | alibaba/jstorm | jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java | UIUtils.fillTLCValue2Edge | private static void fillTLCValue2Edge(List<MetricInfo> componentMetrics, Map<String, TopologyEdge> edges) {
String EDGE_DIM = "." + MetricDef.TUPLE_LIEF_CYCLE;
for (MetricInfo info : componentMetrics) {
if (info == null) continue;
for (Map.Entry<String, Map<Integer, MetricSnapsho... | java | private static void fillTLCValue2Edge(List<MetricInfo> componentMetrics, Map<String, TopologyEdge> edges) {
String EDGE_DIM = "." + MetricDef.TUPLE_LIEF_CYCLE;
for (MetricInfo info : componentMetrics) {
if (info == null) continue;
for (Map.Entry<String, Map<Integer, MetricSnapsho... | [
"private",
"static",
"void",
"fillTLCValue2Edge",
"(",
"List",
"<",
"MetricInfo",
">",
"componentMetrics",
",",
"Map",
"<",
"String",
",",
"TopologyEdge",
">",
"edges",
")",
"{",
"String",
"EDGE_DIM",
"=",
"\".\"",
"+",
"MetricDef",
".",
"TUPLE_LIEF_CYCLE",
";... | fill tuple life cycle time to edges | [
"fill",
"tuple",
"life",
"cycle",
"time",
"to",
"edges"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java#L787-L822 |
25,436 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java | TopologyBuilder.setBolt | public BoltDeclarer setBolt(String id, BaseWindowedBolt<Tuple> bolt, Number parallelism_hint) throws
IllegalArgumentException {
boolean isEventTime = WindowAssigner.isEventTime(bolt.getWindowAssigner());
if (isEventTime && bolt.getTimestampExtractor() == null) {
throw new Illegal... | java | public BoltDeclarer setBolt(String id, BaseWindowedBolt<Tuple> bolt, Number parallelism_hint) throws
IllegalArgumentException {
boolean isEventTime = WindowAssigner.isEventTime(bolt.getWindowAssigner());
if (isEventTime && bolt.getTimestampExtractor() == null) {
throw new Illegal... | [
"public",
"BoltDeclarer",
"setBolt",
"(",
"String",
"id",
",",
"BaseWindowedBolt",
"<",
"Tuple",
">",
"bolt",
",",
"Number",
"parallelism_hint",
")",
"throws",
"IllegalArgumentException",
"{",
"boolean",
"isEventTime",
"=",
"WindowAssigner",
".",
"isEventTime",
"(",... | Define a new bolt in this topology. This defines a windowed bolt, intended
for windowing operations.
@param id the id of this component. This id is referenced by other components that want to consume this bolt's outputs.
@param bolt the windowed bolt
@param parallelism_hint the number of tasks that should be assigned ... | [
"Define",
"a",
"new",
"bolt",
"in",
"this",
"topology",
".",
"This",
"defines",
"a",
"windowed",
"bolt",
"intended",
"for",
"windowing",
"operations",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java#L253-L260 |
25,437 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java | TopologyBuilder.setSpout | public SpoutDeclarer setSpout(String id, IRichSpout spout, Number parallelism_hint) throws IllegalArgumentException {
validateUnusedId(id);
initCommon(id, spout, parallelism_hint);
_spouts.put(id, spout);
return new SpoutGetter(id);
} | java | public SpoutDeclarer setSpout(String id, IRichSpout spout, Number parallelism_hint) throws IllegalArgumentException {
validateUnusedId(id);
initCommon(id, spout, parallelism_hint);
_spouts.put(id, spout);
return new SpoutGetter(id);
} | [
"public",
"SpoutDeclarer",
"setSpout",
"(",
"String",
"id",
",",
"IRichSpout",
"spout",
",",
"Number",
"parallelism_hint",
")",
"throws",
"IllegalArgumentException",
"{",
"validateUnusedId",
"(",
"id",
")",
";",
"initCommon",
"(",
"id",
",",
"spout",
",",
"paral... | Define a new spout in this topology with the specified parallelism. If the spout declares
itself as non-distributed, the parallelism_hint will be ignored and only one task
will be allocated to this component.
@param id the id of this component. This id is referenced by other components that want to consume this spout'... | [
"Define",
"a",
"new",
"spout",
"in",
"this",
"topology",
"with",
"the",
"specified",
"parallelism",
".",
"If",
"the",
"spout",
"declares",
"itself",
"as",
"non",
"-",
"distributed",
"the",
"parallelism_hint",
"will",
"be",
"ignored",
"and",
"only",
"one",
"t... | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java#L321-L326 |
25,438 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java | TopologyBuilder.setSpout | public SpoutDeclarer setSpout(String id, IControlSpout spout) {
return setSpout(id, spout, null);
} | java | public SpoutDeclarer setSpout(String id, IControlSpout spout) {
return setSpout(id, spout, null);
} | [
"public",
"SpoutDeclarer",
"setSpout",
"(",
"String",
"id",
",",
"IControlSpout",
"spout",
")",
"{",
"return",
"setSpout",
"(",
"id",
",",
"spout",
",",
"null",
")",
";",
"}"
] | Define a new bolt in this topology. This defines a control spout, which is a simpler to use but more restricted kind of bolt. Control spouts are intended for
making sending control message more simply
@param id the id of this component.
@param spout the control spout | [
"Define",
"a",
"new",
"bolt",
"in",
"this",
"topology",
".",
"This",
"defines",
"a",
"control",
"spout",
"which",
"is",
"a",
"simpler",
"to",
"use",
"but",
"more",
"restricted",
"kind",
"of",
"bolt",
".",
"Control",
"spouts",
"are",
"intended",
"for",
"m... | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java#L335-L337 |
25,439 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java | TopologyBuilder.setBolt | public BoltDeclarer setBolt(String id, IControlBolt bolt, Number parallelism_hint) {
return setBolt(id, new ControlBoltExecutor(bolt), parallelism_hint);
} | java | public BoltDeclarer setBolt(String id, IControlBolt bolt, Number parallelism_hint) {
return setBolt(id, new ControlBoltExecutor(bolt), parallelism_hint);
} | [
"public",
"BoltDeclarer",
"setBolt",
"(",
"String",
"id",
",",
"IControlBolt",
"bolt",
",",
"Number",
"parallelism_hint",
")",
"{",
"return",
"setBolt",
"(",
"id",
",",
"new",
"ControlBoltExecutor",
"(",
"bolt",
")",
",",
"parallelism_hint",
")",
";",
"}"
] | Define a new bolt in this topology. This defines a control bolt, which is a simpler to use but more restricted kind of bolt. Control bolts are intended for
making sending control message more simply
@param id the id of this component. This id is referenced by other components that want to consume this bolt's outputs.
@... | [
"Define",
"a",
"new",
"bolt",
"in",
"this",
"topology",
".",
"This",
"defines",
"a",
"control",
"bolt",
"which",
"is",
"a",
"simpler",
"to",
"use",
"but",
"more",
"restricted",
"kind",
"of",
"bolt",
".",
"Control",
"bolts",
"are",
"intended",
"for",
"mak... | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java#L350-L352 |
25,440 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java | TopologyBuilder.addWorkerHook | public void addWorkerHook(IWorkerHook workerHook) {
if(null == workerHook) {
throw new IllegalArgumentException("WorkerHook must not be null.");
}
_workerHooks.add(ByteBuffer.wrap(Utils.javaSerialize(workerHook)));
} | java | public void addWorkerHook(IWorkerHook workerHook) {
if(null == workerHook) {
throw new IllegalArgumentException("WorkerHook must not be null.");
}
_workerHooks.add(ByteBuffer.wrap(Utils.javaSerialize(workerHook)));
} | [
"public",
"void",
"addWorkerHook",
"(",
"IWorkerHook",
"workerHook",
")",
"{",
"if",
"(",
"null",
"==",
"workerHook",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"WorkerHook must not be null.\"",
")",
";",
"}",
"_workerHooks",
".",
"add",
"(",
"... | Add a new worker lifecycle hook
@param workerHook the lifecycle hook to add | [
"Add",
"a",
"new",
"worker",
"lifecycle",
"hook"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java#L372-L378 |
25,441 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java | TopologyBuilder.maybeAddWatermarkInputs | private void maybeAddWatermarkInputs(ComponentCommon common, IRichBolt bolt) {
if (bolt instanceof WindowedBoltExecutor) {
Set<String> comps = new HashSet<>();
for (GlobalStreamId globalStreamId : common.get_inputs().keySet()) {
comps.add(globalStreamId.get_componentId())... | java | private void maybeAddWatermarkInputs(ComponentCommon common, IRichBolt bolt) {
if (bolt instanceof WindowedBoltExecutor) {
Set<String> comps = new HashSet<>();
for (GlobalStreamId globalStreamId : common.get_inputs().keySet()) {
comps.add(globalStreamId.get_componentId())... | [
"private",
"void",
"maybeAddWatermarkInputs",
"(",
"ComponentCommon",
"common",
",",
"IRichBolt",
"bolt",
")",
"{",
"if",
"(",
"bolt",
"instanceof",
"WindowedBoltExecutor",
")",
"{",
"Set",
"<",
"String",
">",
"comps",
"=",
"new",
"HashSet",
"<>",
"(",
")",
... | Add watermark stream to source components of window bolts | [
"Add",
"watermark",
"stream",
"to",
"source",
"components",
"of",
"window",
"bolts"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java#L412-L425 |
25,442 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/old/window/StatBuckets.java | StatBuckets.getShowTimeStr | public static String getShowTimeStr(Integer time) {
if (time == null) {
return MINUTE_WINDOW_STR;
} else if (time.equals(MINUTE_WINDOW)) {
return MINUTE_WINDOW_STR;
} else if (time.equals(HOUR_WINDOW)) {
return HOUR_WINDOW_STR;
} else if (time.equals(D... | java | public static String getShowTimeStr(Integer time) {
if (time == null) {
return MINUTE_WINDOW_STR;
} else if (time.equals(MINUTE_WINDOW)) {
return MINUTE_WINDOW_STR;
} else if (time.equals(HOUR_WINDOW)) {
return HOUR_WINDOW_STR;
} else if (time.equals(D... | [
"public",
"static",
"String",
"getShowTimeStr",
"(",
"Integer",
"time",
")",
"{",
"if",
"(",
"time",
"==",
"null",
")",
"{",
"return",
"MINUTE_WINDOW_STR",
";",
"}",
"else",
"if",
"(",
"time",
".",
"equals",
"(",
"MINUTE_WINDOW",
")",
")",
"{",
"return",... | Default is the latest result
@param showStr
@return | [
"Default",
"is",
"the",
"latest",
"result"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/old/window/StatBuckets.java#L96-L111 |
25,443 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/old/window/StatBuckets.java | StatBuckets.prettyUptimeStr | public static String prettyUptimeStr(int secs) {
int diversize = PRETTYSECDIVIDERS.length;
List<String> tmp = new ArrayList<String>();
int div = secs;
for (int i = 0; i < diversize; i++) {
if (PRETTYSECDIVIDERS[i][1] != null) {
Integer d = Integer.parseInt(PR... | java | public static String prettyUptimeStr(int secs) {
int diversize = PRETTYSECDIVIDERS.length;
List<String> tmp = new ArrayList<String>();
int div = secs;
for (int i = 0; i < diversize; i++) {
if (PRETTYSECDIVIDERS[i][1] != null) {
Integer d = Integer.parseInt(PR... | [
"public",
"static",
"String",
"prettyUptimeStr",
"(",
"int",
"secs",
")",
"{",
"int",
"diversize",
"=",
"PRETTYSECDIVIDERS",
".",
"length",
";",
"List",
"<",
"String",
">",
"tmp",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"int",
"div",
... | seconds to string like 1d20h30m40s
@param secs
@return | [
"seconds",
"to",
"string",
"like",
"1d20h30m40s"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/old/window/StatBuckets.java#L119-L140 |
25,444 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/util/TridentUtils.java | TridentUtils.getParents | public static <T> List<T> getParents(DirectedGraph g, T n) {
List<IndexedEdge> incoming = new ArrayList(g.incomingEdgesOf(n));
Collections.sort(incoming);
List<T> ret = new ArrayList();
for(IndexedEdge e: incoming) {
ret.add((T)e.source);
}
return ret;... | java | public static <T> List<T> getParents(DirectedGraph g, T n) {
List<IndexedEdge> incoming = new ArrayList(g.incomingEdgesOf(n));
Collections.sort(incoming);
List<T> ret = new ArrayList();
for(IndexedEdge e: incoming) {
ret.add((T)e.source);
}
return ret;... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"getParents",
"(",
"DirectedGraph",
"g",
",",
"T",
"n",
")",
"{",
"List",
"<",
"IndexedEdge",
">",
"incoming",
"=",
"new",
"ArrayList",
"(",
"g",
".",
"incomingEdgesOf",
"(",
"n",
")",
")",
... | Assumes edge contains an index | [
"Assumes",
"edge",
"contains",
"an",
"index"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/util/TridentUtils.java#L79-L87 |
25,445 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/schedule/default_assign/DefaultTopologyScheduler.java | DefaultTopologyScheduler.getKeepAssign | public Set<ResourceWorkerSlot> getKeepAssign(DefaultTopologyAssignContext defaultContext, Set<Integer> needAssigns) {
Set<Integer> keepAssignIds = new HashSet<>();
keepAssignIds.addAll(defaultContext.getAllTaskIds());
keepAssignIds.removeAll(defaultContext.getUnstoppedTaskIds());
keepAss... | java | public Set<ResourceWorkerSlot> getKeepAssign(DefaultTopologyAssignContext defaultContext, Set<Integer> needAssigns) {
Set<Integer> keepAssignIds = new HashSet<>();
keepAssignIds.addAll(defaultContext.getAllTaskIds());
keepAssignIds.removeAll(defaultContext.getUnstoppedTaskIds());
keepAss... | [
"public",
"Set",
"<",
"ResourceWorkerSlot",
">",
"getKeepAssign",
"(",
"DefaultTopologyAssignContext",
"defaultContext",
",",
"Set",
"<",
"Integer",
">",
"needAssigns",
")",
"{",
"Set",
"<",
"Integer",
">",
"keepAssignIds",
"=",
"new",
"HashSet",
"<>",
"(",
")",... | Get the task Map which the task is alive and will be kept only when type is ASSIGN_TYPE_MONITOR, it is valid
@param defaultContext default topology context
@param needAssigns a set of tasks to be assigned
@return a set of assigned slots | [
"Get",
"the",
"task",
"Map",
"which",
"the",
"task",
"is",
"alive",
"and",
"will",
"be",
"kept",
"only",
"when",
"type",
"is",
"ASSIGN_TYPE_MONITOR",
"it",
"is",
"valid"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/schedule/default_assign/DefaultTopologyScheduler.java#L97-L121 |
25,446 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetricCache.java | JStormMetricCache.putMetricData | public JStormCache putMetricData(String topologyId, TopologyMetric tpMetric) {
// map<key, [ts, metric_info]>
Map<String, Object> batchData = new HashMap<>();
long ts = System.currentTimeMillis();
int tp = 0, comp = 0, compStream = 0, task = 0, stream = 0, worker = 0, netty = 0;
... | java | public JStormCache putMetricData(String topologyId, TopologyMetric tpMetric) {
// map<key, [ts, metric_info]>
Map<String, Object> batchData = new HashMap<>();
long ts = System.currentTimeMillis();
int tp = 0, comp = 0, compStream = 0, task = 0, stream = 0, worker = 0, netty = 0;
... | [
"public",
"JStormCache",
"putMetricData",
"(",
"String",
"topologyId",
",",
"TopologyMetric",
"tpMetric",
")",
"{",
"// map<key, [ts, metric_info]>",
"Map",
"<",
"String",
",",
"Object",
">",
"batchData",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"long",
"ts",... | store 30min metric data. the metric data is stored in a ring. | [
"store",
"30min",
"metric",
"data",
".",
"the",
"metric",
"data",
"is",
"stored",
"in",
"a",
"ring",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetricCache.java#L133-L175 |
25,447 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.setMemoryLoad | @Override
public Stream setMemoryLoad(Number onHeap, Number offHeap) {
_node.setMemoryLoad(onHeap, offHeap);
return this;
} | java | @Override
public Stream setMemoryLoad(Number onHeap, Number offHeap) {
_node.setMemoryLoad(onHeap, offHeap);
return this;
} | [
"@",
"Override",
"public",
"Stream",
"setMemoryLoad",
"(",
"Number",
"onHeap",
",",
"Number",
"offHeap",
")",
"{",
"_node",
".",
"setMemoryLoad",
"(",
"onHeap",
",",
"offHeap",
")",
";",
"return",
"this",
";",
"}"
] | Sets the Memory Load resources for the current operation. | [
"Sets",
"the",
"Memory",
"Load",
"resources",
"for",
"the",
"current",
"operation",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L145-L149 |
25,448 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.project | public Stream project(Fields keepFields) {
projectionValidation(keepFields);
return _topology.addSourcedNode(this, new ProcessorNode(_topology.getUniqueStreamId(), _name, keepFields, new Fields(), new ProjectedProcessor(keepFields)));
} | java | public Stream project(Fields keepFields) {
projectionValidation(keepFields);
return _topology.addSourcedNode(this, new ProcessorNode(_topology.getUniqueStreamId(), _name, keepFields, new Fields(), new ProjectedProcessor(keepFields)));
} | [
"public",
"Stream",
"project",
"(",
"Fields",
"keepFields",
")",
"{",
"projectionValidation",
"(",
"keepFields",
")",
";",
"return",
"_topology",
".",
"addSourcedNode",
"(",
"this",
",",
"new",
"ProcessorNode",
"(",
"_topology",
".",
"getUniqueStreamId",
"(",
")... | Filters out fields from a stream, resulting in a Stream containing only the fields specified by `keepFields`.
For example, if you had a Stream `mystream` containing the fields `["a", "b", "c","d"]`, calling"
```java
mystream.project(new Fields("b", "d"))
```
would produce a stream containing only the fields `["b", "... | [
"Filters",
"out",
"fields",
"from",
"a",
"stream",
"resulting",
"in",
"a",
"Stream",
"containing",
"only",
"the",
"fields",
"specified",
"by",
"keepFields",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L166-L169 |
25,449 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.partitionAggregate | @Override
public Stream partitionAggregate(Fields inputFields, Aggregator agg, Fields functionFields) {
projectionValidation(inputFields);
return _topology.addSourcedNode(this,
new ProcessorNode(_topology.getUniqueStreamId(),
_name,
functionFie... | java | @Override
public Stream partitionAggregate(Fields inputFields, Aggregator agg, Fields functionFields) {
projectionValidation(inputFields);
return _topology.addSourcedNode(this,
new ProcessorNode(_topology.getUniqueStreamId(),
_name,
functionFie... | [
"@",
"Override",
"public",
"Stream",
"partitionAggregate",
"(",
"Fields",
"inputFields",
",",
"Aggregator",
"agg",
",",
"Fields",
"functionFields",
")",
"{",
"projectionValidation",
"(",
"inputFields",
")",
";",
"return",
"_topology",
".",
"addSourcedNode",
"(",
"... | creates brand new tuples with brand new fields | [
"creates",
"brand",
"new",
"tuples",
"with",
"brand",
"new",
"fields"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L312-L321 |
25,450 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.map | public Stream map(MapFunction function) {
projectionValidation(getOutputFields());
return _topology.addSourcedNode(this,
new ProcessorNode(
_topology.getUniqueStreamId(),
... | java | public Stream map(MapFunction function) {
projectionValidation(getOutputFields());
return _topology.addSourcedNode(this,
new ProcessorNode(
_topology.getUniqueStreamId(),
... | [
"public",
"Stream",
"map",
"(",
"MapFunction",
"function",
")",
"{",
"projectionValidation",
"(",
"getOutputFields",
"(",
")",
")",
";",
"return",
"_topology",
".",
"addSourcedNode",
"(",
"this",
",",
"new",
"ProcessorNode",
"(",
"_topology",
".",
"getUniqueStre... | Returns a stream consisting of the result of applying the given mapping function to the values of this stream.
@param function a mapping function to be applied to each value in this stream.
@return the new stream | [
"Returns",
"a",
"stream",
"consisting",
"of",
"the",
"result",
"of",
"applying",
"the",
"given",
"mapping",
"function",
"to",
"the",
"values",
"of",
"this",
"stream",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L395-L404 |
25,451 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.flatMap | public Stream flatMap(FlatMapFunction function) {
projectionValidation(getOutputFields());
return _topology.addSourcedNode(this,
new ProcessorNode(
_topology.getUniqueStreamId(),
... | java | public Stream flatMap(FlatMapFunction function) {
projectionValidation(getOutputFields());
return _topology.addSourcedNode(this,
new ProcessorNode(
_topology.getUniqueStreamId(),
... | [
"public",
"Stream",
"flatMap",
"(",
"FlatMapFunction",
"function",
")",
"{",
"projectionValidation",
"(",
"getOutputFields",
"(",
")",
")",
";",
"return",
"_topology",
".",
"addSourcedNode",
"(",
"this",
",",
"new",
"ProcessorNode",
"(",
"_topology",
".",
"getUn... | Returns a stream consisting of the results of replacing each value of this stream with the contents
produced by applying the provided mapping function to each value. This has the effect of applying
a one-to-many transformation to the values of the stream, and then flattening the resulting elements into a new stream.
@... | [
"Returns",
"a",
"stream",
"consisting",
"of",
"the",
"results",
"of",
"replacing",
"each",
"value",
"of",
"this",
"stream",
"with",
"the",
"contents",
"produced",
"by",
"applying",
"the",
"provided",
"mapping",
"function",
"to",
"each",
"value",
".",
"This",
... | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L414-L423 |
25,452 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.peek | public Stream peek(Consumer action) {
projectionValidation(getOutputFields());
return _topology.addSourcedNode(this,
new ProcessorNode(
_topology.getUniqueStreamId(),
_... | java | public Stream peek(Consumer action) {
projectionValidation(getOutputFields());
return _topology.addSourcedNode(this,
new ProcessorNode(
_topology.getUniqueStreamId(),
_... | [
"public",
"Stream",
"peek",
"(",
"Consumer",
"action",
")",
"{",
"projectionValidation",
"(",
"getOutputFields",
"(",
")",
")",
";",
"return",
"_topology",
".",
"addSourcedNode",
"(",
"this",
",",
"new",
"ProcessorNode",
"(",
"_topology",
".",
"getUniqueStreamId... | Returns a stream consisting of the trident tuples of this stream, additionally performing the provided action on
each trident tuple as they are consumed from the resulting stream. This is mostly useful for debugging
to see the tuples as they flow past a certain point in a pipeline.
@param action the action to perform ... | [
"Returns",
"a",
"stream",
"consisting",
"of",
"the",
"trident",
"tuples",
"of",
"this",
"stream",
"additionally",
"performing",
"the",
"provided",
"action",
"on",
"each",
"trident",
"tuple",
"as",
"they",
"are",
"consumed",
"from",
"the",
"resulting",
"stream",
... | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L433-L442 |
25,453 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.window | public Stream window(WindowConfig windowConfig, Fields inputFields, Aggregator aggregator, Fields functionFields) {
// this store is used only for storing triggered aggregated results but not tuples as storeTuplesInStore is set
// as false int he below call.
InMemoryWindowsStoreFactory inMemoryW... | java | public Stream window(WindowConfig windowConfig, Fields inputFields, Aggregator aggregator, Fields functionFields) {
// this store is used only for storing triggered aggregated results but not tuples as storeTuplesInStore is set
// as false int he below call.
InMemoryWindowsStoreFactory inMemoryW... | [
"public",
"Stream",
"window",
"(",
"WindowConfig",
"windowConfig",
",",
"Fields",
"inputFields",
",",
"Aggregator",
"aggregator",
",",
"Fields",
"functionFields",
")",
"{",
"// this store is used only for storing triggered aggregated results but not tuples as storeTuplesInStore is ... | Returns a stream of aggregated results based on the given window configuration which uses inmemory windowing tuple store.
@param windowConfig window configuration like window length and slide length.
@param inputFields input fields
@param aggregator aggregator to run on the window of tuples to compute the result and e... | [
"Returns",
"a",
"stream",
"of",
"aggregated",
"results",
"based",
"on",
"the",
"given",
"window",
"configuration",
"which",
"uses",
"inmemory",
"windowing",
"tuple",
"store",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L668-L673 |
25,454 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.window | public Stream window(WindowConfig windowConfig, WindowsStoreFactory windowStoreFactory, Fields inputFields,
Aggregator aggregator, Fields functionFields) {
return window(windowConfig, windowStoreFactory, inputFields, aggregator, functionFields, true);
} | java | public Stream window(WindowConfig windowConfig, WindowsStoreFactory windowStoreFactory, Fields inputFields,
Aggregator aggregator, Fields functionFields) {
return window(windowConfig, windowStoreFactory, inputFields, aggregator, functionFields, true);
} | [
"public",
"Stream",
"window",
"(",
"WindowConfig",
"windowConfig",
",",
"WindowsStoreFactory",
"windowStoreFactory",
",",
"Fields",
"inputFields",
",",
"Aggregator",
"aggregator",
",",
"Fields",
"functionFields",
")",
"{",
"return",
"window",
"(",
"windowConfig",
",",... | Returns stream of aggregated results based on the given window configuration.
@param windowConfig window configuration like window length and slide length.
@param windowStoreFactory intermediary tuple store for storing tuples for windowing
@param inputFields input fields
@param aggregator aggregator to run on the wind... | [
"Returns",
"stream",
"of",
"aggregated",
"results",
"based",
"on",
"the",
"given",
"window",
"configuration",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L686-L689 |
25,455 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Cluster.java | Cluster.get_topology_id | public static String get_topology_id(StormClusterState zkCluster, String storm_name) throws Exception {
List<String> active_storms = zkCluster.active_storms();
String rtn = null;
if (active_storms != null) {
for (String topology_id : active_storms) {
if (!topology_id... | java | public static String get_topology_id(StormClusterState zkCluster, String storm_name) throws Exception {
List<String> active_storms = zkCluster.active_storms();
String rtn = null;
if (active_storms != null) {
for (String topology_id : active_storms) {
if (!topology_id... | [
"public",
"static",
"String",
"get_topology_id",
"(",
"StormClusterState",
"zkCluster",
",",
"String",
"storm_name",
")",
"throws",
"Exception",
"{",
"List",
"<",
"String",
">",
"active_storms",
"=",
"zkCluster",
".",
"active_storms",
"(",
")",
";",
"String",
"r... | if a topology's name is equal to the input storm_name, then return the topology id, otherwise return null | [
"if",
"a",
"topology",
"s",
"name",
"is",
"equal",
"to",
"the",
"input",
"storm_name",
"then",
"return",
"the",
"topology",
"id",
"otherwise",
"return",
"null"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Cluster.java#L224-L241 |
25,456 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Cluster.java | Cluster.get_all_StormBase | public static HashMap<String, StormBase> get_all_StormBase(StormClusterState zkCluster) throws Exception {
HashMap<String, StormBase> rtn = new HashMap<>();
List<String> active_storms = zkCluster.active_storms();
if (active_storms != null) {
for (String topology_id : active_storms) {... | java | public static HashMap<String, StormBase> get_all_StormBase(StormClusterState zkCluster) throws Exception {
HashMap<String, StormBase> rtn = new HashMap<>();
List<String> active_storms = zkCluster.active_storms();
if (active_storms != null) {
for (String topology_id : active_storms) {... | [
"public",
"static",
"HashMap",
"<",
"String",
",",
"StormBase",
">",
"get_all_StormBase",
"(",
"StormClusterState",
"zkCluster",
")",
"throws",
"Exception",
"{",
"HashMap",
"<",
"String",
",",
"StormBase",
">",
"rtn",
"=",
"new",
"HashMap",
"<>",
"(",
")",
"... | get all topology's StormBase
@param zkCluster zk cluster state
@return map[topology_id, StormBase] | [
"get",
"all",
"topology",
"s",
"StormBase"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Cluster.java#L249-L261 |
25,457 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Cluster.java | Cluster.get_all_SupervisorInfo | public static Map<String, SupervisorInfo> get_all_SupervisorInfo(
StormClusterState stormClusterState, RunnableCallback callback) throws Exception {
Map<String, SupervisorInfo> rtn = new TreeMap<>();
// get /ZK/supervisors
List<String> supervisorIds = stormClusterState.supervisors(ca... | java | public static Map<String, SupervisorInfo> get_all_SupervisorInfo(
StormClusterState stormClusterState, RunnableCallback callback) throws Exception {
Map<String, SupervisorInfo> rtn = new TreeMap<>();
// get /ZK/supervisors
List<String> supervisorIds = stormClusterState.supervisors(ca... | [
"public",
"static",
"Map",
"<",
"String",
",",
"SupervisorInfo",
">",
"get_all_SupervisorInfo",
"(",
"StormClusterState",
"stormClusterState",
",",
"RunnableCallback",
"callback",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"SupervisorInfo",
">",
"rt... | get all SupervisorInfo of storm cluster
@param stormClusterState storm cluster state
@param callback watcher callback
@return Map[supervisorId, SupervisorInfo] | [
"get",
"all",
"SupervisorInfo",
"of",
"storm",
"cluster"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Cluster.java#L270-L296 |
25,458 | alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/DirLock.java | DirLock.tryLock | public static DirLock tryLock(FileSystem fs, Path dir) throws IOException {
Path lockFile = getDirLockFile(dir);
try {
FSDataOutputStream ostream = HdfsUtils.tryCreateFile(fs, lockFile);
if (ostream!=null) {
LOG.debug("Thread ({}) Acquired lock on dir {}", threadInfo(), dir);
ostrea... | java | public static DirLock tryLock(FileSystem fs, Path dir) throws IOException {
Path lockFile = getDirLockFile(dir);
try {
FSDataOutputStream ostream = HdfsUtils.tryCreateFile(fs, lockFile);
if (ostream!=null) {
LOG.debug("Thread ({}) Acquired lock on dir {}", threadInfo(), dir);
ostrea... | [
"public",
"static",
"DirLock",
"tryLock",
"(",
"FileSystem",
"fs",
",",
"Path",
"dir",
")",
"throws",
"IOException",
"{",
"Path",
"lockFile",
"=",
"getDirLockFile",
"(",
"dir",
")",
";",
"try",
"{",
"FSDataOutputStream",
"ostream",
"=",
"HdfsUtils",
".",
"tr... | Get a lock on file if not already locked
@param fs
@param dir the dir on which to get a lock
@return The lock object if it the lock was acquired. Returns null if the dir is already locked.
@throws IOException if there were errors | [
"Get",
"a",
"lock",
"on",
"file",
"if",
"not",
"already",
"locked"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/DirLock.java#L55-L72 |
25,459 | alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/DirLock.java | DirLock.release | public void release() throws IOException {
if(!fs.delete(lockFile, false)) {
LOG.error("Thread {} could not delete dir lock {} ", threadInfo(), lockFile);
}
else {
LOG.debug("Thread {} Released dir lock {} ", threadInfo(), lockFile);
}
} | java | public void release() throws IOException {
if(!fs.delete(lockFile, false)) {
LOG.error("Thread {} could not delete dir lock {} ", threadInfo(), lockFile);
}
else {
LOG.debug("Thread {} Released dir lock {} ", threadInfo(), lockFile);
}
} | [
"public",
"void",
"release",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"fs",
".",
"delete",
"(",
"lockFile",
",",
"false",
")",
")",
"{",
"LOG",
".",
"error",
"(",
"\"Thread {} could not delete dir lock {} \"",
",",
"threadInfo",
"(",
")",
",... | Release lock on dir by deleting the lock file | [
"Release",
"lock",
"on",
"dir",
"by",
"deleting",
"the",
"lock",
"file"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/DirLock.java#L84-L91 |
25,460 | alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/DirLock.java | DirLock.takeOwnershipIfStale | public static DirLock takeOwnershipIfStale(FileSystem fs, Path dirToLock, int lockTimeoutSec) {
Path dirLockFile = getDirLockFile(dirToLock);
long now = System.currentTimeMillis();
long expiryTime = now - (lockTimeoutSec*1000);
try {
long modTime = fs.getFileStatus(dirLockFile).getModificationT... | java | public static DirLock takeOwnershipIfStale(FileSystem fs, Path dirToLock, int lockTimeoutSec) {
Path dirLockFile = getDirLockFile(dirToLock);
long now = System.currentTimeMillis();
long expiryTime = now - (lockTimeoutSec*1000);
try {
long modTime = fs.getFileStatus(dirLockFile).getModificationT... | [
"public",
"static",
"DirLock",
"takeOwnershipIfStale",
"(",
"FileSystem",
"fs",
",",
"Path",
"dirToLock",
",",
"int",
"lockTimeoutSec",
")",
"{",
"Path",
"dirLockFile",
"=",
"getDirLockFile",
"(",
"dirToLock",
")",
";",
"long",
"now",
"=",
"System",
".",
"curr... | if the lock on the directory is stale, take ownership | [
"if",
"the",
"lock",
"on",
"the",
"directory",
"is",
"stale",
"take",
"ownership"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/DirLock.java#L94-L109 |
25,461 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/schedule/FollowerRunnable.java | FollowerRunnable.setupBlobstore | private void setupBlobstore() throws Exception {
BlobStore blobStore = data.getBlobStore();
StormClusterState clusterState = data.getStormClusterState();
Set<String> localSetOfKeys = Sets.newHashSet(blobStore.listKeys());
Set<String> allKeys = Sets.newHashSet(clusterState.active_keys());... | java | private void setupBlobstore() throws Exception {
BlobStore blobStore = data.getBlobStore();
StormClusterState clusterState = data.getStormClusterState();
Set<String> localSetOfKeys = Sets.newHashSet(blobStore.listKeys());
Set<String> allKeys = Sets.newHashSet(clusterState.active_keys());... | [
"private",
"void",
"setupBlobstore",
"(",
")",
"throws",
"Exception",
"{",
"BlobStore",
"blobStore",
"=",
"data",
".",
"getBlobStore",
"(",
")",
";",
"StormClusterState",
"clusterState",
"=",
"data",
".",
"getStormClusterState",
"(",
")",
";",
"Set",
"<",
"Str... | sets up blobstore state for all current keys | [
"sets",
"up",
"blobstore",
"state",
"for",
"all",
"current",
"keys"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/schedule/FollowerRunnable.java#L134-L152 |
25,462 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/schedule/FollowerRunnable.java | FollowerRunnable.check_nimbus_priority | private boolean check_nimbus_priority() throws Exception {
int gap = update_nimbus_detail();
if (gap == 0) {
return true;
}
int left = SLAVE_NIMBUS_WAIT_TIME;
while (left > 0) {
LOG.info("nimbus.differ.count.zk is {}, so after {} seconds, nimbus will try ... | java | private boolean check_nimbus_priority() throws Exception {
int gap = update_nimbus_detail();
if (gap == 0) {
return true;
}
int left = SLAVE_NIMBUS_WAIT_TIME;
while (left > 0) {
LOG.info("nimbus.differ.count.zk is {}, so after {} seconds, nimbus will try ... | [
"private",
"boolean",
"check_nimbus_priority",
"(",
")",
"throws",
"Exception",
"{",
"int",
"gap",
"=",
"update_nimbus_detail",
"(",
")",
";",
"if",
"(",
"gap",
"==",
"0",
")",
"{",
"return",
"true",
";",
"}",
"int",
"left",
"=",
"SLAVE_NIMBUS_WAIT_TIME",
... | Compared with other nimbus to get priority of this nimbus | [
"Compared",
"with",
"other",
"nimbus",
"to",
"get",
"priority",
"of",
"this",
"nimbus"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/schedule/FollowerRunnable.java#L264-L298 |
25,463 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/schedule/FollowerRunnable.java | FollowerRunnable.checkOwnMaster | private void checkOwnMaster() throws Exception {
int retry_times = 10;
StormClusterState zkClient = data.getStormClusterState();
for (int i = 0; i < retry_times; i++, JStormUtils.sleepMs(sleepTime)) {
if (!zkClient.leader_existed()) {
continue;
}
... | java | private void checkOwnMaster() throws Exception {
int retry_times = 10;
StormClusterState zkClient = data.getStormClusterState();
for (int i = 0; i < retry_times; i++, JStormUtils.sleepMs(sleepTime)) {
if (!zkClient.leader_existed()) {
continue;
}
... | [
"private",
"void",
"checkOwnMaster",
"(",
")",
"throws",
"Exception",
"{",
"int",
"retry_times",
"=",
"10",
";",
"StormClusterState",
"zkClient",
"=",
"data",
".",
"getStormClusterState",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"r... | Check whether current node is master | [
"Check",
"whether",
"current",
"node",
"is",
"master"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/schedule/FollowerRunnable.java#L328-L350 |
25,464 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/AsmHistogram.java | AsmHistogram.doFlush | protected void doFlush() {
long[] values = unFlushed.getSnapshot().getValues();
for (JHistogram histogram : histogramMap.values()) {
for (long val : values) {
histogram.update(val);
}
}
if (MetricUtils.metricAccurateCal) {
for (long val... | java | protected void doFlush() {
long[] values = unFlushed.getSnapshot().getValues();
for (JHistogram histogram : histogramMap.values()) {
for (long val : values) {
histogram.update(val);
}
}
if (MetricUtils.metricAccurateCal) {
for (long val... | [
"protected",
"void",
"doFlush",
"(",
")",
"{",
"long",
"[",
"]",
"values",
"=",
"unFlushed",
".",
"getSnapshot",
"(",
")",
".",
"getValues",
"(",
")",
";",
"for",
"(",
"JHistogram",
"histogram",
":",
"histogramMap",
".",
"values",
"(",
")",
")",
"{",
... | flush temp histogram data to all windows & assoc metrics. | [
"flush",
"temp",
"histogram",
"data",
"to",
"all",
"windows",
"&",
"assoc",
"metrics",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/AsmHistogram.java#L159-L174 |
25,465 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/spout/SpoutOutputCollector.java | SpoutOutputCollector.emitDirect | public void emitDirect(int taskId, String streamId, List<Object> tuple,
Object messageId) {
_delegate.emitDirect(taskId, streamId, tuple, messageId);
} | java | public void emitDirect(int taskId, String streamId, List<Object> tuple,
Object messageId) {
_delegate.emitDirect(taskId, streamId, tuple, messageId);
} | [
"public",
"void",
"emitDirect",
"(",
"int",
"taskId",
",",
"String",
"streamId",
",",
"List",
"<",
"Object",
">",
"tuple",
",",
"Object",
"messageId",
")",
"{",
"_delegate",
".",
"emitDirect",
"(",
"taskId",
",",
"streamId",
",",
"tuple",
",",
"messageId",... | Emits a tuple to the specified task on the specified output stream. This
output stream must have been declared as a direct stream, and the
specified task must use a direct grouping on this stream to receive the
message. The emitted values must be immutable. | [
"Emits",
"a",
"tuple",
"to",
"the",
"specified",
"task",
"on",
"the",
"specified",
"output",
"stream",
".",
"This",
"output",
"stream",
"must",
"have",
"been",
"declared",
"as",
"a",
"direct",
"stream",
"and",
"the",
"specified",
"task",
"must",
"use",
"a"... | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/spout/SpoutOutputCollector.java#L150-L153 |
25,466 | alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/blobstore/HdfsBlobStoreImpl.java | HdfsBlobStoreImpl.exists | public boolean exists(String key) {
Path dir = getKeyDir(key);
boolean res = false;
try {
_fs = dir.getFileSystem(_hadoopConf);
res = _fs.exists(dir);
} catch (IOException e) {
LOG.warn("Exception checking for exists on: " + key);
}
ret... | java | public boolean exists(String key) {
Path dir = getKeyDir(key);
boolean res = false;
try {
_fs = dir.getFileSystem(_hadoopConf);
res = _fs.exists(dir);
} catch (IOException e) {
LOG.warn("Exception checking for exists on: " + key);
}
ret... | [
"public",
"boolean",
"exists",
"(",
"String",
"key",
")",
"{",
"Path",
"dir",
"=",
"getKeyDir",
"(",
"key",
")",
";",
"boolean",
"res",
"=",
"false",
";",
"try",
"{",
"_fs",
"=",
"dir",
".",
"getFileSystem",
"(",
"_hadoopConf",
")",
";",
"res",
"=",
... | Check if the key exists in the blob store.
@param key the key to check for
@return true if it exists else false. | [
"Check",
"if",
"the",
"key",
"exists",
"in",
"the",
"blob",
"store",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/blobstore/HdfsBlobStoreImpl.java#L224-L234 |
25,467 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/utils/OSInfo.java | OSInfo.getOSname | public static EPlatform getOSname() {
if (isAix()) {
_instance.platform = EPlatform.AIX;
} else if (isDigitalUnix()) {
_instance.platform = EPlatform.Digital_Unix;
} else if (isFreeBSD()) {
_instance.platform = EPlatform.FreeBSD;
} else if (isHP... | java | public static EPlatform getOSname() {
if (isAix()) {
_instance.platform = EPlatform.AIX;
} else if (isDigitalUnix()) {
_instance.platform = EPlatform.Digital_Unix;
} else if (isFreeBSD()) {
_instance.platform = EPlatform.FreeBSD;
} else if (isHP... | [
"public",
"static",
"EPlatform",
"getOSname",
"(",
")",
"{",
"if",
"(",
"isAix",
"(",
")",
")",
"{",
"_instance",
".",
"platform",
"=",
"EPlatform",
".",
"AIX",
";",
"}",
"else",
"if",
"(",
"isDigitalUnix",
"(",
")",
")",
"{",
"_instance",
".",
"plat... | Get OS name
@return OS name | [
"Get",
"OS",
"name"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/OSInfo.java#L108-L147 |
25,468 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/StormClientHandler.java | StormClientHandler.channelConnected | @Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent event) {
// register the newly established channel
Channel channel = event.getChannel();
LOG.info("connection established to :{}, local port:{}", client.getRemoteAddr(), channel.getLocalAddress());
c... | java | @Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent event) {
// register the newly established channel
Channel channel = event.getChannel();
LOG.info("connection established to :{}, local port:{}", client.getRemoteAddr(), channel.getLocalAddress());
c... | [
"@",
"Override",
"public",
"void",
"channelConnected",
"(",
"ChannelHandlerContext",
"ctx",
",",
"ChannelStateEvent",
"event",
")",
"{",
"// register the newly established channel",
"Channel",
"channel",
"=",
"event",
".",
"getChannel",
"(",
")",
";",
"LOG",
".",
"i... | Sometime when connecting to a bad channel which isn't writable, this method will be called | [
"Sometime",
"when",
"connecting",
"to",
"a",
"bad",
"channel",
"which",
"isn",
"t",
"writable",
"this",
"method",
"will",
"be",
"called"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/StormClientHandler.java#L53-L61 |
25,469 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/Supervisor.java | Supervisor.main | public static void main(String[] args) {
Thread.setDefaultUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler());
JStormServerUtils.startTaobaoJvmMonitor();
Supervisor instance = new Supervisor();
instance.run();
} | java | public static void main(String[] args) {
Thread.setDefaultUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler());
JStormServerUtils.startTaobaoJvmMonitor();
Supervisor instance = new Supervisor();
instance.run();
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"Thread",
".",
"setDefaultUncaughtExceptionHandler",
"(",
"new",
"DefaultUncaughtExceptionHandler",
"(",
")",
")",
";",
"JStormServerUtils",
".",
"startTaobaoJvmMonitor",
"(",
")",
";",... | start supervisor daemon | [
"start",
"supervisor",
"daemon"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/Supervisor.java#L236-L241 |
25,470 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/task/group/MkLocalShuffer.java | MkLocalShuffer.refreshLocalNodeTasks | private void refreshLocalNodeTasks() {
Set<Integer> localNodeTasks = workerData.getLocalNodeTasks();
if (localNodeTasks == null || localNodeTasks.equals(lastLocalNodeTasks)) {
return;
}
LOG.info("Old localNodeTasks:" + lastLocalNodeTasks + ", new:"
+ localNod... | java | private void refreshLocalNodeTasks() {
Set<Integer> localNodeTasks = workerData.getLocalNodeTasks();
if (localNodeTasks == null || localNodeTasks.equals(lastLocalNodeTasks)) {
return;
}
LOG.info("Old localNodeTasks:" + lastLocalNodeTasks + ", new:"
+ localNod... | [
"private",
"void",
"refreshLocalNodeTasks",
"(",
")",
"{",
"Set",
"<",
"Integer",
">",
"localNodeTasks",
"=",
"workerData",
".",
"getLocalNodeTasks",
"(",
")",
";",
"if",
"(",
"localNodeTasks",
"==",
"null",
"||",
"localNodeTasks",
".",
"equals",
"(",
"lastLoc... | Don't need to take care of multiple thread racing condition, one thread per task | [
"Don",
"t",
"need",
"to",
"take",
"care",
"of",
"multiple",
"thread",
"racing",
"condition",
"one",
"thread",
"per",
"task"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/task/group/MkLocalShuffer.java#L70-L92 |
25,471 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/metric/update/UpdateEvent.java | UpdateEvent.updateClusterMetrics | private void updateClusterMetrics(String topologyId, TopologyMetric tpMetric) {
if (tpMetric.get_topologyMetric().get_metrics_size() == 0) {
return;
}
MetricInfo topologyMetrics = tpMetric.get_topologyMetric();
// make a new MetricInfo to save the topologyId's metric
... | java | private void updateClusterMetrics(String topologyId, TopologyMetric tpMetric) {
if (tpMetric.get_topologyMetric().get_metrics_size() == 0) {
return;
}
MetricInfo topologyMetrics = tpMetric.get_topologyMetric();
// make a new MetricInfo to save the topologyId's metric
... | [
"private",
"void",
"updateClusterMetrics",
"(",
"String",
"topologyId",
",",
"TopologyMetric",
"tpMetric",
")",
"{",
"if",
"(",
"tpMetric",
".",
"get_topologyMetric",
"(",
")",
".",
"get_metrics_size",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"Metr... | update cluster metrics local cache | [
"update",
"cluster",
"metrics",
"local",
"cache"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/metric/update/UpdateEvent.java#L133-L166 |
25,472 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/Node.java | Node.freeAllSlots | public void freeAllSlots(Cluster cluster) {
if (!_isAlive) {
LOG.warn("Freeing all slots on a dead node {} ", _nodeId);
}
for (Entry<String, Set<WorkerSlot>> entry : _topIdToUsedSlots.entrySet()) {
cluster.freeSlots(entry.getValue());
if (_isAlive) {
... | java | public void freeAllSlots(Cluster cluster) {
if (!_isAlive) {
LOG.warn("Freeing all slots on a dead node {} ", _nodeId);
}
for (Entry<String, Set<WorkerSlot>> entry : _topIdToUsedSlots.entrySet()) {
cluster.freeSlots(entry.getValue());
if (_isAlive) {
... | [
"public",
"void",
"freeAllSlots",
"(",
"Cluster",
"cluster",
")",
"{",
"if",
"(",
"!",
"_isAlive",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"Freeing all slots on a dead node {} \"",
",",
"_nodeId",
")",
";",
"}",
"for",
"(",
"Entry",
"<",
"String",
",",
"Set",... | Free all slots on this node. This will update the Cluster too.
@param cluster the cluster to be updated | [
"Free",
"all",
"slots",
"on",
"this",
"node",
".",
"This",
"will",
"update",
"the",
"Cluster",
"too",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/Node.java#L154-L165 |
25,473 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/Node.java | Node.free | public void free(WorkerSlot ws, Cluster cluster, boolean forceFree) {
if (_freeSlots.contains(ws))
return;
boolean wasFound = false;
for (Entry<String, Set<WorkerSlot>> entry : _topIdToUsedSlots.entrySet()) {
Set<WorkerSlot> slots = entry.getValue();
if (slots... | java | public void free(WorkerSlot ws, Cluster cluster, boolean forceFree) {
if (_freeSlots.contains(ws))
return;
boolean wasFound = false;
for (Entry<String, Set<WorkerSlot>> entry : _topIdToUsedSlots.entrySet()) {
Set<WorkerSlot> slots = entry.getValue();
if (slots... | [
"public",
"void",
"free",
"(",
"WorkerSlot",
"ws",
",",
"Cluster",
"cluster",
",",
"boolean",
"forceFree",
")",
"{",
"if",
"(",
"_freeSlots",
".",
"contains",
"(",
"ws",
")",
")",
"return",
";",
"boolean",
"wasFound",
"=",
"false",
";",
"for",
"(",
"En... | Frees a single slot in this node
@param ws the slot to free
@param cluster the cluster to update | [
"Frees",
"a",
"single",
"slot",
"in",
"this",
"node"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/Node.java#L173-L196 |
25,474 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/Node.java | Node.freeTopology | public void freeTopology(String topId, Cluster cluster) {
Set<WorkerSlot> slots = _topIdToUsedSlots.get(topId);
if (slots == null || slots.isEmpty())
return;
for (WorkerSlot ws : slots) {
cluster.freeSlot(ws);
if (_isAlive) {
_freeSlots.add(ws)... | java | public void freeTopology(String topId, Cluster cluster) {
Set<WorkerSlot> slots = _topIdToUsedSlots.get(topId);
if (slots == null || slots.isEmpty())
return;
for (WorkerSlot ws : slots) {
cluster.freeSlot(ws);
if (_isAlive) {
_freeSlots.add(ws)... | [
"public",
"void",
"freeTopology",
"(",
"String",
"topId",
",",
"Cluster",
"cluster",
")",
"{",
"Set",
"<",
"WorkerSlot",
">",
"slots",
"=",
"_topIdToUsedSlots",
".",
"get",
"(",
"topId",
")",
";",
"if",
"(",
"slots",
"==",
"null",
"||",
"slots",
".",
"... | Frees all the slots for a topology.
@param topId the topology to free slots for
@param cluster the cluster to update | [
"Frees",
"all",
"the",
"slots",
"for",
"a",
"topology",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/Node.java#L204-L215 |
25,475 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/Node.java | Node.assign | public void assign(String topId, Collection<ExecutorDetails> executors, Cluster cluster) {
if (!_isAlive) {
throw new IllegalStateException("Trying to adding to a dead node " + _nodeId);
}
if (_freeSlots.isEmpty()) {
throw new IllegalStateException("Trying to assign to a ... | java | public void assign(String topId, Collection<ExecutorDetails> executors, Cluster cluster) {
if (!_isAlive) {
throw new IllegalStateException("Trying to adding to a dead node " + _nodeId);
}
if (_freeSlots.isEmpty()) {
throw new IllegalStateException("Trying to assign to a ... | [
"public",
"void",
"assign",
"(",
"String",
"topId",
",",
"Collection",
"<",
"ExecutorDetails",
">",
"executors",
",",
"Cluster",
"cluster",
")",
"{",
"if",
"(",
"!",
"_isAlive",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Trying to adding to a dea... | Assign a free slot on the node to the following topology and executors. This will update the cluster too.
@param topId the topology to assign a free slot to.
@param executors the executors to run in that slot.
@param cluster the cluster to be updated | [
"Assign",
"a",
"free",
"slot",
"on",
"the",
"node",
"to",
"the",
"following",
"topology",
"and",
"executors",
".",
"This",
"will",
"update",
"the",
"cluster",
"too",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/Node.java#L224-L238 |
25,476 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/StatefulWindowedBoltExecutor.java | StatefulWindowedBoltExecutor.updateStreamState | private void updateStreamState(Map<TaskStream, WindowState> state) {
for (Map.Entry<TaskStream, WindowState> entry : state.entrySet()) {
TaskStream taskStream = entry.getKey();
WindowState newState = entry.getValue();
WindowState curState = streamState.get(taskStream);
... | java | private void updateStreamState(Map<TaskStream, WindowState> state) {
for (Map.Entry<TaskStream, WindowState> entry : state.entrySet()) {
TaskStream taskStream = entry.getKey();
WindowState newState = entry.getValue();
WindowState curState = streamState.get(taskStream);
... | [
"private",
"void",
"updateStreamState",
"(",
"Map",
"<",
"TaskStream",
",",
"WindowState",
">",
"state",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"TaskStream",
",",
"WindowState",
">",
"entry",
":",
"state",
".",
"entrySet",
"(",
")",
")",
"{",
... | update streamState based on stateUpdates | [
"update",
"streamState",
"based",
"on",
"stateUpdates"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/StatefulWindowedBoltExecutor.java#L245-L259 |
25,477 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobSynchronizer.java | BlobSynchronizer.updateKeySetForBlobStore | private void updateKeySetForBlobStore(Set<String> keySetBlobStore, CuratorFramework zkClient) {
try {
for (String key : keySetBlobStore) {
LOG.debug("updating blob");
BlobStoreUtils.updateKeyForBlobStore(conf, blobStore, zkClient, key, nimbusInfo);
}
... | java | private void updateKeySetForBlobStore(Set<String> keySetBlobStore, CuratorFramework zkClient) {
try {
for (String key : keySetBlobStore) {
LOG.debug("updating blob");
BlobStoreUtils.updateKeyForBlobStore(conf, blobStore, zkClient, key, nimbusInfo);
}
... | [
"private",
"void",
"updateKeySetForBlobStore",
"(",
"Set",
"<",
"String",
">",
"keySetBlobStore",
",",
"CuratorFramework",
"zkClient",
")",
"{",
"try",
"{",
"for",
"(",
"String",
"key",
":",
"keySetBlobStore",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"updating bl... | Update current key list inside the blobstore if the version changes | [
"Update",
"current",
"key",
"list",
"inside",
"the",
"blobstore",
"if",
"the",
"version",
"changes"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobSynchronizer.java#L110-L119 |
25,478 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobSynchronizer.java | BlobSynchronizer.getKeySetToDownload | public Set<String> getKeySetToDownload(Set<String> blobStoreKeySet, Set<String> zookeeperKeySet) {
zookeeperKeySet.removeAll(blobStoreKeySet);
LOG.debug("Key list to download {}", zookeeperKeySet);
return zookeeperKeySet;
} | java | public Set<String> getKeySetToDownload(Set<String> blobStoreKeySet, Set<String> zookeeperKeySet) {
zookeeperKeySet.removeAll(blobStoreKeySet);
LOG.debug("Key list to download {}", zookeeperKeySet);
return zookeeperKeySet;
} | [
"public",
"Set",
"<",
"String",
">",
"getKeySetToDownload",
"(",
"Set",
"<",
"String",
">",
"blobStoreKeySet",
",",
"Set",
"<",
"String",
">",
"zookeeperKeySet",
")",
"{",
"zookeeperKeySet",
".",
"removeAll",
"(",
"blobStoreKeySet",
")",
";",
"LOG",
".",
"de... | Make a key list to download | [
"Make",
"a",
"key",
"list",
"to",
"download"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobSynchronizer.java#L122-L126 |
25,479 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/old/window/RollingWindow.java | RollingWindow.updateBatch | public void updateBatch(V batch) {
if (intervalCheck.check()) {
rolling();
}
synchronized (this) {
unflushed = updater.updateBatch(batch, unflushed);
}
} | java | public void updateBatch(V batch) {
if (intervalCheck.check()) {
rolling();
}
synchronized (this) {
unflushed = updater.updateBatch(batch, unflushed);
}
} | [
"public",
"void",
"updateBatch",
"(",
"V",
"batch",
")",
"{",
"if",
"(",
"intervalCheck",
".",
"check",
"(",
")",
")",
"{",
"rolling",
"(",
")",
";",
"}",
"synchronized",
"(",
"this",
")",
"{",
"unflushed",
"=",
"updater",
".",
"updateBatch",
"(",
"b... | In order to improve performance Flush one batch to rollingWindow | [
"In",
"order",
"to",
"improve",
"performance",
"Flush",
"one",
"batch",
"to",
"rollingWindow"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/old/window/RollingWindow.java#L89-L98 |
25,480 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/Worker.java | Worker.worker_output_tasks | public static Set<Integer> worker_output_tasks(WorkerData workerData) {
ContextMaker context_maker = workerData.getContextMaker();
Set<Integer> taskIds = workerData.getTaskIds();
StormTopology topology = workerData.getSysTopology();
Set<Integer> rtn = new HashSet<>();
for (Inte... | java | public static Set<Integer> worker_output_tasks(WorkerData workerData) {
ContextMaker context_maker = workerData.getContextMaker();
Set<Integer> taskIds = workerData.getTaskIds();
StormTopology topology = workerData.getSysTopology();
Set<Integer> rtn = new HashSet<>();
for (Inte... | [
"public",
"static",
"Set",
"<",
"Integer",
">",
"worker_output_tasks",
"(",
"WorkerData",
"workerData",
")",
"{",
"ContextMaker",
"context_maker",
"=",
"workerData",
".",
"getContextMaker",
"(",
")",
";",
"Set",
"<",
"Integer",
">",
"taskIds",
"=",
"workerData",... | get current task's output task list | [
"get",
"current",
"task",
"s",
"output",
"task",
"list"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/Worker.java#L74-L95 |
25,481 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/Worker.java | Worker.mk_worker | @SuppressWarnings("rawtypes")
public static WorkerShutdown mk_worker(Map conf, IContext context, String topologyId, String supervisorId,
int port, String workerId, String jarPath) throws Exception {
StringBuilder sb = new StringBuilder();
sb.append("topolog... | java | @SuppressWarnings("rawtypes")
public static WorkerShutdown mk_worker(Map conf, IContext context, String topologyId, String supervisorId,
int port, String workerId, String jarPath) throws Exception {
StringBuilder sb = new StringBuilder();
sb.append("topolog... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"WorkerShutdown",
"mk_worker",
"(",
"Map",
"conf",
",",
"IContext",
"context",
",",
"String",
"topologyId",
",",
"String",
"supervisorId",
",",
"int",
"port",
",",
"String",
"workerId",
",",
... | create worker instance and run it
@param conf storm conf
@param topologyId topology id
@param supervisorId supervisor iid
@param port worker port
@param workerId worker id
@return WorkerShutDown
@throws Exception | [
"create",
"worker",
"instance",
"and",
"run",
"it"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/Worker.java#L227-L241 |
25,482 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/Worker.java | Worker.getOldPortPids | public static List<Integer> getOldPortPids(String port) {
String currPid = JStormUtils.process_pid();
List<Integer> ret = new ArrayList<>();
StringBuilder sb = new StringBuilder();
sb.append("ps -Af ");
// sb.append(" | grep ");
// sb.append(Worker.class.getName());
... | java | public static List<Integer> getOldPortPids(String port) {
String currPid = JStormUtils.process_pid();
List<Integer> ret = new ArrayList<>();
StringBuilder sb = new StringBuilder();
sb.append("ps -Af ");
// sb.append(" | grep ");
// sb.append(Worker.class.getName());
... | [
"public",
"static",
"List",
"<",
"Integer",
">",
"getOldPortPids",
"(",
"String",
"port",
")",
"{",
"String",
"currPid",
"=",
"JStormUtils",
".",
"process_pid",
"(",
")",
";",
"List",
"<",
"Integer",
">",
"ret",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
... | Note that if the worker's start parameter length is longer than 4096,
ps -ef|grep com.alibaba.jstorm.daemon.worker.Worker can't find worker
@param port worker port | [
"Note",
"that",
"if",
"the",
"worker",
"s",
"start",
"parameter",
"length",
"is",
"longer",
"than",
"4096",
"ps",
"-",
"ef|grep",
"com",
".",
"alibaba",
".",
"jstorm",
".",
"daemon",
".",
"worker",
".",
"Worker",
"can",
"t",
"find",
"worker"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/Worker.java#L293-L385 |
25,483 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/AsmMetric.java | AsmMetric.sample | protected boolean sample() {
if (curr.increment() >= freq) {
curr.set(0);
target.set(rand.nextInt(freq));
}
return curr.get() == target.get();
} | java | protected boolean sample() {
if (curr.increment() >= freq) {
curr.set(0);
target.set(rand.nextInt(freq));
}
return curr.get() == target.get();
} | [
"protected",
"boolean",
"sample",
"(",
")",
"{",
"if",
"(",
"curr",
".",
"increment",
"(",
")",
">=",
"freq",
")",
"{",
"curr",
".",
"set",
"(",
"0",
")",
";",
"target",
".",
"set",
"(",
"rand",
".",
"nextInt",
"(",
"freq",
")",
")",
";",
"}",
... | a faster sampling way | [
"a",
"faster",
"sampling",
"way"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/AsmMetric.java#L90-L96 |
25,484 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/base/BaseStatefulWindowedBolt.java | BaseStatefulWindowedBolt.withMessageIdField | public BaseStatefulWindowedBolt<T> withMessageIdField(String fieldName) {
windowConfiguration.put(Config.TOPOLOGY_BOLTS_MESSAGE_ID_FIELD_NAME, fieldName);
return this;
} | java | public BaseStatefulWindowedBolt<T> withMessageIdField(String fieldName) {
windowConfiguration.put(Config.TOPOLOGY_BOLTS_MESSAGE_ID_FIELD_NAME, fieldName);
return this;
} | [
"public",
"BaseStatefulWindowedBolt",
"<",
"T",
">",
"withMessageIdField",
"(",
"String",
"fieldName",
")",
"{",
"windowConfiguration",
".",
"put",
"(",
"Config",
".",
"TOPOLOGY_BOLTS_MESSAGE_ID_FIELD_NAME",
",",
"fieldName",
")",
";",
"return",
"this",
";",
"}"
] | Specify the name of the field in the tuple that holds the message id. This is used to track
the windowing boundaries and re-evaluating the windowing operation during recovery of IStatefulWindowedBolt
@param fieldName the name of the field that contains the message id | [
"Specify",
"the",
"name",
"of",
"the",
"field",
"in",
"the",
"tuple",
"that",
"holds",
"the",
"message",
"id",
".",
"This",
"is",
"used",
"to",
"track",
"the",
"windowing",
"boundaries",
"and",
"re",
"-",
"evaluating",
"the",
"windowing",
"operation",
"dur... | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/base/BaseStatefulWindowedBolt.java#L131-L134 |
25,485 | aspnet/SignalR | clients/java/signalr/src/main/java/com/microsoft/signalr/Subscription.java | Subscription.unsubscribe | public void unsubscribe() {
List<InvocationHandler> handler = this.handlers.get(target);
if (handler != null) {
handler.remove(this.handler);
}
} | java | public void unsubscribe() {
List<InvocationHandler> handler = this.handlers.get(target);
if (handler != null) {
handler.remove(this.handler);
}
} | [
"public",
"void",
"unsubscribe",
"(",
")",
"{",
"List",
"<",
"InvocationHandler",
">",
"handler",
"=",
"this",
".",
"handlers",
".",
"get",
"(",
"target",
")",
";",
"if",
"(",
"handler",
"!=",
"null",
")",
"{",
"handler",
".",
"remove",
"(",
"this",
... | Removes the client method handler represented by this subscription. | [
"Removes",
"the",
"client",
"method",
"handler",
"represented",
"by",
"this",
"subscription",
"."
] | 8c6ed160d84f58ce8edf06a1c74221ddc8983ee9 | https://github.com/aspnet/SignalR/blob/8c6ed160d84f58ce8edf06a1c74221ddc8983ee9/clients/java/signalr/src/main/java/com/microsoft/signalr/Subscription.java#L25-L30 |
25,486 | getsentry/sentry-java | sentry/src/main/java/io/sentry/connection/RandomEventSampler.java | RandomEventSampler.shouldSendEvent | @Override
public boolean shouldSendEvent(Event event) {
double randomDouble = random.nextDouble();
return sampleRate >= Math.abs(randomDouble);
} | java | @Override
public boolean shouldSendEvent(Event event) {
double randomDouble = random.nextDouble();
return sampleRate >= Math.abs(randomDouble);
} | [
"@",
"Override",
"public",
"boolean",
"shouldSendEvent",
"(",
"Event",
"event",
")",
"{",
"double",
"randomDouble",
"=",
"random",
".",
"nextDouble",
"(",
")",
";",
"return",
"sampleRate",
">=",
"Math",
".",
"abs",
"(",
"randomDouble",
")",
";",
"}"
] | Handles event sampling logic.
@param event Event to be checked against the sampling logic.
@return True if the event should be sent to the server, else False. | [
"Handles",
"event",
"sampling",
"logic",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/connection/RandomEventSampler.java#L45-L49 |
25,487 | getsentry/sentry-java | sentry/src/main/java/io/sentry/util/Util.java | Util.parseMdcTags | public static Set<String> parseMdcTags(String mdcTagsString) {
if (isNullOrEmpty(mdcTagsString)) {
return Collections.emptySet();
}
return new HashSet<>(Arrays.asList(mdcTagsString.split(",")));
} | java | public static Set<String> parseMdcTags(String mdcTagsString) {
if (isNullOrEmpty(mdcTagsString)) {
return Collections.emptySet();
}
return new HashSet<>(Arrays.asList(mdcTagsString.split(",")));
} | [
"public",
"static",
"Set",
"<",
"String",
">",
"parseMdcTags",
"(",
"String",
"mdcTagsString",
")",
"{",
"if",
"(",
"isNullOrEmpty",
"(",
"mdcTagsString",
")",
")",
"{",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"}",
"return",
"new",
"HashSe... | Parses the provided Strings into a Set of Strings.
@param mdcTagsString comma-delimited tags
@return Set of Strings representing mdc tags | [
"Parses",
"the",
"provided",
"Strings",
"into",
"a",
"Set",
"of",
"Strings",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/util/Util.java#L85-L91 |
25,488 | getsentry/sentry-java | sentry/src/main/java/io/sentry/util/Util.java | Util.trimString | public static String trimString(String string, int maxMessageLength) {
if (string == null) {
return null;
} else if (string.length() > maxMessageLength) {
// CHECKSTYLE.OFF: MagicNumber
return string.substring(0, maxMessageLength - 3) + "...";
// CHECKSTYL... | java | public static String trimString(String string, int maxMessageLength) {
if (string == null) {
return null;
} else if (string.length() > maxMessageLength) {
// CHECKSTYLE.OFF: MagicNumber
return string.substring(0, maxMessageLength - 3) + "...";
// CHECKSTYL... | [
"public",
"static",
"String",
"trimString",
"(",
"String",
"string",
",",
"int",
"maxMessageLength",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"string",
".",
"length",
"(",
")",
">",
"maxMessa... | Trims a String, ensuring that the maximum length isn't reached.
@param string string to trim
@param maxMessageLength maximum length of the string
@return trimmed string | [
"Trims",
"a",
"String",
"ensuring",
"that",
"the",
"maximum",
"length",
"isn",
"t",
"reached",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/util/Util.java#L146-L156 |
25,489 | getsentry/sentry-java | sentry/src/main/java/io/sentry/util/Util.java | Util.safelyRemoveShutdownHook | public static boolean safelyRemoveShutdownHook(Thread shutDownHook) {
try {
return Runtime.getRuntime().removeShutdownHook(shutDownHook);
} catch (IllegalStateException e) {
// CHECKSTYLE.OFF: EmptyBlock
if (e.getMessage().equals("Shutdown in progress")) {
... | java | public static boolean safelyRemoveShutdownHook(Thread shutDownHook) {
try {
return Runtime.getRuntime().removeShutdownHook(shutDownHook);
} catch (IllegalStateException e) {
// CHECKSTYLE.OFF: EmptyBlock
if (e.getMessage().equals("Shutdown in progress")) {
... | [
"public",
"static",
"boolean",
"safelyRemoveShutdownHook",
"(",
"Thread",
"shutDownHook",
")",
"{",
"try",
"{",
"return",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"removeShutdownHook",
"(",
"shutDownHook",
")",
";",
"}",
"catch",
"(",
"IllegalStateException",
... | Try to remove the shutDownHook, handling the case where the VM is in shutdown process.
@param shutDownHook the shutDownHook to remove
@return true if the hook was removed, false otherwise | [
"Try",
"to",
"remove",
"the",
"shutDownHook",
"handling",
"the",
"case",
"where",
"the",
"VM",
"is",
"in",
"shutdown",
"process",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/util/Util.java#L163-L176 |
25,490 | getsentry/sentry-java | sentry/src/main/java/io/sentry/time/FixedClock.java | FixedClock.tick | public void tick(long duration, TimeUnit unit) {
this.date = new Date(date.getTime() + unit.toMillis(duration));
} | java | public void tick(long duration, TimeUnit unit) {
this.date = new Date(date.getTime() + unit.toMillis(duration));
} | [
"public",
"void",
"tick",
"(",
"long",
"duration",
",",
"TimeUnit",
"unit",
")",
"{",
"this",
".",
"date",
"=",
"new",
"Date",
"(",
"date",
".",
"getTime",
"(",
")",
"+",
"unit",
".",
"toMillis",
"(",
"duration",
")",
")",
";",
"}"
] | Adjust the FixedClock by the given amount.
@param duration Duration of time to adjust the clock by.
@param unit Unit of time to adjust the clock by. | [
"Adjust",
"the",
"FixedClock",
"by",
"the",
"given",
"amount",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/time/FixedClock.java#L42-L44 |
25,491 | getsentry/sentry-java | sentry/src/main/java/io/sentry/event/UserBuilder.java | UserBuilder.withData | public UserBuilder withData(String name, Object value) {
if (this.data == null) {
this.data = new HashMap<>();
}
this.data.put(name, value);
return this;
} | java | public UserBuilder withData(String name, Object value) {
if (this.data == null) {
this.data = new HashMap<>();
}
this.data.put(name, value);
return this;
} | [
"public",
"UserBuilder",
"withData",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"this",
".",
"data",
"==",
"null",
")",
"{",
"this",
".",
"data",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"}",
"this",
".",
"data",
".",
... | Adds to the extra data for the user.
@param name Name of the data
@param value Value of the data
@return current instance of UserBuilder | [
"Adds",
"to",
"the",
"extra",
"data",
"for",
"the",
"user",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/event/UserBuilder.java#L78-L85 |
25,492 | getsentry/sentry-java | sentry/src/main/java/io/sentry/config/JndiLookup.java | JndiLookup.jndiLookup | public static String jndiLookup(String key) {
String value = null;
try {
Context c = new InitialContext();
value = (String) c.lookup(JNDI_PREFIX + key);
} catch (NoInitialContextException e) {
logger.trace("JNDI not configured for Sentry (NoInitialContextEx)")... | java | public static String jndiLookup(String key) {
String value = null;
try {
Context c = new InitialContext();
value = (String) c.lookup(JNDI_PREFIX + key);
} catch (NoInitialContextException e) {
logger.trace("JNDI not configured for Sentry (NoInitialContextEx)")... | [
"public",
"static",
"String",
"jndiLookup",
"(",
"String",
"key",
")",
"{",
"String",
"value",
"=",
"null",
";",
"try",
"{",
"Context",
"c",
"=",
"new",
"InitialContext",
"(",
")",
";",
"value",
"=",
"(",
"String",
")",
"c",
".",
"lookup",
"(",
"JNDI... | Looks up for a JNDI definition of the provided key.
@param key name of configuration key, e.g. "dsn"
@return the value as defined in JNDI or null if it isn't defined. | [
"Looks",
"up",
"for",
"a",
"JNDI",
"definition",
"of",
"the",
"provided",
"key",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/config/JndiLookup.java#L31-L44 |
25,493 | getsentry/sentry-java | sentry/src/main/java/io/sentry/jul/SentryHandler.java | SentryHandler.retrieveProperties | protected void retrieveProperties() {
LogManager manager = LogManager.getLogManager();
String className = SentryHandler.class.getName();
setPrintfStyle(Boolean.valueOf(manager.getProperty(className + ".printfStyle")));
setLevel(parseLevelOrDefault(manager.getProperty(className + ".level"... | java | protected void retrieveProperties() {
LogManager manager = LogManager.getLogManager();
String className = SentryHandler.class.getName();
setPrintfStyle(Boolean.valueOf(manager.getProperty(className + ".printfStyle")));
setLevel(parseLevelOrDefault(manager.getProperty(className + ".level"... | [
"protected",
"void",
"retrieveProperties",
"(",
")",
"{",
"LogManager",
"manager",
"=",
"LogManager",
".",
"getLogManager",
"(",
")",
";",
"String",
"className",
"=",
"SentryHandler",
".",
"class",
".",
"getName",
"(",
")",
";",
"setPrintfStyle",
"(",
"Boolean... | Retrieves the properties of the logger. | [
"Retrieves",
"the",
"properties",
"of",
"the",
"logger",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/jul/SentryHandler.java#L80-L85 |
25,494 | getsentry/sentry-java | sentry/src/main/java/io/sentry/jul/SentryHandler.java | SentryHandler.createEventBuilder | protected EventBuilder createEventBuilder(LogRecord record) {
EventBuilder eventBuilder = new EventBuilder()
.withSdkIntegration("java.util.logging")
.withLevel(getLevel(record.getLevel()))
.withTimestamp(new Date(record.getMillis()))
.withLogger(record.getLoggerN... | java | protected EventBuilder createEventBuilder(LogRecord record) {
EventBuilder eventBuilder = new EventBuilder()
.withSdkIntegration("java.util.logging")
.withLevel(getLevel(record.getLevel()))
.withTimestamp(new Date(record.getMillis()))
.withLogger(record.getLoggerN... | [
"protected",
"EventBuilder",
"createEventBuilder",
"(",
"LogRecord",
"record",
")",
"{",
"EventBuilder",
"eventBuilder",
"=",
"new",
"EventBuilder",
"(",
")",
".",
"withSdkIntegration",
"(",
"\"java.util.logging\"",
")",
".",
"withLevel",
"(",
"getLevel",
"(",
"reco... | Builds an EventBuilder based on the log record.
@param record Log generated.
@return EventBuilder containing details provided by the logging system. | [
"Builds",
"an",
"EventBuilder",
"based",
"on",
"the",
"log",
"record",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/jul/SentryHandler.java#L119-L167 |
25,495 | getsentry/sentry-java | sentry/src/main/java/io/sentry/jul/SentryHandler.java | SentryHandler.formatMessage | protected String formatMessage(String message, Object[] parameters) {
String formatted;
if (printfStyle) {
formatted = String.format(message, parameters);
} else {
formatted = MessageFormat.format(message, parameters);
}
return formatted;
} | java | protected String formatMessage(String message, Object[] parameters) {
String formatted;
if (printfStyle) {
formatted = String.format(message, parameters);
} else {
formatted = MessageFormat.format(message, parameters);
}
return formatted;
} | [
"protected",
"String",
"formatMessage",
"(",
"String",
"message",
",",
"Object",
"[",
"]",
"parameters",
")",
"{",
"String",
"formatted",
";",
"if",
"(",
"printfStyle",
")",
"{",
"formatted",
"=",
"String",
".",
"format",
"(",
"message",
",",
"parameters",
... | Returns formatted Event message when provided the message template and
parameters.
@param message Message template body.
@param parameters Array of parameters for the message.
@return Formatted message. | [
"Returns",
"formatted",
"Event",
"message",
"when",
"provided",
"the",
"message",
"template",
"and",
"parameters",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/jul/SentryHandler.java#L177-L185 |
25,496 | getsentry/sentry-java | sentry-android/src/main/java/io/sentry/android/event/helper/AndroidEventBuilderHelper.java | AndroidEventBuilderHelper.getPackageInfo | protected static PackageInfo getPackageInfo(Context ctx) {
try {
return ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Error getting package info.", e);
return null;
}
} | java | protected static PackageInfo getPackageInfo(Context ctx) {
try {
return ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Error getting package info.", e);
return null;
}
} | [
"protected",
"static",
"PackageInfo",
"getPackageInfo",
"(",
"Context",
"ctx",
")",
"{",
"try",
"{",
"return",
"ctx",
".",
"getPackageManager",
"(",
")",
".",
"getPackageInfo",
"(",
"ctx",
".",
"getPackageName",
"(",
")",
",",
"0",
")",
";",
"}",
"catch",
... | Return the Application's PackageInfo if possible, or null.
@param ctx Android application context
@return the Application's PackageInfo if possible, or null | [
"Return",
"the",
"Application",
"s",
"PackageInfo",
"if",
"possible",
"or",
"null",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry-android/src/main/java/io/sentry/android/event/helper/AndroidEventBuilderHelper.java#L186-L193 |
25,497 | getsentry/sentry-java | sentry-android/src/main/java/io/sentry/android/event/helper/AndroidEventBuilderHelper.java | AndroidEventBuilderHelper.getFamily | protected static String getFamily() {
try {
return Build.MODEL.split(" ")[0];
} catch (Exception e) {
Log.e(TAG, "Error getting device family.", e);
return null;
}
} | java | protected static String getFamily() {
try {
return Build.MODEL.split(" ")[0];
} catch (Exception e) {
Log.e(TAG, "Error getting device family.", e);
return null;
}
} | [
"protected",
"static",
"String",
"getFamily",
"(",
")",
"{",
"try",
"{",
"return",
"Build",
".",
"MODEL",
".",
"split",
"(",
"\" \"",
")",
"[",
"0",
"]",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"Log",
".",
"e",
"(",
"TAG",
",",
"\"Err... | Fake the device family by using the first word in the Build.MODEL. Works
well in most cases... "Nexus 6P" -> "Nexus", "Galaxy S7" -> "Galaxy".
@return family name of the device, as best we can tell | [
"Fake",
"the",
"device",
"family",
"by",
"using",
"the",
"first",
"word",
"in",
"the",
"Build",
".",
"MODEL",
".",
"Works",
"well",
"in",
"most",
"cases",
"...",
"Nexus",
"6P",
"-",
">",
"Nexus",
"Galaxy",
"S7",
"-",
">",
"Galaxy",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry-android/src/main/java/io/sentry/android/event/helper/AndroidEventBuilderHelper.java#L201-L208 |
25,498 | getsentry/sentry-java | sentry-android/src/main/java/io/sentry/android/event/helper/AndroidEventBuilderHelper.java | AndroidEventBuilderHelper.getMemInfo | protected static ActivityManager.MemoryInfo getMemInfo(Context ctx) {
try {
ActivityManager actManager = (ActivityManager) ctx.getSystemService(ACTIVITY_SERVICE);
ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
actManager.getMemoryInfo(memInfo);
... | java | protected static ActivityManager.MemoryInfo getMemInfo(Context ctx) {
try {
ActivityManager actManager = (ActivityManager) ctx.getSystemService(ACTIVITY_SERVICE);
ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
actManager.getMemoryInfo(memInfo);
... | [
"protected",
"static",
"ActivityManager",
".",
"MemoryInfo",
"getMemInfo",
"(",
"Context",
"ctx",
")",
"{",
"try",
"{",
"ActivityManager",
"actManager",
"=",
"(",
"ActivityManager",
")",
"ctx",
".",
"getSystemService",
"(",
"ACTIVITY_SERVICE",
")",
";",
"ActivityM... | Get MemoryInfo object representing the memory state of the application.
@param ctx Android application context
@return MemoryInfo object representing the memory state of the application | [
"Get",
"MemoryInfo",
"object",
"representing",
"the",
"memory",
"state",
"of",
"the",
"application",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry-android/src/main/java/io/sentry/android/event/helper/AndroidEventBuilderHelper.java#L237-L247 |
25,499 | getsentry/sentry-java | sentry-android/src/main/java/io/sentry/android/event/helper/AndroidEventBuilderHelper.java | AndroidEventBuilderHelper.getOrientation | protected static String getOrientation(Context ctx) {
try {
String o;
switch (ctx.getResources().getConfiguration().orientation) {
case android.content.res.Configuration.ORIENTATION_LANDSCAPE:
o = "landscape";
break;
... | java | protected static String getOrientation(Context ctx) {
try {
String o;
switch (ctx.getResources().getConfiguration().orientation) {
case android.content.res.Configuration.ORIENTATION_LANDSCAPE:
o = "landscape";
break;
... | [
"protected",
"static",
"String",
"getOrientation",
"(",
"Context",
"ctx",
")",
"{",
"try",
"{",
"String",
"o",
";",
"switch",
"(",
"ctx",
".",
"getResources",
"(",
")",
".",
"getConfiguration",
"(",
")",
".",
"orientation",
")",
"{",
"case",
"android",
"... | Get the device's current screen orientation.
@param ctx Android application context
@return the device's current screen orientation, or null if unknown | [
"Get",
"the",
"device",
"s",
"current",
"screen",
"orientation",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry-android/src/main/java/io/sentry/android/event/helper/AndroidEventBuilderHelper.java#L255-L274 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.