Member since
06-16-2016
16
Posts
2
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
2462 | 12-27-2016 12:46 PM |
12-27-2016
12:48 PM
if (readConfiguration.getInstance()
.getPropertyMap()
.containsKey(word.replace("#", ""))) {
String companyName = readConfiguration
.getPropertyMap().get(
word.replace("#", "")); This logic is been implemented and getting the desired output. Thanks.
... View more
12-27-2016
12:46 PM
Its working properly I have applied this logic if (readConfiguration.getInstance()
.getPropertyMap()
.containsKey(word.replace("#", ""))) {
String companyName = readConfiguration
.getPropertyMap().get(
word.replace("#", "")); Thanks.
... View more
12-27-2016
04:04 AM
for almost 50 different companies I have to use it eg:#google=google,#yahoo=yahoo and so on
... View more
12-26-2016
12:12 PM
@Rajkumar Singh
config.properties yahoo=yahoo
google=google #google=google(This is actually what I want to do but I know its comment in config.properties file) Read configuration.class public class ReadConfiguration implements Serializable { private static ReadConfiguration readConfiguration;
private static HashMap<String, String> propertyMap; public static HashMap<String, String> getPropertyMap() { return propertyMap;
} private ReadConfiguration() {
} public static synchronized ReadConfiguration getInstance() {
if (readConfiguration == null) {
readConfiguration = new ReadConfiguration();
propertyMap = readConfiguration
.readConfiguration("/configuration.properties");
}
return readConfiguration; } public HashMap<String, String> readConfiguration(String path)
throws NullPointerException {
HashMap<String, String> propertyMap = new HashMap<String, String>(); InputStream input = null; try { input = ReadConfiguration.class.getResourceAsStream(path);// /configuration Properties properties = new Properties(); properties.load(input); Set<String> propertyNames = properties.stringPropertyNames(); for (String Property : propertyNames) { Enumeration<?> e = properties.propertyNames(); while (e.hasMoreElements()) {
String key = (String) e.nextElement(); String value = properties.getProperty(key); propertyMap.put(Property, properties.getProperty(Property));
}
}
} catch (IOException ex) {
ex.printStackTrace();
}
return propertyMap;
}
} kafka.class if (nullHandler.checkNull(tweetAsMap
.get(TwitterProcessingPipelineConstants.TEXT))) {
String tweetTextAsString = tweetAsMap.get(
"text").toString(); tweetBean.setText(tweetTextAsString);
logger.info("The Text --> " + tweetTextAsString); for (String word : tweetTextAsString
.toLowerCase().split(" ")) {
if (readConfiguration.getInstance()
.getPropertyMap().containsKey(word)) {
String companyName = readConfiguration
.getPropertyMap().get(word);// tweetBean.setCompanyName(companyName); break; }
} This
is what we have done in read config class we are taking company name
from config.properties without any special character we are able to get
the desired output.But as mentioned above for # how I can get the desired output. Thanks in advance.
... View more
12-26-2016
09:14 AM
I want to use # symbol in config.properties . I know that # is used for comment in config.properties but I want to use it as a part of keyword. eg: #google=google #microsoft=microsoft I need this for getting tweets having hashtag(#)of google. Is this possible?
If yes then how and if no then why? Thanks in advance.
... View more
Labels:
- Labels:
-
Apache Kafka
09-09-2016
12:10 PM
2 Kudos
Getting the above exception .How to solve this? Unable to put data in elastic search. and In configuration in Identifier Attribute what must be given? Cluster Name
elasticsearch
ElasticSearch Hosts
D-9033.xyz.com:9200
SSL Context Service
No value set
Shield Plugin Filename
No value set
Username
No value set
Password
No value set
ElasticSearch Ping Timeout
5s
Sampler Interval
5s
Identifier Attribute
twt
Index
tweet_google_1461888000_1477440000
Type
twt
Character Set
UTF-8
Batch Size
10
Index Operation
index
... View more
Labels:
- Labels:
-
Apache Kafka
-
Apache NiFi
06-24-2016
12:33 PM
Thanks a lot
... View more
06-24-2016
10:43 AM
Thanks for reply. we wanna run it on local cluster only
... View more
06-24-2016
08:23 AM
Thanks for reply . we are reading messages from kafka and trying to put it in hbase table. TopologyBuilder builder = new TopologyBuilder(); builder.setSpout("message-spout", kafkaSpout); builder.setBolt("message-bolt", new ReadTopicBolt()).shuffleGrouping("message-spout"); builder.setBolt("hbase-bolt", new HbasePutBolt2()).shuffleGrouping("message-bolt"); cluster.submitTopology("KafkaStorm", config, builder.createTopology()); Thread.sleep(100000); but when message are in excess we wanna increase the sleep time everytime. we used to use "awaitTermination" in spark. but for STORM is their same functionality which we can use. i.e for processing the spout and bolt completely and then to shutdown the topology.
... View more
06-24-2016
07:31 AM
as there is awaitTermination in spark is there any other method in storm . Any help would be appreciated. Thanks.
... View more
Labels: