tpjg / goriakpbc Goto Github PK
View Code? Open in Web Editor NEWA golang riak client inspired by the Ruby riak-client from Basho and riakpbc from mrb
License: Other
A golang riak client inspired by the Ruby riak-client from Basho and riakpbc from mrb
License: Other
After converting my code to use the new bucket types my tests for the existence of objects are failing. .Exists() currently returns false
no matter what.
The SetChanWaitTimeout() function uses an int instead of the more appropriate time.Duration. I plan to create a patch that will use time.Duration instead.
I realize this means some existing programs may break if they're using the SetChanWaitTimeout() function.
So, especially @etix , please be aware of this small API change.
Hey @tpjg! This client is excellent. A few of us inside Basho would like to fork it and maintain it as an "official" library. Would you be comfortable with this collaboration? The intention is to continue to share this code in the open.
The new home of the Go protobuf library is https://github.com/golang/protobuf
You might also consider using the faster protobuf implementation available at https://github.com/gogo/protobuf .
As pointed out in PR #88, Travis CI randomly fails in search_test.go on line 40. Re-running the tests on Travis can remove the error, and it hasn't been reproducible locally. This needs fixing on Travis, or the test needs work to make it more robust.
Commit 1ed4ed5 breaks the ability for an application to safely create models (for insert) using just LoadModelFrom. Before, even if no tombstone was sent, the model was initialized for use, so the following code would work:
if err := con.LoadModelFrom("bucket", "key", &model); err != riak.NotFound {
return err
} else {
// Do stuff to the model.
if err = model.Save(); err != nil {
return err
}
}
I would think this is the desired behaviour, as only calling LoadModelFrom would call into Riak to find tombstones. NewModel doesn't make sense, as different people may want different behaviour when NewModel is called with a key with already existing data (ie should that fail, claiming key exists, silently ignore and overwrite, or silently ignore and not specify an existing Vclock.) Otherwise, an new function is required.
Hello,
I've been searching for a way to run a map/reduce on a single bucket using this library but I haven't found a way to do so.
Does this support such a thing or it needs to be added?
Thanks.
Currently it appears we are unable to search via the client pool.
Trying to run the example:
package main
import (
"fmt"
"github.com/tpjg/goriakpbc"
)
func main() {
err := riak.ConnectClient("127.0.0.1:8097")
if err != nil {
fmt.Println("Cannot connect, is Riak running?")
return
}
bucket, _ := riak.NewBucket("tstriak")
obj := bucket.New("tstobj")
obj.ContentType = "application/json"
obj.Data = []byte("{'field':'value'}")
obj.Store()
fmt.Printf("Stored an object in Riak, vclock = %v\n", obj.Vclock)
client.Close()
}
Error message on compile:
# command-line-arguments
./riak.go:23: undefined: client
Riak 1.4 added support for paginating through secondary indexes with the "max_results" option: http://basho.com/riak-1-4-secondary-indexes/
I'm happy to summit a pull request, but looking for feedback before getting started. My thought was to add IndexQueryPage and IndexQueryRangePage functions which would take a limit and continuation in addition to the other needed arguments.
Would this be an acceptable approach?
Thanks,
John
Hello,
Is there a way to run reduce queries not just the map ones using this library or does it need to be added?
Thanks.
For example, given this sample code:
r, a, b, e := riakClient.Search(&riak.Search{Q: query, Index: "invites"})
if e != nil {
println(e)
}
with a junk query Dolphins:1 AND Forks:
displays the following error:
(0x6cee80,0xc210098210)
Given that the empty querystring after Forks
is not valid (I think), it should output something more to that effect. The command-line search client outputs something like 'badmatch'.
Are there any plans to introduce the ability to set last_write_wins property on buckets?
There seems no way to set search schemas.
I just pulled this and built it in Docker successfully but running it nets me a 'invoke-rc.d: policy-rc.d denied execution of restart.' error.
Investigation seems to say I need to edit a file on the system, but I don't feel like that's something I should have to mod the Dockerfile manually for...
Console print:
$ docker run bukkit-db
No SSH host key available. Generating one...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
Creating SSH2 ED25519 key; this may take some time ...
invoke-rc.d: policy-rc.d denied execution of restart.
*** /etc/my_init.d/99_automatic_clustering.sh failed with status 127
I would like to model something like:
Person = { Cars: [{plate: 123}, {plate: 345}]
}
And add a secondary index "plate-number" for each car the person owns. But I can't find a way to do it with the API.
(I'm trying to do this example http://cdn.oreillystatic.com/en/assets/1/event/61/Querying%20Riak%20Just%20Got%20Easier%20-%20Introducing%20Secondary%20Indices%20Presentation%201.pdf , page 37)
Are the CRDT Riak maps supported by this library? The functions and type are there (though undocumented), and the only method that appears to create one is .Fetchmap()
which when used on an empty key produces a panic:
panic: interface conversion: riak.RDataType is *riak.RDtCounter, not *riak.RDtMap
I've attempted to create my own from the type as well, manually setting the internal Key
and Bucket
but when I try .Store()
it, well, doesn't work, example:
testMap := new(riak.RDtMap)
testMap.Key = "testkey"
testMap.Bucket = bucket
err = testMap.Store()
if err != nil {
fmt.Fatalln("Could not store RDtMap", err)
}
This produces:
Could not store RDtMap "non-counter operation on default bucket"
Before I dive into this further trying to get it to work, are the CRDT types thought/intended to be supported by this library atm? If so is this a bug or am I missing something obvious?
Is it possible to use Riak Search from this client ?
I would like to create a NewObject with no key and have riak assign the key for me. Is that possible?
It is a bit unclear to me that what Riak/Go versions this library supports. It seems that it supports Go 1.0 and Riak 1.4? Is it a valid assumption that we can drop Go 1.0 support at sometime? (for the model_11.go
file, for example)
I'm new to Riak, but I think there's some big changes in Riak 2. What's the support for it? I see that there are the rdatatype.go
and related files, but I can't really figure out how they are used. In particular, when using the ORM, are data types used under the hood, or not at all?
I may be missing something here, but any pointers will be appreciated! Thanks :)
I'm having trouble understanding the following:
type RDtFlag struct {
Value bool
Enabled bool
Disabled bool
}
Flag should just be a boolean, and if that's the case, why do we need Value, Enabled and Disabled? In particular, can it both be Enabled and Disabled, and if not, why do we need two?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.