Apache Storm Topology used by cenote for querying data.
- The
drpc-spout
Spout continiully listens for client requests. - Everytime it consumes a request, it passes it down to
calculate-data
Bolt. - This bolt (which is written in Python) reads the input arguments, calculates the desired results and passes it to
return
Bolt. return
Bolt, then, sends the (converted to a JSON string) result back to the client.
- Compile the source code:
$ mvn clean package
- Submit the topology to the cluster:
$ storm jar path/to/read-0.1.0-jar-with-dependencies.jar com.issel.cenote.ReadTopology ReadTopology
const drpcjs = require('drpcjs');
const drpc = new drpcjs({ host: '83.212.104.172' }); // Using DNS records (e.g. snf-{...}) won't work.
drpc.execute('read', JSON.stringify({
cql: {
mode: "select",
table: "someTable",
columns: "name,age,blabla"
}
})).then(res => console.log(res)).catch(console.error);