Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View PharkMillups's full-sized avatar

Mark Phillips PharkMillups

  • Helium
  • Boston / San Francisco
View GitHub Profile
johne # I have some questions about limits and was hoping someone could help
me out. If I understand correctly, riak does not impose a limit on the number
of buckets, but the chosen backstore may impose some practical limits. Is this correct?
arg # pretty much, yes
johne # There appears to be a similar situation with the number of keys.
arg # innostore currently creates a file per bucket/partition combo
but all other backends use one file per partition unless you really want
void
loop()
{
//Create Json object with buffer to match data size
StaticJsonBuffer<JSON_OBJECT_SIZE(2) + 35> jsonBuffer;
JsonObject & root = jsonBuffer.createObject();
root[F("interval")] = send_interval; //JSON MESSAGE
char buffer[HELIUM_MAX_DATA_SIZE];
size_t used = root.printTo(buffer, HELIUM_MAX_DATA_SIZE);
/*
* Copyright 2017, Helium Systems, Inc.
* All Rights Reserved. See LICENCE.txt for license information
*/
#include "Arduino.h"
#include "Board.h"
#include "Helium.h"
#include "HeliumUtil.h"
### Keybase proof
I hereby claim:
* I am pharkmillups on github.
* I am themarkphillips (https://keybase.io/themarkphillips) on keybase.
* I have a public key ASBYZtj0kDhPbhXLsGtT5BKb3qokovBx_WB0aTIae4AyzQo
To claim this, I am signing this object:
@PharkMillups
PharkMillups / pbc.sh
Created July 29, 2013 22:51
Riaks Counters vis PBC API
// Counter update request
message RpbCounterUpdateReq {
required bytes bucket = 1;
required bytes key = 2;
required sint64 amount = 3;
optional uint32 w = 4;
optional uint32 dw = 5;
optional uint32 pw = 6;
optional bool returnvalue = 7;
// Create a new bucket in Riak and enable `allow_mult`
$ curl -i http://localhost:8098/buckets/new_hotness/props \
-X PUT -d '{"props":{"allow_mult":true}}' -H "Content-Type: application/json"
// POST to the `counters` resource. In this example we're adding "1" to the "riak-counters-blog-post-views" counter
$ curl -i http://localhost:8098/buckets/new_hotness/counters/riak-counters-blog-post-views \
-X POST -d "1"
@PharkMillups
PharkMillups / gist:5630223
Last active December 17, 2015 15:18
Crispy Tailors in San Francisco
db.getBucket('airlines', function(err, properties) {
  console.log(properties.dw);

});

db.search.add('airlines', {id: 'Lufthansa', country: 'DE'});

db.search.find('airlines', 'country:DE');

var db = require('riak-js').getClient();

db.mapreduce.add('airlines').map('Riak.mapValuesJson').run();