Create topcis.json
{
"version": 1,
"topics": [
{ "topic": "my-sample-topic"
| using System; | |
| using System.Collections.Concurrent; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using MimeKit; | |
| using MimeKit.Text; |
| /* | |
| * This script reads the existing partition assignments in JSON (exported using kafka-reassign-partitions.sh) and generates | |
| * the appropriate reassignment JSON file for input to kafka-reassign-partitions.sh. | |
| * | |
| */ | |
| var usage = ` | |
| Usage: node increase-replication-factory.js (brokers) (replication factor) (current assignment file) (output file) [-f] | |
| * brokers: comma separated list of brokers | |
| * replication factor: the new replication factor to use |
| curl http://spark-cluster-ip:6066/v1/submissions/status/driver-20151008145126-0000 |
In the below keyboard shortcuts, I use the capital letters for reading clarity but this does not imply shift, if shift is needed, I will say shift. So ⌘ + D does not mean hold shift. ⌘ + Shift + D does of course.
| Function | Shortcut |
|---|---|
| New Tab | ⌘ + T |
| Close Tab or Window | ⌘ + W (same as many mac apps) |
| Go to Tab | ⌘ + Number Key (ie: ⌘2 is 2nd tab) |
| Go to Split Pane by Direction | ⌘ + Option + Arrow Key |
| package demo; | |
| import java.io.IOException; | |
| import java.util.StringTokenizer; | |
| import org.apache.hadoop.conf.Configuration; | |
| import org.apache.hadoop.conf.Configured; | |
| import org.apache.hadoop.fs.Path; | |
| import org.apache.hadoop.io.LongWritable; | |
| import org.apache.hadoop.io.MapWritable; |
| // pre-render d3 charts at server side | |
| var d3 = require('d3') | |
| , jsdom = require('jsdom') | |
| , fs = require('fs') | |
| , htmlStub = '<html><head></head><body><div id="dataviz-container"></div><script src="js/d3.v3.min.js"></script></body></html>' | |
| jsdom.env({ | |
| features : { QuerySelector : true } | |
| , html : htmlStub | |
| , done : function(errors, window) { |
Press minus + shift + s and return to chop/fold long lines!
| .DS_Store | |
| tmp/ |
| db = db.getSisterDB("config"); | |
| var mongosConn = db; // assume we connected to a mongos to get going | |
| var res = null; | |
| function check() { | |
| printjson(res); | |
| if( !res || !res.ok ) { | |
| throw "check(): not ok, stopping"; |