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,200 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java | ServiceHandler.activate | @Override
public void activate(String topologyName) throws TException {
try {
NimbusUtils.transitionName(data, topologyName, true, StatusType.activate);
notifyTopologyActionListener(topologyName, "activate");
} catch (NotAliveException e) {
String errMsg = "Activa... | java | @Override
public void activate(String topologyName) throws TException {
try {
NimbusUtils.transitionName(data, topologyName, true, StatusType.activate);
notifyTopologyActionListener(topologyName, "activate");
} catch (NotAliveException e) {
String errMsg = "Activa... | [
"@",
"Override",
"public",
"void",
"activate",
"(",
"String",
"topologyName",
")",
"throws",
"TException",
"{",
"try",
"{",
"NimbusUtils",
".",
"transitionName",
"(",
"data",
",",
"topologyName",
",",
"true",
",",
"StatusType",
".",
"activate",
")",
";",
"no... | set topology status as active | [
"set",
"topology",
"status",
"as",
"active"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java#L422-L436 |
25,201 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java | ServiceHandler.rebalance | @Override
public void rebalance(String topologyName, RebalanceOptions options) throws TException {
try {
checkTopologyActive(data, topologyName, true);
Integer wait_amt = null;
String jsonConf = null;
Boolean reassign = false;
if (options != null) ... | java | @Override
public void rebalance(String topologyName, RebalanceOptions options) throws TException {
try {
checkTopologyActive(data, topologyName, true);
Integer wait_amt = null;
String jsonConf = null;
Boolean reassign = false;
if (options != null) ... | [
"@",
"Override",
"public",
"void",
"rebalance",
"(",
"String",
"topologyName",
",",
"RebalanceOptions",
"options",
")",
"throws",
"TException",
"{",
"try",
"{",
"checkTopologyActive",
"(",
"data",
",",
"topologyName",
",",
"true",
")",
";",
"Integer",
"wait_amt"... | rebalance a topology
@param topologyName topology name
@param options RebalanceOptions | [
"rebalance",
"a",
"topology"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java#L463-L497 |
25,202 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java | ServiceHandler.beginFileUpload | @Override
public String beginFileUpload() throws TException {
String fileLoc = null;
try {
String path;
String key = UUID.randomUUID().toString();
path = StormConfig.masterInbox(conf) + "/" + key;
FileUtils.forceMkdir(new File(path));
FileU... | java | @Override
public String beginFileUpload() throws TException {
String fileLoc = null;
try {
String path;
String key = UUID.randomUUID().toString();
path = StormConfig.masterInbox(conf) + "/" + key;
FileUtils.forceMkdir(new File(path));
FileU... | [
"@",
"Override",
"public",
"String",
"beginFileUpload",
"(",
")",
"throws",
"TException",
"{",
"String",
"fileLoc",
"=",
"null",
";",
"try",
"{",
"String",
"path",
";",
"String",
"key",
"=",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",... | prepare to upload topology jar, return the file location | [
"prepare",
"to",
"upload",
"topology",
"jar",
"return",
"the",
"file",
"location"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java#L625-L646 |
25,203 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java | ServiceHandler.uploadChunk | @Override
public void uploadChunk(String location, ByteBuffer chunk) throws TException {
TimeCacheMap<Object, Object> uploaders = data.getUploaders();
Object obj = uploaders.get(location);
if (obj == null) {
throw new TException("File for that location does not exist (or timed ou... | java | @Override
public void uploadChunk(String location, ByteBuffer chunk) throws TException {
TimeCacheMap<Object, Object> uploaders = data.getUploaders();
Object obj = uploaders.get(location);
if (obj == null) {
throw new TException("File for that location does not exist (or timed ou... | [
"@",
"Override",
"public",
"void",
"uploadChunk",
"(",
"String",
"location",
",",
"ByteBuffer",
"chunk",
")",
"throws",
"TException",
"{",
"TimeCacheMap",
"<",
"Object",
",",
"Object",
">",
"uploaders",
"=",
"data",
".",
"getUploaders",
"(",
")",
";",
"Objec... | upload topology jar data | [
"upload",
"topology",
"jar",
"data"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java#L651-L672 |
25,204 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java | ServiceHandler.getClusterInfo | @Override
public ClusterSummary getClusterInfo() throws TException {
long start = System.nanoTime();
try {
StormClusterState stormClusterState = data.getStormClusterState();
Map<String, Assignment> assignments = new HashMap<>();
// get TopologySummary
... | java | @Override
public ClusterSummary getClusterInfo() throws TException {
long start = System.nanoTime();
try {
StormClusterState stormClusterState = data.getStormClusterState();
Map<String, Assignment> assignments = new HashMap<>();
// get TopologySummary
... | [
"@",
"Override",
"public",
"ClusterSummary",
"getClusterInfo",
"(",
")",
"throws",
"TException",
"{",
"long",
"start",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"try",
"{",
"StormClusterState",
"stormClusterState",
"=",
"data",
".",
"getStormClusterState",
... | get cluster's summary, it will contain SupervisorSummary and TopologySummary
@return ClusterSummary | [
"get",
"cluster",
"s",
"summary",
"it",
"will",
"contain",
"SupervisorSummary",
"and",
"TopologySummary"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java#L951-L981 |
25,205 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java | ServiceHandler.getTopologyConf | @Override
public String getTopologyConf(String id) throws TException {
String rtn;
try {
Map<Object, Object> topologyConf = StormConfig.read_nimbus_topology_conf(id, data.getBlobStore());
rtn = JStormUtils.to_json(topologyConf);
} catch (IOException e) {
L... | java | @Override
public String getTopologyConf(String id) throws TException {
String rtn;
try {
Map<Object, Object> topologyConf = StormConfig.read_nimbus_topology_conf(id, data.getBlobStore());
rtn = JStormUtils.to_json(topologyConf);
} catch (IOException e) {
L... | [
"@",
"Override",
"public",
"String",
"getTopologyConf",
"(",
"String",
"id",
")",
"throws",
"TException",
"{",
"String",
"rtn",
";",
"try",
"{",
"Map",
"<",
"Object",
",",
"Object",
">",
"topologyConf",
"=",
"StormConfig",
".",
"read_nimbus_topology_conf",
"("... | get topology configuration
@param id String: topology id
@return String | [
"get",
"topology",
"configuration"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java#L1399-L1410 |
25,206 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java | ServiceHandler.getTopology | @Override
public StormTopology getTopology(String id) throws TException {
StormTopology topology;
try {
StormTopology stormtopology = StormConfig.read_nimbus_topology_code(id, data.getBlobStore());
if (stormtopology == null) {
throw new NotAliveException("No t... | java | @Override
public StormTopology getTopology(String id) throws TException {
StormTopology topology;
try {
StormTopology stormtopology = StormConfig.read_nimbus_topology_code(id, data.getBlobStore());
if (stormtopology == null) {
throw new NotAliveException("No t... | [
"@",
"Override",
"public",
"StormTopology",
"getTopology",
"(",
"String",
"id",
")",
"throws",
"TException",
"{",
"StormTopology",
"topology",
";",
"try",
"{",
"StormTopology",
"stormtopology",
"=",
"StormConfig",
".",
"read_nimbus_topology_code",
"(",
"id",
",",
... | get StormTopology throw deserialize local files
@param id String: topology id
@return StormTopology | [
"get",
"StormTopology",
"throw",
"deserialize",
"local",
"files"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java#L1438-L1454 |
25,207 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java | ServiceHandler.checkTopologyActive | public void checkTopologyActive(NimbusData nimbus, String topologyName, boolean bActive) throws Exception {
if (isTopologyActive(nimbus.getStormClusterState(), topologyName) != bActive) {
if (bActive) {
throw new NotAliveException(topologyName + " is not alive");
} else {... | java | public void checkTopologyActive(NimbusData nimbus, String topologyName, boolean bActive) throws Exception {
if (isTopologyActive(nimbus.getStormClusterState(), topologyName) != bActive) {
if (bActive) {
throw new NotAliveException(topologyName + " is not alive");
} else {... | [
"public",
"void",
"checkTopologyActive",
"(",
"NimbusData",
"nimbus",
",",
"String",
"topologyName",
",",
"boolean",
"bActive",
")",
"throws",
"Exception",
"{",
"if",
"(",
"isTopologyActive",
"(",
"nimbus",
".",
"getStormClusterState",
"(",
")",
",",
"topologyName... | check whether the topology is bActive?
@throws Exception | [
"check",
"whether",
"the",
"topology",
"is",
"bActive?"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java#L1476-L1484 |
25,208 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java | ServiceHandler.isTopologyActive | public boolean isTopologyActive(StormClusterState stormClusterState, String topologyName) throws Exception {
boolean rtn = false;
if (Cluster.get_topology_id(stormClusterState, topologyName) != null) {
rtn = true;
}
return rtn;
} | java | public boolean isTopologyActive(StormClusterState stormClusterState, String topologyName) throws Exception {
boolean rtn = false;
if (Cluster.get_topology_id(stormClusterState, topologyName) != null) {
rtn = true;
}
return rtn;
} | [
"public",
"boolean",
"isTopologyActive",
"(",
"StormClusterState",
"stormClusterState",
",",
"String",
"topologyName",
")",
"throws",
"Exception",
"{",
"boolean",
"rtn",
"=",
"false",
";",
"if",
"(",
"Cluster",
".",
"get_topology_id",
"(",
"stormClusterState",
",",
... | whether the topology is active by topology name
@param stormClusterState see Cluster_clj
@param topologyName topology name
@return boolean if the storm is active, return true, otherwise return false | [
"whether",
"the",
"topology",
"is",
"active",
"by",
"topology",
"name"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java#L1493-L1499 |
25,209 | alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/common/HdfsUtils.java | HdfsUtils.listFilesByModificationTime | public static ArrayList<Path> listFilesByModificationTime(FileSystem fs, Path directory, long olderThan)
throws IOException {
ArrayList<LocatedFileStatus> fstats = new ArrayList<>();
RemoteIterator<LocatedFileStatus> itr = fs.listFiles(directory, false);
while( itr.hasNext() ) {
LocatedFile... | java | public static ArrayList<Path> listFilesByModificationTime(FileSystem fs, Path directory, long olderThan)
throws IOException {
ArrayList<LocatedFileStatus> fstats = new ArrayList<>();
RemoteIterator<LocatedFileStatus> itr = fs.listFiles(directory, false);
while( itr.hasNext() ) {
LocatedFile... | [
"public",
"static",
"ArrayList",
"<",
"Path",
">",
"listFilesByModificationTime",
"(",
"FileSystem",
"fs",
",",
"Path",
"directory",
",",
"long",
"olderThan",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"LocatedFileStatus",
">",
"fstats",
"=",
"new",
"A... | list files sorted by modification time that have not been modified since 'olderThan'. if
'olderThan' is <= 0 then the filtering is disabled | [
"list",
"files",
"sorted",
"by",
"modification",
"time",
"that",
"have",
"not",
"been",
"modified",
"since",
"olderThan",
".",
"if",
"olderThan",
"is",
"<",
"=",
"0",
"then",
"the",
"filtering",
"is",
"disabled"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/common/HdfsUtils.java#L38-L60 |
25,210 | alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/common/HdfsUtils.java | HdfsUtils.tryCreateFile | public static FSDataOutputStream tryCreateFile(FileSystem fs, Path file) throws IOException {
try {
FSDataOutputStream os = fs.create(file, false);
return os;
} catch (FileAlreadyExistsException e) {
return null;
} catch (RemoteException e) {
if( e.unwrapRemoteException() instanceof ... | java | public static FSDataOutputStream tryCreateFile(FileSystem fs, Path file) throws IOException {
try {
FSDataOutputStream os = fs.create(file, false);
return os;
} catch (FileAlreadyExistsException e) {
return null;
} catch (RemoteException e) {
if( e.unwrapRemoteException() instanceof ... | [
"public",
"static",
"FSDataOutputStream",
"tryCreateFile",
"(",
"FileSystem",
"fs",
",",
"Path",
"file",
")",
"throws",
"IOException",
"{",
"try",
"{",
"FSDataOutputStream",
"os",
"=",
"fs",
".",
"create",
"(",
"file",
",",
"false",
")",
";",
"return",
"os",... | Returns null if file already exists. throws if there was unexpected problem | [
"Returns",
"null",
"if",
"file",
"already",
"exists",
".",
"throws",
"if",
"there",
"was",
"unexpected",
"problem"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/common/HdfsUtils.java#L65-L78 |
25,211 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/transactional/TransactionTopologyBuilder.java | TransactionTopologyBuilder.setSpoutWithAck | public SpoutDeclarer setSpoutWithAck(String id, IRichSpout spout, Number parallelismHint) {
return setSpout(id, new AckTransactionSpout(spout), parallelismHint);
} | java | public SpoutDeclarer setSpoutWithAck(String id, IRichSpout spout, Number parallelismHint) {
return setSpout(id, new AckTransactionSpout(spout), parallelismHint);
} | [
"public",
"SpoutDeclarer",
"setSpoutWithAck",
"(",
"String",
"id",
",",
"IRichSpout",
"spout",
",",
"Number",
"parallelismHint",
")",
"{",
"return",
"setSpout",
"(",
"id",
",",
"new",
"AckTransactionSpout",
"(",
"spout",
")",
",",
"parallelismHint",
")",
";",
... | Build spout to provide the compatibility with Storm's ack mechanism
@param id spout Id
@param spout
@return | [
"Build",
"spout",
"to",
"provide",
"the",
"compatibility",
"with",
"Storm",
"s",
"ack",
"mechanism"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/transactional/TransactionTopologyBuilder.java#L117-L119 |
25,212 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/transactional/TransactionTopologyBuilder.java | TransactionTopologyBuilder.setBoltWithAck | public BoltDeclarer setBoltWithAck(String id, IRichBolt bolt, Number parallelismHint) {
return setBolt(id, new AckTransactionBolt(bolt), parallelismHint);
} | java | public BoltDeclarer setBoltWithAck(String id, IRichBolt bolt, Number parallelismHint) {
return setBolt(id, new AckTransactionBolt(bolt), parallelismHint);
} | [
"public",
"BoltDeclarer",
"setBoltWithAck",
"(",
"String",
"id",
",",
"IRichBolt",
"bolt",
",",
"Number",
"parallelismHint",
")",
"{",
"return",
"setBolt",
"(",
"id",
",",
"new",
"AckTransactionBolt",
"(",
"bolt",
")",
",",
"parallelismHint",
")",
";",
"}"
] | Build bolt to provide the compatibility with Storm's ack mechanism
@param id bolt Id
@param bolt
@return | [
"Build",
"bolt",
"to",
"provide",
"the",
"compatibility",
"with",
"Storm",
"s",
"ack",
"mechanism"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/transactional/TransactionTopologyBuilder.java#L181-L183 |
25,213 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/NettyContext.java | NettyContext.prepare | @SuppressWarnings("rawtypes")
public void prepare(Map stormConf) {
this.stormConf = stormConf;
int maxWorkers = Utils.getInt(stormConf.get(Config.STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS));
ThreadFactory bossFactory = new NettyRenameThreadFactory(MetricDef.NETTY_CLI + "boss");
Th... | java | @SuppressWarnings("rawtypes")
public void prepare(Map stormConf) {
this.stormConf = stormConf;
int maxWorkers = Utils.getInt(stormConf.get(Config.STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS));
ThreadFactory bossFactory = new NettyRenameThreadFactory(MetricDef.NETTY_CLI + "boss");
Th... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"void",
"prepare",
"(",
"Map",
"stormConf",
")",
"{",
"this",
".",
"stormConf",
"=",
"stormConf",
";",
"int",
"maxWorkers",
"=",
"Utils",
".",
"getInt",
"(",
"stormConf",
".",
"get",
"(",
"Config... | initialization per Storm configuration | [
"initialization",
"per",
"Storm",
"configuration"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/NettyContext.java#L55-L73 |
25,214 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/SchedulerAssignmentImpl.java | SchedulerAssignmentImpl.assign | public void assign(WorkerSlot slot, Collection<ExecutorDetails> executors) {
for (ExecutorDetails executor : executors) {
this.executorToSlot.put(executor, slot);
}
} | java | public void assign(WorkerSlot slot, Collection<ExecutorDetails> executors) {
for (ExecutorDetails executor : executors) {
this.executorToSlot.put(executor, slot);
}
} | [
"public",
"void",
"assign",
"(",
"WorkerSlot",
"slot",
",",
"Collection",
"<",
"ExecutorDetails",
">",
"executors",
")",
"{",
"for",
"(",
"ExecutorDetails",
"executor",
":",
"executors",
")",
"{",
"this",
".",
"executorToSlot",
".",
"put",
"(",
"executor",
"... | Assign the slot to executors. | [
"Assign",
"the",
"slot",
"to",
"executors",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/SchedulerAssignmentImpl.java#L55-L59 |
25,215 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/SchedulerAssignmentImpl.java | SchedulerAssignmentImpl.unassignBySlot | public void unassignBySlot(WorkerSlot slot) {
List<ExecutorDetails> executors = new ArrayList<>();
for (ExecutorDetails executor : this.executorToSlot.keySet()) {
WorkerSlot ws = this.executorToSlot.get(executor);
if (ws.equals(slot)) {
executors.add(executor);
... | java | public void unassignBySlot(WorkerSlot slot) {
List<ExecutorDetails> executors = new ArrayList<>();
for (ExecutorDetails executor : this.executorToSlot.keySet()) {
WorkerSlot ws = this.executorToSlot.get(executor);
if (ws.equals(slot)) {
executors.add(executor);
... | [
"public",
"void",
"unassignBySlot",
"(",
"WorkerSlot",
"slot",
")",
"{",
"List",
"<",
"ExecutorDetails",
">",
"executors",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"ExecutorDetails",
"executor",
":",
"this",
".",
"executorToSlot",
".",
"keyS... | Release the slot occupied by this assignment. | [
"Release",
"the",
"slot",
"occupied",
"by",
"this",
"assignment",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/SchedulerAssignmentImpl.java#L64-L77 |
25,216 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/windowing/WatermarkCountTriggerPolicy.java | WatermarkCountTriggerPolicy.handleWaterMarkEvent | private void handleWaterMarkEvent(Event<T> waterMarkEvent) {
long watermarkTs = waterMarkEvent.getTimestamp();
List<Long> eventTs = windowManager.getSlidingCountTimestamps(lastProcessedTs, watermarkTs, count);
for (long ts : eventTs) {
evictionPolicy.setContext(ts);
handl... | java | private void handleWaterMarkEvent(Event<T> waterMarkEvent) {
long watermarkTs = waterMarkEvent.getTimestamp();
List<Long> eventTs = windowManager.getSlidingCountTimestamps(lastProcessedTs, watermarkTs, count);
for (long ts : eventTs) {
evictionPolicy.setContext(ts);
handl... | [
"private",
"void",
"handleWaterMarkEvent",
"(",
"Event",
"<",
"T",
">",
"waterMarkEvent",
")",
"{",
"long",
"watermarkTs",
"=",
"waterMarkEvent",
".",
"getTimestamp",
"(",
")",
";",
"List",
"<",
"Long",
">",
"eventTs",
"=",
"windowManager",
".",
"getSlidingCou... | Triggers all the pending windows up to the waterMarkEvent timestamp
based on the sliding interval count.
@param waterMarkEvent the watermark event | [
"Triggers",
"all",
"the",
"pending",
"windows",
"up",
"to",
"the",
"waterMarkEvent",
"timestamp",
"based",
"on",
"the",
"sliding",
"interval",
"count",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/windowing/WatermarkCountTriggerPolicy.java#L73-L81 |
25,217 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/SimpleTransportPlugin.java | SimpleTransportPlugin.connect | @Override
public TTransport connect(TTransport transport, String serverHost, String asUser) throws TTransportException {
int maxBufferSize = type.getMaxBufferSize(storm_conf);
// create a framed transport
TTransport conn = new TFramedTransport(transport, maxBufferSize);
// connect
... | java | @Override
public TTransport connect(TTransport transport, String serverHost, String asUser) throws TTransportException {
int maxBufferSize = type.getMaxBufferSize(storm_conf);
// create a framed transport
TTransport conn = new TFramedTransport(transport, maxBufferSize);
// connect
... | [
"@",
"Override",
"public",
"TTransport",
"connect",
"(",
"TTransport",
"transport",
",",
"String",
"serverHost",
",",
"String",
"asUser",
")",
"throws",
"TTransportException",
"{",
"int",
"maxBufferSize",
"=",
"type",
".",
"getMaxBufferSize",
"(",
"storm_conf",
")... | Connect to the specified server via framed transport
@param transport The underlying Thrift transport.
@param serverHost unused.
@param asUser unused. | [
"Connect",
"to",
"the",
"specified",
"server",
"via",
"framed",
"transport"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/SimpleTransportPlugin.java#L95-L106 |
25,218 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/utils/JStormSignalHandler.java | JStormSignalHandler.registerSignal | public synchronized void registerSignal(int signalNumber, Runnable callback, boolean replace) {
String signalName = signalMap.get(signalNumber);
if (signalName == null) {
LOG.warn("Invalid signalNumber " + signalNumber);
return;
}
LOG.info("Begin to register sign... | java | public synchronized void registerSignal(int signalNumber, Runnable callback, boolean replace) {
String signalName = signalMap.get(signalNumber);
if (signalName == null) {
LOG.warn("Invalid signalNumber " + signalNumber);
return;
}
LOG.info("Begin to register sign... | [
"public",
"synchronized",
"void",
"registerSignal",
"(",
"int",
"signalNumber",
",",
"Runnable",
"callback",
",",
"boolean",
"replace",
")",
"{",
"String",
"signalName",
"=",
"signalMap",
".",
"get",
"(",
"signalNumber",
")",
";",
"if",
"(",
"signalName",
"=="... | Register signal to system
if callback is null, then the current process will ignore this signal | [
"Register",
"signal",
"to",
"system",
"if",
"callback",
"is",
"null",
"then",
"the",
"current",
"process",
"will",
"ignore",
"this",
"signal"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/JStormSignalHandler.java#L111-L138 |
25,219 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/task/comm/TaskSendTargets.java | TaskSendTargets.get | public List<Integer> get(Integer out_task_id, String stream, List<Object> tuple,
Collection<Tuple> anchors, Object root_id) {
// in order to improve acker's performance, skip checking
// String target_component =
// topologyContext.getComponentId(out_task_id);
... | java | public List<Integer> get(Integer out_task_id, String stream, List<Object> tuple,
Collection<Tuple> anchors, Object root_id) {
// in order to improve acker's performance, skip checking
// String target_component =
// topologyContext.getComponentId(out_task_id);
... | [
"public",
"List",
"<",
"Integer",
">",
"get",
"(",
"Integer",
"out_task_id",
",",
"String",
"stream",
",",
"List",
"<",
"Object",
">",
"tuple",
",",
"Collection",
"<",
"Tuple",
">",
"anchors",
",",
"Object",
"root_id",
")",
"{",
"// in order to improve acker... | direct send tuple to special task | [
"direct",
"send",
"tuple",
"to",
"special",
"task"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/task/comm/TaskSendTargets.java#L71-L95 |
25,220 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/task/comm/TaskSendTargets.java | TaskSendTargets.get | public List<Integer> get(String stream, List<Object> tuple, Collection<Tuple> anchors, Object rootId) {
List<Integer> outTasks = new ArrayList<>();
// get grouper, then get which task should tuple be sent to.
Map<String, MkGrouper> componentCrouping = streamComponentGrouper.get(stream);
... | java | public List<Integer> get(String stream, List<Object> tuple, Collection<Tuple> anchors, Object rootId) {
List<Integer> outTasks = new ArrayList<>();
// get grouper, then get which task should tuple be sent to.
Map<String, MkGrouper> componentCrouping = streamComponentGrouper.get(stream);
... | [
"public",
"List",
"<",
"Integer",
">",
"get",
"(",
"String",
"stream",
",",
"List",
"<",
"Object",
">",
"tuple",
",",
"Collection",
"<",
"Tuple",
">",
"anchors",
",",
"Object",
"rootId",
")",
"{",
"List",
"<",
"Integer",
">",
"outTasks",
"=",
"new",
... | send tuple according to grouping | [
"send",
"tuple",
"according",
"to",
"grouping"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/task/comm/TaskSendTargets.java#L98-L128 |
25,221 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetrics.java | JStormMetrics.find | public static AsmMetric find(String name) {
for (AsmMetricRegistry registry : allRegistries) {
AsmMetric metric = registry.getMetric(name);
if (metric != null) {
return metric;
}
}
return null;
} | java | public static AsmMetric find(String name) {
for (AsmMetricRegistry registry : allRegistries) {
AsmMetric metric = registry.getMetric(name);
if (metric != null) {
return metric;
}
}
return null;
} | [
"public",
"static",
"AsmMetric",
"find",
"(",
"String",
"name",
")",
"{",
"for",
"(",
"AsmMetricRegistry",
"registry",
":",
"allRegistries",
")",
"{",
"AsmMetric",
"metric",
"=",
"registry",
".",
"getMetric",
"(",
"name",
")",
";",
"if",
"(",
"metric",
"!=... | reserve for debug purposes | [
"reserve",
"for",
"debug",
"purposes"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetrics.java#L169-L177 |
25,222 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetrics.java | JStormMetrics.registerWorkerHistogram | public static AsmHistogram registerWorkerHistogram(String topologyId, String name, AsmHistogram histogram) {
return (AsmHistogram) registerWorkerMetric(
MetricUtils.workerMetricName(topologyId, host, 0, name, MetricType.HISTOGRAM), histogram);
} | java | public static AsmHistogram registerWorkerHistogram(String topologyId, String name, AsmHistogram histogram) {
return (AsmHistogram) registerWorkerMetric(
MetricUtils.workerMetricName(topologyId, host, 0, name, MetricType.HISTOGRAM), histogram);
} | [
"public",
"static",
"AsmHistogram",
"registerWorkerHistogram",
"(",
"String",
"topologyId",
",",
"String",
"name",
",",
"AsmHistogram",
"histogram",
")",
"{",
"return",
"(",
"AsmHistogram",
")",
"registerWorkerMetric",
"(",
"MetricUtils",
".",
"workerMetricName",
"(",... | simplified helper method to register a worker histogram
@param topologyId topology id
@param name metric name, NOTE it's not a full-qualified name.
@param histogram histogram
@return registered histogram | [
"simplified",
"helper",
"method",
"to",
"register",
"a",
"worker",
"histogram"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetrics.java#L309-L312 |
25,223 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetrics.java | JStormMetrics.registerWorkerGauge | public static AsmGauge registerWorkerGauge(String topologyId, String name, AsmGauge gauge) {
return (AsmGauge) registerWorkerMetric(
MetricUtils.workerMetricName(topologyId, host, 0, name, MetricType.GAUGE), gauge);
} | java | public static AsmGauge registerWorkerGauge(String topologyId, String name, AsmGauge gauge) {
return (AsmGauge) registerWorkerMetric(
MetricUtils.workerMetricName(topologyId, host, 0, name, MetricType.GAUGE), gauge);
} | [
"public",
"static",
"AsmGauge",
"registerWorkerGauge",
"(",
"String",
"topologyId",
",",
"String",
"name",
",",
"AsmGauge",
"gauge",
")",
"{",
"return",
"(",
"AsmGauge",
")",
"registerWorkerMetric",
"(",
"MetricUtils",
".",
"workerMetricName",
"(",
"topologyId",
"... | simplified helper method to register a worker gauge | [
"simplified",
"helper",
"method",
"to",
"register",
"a",
"worker",
"gauge"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetrics.java#L317-L320 |
25,224 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetrics.java | JStormMetrics.registerWorkerMeter | public static AsmMeter registerWorkerMeter(String topologyId, String name, AsmMeter meter) {
return (AsmMeter) registerWorkerMetric(
MetricUtils.workerMetricName(topologyId, host, 0, name, MetricType.METER), meter);
} | java | public static AsmMeter registerWorkerMeter(String topologyId, String name, AsmMeter meter) {
return (AsmMeter) registerWorkerMetric(
MetricUtils.workerMetricName(topologyId, host, 0, name, MetricType.METER), meter);
} | [
"public",
"static",
"AsmMeter",
"registerWorkerMeter",
"(",
"String",
"topologyId",
",",
"String",
"name",
",",
"AsmMeter",
"meter",
")",
"{",
"return",
"(",
"AsmMeter",
")",
"registerWorkerMetric",
"(",
"MetricUtils",
".",
"workerMetricName",
"(",
"topologyId",
"... | simplified helper method to register a worker meter | [
"simplified",
"helper",
"method",
"to",
"register",
"a",
"worker",
"meter"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetrics.java#L325-L328 |
25,225 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetrics.java | JStormMetrics.registerWorkerCounter | public static AsmCounter registerWorkerCounter(String topologyId, String name, AsmCounter counter) {
return (AsmCounter) registerWorkerMetric(
MetricUtils.workerMetricName(topologyId, host, 0, name, MetricType.COUNTER), counter);
} | java | public static AsmCounter registerWorkerCounter(String topologyId, String name, AsmCounter counter) {
return (AsmCounter) registerWorkerMetric(
MetricUtils.workerMetricName(topologyId, host, 0, name, MetricType.COUNTER), counter);
} | [
"public",
"static",
"AsmCounter",
"registerWorkerCounter",
"(",
"String",
"topologyId",
",",
"String",
"name",
",",
"AsmCounter",
"counter",
")",
"{",
"return",
"(",
"AsmCounter",
")",
"registerWorkerMetric",
"(",
"MetricUtils",
".",
"workerMetricName",
"(",
"topolo... | simplified helper method to register a worker counter | [
"simplified",
"helper",
"method",
"to",
"register",
"a",
"worker",
"counter"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/JStormMetrics.java#L333-L336 |
25,226 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/ProcessSimulator.java | ProcessSimulator.killProcess | public static void killProcess(String pid) {
synchronized (lock) {
LOG.info("Begin to kill process " + pid);
WorkerShutdown shutdownHandle = getProcessHandle(pid);
if (shutdownHandle != null) {
shutdownHandle.shutdown();
}
processMap... | java | public static void killProcess(String pid) {
synchronized (lock) {
LOG.info("Begin to kill process " + pid);
WorkerShutdown shutdownHandle = getProcessHandle(pid);
if (shutdownHandle != null) {
shutdownHandle.shutdown();
}
processMap... | [
"public",
"static",
"void",
"killProcess",
"(",
"String",
"pid",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Begin to kill process \"",
"+",
"pid",
")",
";",
"WorkerShutdown",
"shutdownHandle",
"=",
"getProcessHandle",
"(",
"pi... | Kill a process
@param pid process id | [
"Kill",
"a",
"process"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/ProcessSimulator.java#L68-L82 |
25,227 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/kerberos/AutoTGT.java | AutoTGT.loginHadoopUser | private void loginHadoopUser(Subject subject) {
Class<?> ugi = null;
try {
ugi = Class.forName("org.apache.hadoop.security.UserGroupInformation");
} catch (ClassNotFoundException e) {
LOG.info("Hadoop was not found on the class path");
return;
}
... | java | private void loginHadoopUser(Subject subject) {
Class<?> ugi = null;
try {
ugi = Class.forName("org.apache.hadoop.security.UserGroupInformation");
} catch (ClassNotFoundException e) {
LOG.info("Hadoop was not found on the class path");
return;
}
... | [
"private",
"void",
"loginHadoopUser",
"(",
"Subject",
"subject",
")",
"{",
"Class",
"<",
"?",
">",
"ugi",
"=",
"null",
";",
"try",
"{",
"ugi",
"=",
"Class",
".",
"forName",
"(",
"\"org.apache.hadoop.security.UserGroupInformation\"",
")",
";",
"}",
"catch",
"... | Hadoop does not just go off of a TGT, it needs a bit more. This should fill in the rest.
@param subject the subject that should have a TGT in it. | [
"Hadoop",
"does",
"not",
"just",
"go",
"off",
"of",
"a",
"TGT",
"it",
"needs",
"a",
"bit",
"more",
".",
"This",
"should",
"fill",
"in",
"the",
"rest",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/kerberos/AutoTGT.java#L186-L242 |
25,228 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/UpdateListener.java | UpdateListener.update | public void update(Map conf) {
for (IUpdater updater : updaters) {
try {
updater.update(conf);
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}
}
} | java | public void update(Map conf) {
for (IUpdater updater : updaters) {
try {
updater.update(conf);
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}
}
} | [
"public",
"void",
"update",
"(",
"Map",
"conf",
")",
"{",
"for",
"(",
"IUpdater",
"updater",
":",
"updaters",
")",
"{",
"try",
"{",
"updater",
".",
"update",
"(",
"conf",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"LOG",
".",
"error",... | trigger all updaters' update action
@param conf the new worker conf | [
"trigger",
"all",
"updaters",
"update",
"action"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/UpdateListener.java#L56-L64 |
25,229 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java | MetricUtils.stream2taskName | public static String stream2taskName(String old) {
String[] parts = old.split(DELIM);
if (parts.length >= 7) {
parts[0] = MetaType.TASK.getV() + parts[0].charAt(1);
parts[parts.length - 3] = EMPTY;
String metricName = getMergeMetricName(parts[parts.length - 1]);
... | java | public static String stream2taskName(String old) {
String[] parts = old.split(DELIM);
if (parts.length >= 7) {
parts[0] = MetaType.TASK.getV() + parts[0].charAt(1);
parts[parts.length - 3] = EMPTY;
String metricName = getMergeMetricName(parts[parts.length - 1]);
... | [
"public",
"static",
"String",
"stream2taskName",
"(",
"String",
"old",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"old",
".",
"split",
"(",
"DELIM",
")",
";",
"if",
"(",
"parts",
".",
"length",
">=",
"7",
")",
"{",
"parts",
"[",
"0",
"]",
"=",
"... | make streamId empty, remain other parts the same | [
"make",
"streamId",
"empty",
"remain",
"other",
"parts",
"the",
"same"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java#L152-L162 |
25,230 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java | MetricUtils.task2compName | public static String task2compName(String old) {
String[] parts = old.split(DELIM);
if (parts.length >= 7) {
parts[0] = MetaType.COMPONENT.getV() + parts[0].charAt(1);
parts[parts.length - 3] = EMPTY;
parts[parts.length - 4] = "0";
}
return concat(part... | java | public static String task2compName(String old) {
String[] parts = old.split(DELIM);
if (parts.length >= 7) {
parts[0] = MetaType.COMPONENT.getV() + parts[0].charAt(1);
parts[parts.length - 3] = EMPTY;
parts[parts.length - 4] = "0";
}
return concat(part... | [
"public",
"static",
"String",
"task2compName",
"(",
"String",
"old",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"old",
".",
"split",
"(",
"DELIM",
")",
";",
"if",
"(",
"parts",
".",
"length",
">=",
"7",
")",
"{",
"parts",
"[",
"0",
"]",
"=",
"Me... | make taskId=0 and streamId empty. | [
"make",
"taskId",
"=",
"0",
"and",
"streamId",
"empty",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java#L167-L175 |
25,231 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java | MetricUtils.stream2compStreamName | public static String stream2compStreamName(String old) {
String[] parts = old.split(DELIM);
if (parts.length >= 7) {
parts[0] = MetaType.COMPONENT_STREAM.getV() + parts[0].charAt(1);
//parts[parts.length - 3] = EMPTY; retain stream name
parts[parts.length - 4] = "0"; ... | java | public static String stream2compStreamName(String old) {
String[] parts = old.split(DELIM);
if (parts.length >= 7) {
parts[0] = MetaType.COMPONENT_STREAM.getV() + parts[0].charAt(1);
//parts[parts.length - 3] = EMPTY; retain stream name
parts[parts.length - 4] = "0"; ... | [
"public",
"static",
"String",
"stream2compStreamName",
"(",
"String",
"old",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"old",
".",
"split",
"(",
"DELIM",
")",
";",
"if",
"(",
"parts",
".",
"length",
">=",
"7",
")",
"{",
"parts",
"[",
"0",
"]",
"=... | converts a task metric name to a component-level stream metric name | [
"converts",
"a",
"task",
"metric",
"name",
"to",
"a",
"component",
"-",
"level",
"stream",
"metric",
"name"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java#L180-L189 |
25,232 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java | MetricUtils.task2MergeCompName | public static String task2MergeCompName(String old) {
String[] parts = old.split(DELIM);
if (parts.length >= 7) {
parts[0] = MetaType.COMPONENT.getV() + parts[0].charAt(1);
parts[parts.length - 3] = EMPTY;
parts[parts.length - 4] = "0";
String metricName ... | java | public static String task2MergeCompName(String old) {
String[] parts = old.split(DELIM);
if (parts.length >= 7) {
parts[0] = MetaType.COMPONENT.getV() + parts[0].charAt(1);
parts[parts.length - 3] = EMPTY;
parts[parts.length - 4] = "0";
String metricName ... | [
"public",
"static",
"String",
"task2MergeCompName",
"(",
"String",
"old",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"old",
".",
"split",
"(",
"DELIM",
")",
";",
"if",
"(",
"parts",
".",
"length",
">=",
"7",
")",
"{",
"parts",
"[",
"0",
"]",
"=",
... | make taskId=0 and streamId empty and metricName remain the string after `.`. | [
"make",
"taskId",
"=",
"0",
"and",
"streamId",
"empty",
"and",
"metricName",
"remain",
"the",
"string",
"after",
".",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java#L194-L205 |
25,233 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java | MetricUtils.comp2topologyName | public static String comp2topologyName(String old) {
String[] parts = old.split(DELIM);
parts[0] = MetaType.TOPOLOGY.getV() + parts[0].charAt(1);
// type + topologyId + comp + task + group + name
return concat(parts[0], parts[1], EMPTY, "0", parts[5], parts[6]);
} | java | public static String comp2topologyName(String old) {
String[] parts = old.split(DELIM);
parts[0] = MetaType.TOPOLOGY.getV() + parts[0].charAt(1);
// type + topologyId + comp + task + group + name
return concat(parts[0], parts[1], EMPTY, "0", parts[5], parts[6]);
} | [
"public",
"static",
"String",
"comp2topologyName",
"(",
"String",
"old",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"old",
".",
"split",
"(",
"DELIM",
")",
";",
"parts",
"[",
"0",
"]",
"=",
"MetaType",
".",
"TOPOLOGY",
".",
"getV",
"(",
")",
"+",
... | change component metric name to topology metric name | [
"change",
"component",
"metric",
"name",
"to",
"topology",
"metric",
"name"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java#L218-L223 |
25,234 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java | AuthUtils.GetConfiguration | public static Configuration GetConfiguration(Map storm_conf) {
Configuration login_conf = null;
// find login file configuration from Storm configuration
String loginConfigurationFile = (String) storm_conf.get("java.security.auth.login.config");
if ((loginConfigurationFile != null) && (... | java | public static Configuration GetConfiguration(Map storm_conf) {
Configuration login_conf = null;
// find login file configuration from Storm configuration
String loginConfigurationFile = (String) storm_conf.get("java.security.auth.login.config");
if ((loginConfigurationFile != null) && (... | [
"public",
"static",
"Configuration",
"GetConfiguration",
"(",
"Map",
"storm_conf",
")",
"{",
"Configuration",
"login_conf",
"=",
"null",
";",
"// find login file configuration from Storm configuration",
"String",
"loginConfigurationFile",
"=",
"(",
"String",
")",
"storm_con... | Construct a JAAS configuration object per storm configuration file
@param storm_conf Storm configuration
@return JAAS configuration object | [
"Construct",
"a",
"JAAS",
"configuration",
"object",
"per",
"storm",
"configuration",
"file"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java#L52-L71 |
25,235 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java | AuthUtils.GetPrincipalToLocalPlugin | public static IPrincipalToLocal GetPrincipalToLocalPlugin(Map storm_conf) {
IPrincipalToLocal ptol = null;
try {
String ptol_klassName = (String) storm_conf.get(Config.STORM_PRINCIPAL_TO_LOCAL_PLUGIN);
Class klass = Class.forName(ptol_klassName);
ptol = (IPrincipalToL... | java | public static IPrincipalToLocal GetPrincipalToLocalPlugin(Map storm_conf) {
IPrincipalToLocal ptol = null;
try {
String ptol_klassName = (String) storm_conf.get(Config.STORM_PRINCIPAL_TO_LOCAL_PLUGIN);
Class klass = Class.forName(ptol_klassName);
ptol = (IPrincipalToL... | [
"public",
"static",
"IPrincipalToLocal",
"GetPrincipalToLocalPlugin",
"(",
"Map",
"storm_conf",
")",
"{",
"IPrincipalToLocal",
"ptol",
"=",
"null",
";",
"try",
"{",
"String",
"ptol_klassName",
"=",
"(",
"String",
")",
"storm_conf",
".",
"get",
"(",
"Config",
"."... | Construct a principal to local plugin
@param conf storm configuration
@return the plugin | [
"Construct",
"a",
"principal",
"to",
"local",
"plugin"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java#L79-L90 |
25,236 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java | AuthUtils.GetGroupMappingServiceProviderPlugin | public static IGroupMappingServiceProvider GetGroupMappingServiceProviderPlugin(Map storm_conf) {
IGroupMappingServiceProvider gmsp = null;
try {
String gmsp_klassName = (String) storm_conf.get(Config.STORM_GROUP_MAPPING_SERVICE_PROVIDER_PLUGIN);
Class klass = Class.forName(gmsp_... | java | public static IGroupMappingServiceProvider GetGroupMappingServiceProviderPlugin(Map storm_conf) {
IGroupMappingServiceProvider gmsp = null;
try {
String gmsp_klassName = (String) storm_conf.get(Config.STORM_GROUP_MAPPING_SERVICE_PROVIDER_PLUGIN);
Class klass = Class.forName(gmsp_... | [
"public",
"static",
"IGroupMappingServiceProvider",
"GetGroupMappingServiceProviderPlugin",
"(",
"Map",
"storm_conf",
")",
"{",
"IGroupMappingServiceProvider",
"gmsp",
"=",
"null",
";",
"try",
"{",
"String",
"gmsp_klassName",
"=",
"(",
"String",
")",
"storm_conf",
".",
... | Construct a group mapping service provider plugin
@param conf storm configuration
@return the plugin | [
"Construct",
"a",
"group",
"mapping",
"service",
"provider",
"plugin"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java#L98-L109 |
25,237 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java | AuthUtils.GetCredentialRenewers | public static Collection<ICredentialsRenewer> GetCredentialRenewers(Map conf) {
try {
Set<ICredentialsRenewer> ret = new HashSet<ICredentialsRenewer>();
Collection<String> clazzes = (Collection<String>) conf.get(Config.NIMBUS_CREDENTIAL_RENEWERS);
if (clazzes != null) {
... | java | public static Collection<ICredentialsRenewer> GetCredentialRenewers(Map conf) {
try {
Set<ICredentialsRenewer> ret = new HashSet<ICredentialsRenewer>();
Collection<String> clazzes = (Collection<String>) conf.get(Config.NIMBUS_CREDENTIAL_RENEWERS);
if (clazzes != null) {
... | [
"public",
"static",
"Collection",
"<",
"ICredentialsRenewer",
">",
"GetCredentialRenewers",
"(",
"Map",
"conf",
")",
"{",
"try",
"{",
"Set",
"<",
"ICredentialsRenewer",
">",
"ret",
"=",
"new",
"HashSet",
"<",
"ICredentialsRenewer",
">",
"(",
")",
";",
"Collect... | Get all of the configured Credential Renwer Plugins.
@param storm_conf the storm configuration to use.
@return the configured credential renewers. | [
"Get",
"all",
"of",
"the",
"configured",
"Credential",
"Renwer",
"Plugins",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java#L117-L132 |
25,238 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java | AuthUtils.getNimbusAutoCredPlugins | public static Collection<INimbusCredentialPlugin> getNimbusAutoCredPlugins(Map conf) {
try {
Set<INimbusCredentialPlugin> ret = new HashSet<INimbusCredentialPlugin>();
Collection<String> clazzes = (Collection<String>) conf.get(Config.NIMBUS_AUTO_CRED_PLUGINS);
if (clazzes != ... | java | public static Collection<INimbusCredentialPlugin> getNimbusAutoCredPlugins(Map conf) {
try {
Set<INimbusCredentialPlugin> ret = new HashSet<INimbusCredentialPlugin>();
Collection<String> clazzes = (Collection<String>) conf.get(Config.NIMBUS_AUTO_CRED_PLUGINS);
if (clazzes != ... | [
"public",
"static",
"Collection",
"<",
"INimbusCredentialPlugin",
">",
"getNimbusAutoCredPlugins",
"(",
"Map",
"conf",
")",
"{",
"try",
"{",
"Set",
"<",
"INimbusCredentialPlugin",
">",
"ret",
"=",
"new",
"HashSet",
"<",
"INimbusCredentialPlugin",
">",
"(",
")",
... | Get all the Nimbus Auto cred plugins.
@param conf nimbus configuration to use.
@return nimbus auto credential plugins. | [
"Get",
"all",
"the",
"Nimbus",
"Auto",
"cred",
"plugins",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java#L140-L155 |
25,239 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java | AuthUtils.GetAutoCredentials | public static Collection<IAutoCredentials> GetAutoCredentials(Map storm_conf) {
try {
Set<IAutoCredentials> autos = new HashSet<IAutoCredentials>();
Collection<String> clazzes = (Collection<String>) storm_conf.get(Config.TOPOLOGY_AUTO_CREDENTIALS);
if (clazzes != null) {
... | java | public static Collection<IAutoCredentials> GetAutoCredentials(Map storm_conf) {
try {
Set<IAutoCredentials> autos = new HashSet<IAutoCredentials>();
Collection<String> clazzes = (Collection<String>) storm_conf.get(Config.TOPOLOGY_AUTO_CREDENTIALS);
if (clazzes != null) {
... | [
"public",
"static",
"Collection",
"<",
"IAutoCredentials",
">",
"GetAutoCredentials",
"(",
"Map",
"storm_conf",
")",
"{",
"try",
"{",
"Set",
"<",
"IAutoCredentials",
">",
"autos",
"=",
"new",
"HashSet",
"<",
"IAutoCredentials",
">",
"(",
")",
";",
"Collection"... | Get all of the configured AutoCredential Plugins.
@param storm_conf the storm configuration to use.
@return the configured auto credentials. | [
"Get",
"all",
"of",
"the",
"configured",
"AutoCredential",
"Plugins",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java#L163-L179 |
25,240 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java | AuthUtils.populateSubject | public static Subject populateSubject(Subject subject, Collection<IAutoCredentials> autos, Map<String, String> credentials) {
try {
if (subject == null) {
subject = new Subject();
}
for (IAutoCredentials autoCred : autos) {
autoCred.populateSub... | java | public static Subject populateSubject(Subject subject, Collection<IAutoCredentials> autos, Map<String, String> credentials) {
try {
if (subject == null) {
subject = new Subject();
}
for (IAutoCredentials autoCred : autos) {
autoCred.populateSub... | [
"public",
"static",
"Subject",
"populateSubject",
"(",
"Subject",
"subject",
",",
"Collection",
"<",
"IAutoCredentials",
">",
"autos",
",",
"Map",
"<",
"String",
",",
"String",
">",
"credentials",
")",
"{",
"try",
"{",
"if",
"(",
"subject",
"==",
"null",
"... | Populate a subject from credentials using the IAutoCredentials.
@param subject the subject to populate or null if a new Subject should be created.
@param autos the IAutoCredentials to call to populate the subject.
@param credentials the credentials to pull from
@return the populated subject. | [
"Populate",
"a",
"subject",
"from",
"credentials",
"using",
"the",
"IAutoCredentials",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java#L189-L201 |
25,241 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java | AuthUtils.GetTransportPlugin | public static ITransportPlugin GetTransportPlugin(ThriftConnectionType type, Map storm_conf, Configuration login_conf) {
ITransportPlugin transportPlugin = null;
try {
String transport_plugin_klassName = type.getTransportPlugin(storm_conf);
Class klass = Class.forName(transport_p... | java | public static ITransportPlugin GetTransportPlugin(ThriftConnectionType type, Map storm_conf, Configuration login_conf) {
ITransportPlugin transportPlugin = null;
try {
String transport_plugin_klassName = type.getTransportPlugin(storm_conf);
Class klass = Class.forName(transport_p... | [
"public",
"static",
"ITransportPlugin",
"GetTransportPlugin",
"(",
"ThriftConnectionType",
"type",
",",
"Map",
"storm_conf",
",",
"Configuration",
"login_conf",
")",
"{",
"ITransportPlugin",
"transportPlugin",
"=",
"null",
";",
"try",
"{",
"String",
"transport_plugin_kl... | Construct a transport plugin per storm configuration
@param conf storm configuration
@return | [
"Construct",
"a",
"transport",
"plugin",
"per",
"storm",
"configuration"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java#L230-L241 |
25,242 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java | AuthUtils.GetUiHttpCredentialsPlugin | public static IHttpCredentialsPlugin GetUiHttpCredentialsPlugin(Map conf) {
String klassName = (String) conf.get(Config.UI_HTTP_CREDS_PLUGIN);
return AuthUtils.GetHttpCredentialsPlugin(conf, klassName);
} | java | public static IHttpCredentialsPlugin GetUiHttpCredentialsPlugin(Map conf) {
String klassName = (String) conf.get(Config.UI_HTTP_CREDS_PLUGIN);
return AuthUtils.GetHttpCredentialsPlugin(conf, klassName);
} | [
"public",
"static",
"IHttpCredentialsPlugin",
"GetUiHttpCredentialsPlugin",
"(",
"Map",
"conf",
")",
"{",
"String",
"klassName",
"=",
"(",
"String",
")",
"conf",
".",
"get",
"(",
"Config",
".",
"UI_HTTP_CREDS_PLUGIN",
")",
";",
"return",
"AuthUtils",
".",
"GetHt... | Construct an HttpServletRequest credential plugin specified by the UI storm configuration
@param conf storm configuration
@return the plugin | [
"Construct",
"an",
"HttpServletRequest",
"credential",
"plugin",
"specified",
"by",
"the",
"UI",
"storm",
"configuration"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java#L261-L264 |
25,243 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java | AuthUtils.GetDrpcHttpCredentialsPlugin | public static IHttpCredentialsPlugin GetDrpcHttpCredentialsPlugin(Map conf) {
String klassName = (String) conf.get(Config.DRPC_HTTP_CREDS_PLUGIN);
return AuthUtils.GetHttpCredentialsPlugin(conf, klassName);
} | java | public static IHttpCredentialsPlugin GetDrpcHttpCredentialsPlugin(Map conf) {
String klassName = (String) conf.get(Config.DRPC_HTTP_CREDS_PLUGIN);
return AuthUtils.GetHttpCredentialsPlugin(conf, klassName);
} | [
"public",
"static",
"IHttpCredentialsPlugin",
"GetDrpcHttpCredentialsPlugin",
"(",
"Map",
"conf",
")",
"{",
"String",
"klassName",
"=",
"(",
"String",
")",
"conf",
".",
"get",
"(",
"Config",
".",
"DRPC_HTTP_CREDS_PLUGIN",
")",
";",
"return",
"AuthUtils",
".",
"G... | Construct an HttpServletRequest credential plugin specified by the DRPC storm configuration
@param conf storm configuration
@return the plugin | [
"Construct",
"an",
"HttpServletRequest",
"credential",
"plugin",
"specified",
"by",
"the",
"DRPC",
"storm",
"configuration"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java#L272-L275 |
25,244 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/operation/impl/ChainedAggregatorImpl.java | ChainedAggregatorImpl.increment | private boolean increment(TridentCollector[] lengths, int[] indices, int j) {
if (j == -1)
return false;
indices[j]++;
CaptureCollector capturer = (CaptureCollector) lengths[j];
if (indices[j] >= capturer.captured.size()) {
indices[j] = 0;
return incre... | java | private boolean increment(TridentCollector[] lengths, int[] indices, int j) {
if (j == -1)
return false;
indices[j]++;
CaptureCollector capturer = (CaptureCollector) lengths[j];
if (indices[j] >= capturer.captured.size()) {
indices[j] = 0;
return incre... | [
"private",
"boolean",
"increment",
"(",
"TridentCollector",
"[",
"]",
"lengths",
",",
"int",
"[",
"]",
"indices",
",",
"int",
"j",
")",
"{",
"if",
"(",
"j",
"==",
"-",
"1",
")",
"return",
"false",
";",
"indices",
"[",
"j",
"]",
"++",
";",
"CaptureC... | return false if can't increment anymore | [
"return",
"false",
"if",
"can",
"t",
"increment",
"anymore"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/operation/impl/ChainedAggregatorImpl.java#L95-L105 |
25,245 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/NettyClient.java | NettyClient.doReconnect | public void doReconnect() {
if (channelRef.get() != null) {
// if (channelRef.get().isWritable()) {
// LOG.info("already exist a writable channel, give up reconnect, {}",
// channelRef.get());
// return;
// }
return;
}
if (... | java | public void doReconnect() {
if (channelRef.get() != null) {
// if (channelRef.get().isWritable()) {
// LOG.info("already exist a writable channel, give up reconnect, {}",
// channelRef.get());
// return;
// }
return;
}
if (... | [
"public",
"void",
"doReconnect",
"(",
")",
"{",
"if",
"(",
"channelRef",
".",
"get",
"(",
")",
"!=",
"null",
")",
"{",
"// if (channelRef.get().isWritable()) {",
"// LOG.info(\"already exist a writable channel, give up reconnect, {}\",",
"// channelRef.get());",
"// return;",... | The function can't be synchronized, otherwise it will cause deadlock | [
"The",
"function",
"can",
"t",
"be",
"synchronized",
"otherwise",
"it",
"will",
"cause",
"deadlock"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/NettyClient.java#L244-L297 |
25,246 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/NettyClient.java | NettyClient.closeChannel | void closeChannel(final Channel channel) {
synchronized (channelClosing) {
if (closingChannel.contains(channel)) {
LOG.info(channel.toString() + " has already been closed");
return;
}
closingChannel.add(channel);
}
LOG.debug(c... | java | void closeChannel(final Channel channel) {
synchronized (channelClosing) {
if (closingChannel.contains(channel)) {
LOG.info(channel.toString() + " has already been closed");
return;
}
closingChannel.add(channel);
}
LOG.debug(c... | [
"void",
"closeChannel",
"(",
"final",
"Channel",
"channel",
")",
"{",
"synchronized",
"(",
"channelClosing",
")",
"{",
"if",
"(",
"closingChannel",
".",
"contains",
"(",
"channel",
")",
")",
"{",
"LOG",
".",
"info",
"(",
"channel",
".",
"toString",
"(",
... | Avoid channel double close | [
"Avoid",
"channel",
"double",
"close"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/NettyClient.java#L454-L475 |
25,247 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/task/execute/spout/SpoutExecutors.java | SpoutExecutors.onEvent | @Override
public void onEvent(Object event, long sequence, boolean endOfBatch) throws Exception {
try {
if (event == null) {
return;
}
Runnable runnable = null;
if (event instanceof Tuple) {
if (((TupleExt) event).isBatchTuple()... | java | @Override
public void onEvent(Object event, long sequence, boolean endOfBatch) throws Exception {
try {
if (event == null) {
return;
}
Runnable runnable = null;
if (event instanceof Tuple) {
if (((TupleExt) event).isBatchTuple()... | [
"@",
"Override",
"public",
"void",
"onEvent",
"(",
"Object",
"event",
",",
"long",
"sequence",
",",
"boolean",
"endOfBatch",
")",
"throws",
"Exception",
"{",
"try",
"{",
"if",
"(",
"event",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Runnable",
"runnabl... | Handle acker message
@see com.lmax.disruptor.EventHandler#onEvent(java.lang.Object, long, boolean) | [
"Handle",
"acker",
"message"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/task/execute/spout/SpoutExecutors.java#L205-L250 |
25,248 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/spout/CheckpointSpout.java | CheckpointSpout.loadCheckpointState | private KeyValueState<String, CheckPointState> loadCheckpointState(Map conf, TopologyContext ctx) {
String namespace = ctx.getThisComponentId() + "-" + ctx.getThisTaskId();
KeyValueState<String, CheckPointState> state =
(KeyValueState<String, CheckPointState>) StateFactory.getState(names... | java | private KeyValueState<String, CheckPointState> loadCheckpointState(Map conf, TopologyContext ctx) {
String namespace = ctx.getThisComponentId() + "-" + ctx.getThisTaskId();
KeyValueState<String, CheckPointState> state =
(KeyValueState<String, CheckPointState>) StateFactory.getState(names... | [
"private",
"KeyValueState",
"<",
"String",
",",
"CheckPointState",
">",
"loadCheckpointState",
"(",
"Map",
"conf",
",",
"TopologyContext",
"ctx",
")",
"{",
"String",
"namespace",
"=",
"ctx",
".",
"getThisComponentId",
"(",
")",
"+",
"\"-\"",
"+",
"ctx",
".",
... | Loads the last saved checkpoint state the from persistent storage. | [
"Loads",
"the",
"last",
"saved",
"checkpoint",
"state",
"the",
"from",
"persistent",
"storage",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/spout/CheckpointSpout.java#L134-L147 |
25,249 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.checkNeedUpdateTopologies | @SuppressWarnings("unchecked")
private void checkNeedUpdateTopologies(Map<String, StateHeartbeat> localWorkerStats,
Map<Integer, LocalAssignment> localAssignments) throws Exception {
Set<String> topologies = new HashSet<>();
for (Map.Entry<Integer, LocalAs... | java | @SuppressWarnings("unchecked")
private void checkNeedUpdateTopologies(Map<String, StateHeartbeat> localWorkerStats,
Map<Integer, LocalAssignment> localAssignments) throws Exception {
Set<String> topologies = new HashSet<>();
for (Map.Entry<Integer, LocalAs... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"checkNeedUpdateTopologies",
"(",
"Map",
"<",
"String",
",",
"StateHeartbeat",
">",
"localWorkerStats",
",",
"Map",
"<",
"Integer",
",",
"LocalAssignment",
">",
"localAssignments",
")",
"throws",... | check all workers is failed or not | [
"check",
"all",
"workers",
"is",
"failed",
"or",
"not"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L267-L303 |
25,250 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.markAllNewWorkers | public void markAllNewWorkers(Map<Integer, String> workerIds) {
int startTime = TimeUtils.current_time_secs();
for (Entry<Integer, String> entry : workerIds.entrySet()) {
String oldWorkerIds = portToWorkerId.get(entry.getKey());
if (oldWorkerIds != null) {
worker... | java | public void markAllNewWorkers(Map<Integer, String> workerIds) {
int startTime = TimeUtils.current_time_secs();
for (Entry<Integer, String> entry : workerIds.entrySet()) {
String oldWorkerIds = portToWorkerId.get(entry.getKey());
if (oldWorkerIds != null) {
worker... | [
"public",
"void",
"markAllNewWorkers",
"(",
"Map",
"<",
"Integer",
",",
"String",
">",
"workerIds",
")",
"{",
"int",
"startTime",
"=",
"TimeUtils",
".",
"current_time_secs",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"Integer",
",",
"String",
">",
"entry",
... | mark all new Workers like 52b11418-7474-446d-bff5-0ecd68f4954f | [
"mark",
"all",
"new",
"Workers",
"like",
"52b11418",
"-",
"7474",
"-",
"446d",
"-",
"bff5",
"-",
"0ecd68f4954f"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L308-L322 |
25,251 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.checkNewWorkers | public void checkNewWorkers(Map conf) throws IOException, InterruptedException {
Set<String> workers = new HashSet<>();
for (Entry<String, Pair<Integer, Integer>> entry : workerIdToStartTimeAndPort.entrySet()) {
String workerId = entry.getKey();
int startTime = entry.getValue().g... | java | public void checkNewWorkers(Map conf) throws IOException, InterruptedException {
Set<String> workers = new HashSet<>();
for (Entry<String, Pair<Integer, Integer>> entry : workerIdToStartTimeAndPort.entrySet()) {
String workerId = entry.getKey();
int startTime = entry.getValue().g... | [
"public",
"void",
"checkNewWorkers",
"(",
"Map",
"conf",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"Set",
"<",
"String",
">",
"workers",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"Pair",
"<... | check whether timestamp of new workers is not > SUPERVISOR_WORKER_START_TIMEOUT_SECS, otherwise mark as failed | [
"check",
"whether",
"timestamp",
"of",
"new",
"workers",
"is",
"not",
">",
"SUPERVISOR_WORKER_START_TIMEOUT_SECS",
"otherwise",
"mark",
"as",
"failed"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L327-L352 |
25,252 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.matchesAssignment | public boolean matchesAssignment(WorkerHeartbeat whb, Map<Integer, LocalAssignment> assignedTasks) {
boolean isMatch = true;
LocalAssignment localAssignment = assignedTasks.get(whb.getPort());
if (localAssignment == null) {
LOG.debug("Following worker has been removed, port=" + whb.g... | java | public boolean matchesAssignment(WorkerHeartbeat whb, Map<Integer, LocalAssignment> assignedTasks) {
boolean isMatch = true;
LocalAssignment localAssignment = assignedTasks.get(whb.getPort());
if (localAssignment == null) {
LOG.debug("Following worker has been removed, port=" + whb.g... | [
"public",
"boolean",
"matchesAssignment",
"(",
"WorkerHeartbeat",
"whb",
",",
"Map",
"<",
"Integer",
",",
"LocalAssignment",
">",
"assignedTasks",
")",
"{",
"boolean",
"isMatch",
"=",
"true",
";",
"LocalAssignment",
"localAssignment",
"=",
"assignedTasks",
".",
"g... | check whether the worker heartbeat is allowed in the assignedTasks
@param whb WorkerHeartbeat
@param assignedTasks assigned tasks
@return if true, the assignments(LS-LOCAL-ASSIGNMENTS) match with worker heartbeat, false otherwise | [
"check",
"whether",
"the",
"worker",
"heartbeat",
"is",
"allowed",
"in",
"the",
"assignedTasks"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L437-L453 |
25,253 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.readWorkerHeartbeats | public Map<String, WorkerHeartbeat> readWorkerHeartbeats(Map conf) throws Exception {
Map<String, WorkerHeartbeat> workerHeartbeats = new HashMap<>();
// get the path: STORM-LOCAL-DIR/workers
String path = StormConfig.worker_root(conf);
List<String> workerIds = PathUtils.read_dir_conte... | java | public Map<String, WorkerHeartbeat> readWorkerHeartbeats(Map conf) throws Exception {
Map<String, WorkerHeartbeat> workerHeartbeats = new HashMap<>();
// get the path: STORM-LOCAL-DIR/workers
String path = StormConfig.worker_root(conf);
List<String> workerIds = PathUtils.read_dir_conte... | [
"public",
"Map",
"<",
"String",
",",
"WorkerHeartbeat",
">",
"readWorkerHeartbeats",
"(",
"Map",
"conf",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"WorkerHeartbeat",
">",
"workerHeartbeats",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"// g... | get all workers heartbeats of the supervisor
@param conf conf
@throws IOException | [
"get",
"all",
"workers",
"heartbeats",
"of",
"the",
"supervisor"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L461-L480 |
25,254 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.readWorkerHeartbeat | public WorkerHeartbeat readWorkerHeartbeat(Map conf, String workerId) throws Exception {
try {
LocalState ls = StormConfig.worker_state(conf, workerId);
return (WorkerHeartbeat) ls.get(Common.LS_WORKER_HEARTBEAT);
} catch (Exception e) {
LOG.error("Failed to get heart... | java | public WorkerHeartbeat readWorkerHeartbeat(Map conf, String workerId) throws Exception {
try {
LocalState ls = StormConfig.worker_state(conf, workerId);
return (WorkerHeartbeat) ls.get(Common.LS_WORKER_HEARTBEAT);
} catch (Exception e) {
LOG.error("Failed to get heart... | [
"public",
"WorkerHeartbeat",
"readWorkerHeartbeat",
"(",
"Map",
"conf",
",",
"String",
"workerId",
")",
"throws",
"Exception",
"{",
"try",
"{",
"LocalState",
"ls",
"=",
"StormConfig",
".",
"worker_state",
"(",
"conf",
",",
"workerId",
")",
";",
"return",
"(",
... | get worker heartbeat by workerId
@param conf conf
@param workerId worker id
@return WorkerHeartbeat | [
"get",
"worker",
"heartbeat",
"by",
"workerId"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L489-L497 |
25,255 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.launchWorker | public void launchWorker(Map conf, IContext sharedContext, String topologyId,
String supervisorId, Integer port, String workerId,
ConcurrentHashMap<String, String> workerThreadPidsAtom) throws Exception {
String pid = UUID.randomUUID().toString();
... | java | public void launchWorker(Map conf, IContext sharedContext, String topologyId,
String supervisorId, Integer port, String workerId,
ConcurrentHashMap<String, String> workerThreadPidsAtom) throws Exception {
String pid = UUID.randomUUID().toString();
... | [
"public",
"void",
"launchWorker",
"(",
"Map",
"conf",
",",
"IContext",
"sharedContext",
",",
"String",
"topologyId",
",",
"String",
"supervisorId",
",",
"Integer",
"port",
",",
"String",
"workerId",
",",
"ConcurrentHashMap",
"<",
"String",
",",
"String",
">",
... | launch a worker in local mode | [
"launch",
"a",
"worker",
"in",
"local",
"mode"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L502-L509 |
25,256 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.setFilterJars | private Set<String> setFilterJars(Map totalConf) {
Set<String> filterJars = new HashSet<>();
boolean enableClassLoader = ConfigExtension.isEnableTopologyClassLoader(totalConf);
if (!enableClassLoader) {
// avoid logback vs log4j conflict
boolean enableLog4j = false;
... | java | private Set<String> setFilterJars(Map totalConf) {
Set<String> filterJars = new HashSet<>();
boolean enableClassLoader = ConfigExtension.isEnableTopologyClassLoader(totalConf);
if (!enableClassLoader) {
// avoid logback vs log4j conflict
boolean enableLog4j = false;
... | [
"private",
"Set",
"<",
"String",
">",
"setFilterJars",
"(",
"Map",
"totalConf",
")",
"{",
"Set",
"<",
"String",
">",
"filterJars",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"boolean",
"enableClassLoader",
"=",
"ConfigExtension",
".",
"isEnableTopologyClassLo... | filter conflict jar | [
"filter",
"conflict",
"jar"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L512-L546 |
25,257 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.getWorkerMemParameter | public String getWorkerMemParameter(LocalAssignment assignment,
Map totalConf,
String topologyId,
Integer port) {
long memSize = assignment.getMem();
long memMinSize = ConfigExtension.... | java | public String getWorkerMemParameter(LocalAssignment assignment,
Map totalConf,
String topologyId,
Integer port) {
long memSize = assignment.getMem();
long memMinSize = ConfigExtension.... | [
"public",
"String",
"getWorkerMemParameter",
"(",
"LocalAssignment",
"assignment",
",",
"Map",
"totalConf",
",",
"String",
"topologyId",
",",
"Integer",
"port",
")",
"{",
"long",
"memSize",
"=",
"assignment",
".",
"getMem",
"(",
")",
";",
"long",
"memMinSize",
... | Get worker's JVM memory setting | [
"Get",
"worker",
"s",
"JVM",
"memory",
"setting"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L729-L773 |
25,258 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.getWorkerGcParameter | public String getWorkerGcParameter(LocalAssignment assignment,
Map totalConf,
String topologyId,
Integer port) {
StringBuilder commandSB = new StringBuilder();
GcStrategy gcStrategy = Gc... | java | public String getWorkerGcParameter(LocalAssignment assignment,
Map totalConf,
String topologyId,
Integer port) {
StringBuilder commandSB = new StringBuilder();
GcStrategy gcStrategy = Gc... | [
"public",
"String",
"getWorkerGcParameter",
"(",
"LocalAssignment",
"assignment",
",",
"Map",
"totalConf",
",",
"String",
"topologyId",
",",
"Integer",
"port",
")",
"{",
"StringBuilder",
"commandSB",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"GcStrategy",
"gcStr... | Get worker's JVM gc setting | [
"Get",
"worker",
"s",
"JVM",
"gc",
"setting"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L778-L786 |
25,259 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.launchWorker | public void launchWorker(Map conf, IContext sharedContext, String topologyId, String supervisorId,
Integer port, String workerId, LocalAssignment assignment) throws IOException {
// get supervisor conf
Map stormConf = StormConfig.read_supervisor_topology_conf(conf, topologyI... | java | public void launchWorker(Map conf, IContext sharedContext, String topologyId, String supervisorId,
Integer port, String workerId, LocalAssignment assignment) throws IOException {
// get supervisor conf
Map stormConf = StormConfig.read_supervisor_topology_conf(conf, topologyI... | [
"public",
"void",
"launchWorker",
"(",
"Map",
"conf",
",",
"IContext",
"sharedContext",
",",
"String",
"topologyId",
",",
"String",
"supervisorId",
",",
"Integer",
"port",
",",
"String",
"workerId",
",",
"LocalAssignment",
"assignment",
")",
"throws",
"IOException... | launch a worker in distributed mode
@throws IOException | [
"launch",
"a",
"worker",
"in",
"distributed",
"mode"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L895-L947 |
25,260 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.needsSchedulingTopologies | public List<TopologyDetails> needsSchedulingTopologies(Topologies topologies) {
List<TopologyDetails> ret = new ArrayList<>();
for (TopologyDetails topology : topologies.getTopologies()) {
if (needsScheduling(topology)) {
ret.add(topology);
}
}
re... | java | public List<TopologyDetails> needsSchedulingTopologies(Topologies topologies) {
List<TopologyDetails> ret = new ArrayList<>();
for (TopologyDetails topology : topologies.getTopologies()) {
if (needsScheduling(topology)) {
ret.add(topology);
}
}
re... | [
"public",
"List",
"<",
"TopologyDetails",
">",
"needsSchedulingTopologies",
"(",
"Topologies",
"topologies",
")",
"{",
"List",
"<",
"TopologyDetails",
">",
"ret",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"TopologyDetails",
"topology",
":",
"to... | Gets all the topologies which needs scheduling. | [
"Gets",
"all",
"the",
"topologies",
"which",
"needs",
"scheduling",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L100-L109 |
25,261 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.needsScheduling | public boolean needsScheduling(TopologyDetails topology) {
int desiredNumWorkers = topology.getNumWorkers();
int assignedNumWorkers = this.getAssignedNumWorkers(topology);
if (desiredNumWorkers > assignedNumWorkers) {
return true;
}
return this.getUnassignedExecutors... | java | public boolean needsScheduling(TopologyDetails topology) {
int desiredNumWorkers = topology.getNumWorkers();
int assignedNumWorkers = this.getAssignedNumWorkers(topology);
if (desiredNumWorkers > assignedNumWorkers) {
return true;
}
return this.getUnassignedExecutors... | [
"public",
"boolean",
"needsScheduling",
"(",
"TopologyDetails",
"topology",
")",
"{",
"int",
"desiredNumWorkers",
"=",
"topology",
".",
"getNumWorkers",
"(",
")",
";",
"int",
"assignedNumWorkers",
"=",
"this",
".",
"getAssignedNumWorkers",
"(",
"topology",
")",
";... | Does the topology need scheduling?
A topology needs scheduling if one of the following conditions holds:
<ul>
<li>Although the topology is assigned slots, but is squeezed. i.e. the topology is assigned less slots than desired.</li>
<li>There are unassigned executors in this topology</li>
</ul> | [
"Does",
"the",
"topology",
"need",
"scheduling?"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L120-L128 |
25,262 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.getNeedsSchedulingExecutorToComponents | public Map<ExecutorDetails, String> getNeedsSchedulingExecutorToComponents(TopologyDetails topology) {
Collection<ExecutorDetails> allExecutors = new HashSet<>(topology.getExecutors());
SchedulerAssignment assignment = this.assignments.get(topology.getId());
if (assignment != null) {
... | java | public Map<ExecutorDetails, String> getNeedsSchedulingExecutorToComponents(TopologyDetails topology) {
Collection<ExecutorDetails> allExecutors = new HashSet<>(topology.getExecutors());
SchedulerAssignment assignment = this.assignments.get(topology.getId());
if (assignment != null) {
... | [
"public",
"Map",
"<",
"ExecutorDetails",
",",
"String",
">",
"getNeedsSchedulingExecutorToComponents",
"(",
"TopologyDetails",
"topology",
")",
"{",
"Collection",
"<",
"ExecutorDetails",
">",
"allExecutors",
"=",
"new",
"HashSet",
"<>",
"(",
"topology",
".",
"getExe... | Gets a executor -> component-id map which needs scheduling in this topology. | [
"Gets",
"a",
"executor",
"-",
">",
"component",
"-",
"id",
"map",
"which",
"needs",
"scheduling",
"in",
"this",
"topology",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L133-L143 |
25,263 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.getNeedsSchedulingComponentToExecutors | public Map<String, List<ExecutorDetails>> getNeedsSchedulingComponentToExecutors(TopologyDetails topology) {
Map<ExecutorDetails, String> executorToComponents = this.getNeedsSchedulingExecutorToComponents(topology);
Map<String, List<ExecutorDetails>> componentToExecutors = new HashMap<>();
for (... | java | public Map<String, List<ExecutorDetails>> getNeedsSchedulingComponentToExecutors(TopologyDetails topology) {
Map<ExecutorDetails, String> executorToComponents = this.getNeedsSchedulingExecutorToComponents(topology);
Map<String, List<ExecutorDetails>> componentToExecutors = new HashMap<>();
for (... | [
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"ExecutorDetails",
">",
">",
"getNeedsSchedulingComponentToExecutors",
"(",
"TopologyDetails",
"topology",
")",
"{",
"Map",
"<",
"ExecutorDetails",
",",
"String",
">",
"executorToComponents",
"=",
"this",
".",
"get... | Gets a component-id -> executors map which needs scheduling in this topology. | [
"Gets",
"a",
"component",
"-",
"id",
"-",
">",
"executors",
"map",
"which",
"needs",
"scheduling",
"in",
"this",
"topology",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L148-L161 |
25,264 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.getUsedPorts | public Set<Integer> getUsedPorts(SupervisorDetails supervisor) {
Map<String, SchedulerAssignment> assignments = this.getAssignments();
Set<Integer> usedPorts = new HashSet<>();
for (SchedulerAssignment assignment : assignments.values()) {
for (WorkerSlot slot : assignment.getExecuto... | java | public Set<Integer> getUsedPorts(SupervisorDetails supervisor) {
Map<String, SchedulerAssignment> assignments = this.getAssignments();
Set<Integer> usedPorts = new HashSet<>();
for (SchedulerAssignment assignment : assignments.values()) {
for (WorkerSlot slot : assignment.getExecuto... | [
"public",
"Set",
"<",
"Integer",
">",
"getUsedPorts",
"(",
"SupervisorDetails",
"supervisor",
")",
"{",
"Map",
"<",
"String",
",",
"SchedulerAssignment",
">",
"assignments",
"=",
"this",
".",
"getAssignments",
"(",
")",
";",
"Set",
"<",
"Integer",
">",
"used... | Get all the used ports of this supervisor. | [
"Get",
"all",
"the",
"used",
"ports",
"of",
"this",
"supervisor",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L166-L179 |
25,265 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.getAvailablePorts | public Set<Integer> getAvailablePorts(SupervisorDetails supervisor) {
Set<Integer> usedPorts = this.getUsedPorts(supervisor);
Set<Integer> ret = new HashSet<>();
ret.addAll(getAssignablePorts(supervisor));
ret.removeAll(usedPorts);
return ret;
} | java | public Set<Integer> getAvailablePorts(SupervisorDetails supervisor) {
Set<Integer> usedPorts = this.getUsedPorts(supervisor);
Set<Integer> ret = new HashSet<>();
ret.addAll(getAssignablePorts(supervisor));
ret.removeAll(usedPorts);
return ret;
} | [
"public",
"Set",
"<",
"Integer",
">",
"getAvailablePorts",
"(",
"SupervisorDetails",
"supervisor",
")",
"{",
"Set",
"<",
"Integer",
">",
"usedPorts",
"=",
"this",
".",
"getUsedPorts",
"(",
"supervisor",
")",
";",
"Set",
"<",
"Integer",
">",
"ret",
"=",
"ne... | Return the available ports of this supervisor. | [
"Return",
"the",
"available",
"ports",
"of",
"this",
"supervisor",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L184-L192 |
25,266 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.getAvailableSlots | public List<WorkerSlot> getAvailableSlots(SupervisorDetails supervisor) {
Set<Integer> ports = this.getAvailablePorts(supervisor);
List<WorkerSlot> slots = new ArrayList<>(ports.size());
for (Integer port : ports) {
slots.add(new WorkerSlot(supervisor.getId(), port));
}
... | java | public List<WorkerSlot> getAvailableSlots(SupervisorDetails supervisor) {
Set<Integer> ports = this.getAvailablePorts(supervisor);
List<WorkerSlot> slots = new ArrayList<>(ports.size());
for (Integer port : ports) {
slots.add(new WorkerSlot(supervisor.getId(), port));
}
... | [
"public",
"List",
"<",
"WorkerSlot",
">",
"getAvailableSlots",
"(",
"SupervisorDetails",
"supervisor",
")",
"{",
"Set",
"<",
"Integer",
">",
"ports",
"=",
"this",
".",
"getAvailablePorts",
"(",
"supervisor",
")",
";",
"List",
"<",
"WorkerSlot",
">",
"slots",
... | Return all the available slots on this supervisor. | [
"Return",
"all",
"the",
"available",
"slots",
"on",
"this",
"supervisor",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L203-L212 |
25,267 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.getUnassignedExecutors | public Collection<ExecutorDetails> getUnassignedExecutors(TopologyDetails topology) {
if (topology == null) {
return new ArrayList<>(0);
}
Collection<ExecutorDetails> ret = new HashSet<>(topology.getExecutors());
SchedulerAssignment assignment = this.getAssignmentById(topol... | java | public Collection<ExecutorDetails> getUnassignedExecutors(TopologyDetails topology) {
if (topology == null) {
return new ArrayList<>(0);
}
Collection<ExecutorDetails> ret = new HashSet<>(topology.getExecutors());
SchedulerAssignment assignment = this.getAssignmentById(topol... | [
"public",
"Collection",
"<",
"ExecutorDetails",
">",
"getUnassignedExecutors",
"(",
"TopologyDetails",
"topology",
")",
"{",
"if",
"(",
"topology",
"==",
"null",
")",
"{",
"return",
"new",
"ArrayList",
"<>",
"(",
"0",
")",
";",
"}",
"Collection",
"<",
"Execu... | get the unassigned executors of the topology. | [
"get",
"the",
"unassigned",
"executors",
"of",
"the",
"topology",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L228-L242 |
25,268 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.getAssignedNumWorkers | public int getAssignedNumWorkers(TopologyDetails topology) {
SchedulerAssignment assignment = this.getAssignmentById(topology.getId());
if (assignment == null) {
return 0;
}
Set<WorkerSlot> slots = new HashSet<>();
slots.addAll(assignment.getExecutorToSlot().values()... | java | public int getAssignedNumWorkers(TopologyDetails topology) {
SchedulerAssignment assignment = this.getAssignmentById(topology.getId());
if (assignment == null) {
return 0;
}
Set<WorkerSlot> slots = new HashSet<>();
slots.addAll(assignment.getExecutorToSlot().values()... | [
"public",
"int",
"getAssignedNumWorkers",
"(",
"TopologyDetails",
"topology",
")",
"{",
"SchedulerAssignment",
"assignment",
"=",
"this",
".",
"getAssignmentById",
"(",
"topology",
".",
"getId",
"(",
")",
")",
";",
"if",
"(",
"assignment",
"==",
"null",
")",
"... | Gets the number of workers assigned to this topology. | [
"Gets",
"the",
"number",
"of",
"workers",
"assigned",
"to",
"this",
"topology",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L247-L257 |
25,269 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.assign | public void assign(WorkerSlot slot, String topologyId, Collection<ExecutorDetails> executors) {
if (this.isSlotOccupied(slot)) {
throw new RuntimeException("slot: [" + slot.getNodeId() + ", " + slot.getPort() + "] is already occupied.");
}
SchedulerAssignmentImpl assignment = (Sched... | java | public void assign(WorkerSlot slot, String topologyId, Collection<ExecutorDetails> executors) {
if (this.isSlotOccupied(slot)) {
throw new RuntimeException("slot: [" + slot.getNodeId() + ", " + slot.getPort() + "] is already occupied.");
}
SchedulerAssignmentImpl assignment = (Sched... | [
"public",
"void",
"assign",
"(",
"WorkerSlot",
"slot",
",",
"String",
"topologyId",
",",
"Collection",
"<",
"ExecutorDetails",
">",
"executors",
")",
"{",
"if",
"(",
"this",
".",
"isSlotOccupied",
"(",
"slot",
")",
")",
"{",
"throw",
"new",
"RuntimeException... | Assign the slot to the executors for this topology.
@throws RuntimeException if the specified slot is already occupied. | [
"Assign",
"the",
"slot",
"to",
"the",
"executors",
"for",
"this",
"topology",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L264-L282 |
25,270 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.getAvailableSlots | public List<WorkerSlot> getAvailableSlots() {
List<WorkerSlot> slots = new ArrayList<>();
for (SupervisorDetails supervisor : this.supervisors.values()) {
slots.addAll(this.getAvailableSlots(supervisor));
}
return slots;
} | java | public List<WorkerSlot> getAvailableSlots() {
List<WorkerSlot> slots = new ArrayList<>();
for (SupervisorDetails supervisor : this.supervisors.values()) {
slots.addAll(this.getAvailableSlots(supervisor));
}
return slots;
} | [
"public",
"List",
"<",
"WorkerSlot",
">",
"getAvailableSlots",
"(",
")",
"{",
"List",
"<",
"WorkerSlot",
">",
"slots",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"SupervisorDetails",
"supervisor",
":",
"this",
".",
"supervisors",
".",
"value... | Gets all the available slots in the cluster. | [
"Gets",
"all",
"the",
"available",
"slots",
"in",
"the",
"cluster",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L287-L294 |
25,271 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.freeSlot | public void freeSlot(WorkerSlot slot) {
// remove the slot from the existing assignments
for (SchedulerAssignmentImpl assignment : this.assignments.values()) {
if (assignment.isSlotOccupied(slot)) {
assignment.unassignBySlot(slot);
}
}
} | java | public void freeSlot(WorkerSlot slot) {
// remove the slot from the existing assignments
for (SchedulerAssignmentImpl assignment : this.assignments.values()) {
if (assignment.isSlotOccupied(slot)) {
assignment.unassignBySlot(slot);
}
}
} | [
"public",
"void",
"freeSlot",
"(",
"WorkerSlot",
"slot",
")",
"{",
"// remove the slot from the existing assignments",
"for",
"(",
"SchedulerAssignmentImpl",
"assignment",
":",
"this",
".",
"assignments",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"assignment",
... | Free the specified slot. | [
"Free",
"the",
"specified",
"slot",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L308-L315 |
25,272 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.freeSlots | public void freeSlots(Collection<WorkerSlot> slots) {
if (slots != null) {
for (WorkerSlot slot : slots) {
this.freeSlot(slot);
}
}
} | java | public void freeSlots(Collection<WorkerSlot> slots) {
if (slots != null) {
for (WorkerSlot slot : slots) {
this.freeSlot(slot);
}
}
} | [
"public",
"void",
"freeSlots",
"(",
"Collection",
"<",
"WorkerSlot",
">",
"slots",
")",
"{",
"if",
"(",
"slots",
"!=",
"null",
")",
"{",
"for",
"(",
"WorkerSlot",
"slot",
":",
"slots",
")",
"{",
"this",
".",
"freeSlot",
"(",
"slot",
")",
";",
"}",
... | free the slots. | [
"free",
"the",
"slots",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L320-L326 |
25,273 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.isSlotOccupied | public boolean isSlotOccupied(WorkerSlot slot) {
for (SchedulerAssignment assignment : this.assignments.values()) {
if (assignment.isSlotOccupied(slot)) {
return true;
}
}
return false;
} | java | public boolean isSlotOccupied(WorkerSlot slot) {
for (SchedulerAssignment assignment : this.assignments.values()) {
if (assignment.isSlotOccupied(slot)) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"isSlotOccupied",
"(",
"WorkerSlot",
"slot",
")",
"{",
"for",
"(",
"SchedulerAssignment",
"assignment",
":",
"this",
".",
"assignments",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"assignment",
".",
"isSlotOccupied",
"(",
"slot",
")",... | Checks the specified slot is occupied.
@param slot the slot be to checked. | [
"Checks",
"the",
"specified",
"slot",
"is",
"occupied",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L333-L341 |
25,274 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.getAssignmentById | public SchedulerAssignment getAssignmentById(String topologyId) {
if (this.assignments.containsKey(topologyId)) {
return this.assignments.get(topologyId);
}
return null;
} | java | public SchedulerAssignment getAssignmentById(String topologyId) {
if (this.assignments.containsKey(topologyId)) {
return this.assignments.get(topologyId);
}
return null;
} | [
"public",
"SchedulerAssignment",
"getAssignmentById",
"(",
"String",
"topologyId",
")",
"{",
"if",
"(",
"this",
".",
"assignments",
".",
"containsKey",
"(",
"topologyId",
")",
")",
"{",
"return",
"this",
".",
"assignments",
".",
"get",
"(",
"topologyId",
")",
... | get the current assignment for the topology. | [
"get",
"the",
"current",
"assignment",
"for",
"the",
"topology",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L346-L351 |
25,275 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java | Cluster.getAssignments | public Map<String, SchedulerAssignment> getAssignments() {
Map<String, SchedulerAssignment> ret = new HashMap<>(this.assignments.size());
for (String topologyId : this.assignments.keySet()) {
ret.put(topologyId, this.assignments.get(topologyId));
}
return ret;
} | java | public Map<String, SchedulerAssignment> getAssignments() {
Map<String, SchedulerAssignment> ret = new HashMap<>(this.assignments.size());
for (String topologyId : this.assignments.keySet()) {
ret.put(topologyId, this.assignments.get(topologyId));
}
return ret;
} | [
"public",
"Map",
"<",
"String",
",",
"SchedulerAssignment",
">",
"getAssignments",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"SchedulerAssignment",
">",
"ret",
"=",
"new",
"HashMap",
"<>",
"(",
"this",
".",
"assignments",
".",
"size",
"(",
")",
")",
";",... | Get all the assignments. | [
"Get",
"all",
"the",
"assignments",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/Cluster.java#L394-L402 |
25,276 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/DefaultHttpCredentialsPlugin.java | DefaultHttpCredentialsPlugin.getUserName | @Override
public String getUserName(HttpServletRequest req) {
Principal princ = null;
if (req != null && (princ = req.getUserPrincipal()) != null) {
String userName = princ.getName();
if (userName != null && !userName.isEmpty()) {
LOG.debug("HTTP request had u... | java | @Override
public String getUserName(HttpServletRequest req) {
Principal princ = null;
if (req != null && (princ = req.getUserPrincipal()) != null) {
String userName = princ.getName();
if (userName != null && !userName.isEmpty()) {
LOG.debug("HTTP request had u... | [
"@",
"Override",
"public",
"String",
"getUserName",
"(",
"HttpServletRequest",
"req",
")",
"{",
"Principal",
"princ",
"=",
"null",
";",
"if",
"(",
"req",
"!=",
"null",
"&&",
"(",
"princ",
"=",
"req",
".",
"getUserPrincipal",
"(",
")",
")",
"!=",
"null",
... | Gets the user name from the request principal.
@param req the servlet request
@return the authenticated user, or null if none is authenticated | [
"Gets",
"the",
"user",
"name",
"from",
"the",
"request",
"principal",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/DefaultHttpCredentialsPlugin.java#L52-L63 |
25,277 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/DefaultHttpCredentialsPlugin.java | DefaultHttpCredentialsPlugin.populateContext | @Override
public ReqContext populateContext(ReqContext context, HttpServletRequest req) {
String userName = getUserName(req);
String doAsUser = req.getHeader("doAsUser");
if (doAsUser == null) {
doAsUser = req.getParameter("doAsUser");
}
if (doAsUser != null) {
... | java | @Override
public ReqContext populateContext(ReqContext context, HttpServletRequest req) {
String userName = getUserName(req);
String doAsUser = req.getHeader("doAsUser");
if (doAsUser == null) {
doAsUser = req.getParameter("doAsUser");
}
if (doAsUser != null) {
... | [
"@",
"Override",
"public",
"ReqContext",
"populateContext",
"(",
"ReqContext",
"context",
",",
"HttpServletRequest",
"req",
")",
"{",
"String",
"userName",
"=",
"getUserName",
"(",
"req",
")",
";",
"String",
"doAsUser",
"=",
"req",
".",
"getHeader",
"(",
"\"do... | Populates a given context with a new Subject derived from the credentials in a servlet request.
@param context the context to be populated
@param req the servlet request
@return the context | [
"Populates",
"a",
"given",
"context",
"with",
"a",
"new",
"Subject",
"derived",
"from",
"the",
"credentials",
"in",
"a",
"servlet",
"request",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/DefaultHttpCredentialsPlugin.java#L72-L95 |
25,278 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/task/master/GrayUpgradeHandler.java | GrayUpgradeHandler.run | @Override
public void run() {
try {
GrayUpgradeConfig grayUpgradeConf = (GrayUpgradeConfig) stormClusterState.get_gray_upgrade_conf(topologyId);
// no upgrade request
if (grayUpgradeConf == null) {
LOG.debug("gray upgrade conf is null, skip...");
... | java | @Override
public void run() {
try {
GrayUpgradeConfig grayUpgradeConf = (GrayUpgradeConfig) stormClusterState.get_gray_upgrade_conf(topologyId);
// no upgrade request
if (grayUpgradeConf == null) {
LOG.debug("gray upgrade conf is null, skip...");
... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"GrayUpgradeConfig",
"grayUpgradeConf",
"=",
"(",
"GrayUpgradeConfig",
")",
"stormClusterState",
".",
"get_gray_upgrade_conf",
"(",
"topologyId",
")",
";",
"// no upgrade request",
"if",
"(",
"gr... | scheduled runnable callback, called periodically | [
"scheduled",
"runnable",
"callback",
"called",
"periodically"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/task/master/GrayUpgradeHandler.java#L86-L157 |
25,279 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java | RingBuffer.tryPublishEvent | public boolean tryPublishEvent(EventTranslatorVararg<E> translator, Object... args) {
try {
final long sequence = sequencer.tryNext();
translateAndPublish(translator, sequence, args);
return true;
} catch (InsufficientCapacityException e) {
return false;
... | java | public boolean tryPublishEvent(EventTranslatorVararg<E> translator, Object... args) {
try {
final long sequence = sequencer.tryNext();
translateAndPublish(translator, sequence, args);
return true;
} catch (InsufficientCapacityException e) {
return false;
... | [
"public",
"boolean",
"tryPublishEvent",
"(",
"EventTranslatorVararg",
"<",
"E",
">",
"translator",
",",
"Object",
"...",
"args",
")",
"{",
"try",
"{",
"final",
"long",
"sequence",
"=",
"sequencer",
".",
"tryNext",
"(",
")",
";",
"translateAndPublish",
"(",
"... | Allows a variable number of user supplied arguments
@see #publishEvent(EventTranslator)
@param translator The user specified translation for the event
@param args User supplied arguments.
@return true if the value was published, false if there was insufficient capacity. | [
"Allows",
"a",
"variable",
"number",
"of",
"user",
"supplied",
"arguments"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java#L499-L507 |
25,280 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java | RingBuffer.publishEvents | public <A> void publishEvents(EventTranslatorOneArg<E, A> translator, int batchStartsAt, int batchSize, A[] arg0) {
checkBounds(arg0, batchStartsAt, batchSize);
final long finalSequence = sequencer.next(batchSize);
translateAndPublishBatch(translator, arg0, batchStartsAt, batchSize, finalSequenc... | java | public <A> void publishEvents(EventTranslatorOneArg<E, A> translator, int batchStartsAt, int batchSize, A[] arg0) {
checkBounds(arg0, batchStartsAt, batchSize);
final long finalSequence = sequencer.next(batchSize);
translateAndPublishBatch(translator, arg0, batchStartsAt, batchSize, finalSequenc... | [
"public",
"<",
"A",
">",
"void",
"publishEvents",
"(",
"EventTranslatorOneArg",
"<",
"E",
",",
"A",
">",
"translator",
",",
"int",
"batchStartsAt",
",",
"int",
"batchSize",
",",
"A",
"[",
"]",
"arg0",
")",
"{",
"checkBounds",
"(",
"arg0",
",",
"batchStar... | Allows one user supplied argument per event.
@param translator The user specified translation for each event
@param batchStartsAt The first element of the array which is within the batch.
@param batchSize The actual size of the batch
@param arg0 An array of user supplied arguments, one element per event.
@see #publish... | [
"Allows",
"one",
"user",
"supplied",
"argument",
"per",
"event",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java#L584-L588 |
25,281 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java | RingBuffer.publishEvents | public <A, B, C> void publishEvents(EventTranslatorThreeArg<E, A, B, C> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1, C[] arg2) {
checkBounds(arg0, arg1, arg2, batchStartsAt, batchSize);
final long finalSequence = sequencer.next(batchSize);
translateAndPublishBatch(translator... | java | public <A, B, C> void publishEvents(EventTranslatorThreeArg<E, A, B, C> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1, C[] arg2) {
checkBounds(arg0, arg1, arg2, batchStartsAt, batchSize);
final long finalSequence = sequencer.next(batchSize);
translateAndPublishBatch(translator... | [
"public",
"<",
"A",
",",
"B",
",",
"C",
">",
"void",
"publishEvents",
"(",
"EventTranslatorThreeArg",
"<",
"E",
",",
"A",
",",
"B",
",",
"C",
">",
"translator",
",",
"int",
"batchStartsAt",
",",
"int",
"batchSize",
",",
"A",
"[",
"]",
"arg0",
",",
... | Allows three user supplied arguments per event.
@param translator The user specified translation for the event
@param batchStartsAt The first element of the array which is within the batch.
@param batchSize The number of elements in the batch.
@param arg0 An array of user supplied arguments, one element per event.
@pa... | [
"Allows",
"three",
"user",
"supplied",
"arguments",
"per",
"event",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java#L710-L714 |
25,282 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/TridentTopology.java | TridentTopology.getDRPCSpoutNode | private static SpoutNode getDRPCSpoutNode(Collection<Node> g) {
for(Node n: g) {
if(n instanceof SpoutNode) {
SpoutNode.SpoutType type = ((SpoutNode) n).type;
if(type==SpoutNode.SpoutType.DRPC) {
return (SpoutNode) n;
}
... | java | private static SpoutNode getDRPCSpoutNode(Collection<Node> g) {
for(Node n: g) {
if(n instanceof SpoutNode) {
SpoutNode.SpoutType type = ((SpoutNode) n).type;
if(type==SpoutNode.SpoutType.DRPC) {
return (SpoutNode) n;
}
... | [
"private",
"static",
"SpoutNode",
"getDRPCSpoutNode",
"(",
"Collection",
"<",
"Node",
">",
"g",
")",
"{",
"for",
"(",
"Node",
"n",
":",
"g",
")",
"{",
"if",
"(",
"n",
"instanceof",
"SpoutNode",
")",
"{",
"SpoutNode",
".",
"SpoutType",
"type",
"=",
"(",... | returns null if it's not a drpc group | [
"returns",
"null",
"if",
"it",
"s",
"not",
"a",
"drpc",
"group"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/TridentTopology.java#L563-L573 |
25,283 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SandBoxMaker.java | SandBoxMaker.sandboxPolicy | public String sandboxPolicy(String workerId, Map<String, String> replaceMap) throws IOException {
if (!isEnable) {
return "";
}
replaceMap.putAll(replaceBaseMap);
String tmpPolicy = generatePolicyFile(replaceMap);
File file = new File(tmpPolicy);
String poli... | java | public String sandboxPolicy(String workerId, Map<String, String> replaceMap) throws IOException {
if (!isEnable) {
return "";
}
replaceMap.putAll(replaceBaseMap);
String tmpPolicy = generatePolicyFile(replaceMap);
File file = new File(tmpPolicy);
String poli... | [
"public",
"String",
"sandboxPolicy",
"(",
"String",
"workerId",
",",
"Map",
"<",
"String",
",",
"String",
">",
"replaceMap",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"isEnable",
")",
"{",
"return",
"\"\"",
";",
"}",
"replaceMap",
".",
"putAll",
... | Generate command string | [
"Generate",
"command",
"string"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SandBoxMaker.java#L151-L169 |
25,284 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/task/TopologyContext.java | TopologyContext.setSubscribedState | public <T extends ISubscribedState> T setSubscribedState(String componentId, T obj) {
return setSubscribedState(componentId, Utils.DEFAULT_STREAM_ID, obj);
} | java | public <T extends ISubscribedState> T setSubscribedState(String componentId, T obj) {
return setSubscribedState(componentId, Utils.DEFAULT_STREAM_ID, obj);
} | [
"public",
"<",
"T",
"extends",
"ISubscribedState",
">",
"T",
"setSubscribedState",
"(",
"String",
"componentId",
",",
"T",
"obj",
")",
"{",
"return",
"setSubscribedState",
"(",
"componentId",
",",
"Utils",
".",
"DEFAULT_STREAM_ID",
",",
"obj",
")",
";",
"}"
] | Synchronizes the default stream from the specified state spout component id with the provided ISubscribedState object.
The recommended usage of this method is as follows:
<pre>
_myState = context.setSubscribedState(componentId, new MyState());
</pre>
@param componentId the id of the StateSpout component to subscribe ... | [
"Synchronizes",
"the",
"default",
"stream",
"from",
"the",
"specified",
"state",
"spout",
"component",
"id",
"with",
"the",
"provided",
"ISubscribedState",
"object",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/task/TopologyContext.java#L109-L111 |
25,285 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/task/TopologyContext.java | TopologyContext.getThisOutputFieldsForStreams | public Map<String, List<String>> getThisOutputFieldsForStreams() {
Map<String, List<String>> streamToFields = new HashMap<>();
for (String stream : this.getThisStreams()) {
streamToFields.put(stream, this.getThisOutputFields(stream).toList());
}
return streamToFields;
} | java | public Map<String, List<String>> getThisOutputFieldsForStreams() {
Map<String, List<String>> streamToFields = new HashMap<>();
for (String stream : this.getThisStreams()) {
streamToFields.put(stream, this.getThisOutputFields(stream).toList());
}
return streamToFields;
} | [
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"getThisOutputFieldsForStreams",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"streamToFields",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
... | Gets the declared output fields for the specified stream id for the component this task is a part of. | [
"Gets",
"the",
"declared",
"output",
"fields",
"for",
"the",
"specified",
"stream",
"id",
"for",
"the",
"component",
"this",
"task",
"is",
"a",
"part",
"of",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/task/TopologyContext.java#L157-L163 |
25,286 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/task/master/metrics/MetricsUploader.java | MetricsUploader.process | @Override
public void process(Object event) throws Exception {
int secOffset = TimeUtils.secOffset();
if (secOffset < UPLOAD_TIME_OFFSET_SEC) {
JStormUtils.sleepMs((UPLOAD_TIME_OFFSET_SEC - secOffset) * 1000);
} else if (secOffset == UPLOAD_TIME_OFFSET_SEC) {
// do no... | java | @Override
public void process(Object event) throws Exception {
int secOffset = TimeUtils.secOffset();
if (secOffset < UPLOAD_TIME_OFFSET_SEC) {
JStormUtils.sleepMs((UPLOAD_TIME_OFFSET_SEC - secOffset) * 1000);
} else if (secOffset == UPLOAD_TIME_OFFSET_SEC) {
// do no... | [
"@",
"Override",
"public",
"void",
"process",
"(",
"Object",
"event",
")",
"throws",
"Exception",
"{",
"int",
"secOffset",
"=",
"TimeUtils",
".",
"secOffset",
"(",
")",
";",
"if",
"(",
"secOffset",
"<",
"UPLOAD_TIME_OFFSET_SEC",
")",
"{",
"JStormUtils",
".",... | Wait UPLOAD_TIME_OFFSET_SEC sec to ensure we've collected enough metrics from
topology workers, note that it's not guaranteed metrics from all workers will be collected.
If we miss the offset, we'll sleep until the offset comes next minute. | [
"Wait",
"UPLOAD_TIME_OFFSET_SEC",
"sec",
"to",
"ensure",
"we",
"ve",
"collected",
"enough",
"metrics",
"from",
"topology",
"workers",
"note",
"that",
"it",
"s",
"not",
"guaranteed",
"metrics",
"from",
"all",
"workers",
"will",
"be",
"collected",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/task/master/metrics/MetricsUploader.java#L77-L91 |
25,287 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/utils/LinuxResource.java | LinuxResource.getDiskUsage | public static Double getDiskUsage() {
if (!OSInfo.isLinux() && !OSInfo.isMac()) {
return 0.0;
}
try {
String output = SystemOperation.exec("df -h " + duHome);
if (output != null) {
String[] lines = output.split("[\\r\\n]+");
if ... | java | public static Double getDiskUsage() {
if (!OSInfo.isLinux() && !OSInfo.isMac()) {
return 0.0;
}
try {
String output = SystemOperation.exec("df -h " + duHome);
if (output != null) {
String[] lines = output.split("[\\r\\n]+");
if ... | [
"public",
"static",
"Double",
"getDiskUsage",
"(",
")",
"{",
"if",
"(",
"!",
"OSInfo",
".",
"isLinux",
"(",
")",
"&&",
"!",
"OSInfo",
".",
"isMac",
"(",
")",
")",
"{",
"return",
"0.0",
";",
"}",
"try",
"{",
"String",
"output",
"=",
"SystemOperation",... | calculate the disk usage at current filesystem
@return disk usage, from 0.0 ~ 1.0 | [
"calculate",
"the",
"disk",
"usage",
"at",
"current",
"filesystem"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/LinuxResource.java#L213-L235 |
25,288 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/StormSubmitter.java | StormSubmitter.submitTopologyWithProgressBar | public static void submitTopologyWithProgressBar(String name, Map stormConf, StormTopology topology, SubmitOptions opts)
throws AlreadyAliveException, InvalidTopologyException {
/**
* progress bar is removed in jstorm
*/
submitTopology(name, stormConf, topology, opts);
... | java | public static void submitTopologyWithProgressBar(String name, Map stormConf, StormTopology topology, SubmitOptions opts)
throws AlreadyAliveException, InvalidTopologyException {
/**
* progress bar is removed in jstorm
*/
submitTopology(name, stormConf, topology, opts);
... | [
"public",
"static",
"void",
"submitTopologyWithProgressBar",
"(",
"String",
"name",
",",
"Map",
"stormConf",
",",
"StormTopology",
"topology",
",",
"SubmitOptions",
"opts",
")",
"throws",
"AlreadyAliveException",
",",
"InvalidTopologyException",
"{",
"/**\n * prog... | Submits a topology to run on the cluster with a progress bar. A topology runs forever or until explicitly killed.
@param name the name of the storm.
@param stormConf the topology-specific configuration. See {@link Config}.
@param topology the processing to execute.
@param opts to manipulate the starting of ... | [
"Submits",
"a",
"topology",
"to",
"run",
"on",
"the",
"cluster",
"with",
"a",
"progress",
"bar",
".",
"A",
"topology",
"runs",
"forever",
"or",
"until",
"explicitly",
"killed",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/StormSubmitter.java#L194-L200 |
25,289 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/transactional/state/KeyRangeState.java | KeyRangeState.classifyBatch | private Map<Integer, Map<K, V>> classifyBatch(Map<K, V> batch) {
Map<Integer, Map<K, V>> classifiedBatch = new HashMap<Integer, Map<K, V>>();
for (Entry<K, V> entry : batch.entrySet()) {
int keyRange = hash(entry.getKey());
Map<K, V> subBatch = classifiedBatch.get(keyRange);
... | java | private Map<Integer, Map<K, V>> classifyBatch(Map<K, V> batch) {
Map<Integer, Map<K, V>> classifiedBatch = new HashMap<Integer, Map<K, V>>();
for (Entry<K, V> entry : batch.entrySet()) {
int keyRange = hash(entry.getKey());
Map<K, V> subBatch = classifiedBatch.get(keyRange);
... | [
"private",
"Map",
"<",
"Integer",
",",
"Map",
"<",
"K",
",",
"V",
">",
">",
"classifyBatch",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"batch",
")",
"{",
"Map",
"<",
"Integer",
",",
"Map",
"<",
"K",
",",
"V",
">",
">",
"classifiedBatch",
"=",
"new",... | classify batch into several sub-batches for each key range
@param batch covers several key range
@return sub-batches which map to different key range | [
"classify",
"batch",
"into",
"several",
"sub",
"-",
"batches",
"for",
"each",
"key",
"range"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/transactional/state/KeyRangeState.java#L175-L187 |
25,290 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/zk/Zookeeper.java | Zookeeper.mkClient | public CuratorFramework mkClient(Map conf, List<String> servers, Object port,
String root, final WatcherCallBack watcher) {
CuratorFramework fk = Utils.newCurator(conf, servers, port, root);
fk.getCuratorListenable().addListener(new CuratorListener() {
... | java | public CuratorFramework mkClient(Map conf, List<String> servers, Object port,
String root, final WatcherCallBack watcher) {
CuratorFramework fk = Utils.newCurator(conf, servers, port, root);
fk.getCuratorListenable().addListener(new CuratorListener() {
... | [
"public",
"CuratorFramework",
"mkClient",
"(",
"Map",
"conf",
",",
"List",
"<",
"String",
">",
"servers",
",",
"Object",
"port",
",",
"String",
"root",
",",
"final",
"WatcherCallBack",
"watcher",
")",
"{",
"CuratorFramework",
"fk",
"=",
"Utils",
".",
"newCur... | connect ZK, register watchers | [
"connect",
"ZK",
"register",
"watchers"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/zk/Zookeeper.java#L62-L90 |
25,291 | alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/blobstore/HdfsBlobStore.java | HdfsBlobStore.prepareInternal | protected void prepareInternal(Map conf, String overrideBase, Configuration hadoopConf) {
this.conf = conf;
if (overrideBase == null) {
overrideBase = (String)conf.get(Config.BLOBSTORE_DIR);
}
if (overrideBase == null) {
throw new RuntimeException("You must specif... | java | protected void prepareInternal(Map conf, String overrideBase, Configuration hadoopConf) {
this.conf = conf;
if (overrideBase == null) {
overrideBase = (String)conf.get(Config.BLOBSTORE_DIR);
}
if (overrideBase == null) {
throw new RuntimeException("You must specif... | [
"protected",
"void",
"prepareInternal",
"(",
"Map",
"conf",
",",
"String",
"overrideBase",
",",
"Configuration",
"hadoopConf",
")",
"{",
"this",
".",
"conf",
"=",
"conf",
";",
"if",
"(",
"overrideBase",
"==",
"null",
")",
"{",
"overrideBase",
"=",
"(",
"St... | Allow a Hadoop Configuration to be passed for testing. If it's null then the hadoop configs
must be in your classpath. | [
"Allow",
"a",
"Hadoop",
"Configuration",
"to",
"be",
"passed",
"for",
"testing",
".",
"If",
"it",
"s",
"null",
"then",
"the",
"hadoop",
"configs",
"must",
"be",
"in",
"your",
"classpath",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/blobstore/HdfsBlobStore.java#L112-L153 |
25,292 | alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/trident/HdfsState.java | HdfsState.getTxnRecord | private TxnRecord getTxnRecord(Path indexFilePath) throws IOException {
Path tmpPath = tmpFilePath(indexFilePath.toString());
if (this.options.fs.exists(indexFilePath)) {
return readTxnRecord(indexFilePath);
} else if (this.options.fs.exists(tmpPath)) {
return readTxnReco... | java | private TxnRecord getTxnRecord(Path indexFilePath) throws IOException {
Path tmpPath = tmpFilePath(indexFilePath.toString());
if (this.options.fs.exists(indexFilePath)) {
return readTxnRecord(indexFilePath);
} else if (this.options.fs.exists(tmpPath)) {
return readTxnReco... | [
"private",
"TxnRecord",
"getTxnRecord",
"(",
"Path",
"indexFilePath",
")",
"throws",
"IOException",
"{",
"Path",
"tmpPath",
"=",
"tmpFilePath",
"(",
"indexFilePath",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"this",
".",
"options",
".",
"fs",
".",
"e... | Reads the last txn record from index file if it exists, if not
from .tmp file if exists.
@param indexFilePath the index file path
@return the txn record from the index file or a default initial record.
@throws IOException | [
"Reads",
"the",
"last",
"txn",
"record",
"from",
"index",
"file",
"if",
"it",
"exists",
"if",
"not",
"from",
".",
"tmp",
"file",
"if",
"exists",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/trident/HdfsState.java#L470-L478 |
25,293 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/codahale/EWMA.java | EWMA.tick | public void tick() {
final long count = uncounted.sumThenReset();
final double instantRate = count / interval;
if (initialized) {
rate += (alpha * (instantRate - rate));
} else {
rate = instantRate;
initialized = true;
}
} | java | public void tick() {
final long count = uncounted.sumThenReset();
final double instantRate = count / interval;
if (initialized) {
rate += (alpha * (instantRate - rate));
} else {
rate = instantRate;
initialized = true;
}
} | [
"public",
"void",
"tick",
"(",
")",
"{",
"final",
"long",
"count",
"=",
"uncounted",
".",
"sumThenReset",
"(",
")",
";",
"final",
"double",
"instantRate",
"=",
"count",
"/",
"interval",
";",
"if",
"(",
"initialized",
")",
"{",
"rate",
"+=",
"(",
"alpha... | Mark the passage of time and decay the current rate accordingly. | [
"Mark",
"the",
"passage",
"of",
"time",
"and",
"decay",
"the",
"current",
"rate",
"accordingly",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/common/metric/codahale/EWMA.java#L94-L103 |
25,294 | alibaba/jstorm | example/sequence-split-merge/src/main/java/org/apache/storm/starter/tools/Rankings.java | Rankings.pruneZeroCounts | public void pruneZeroCounts() {
int i = 0;
while (i < rankedItems.size()) {
if (rankedItems.get(i).getCount() == 0) {
rankedItems.remove(i);
} else {
i++;
}
}
} | java | public void pruneZeroCounts() {
int i = 0;
while (i < rankedItems.size()) {
if (rankedItems.get(i).getCount() == 0) {
rankedItems.remove(i);
} else {
i++;
}
}
} | [
"public",
"void",
"pruneZeroCounts",
"(",
")",
"{",
"int",
"i",
"=",
"0",
";",
"while",
"(",
"i",
"<",
"rankedItems",
".",
"size",
"(",
")",
")",
"{",
"if",
"(",
"rankedItems",
".",
"get",
"(",
"i",
")",
".",
"getCount",
"(",
")",
"==",
"0",
")... | Removes ranking entries that have a count of zero. | [
"Removes",
"ranking",
"entries",
"that",
"have",
"a",
"count",
"of",
"zero",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/example/sequence-split-merge/src/main/java/org/apache/storm/starter/tools/Rankings.java#L138-L147 |
25,295 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStore.java | BlobStore.validateKey | public static final void validateKey(String key) throws IllegalArgumentException {
if (StringUtils.isEmpty(key) || "..".equals(key) || ".".equals(key) || !KEY_PATTERN.matcher(key).matches()) {
LOG.error("'{}' does not appear to be valid {}", key, KEY_PATTERN);
throw new IllegalArgumentEx... | java | public static final void validateKey(String key) throws IllegalArgumentException {
if (StringUtils.isEmpty(key) || "..".equals(key) || ".".equals(key) || !KEY_PATTERN.matcher(key).matches()) {
LOG.error("'{}' does not appear to be valid {}", key, KEY_PATTERN);
throw new IllegalArgumentEx... | [
"public",
"static",
"final",
"void",
"validateKey",
"(",
"String",
"key",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"key",
")",
"||",
"\"..\"",
".",
"equals",
"(",
"key",
")",
"||",
"\".\"",
".",
"equals... | Validates key checking for potentially harmful patterns
@param key Key for the blob. | [
"Validates",
"key",
"checking",
"for",
"potentially",
"harmful",
"patterns"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStore.java#L149-L154 |
25,296 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStore.java | BlobStore.readBlobTo | public void readBlobTo(String key, OutputStream out) throws IOException, KeyNotFoundException {
InputStreamWithMeta in = getBlob(key);
if (in == null) {
throw new IOException("Could not find " + key);
}
byte[] buffer = new byte[2048];
int len = 0;
try{
... | java | public void readBlobTo(String key, OutputStream out) throws IOException, KeyNotFoundException {
InputStreamWithMeta in = getBlob(key);
if (in == null) {
throw new IOException("Could not find " + key);
}
byte[] buffer = new byte[2048];
int len = 0;
try{
... | [
"public",
"void",
"readBlobTo",
"(",
"String",
"key",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
",",
"KeyNotFoundException",
"{",
"InputStreamWithMeta",
"in",
"=",
"getBlob",
"(",
"key",
")",
";",
"if",
"(",
"in",
"==",
"null",
")",
"{",
"t... | Reads the blob from the blob store
and writes it into the output stream.
@param key Key for the blob.
@param out Output stream
privilege for the blob.
@throws IOException
@throws KeyNotFoundException | [
"Reads",
"the",
"blob",
"from",
"the",
"blob",
"store",
"and",
"writes",
"it",
"into",
"the",
"output",
"stream",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStore.java#L217-L232 |
25,297 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStore.java | BlobStore.readBlob | public byte[] readBlob(String key) throws IOException, KeyNotFoundException{
ByteArrayOutputStream out = new ByteArrayOutputStream();
readBlobTo(key, out);
byte[] bytes = out.toByteArray();
out.close();
return bytes;
} | java | public byte[] readBlob(String key) throws IOException, KeyNotFoundException{
ByteArrayOutputStream out = new ByteArrayOutputStream();
readBlobTo(key, out);
byte[] bytes = out.toByteArray();
out.close();
return bytes;
} | [
"public",
"byte",
"[",
"]",
"readBlob",
"(",
"String",
"key",
")",
"throws",
"IOException",
",",
"KeyNotFoundException",
"{",
"ByteArrayOutputStream",
"out",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"readBlobTo",
"(",
"key",
",",
"out",
")",
";",
... | Wrapper around readBlobTo which
returns a ByteArray output stream.
@param key Key for the blob.
the read privilege for the blob.
@return ByteArrayOutputStream
@throws IOException
@throws KeyNotFoundException | [
"Wrapper",
"around",
"readBlobTo",
"which",
"returns",
"a",
"ByteArray",
"output",
"stream",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStore.java#L243-L249 |
25,298 | alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/FileLock.java | FileLock.logProgress | private void logProgress(String fileOffset, boolean prefixNewLine)
throws IOException {
long now = System.currentTimeMillis();
LogEntry entry = new LogEntry(now, componentID, fileOffset);
String line = entry.toString();
if(prefixNewLine) {
lockFileStream.writeBytes(System.lineSeparator()... | java | private void logProgress(String fileOffset, boolean prefixNewLine)
throws IOException {
long now = System.currentTimeMillis();
LogEntry entry = new LogEntry(now, componentID, fileOffset);
String line = entry.toString();
if(prefixNewLine) {
lockFileStream.writeBytes(System.lineSeparator()... | [
"private",
"void",
"logProgress",
"(",
"String",
"fileOffset",
",",
"boolean",
"prefixNewLine",
")",
"throws",
"IOException",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"LogEntry",
"entry",
"=",
"new",
"LogEntry",
"(",
"now",
... | partial writes of prior lines | [
"partial",
"writes",
"of",
"prior",
"lines"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/FileLock.java#L79-L93 |
25,299 | alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/FileLock.java | FileLock.release | public void release() throws IOException {
lockFileStream.close();
if(!fs.delete(lockFile, false)) {
LOG.warn("Unable to delete lock file, Spout = {}", componentID);
throw new IOException("Unable to delete lock file");
}
LOG.debug("Released lock file {}. Spout {}", lockFile, componentID);
... | java | public void release() throws IOException {
lockFileStream.close();
if(!fs.delete(lockFile, false)) {
LOG.warn("Unable to delete lock file, Spout = {}", componentID);
throw new IOException("Unable to delete lock file");
}
LOG.debug("Released lock file {}. Spout {}", lockFile, componentID);
... | [
"public",
"void",
"release",
"(",
")",
"throws",
"IOException",
"{",
"lockFileStream",
".",
"close",
"(",
")",
";",
"if",
"(",
"!",
"fs",
".",
"delete",
"(",
"lockFile",
",",
"false",
")",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"Unable to delete lock file,... | Release lock by deleting file
@throws IOException if lock file could not be deleted | [
"Release",
"lock",
"by",
"deleting",
"file"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/FileLock.java#L98-L105 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.