show dbs
This file contains 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 |
This file contains 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 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 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 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
##################### ElasticSearch Configuration Example ##################### | |
# This file contains an overview of various configuration settings, | |
# targeted at operations staff. Application developers should | |
# consult the guide at <http://elasticsearch.org/guide>. | |
# | |
# The installation procedure is covered at | |
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>. | |
# | |
# ElasticSearch comes with reasonable defaults for most settings, |
This file contains 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
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands | |
# cat paths | |
/_cat/allocation | |
/_cat/shards | |
/_cat/shards/{index} | |
/_cat/master | |
/_cat/nodes | |
/_cat/indices | |
/_cat/indices/{index} |
This file contains 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
import {HttpClientModule} from '@angular/common/http'; | |
@NgModule({ | |
declarations: [ | |
AppComponent | |
], | |
imports: [ | |
BrowserModule, | |
HttpClientModule | |
], |
This file contains 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
-server | |
-Xms2048m | |
-Xmx2048m | |
-XX:NewSize=512m | |
-XX:MaxNewSize=512m | |
-XX:PermSize=512m | |
-XX:MaxPermSize=512m | |
-XX:+UseParNewGC | |
-XX:ParallelGCThreads=4 | |
-XX:MaxTenuringThreshold=1 |
This file contains 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
# Plain Ol' Node | |
node --max_old_space_size=1024 app.js # increase to 1gb | |
node --max_old_space_size=2048 app.js # increase to 2gb | |
node --max_old_space_size=3072 app.js # increase to 3gb | |
node --max_old_space_size=4096 app.js # increase to 4gb | |
node --max_old_space_size=5120 app.js # increase to 5gb | |
node --max_old_space_size=6144 app.js # increase to 6gb | |
# For pm2 | |
pm2 start app.js --node-args="--max_old_space_size=1024" # increase to 1gb |
NewerOlder