show dbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/ | |
// JavaScript regex trick: Parse a query string into an object | |
var queryString = {}; | |
anchor.href.replace( | |
new RegExp("([^?=&]+)(=([^&]*))?", "g"), | |
function($0, $1, $2, $3) { queryString[$1] = $3; } | |
); | |
// Usage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The object creation time can be set to object’s identifier property. | |
* For this purpose, System.currentTimeMillis() can be used. However, | |
* two or more objects may be created in a single millisecond. | |
* In this case, these objects will have the same id which is unacceptable. | |
* One way to cope with this problem is to use System.nanoTime(). | |
* Even if the nano time is the smallest interval we can use, it does not | |
* also guarantee the uniqueness. To provide unique time stamps, | |
* I got help from AtomicReference class as follows. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"retweeted_status": { | |
"contributors": null, | |
"text": "#Crowdsourcing – drivers already generate traffic data for your smartphone to suggest alternative routes when a road is clogged. #bigdata", | |
"geo": null, | |
"retweeted": false, | |
"in_reply_to_screen_name": null, | |
"truncated": false, | |
"entities": { | |
"urls": [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Producer | |
Setup | |
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3 | |
Single thread, no replication | |
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196 |
OlderNewer