Skip to content

Commit

Permalink
Updated Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
khaf committed Aug 21, 2014
1 parent d47fa79 commit e8cfdce
Show file tree
Hide file tree
Showing 17 changed files with 898 additions and 51 deletions.
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Change history

## Aug 20 2014 (Beta 1)

Major changes and improvements.

* **New Features**:

* Added client.Query()
* Added client.ScanNode()/All()
* Added client.Operate()
* Added client.CreateIndex()
* Added client.DropIndex()
* Added client.RegisterUDF()
* Added client.RegisterUDFFromFile()
* Added client.Execute()
* Added client.ExecuteUDF()
* Added client.BatchGet()
* Added client.BatchGetHeader()
* Added client.BatchExists()
* Added LDT implementation
* Added `Node` and `Key` references to the Record

* **Changes**:

* Many minor and major bug fixes
* Potentially breaking change: Reduced Undocumented API surface
* Fixed a few places where error results were not checked
* Breaking Change: Convert Key.namespace & Key.setName from pointer to string; affects Key API
* Renamed all `this` receivers to appropriate names
* Major performance improvements (~2X improvements in speed and memory consumption):
* better memory management for commands; won't allocate if capacity is big enough
* better hash management in key; avoids two redundant memory allocs
* use a buffer pool to reduce GC load
* fine-grained, customizable and deterministic buffer pool implementation for command

* Optimizations for Key & Digest
* changed digest implementation, removed an allocation
* Added RIPEMD160 hash files from crypto to lib
* pool hash objects

* Various Benchmark tool improvements
* now profileable using localhost:6060
* minor bug fixes

## Jul 26 2014 (Alpha)

* Initial Release.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Aerospike Go Client (BETA)
# Aerospike Go Client (BETA1)

An Aerospike library for Go.

Expand All @@ -7,11 +7,12 @@ This library is compatible with Go 1.2+ and supports the following operating sys
- [Usage](#Usage)
- [Prerequisites](#Prerequisites)
- [Installation](#Installation)
- [Tweaking Performance](#Performance)
- [Benchmarks](#Benchmarks)
- [API Documentaion](#API-Documentation)
- [Tests](#Tests)
- [Examples](#Examples)
- [Tools](#Tools)
- [Benchmarks](#Benchmarks)
- [API Documentaion](#API-Documentation)


## Usage:
Expand Down Expand Up @@ -79,7 +80,6 @@ Details about the API are available in the [`docs`](docs) directory.
To install the latest stable version of Go, visit
[http://golang.org/dl/](http://golang.org/dl/)

[Mercurial SCM](http://mercurial.selenic.com/) To fetch a dependent library using ```go get```.

Aerospike Go client implements the wire protocol, and does not depend on the C client.
It is goroutine friendly, and works asynchronously.
Expand All @@ -93,7 +93,7 @@ Supported operating systems:
<a name="Installation"></a>
## Installation:

1. Install Go 1.2+ and setup your environment as [Documented](http://golang.org/doc/code.html#GOPATH)
1. Install Go 1.2+ and setup your environment as [Documented](http://golang.org/doc/code.html#GOPATH) here.
2. Get the client in your ```GOPATH``` : ```go get github.com/aerospike/aerospike-client-go```
* To update the client library: ```go get -u github.com/aerospike/aerospike-client-go```

Expand All @@ -103,6 +103,13 @@ Supported operating systems:
* to build: ```go build -o <output> <filename.go>```
* example: ```go build -o benchmark tools/benchmark/benchmark.go```

<a name="Performance"></a>
## Performance Tweaking

We are bending all efforts to improve the client's performance. In out reference benchmarks, Go client performs almost as good as the C client.

To read about performance variables, please refer to [`docs/performance.md`](docs/performance.md)

<a name="Tests"></a>
## Tests

Expand Down Expand Up @@ -138,13 +145,11 @@ See the [`tools/benchmark/README.md`](tools/benchmark/README.md) for details.
<a name="API-Documentation"></a>
## API Documentation

API documentation is available using godocs.

A preformatted version is provided in the [`docs`](docs/README.md) directory.
API documentation is available in the [`docs`](docs/README.md) directory.

## License

The Aerospike Go Client is made availabled under the terms of the Apache License, Version 2, as stated in the file `LICENSE`.
The Aerospike Go Client is made available under the terms of the Apache License, Version 2, as stated in the file `LICENSE`.

Individual files may be made available under their own specific license,
all compatible with Apache License, Version 2. Please see individual files for details.
Expand Down
2 changes: 1 addition & 1 deletion bin.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewBin(name string, value interface{}) *Bin {
}
}

func mapToBins(bins BinMap) []*Bin {
func binMapToBins(bins BinMap) []*Bin {
binList := make([]*Bin, 0, len(bins))
for k, v := range bins {
binList = append(binList, NewBin(k, v))
Expand Down
17 changes: 9 additions & 8 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ import (
"strings"
"sync"

// . "github.com/aerospike/aerospike-client-go/logger"
. "github.com/aerospike/aerospike-client-go/types"
// "github.com/aerospike/aerospike-client-go/utils"
)

type Client struct {
Expand Down Expand Up @@ -99,9 +97,12 @@ func (clnt *Client) GetNodeNames() []string {
// The policy specifies the transaction timeout, record expiration and how the transaction is
// handled when the record already exists.
func (clnt *Client) Put(policy *WritePolicy, key *Key, bins BinMap) error {
return clnt.PutBins(policy, key, mapToBins(bins)...)
return clnt.PutBins(policy, key, binMapToBins(bins)...)
}

// Write record bin(s).
// The policy specifies the transaction timeout, record expiration and how the transaction is
// handled when the record already exists.
func (clnt *Client) PutBins(policy *WritePolicy, key *Key, bins ...*Bin) error {
if policy == nil {
policy = NewWritePolicy(0, 0)
Expand All @@ -119,7 +120,7 @@ func (clnt *Client) PutBins(policy *WritePolicy, key *Key, bins ...*Bin) error {
// handled when the record already exists.
// This call only works for string values.
func (clnt *Client) Append(policy *WritePolicy, key *Key, bins BinMap) error {
return clnt.AppendBins(policy, key, mapToBins(bins)...)
return clnt.AppendBins(policy, key, binMapToBins(bins)...)
}

func (clnt *Client) AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) error {
Expand All @@ -135,7 +136,7 @@ func (clnt *Client) AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) erro
// handled when the record already exists.
// This call works only for string values.
func (clnt *Client) Prepend(policy *WritePolicy, key *Key, bins BinMap) error {
return clnt.PrependBins(policy, key, mapToBins(bins)...)
return clnt.PrependBins(policy, key, binMapToBins(bins)...)
}

func (clnt *Client) PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) error {
Expand All @@ -155,7 +156,7 @@ func (clnt *Client) PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) err
// handled when the record already exists.
// This call only works for integer values.
func (clnt *Client) Add(policy *WritePolicy, key *Key, bins BinMap) error {
return clnt.AddBins(policy, key, mapToBins(bins)...)
return clnt.AddBins(policy, key, binMapToBins(bins)...)
}

func (clnt *Client) AddBins(policy *WritePolicy, key *Key, bins ...*Bin) error {
Expand Down Expand Up @@ -269,7 +270,7 @@ func (clnt *Client) GetHeader(policy *BasePolicy, key *Key) (*Record, error) {

// Read multiple record headers and bins for specified keys in one batch call.
// The returned records are in positional order with the original key array order.
// If a key is not found, the positional record will be null.
// If a key is not found, the positional record will be nil.
// The policy can be used to specify timeouts.
func (clnt *Client) BatchGet(policy *BasePolicy, keys []*Key, binNames ...string) ([]*Record, error) {
if policy == nil {
Expand Down Expand Up @@ -298,7 +299,7 @@ func (clnt *Client) BatchGet(policy *BasePolicy, keys []*Key, binNames ...string

// Read multiple record header data for specified keys in one batch call.
// The returned records are in positional order with the original key array order.
// If a key is not found, the positional record will be null.
// If a key is not found, the positional record will be nil.
// The policy can be used to specify timeouts.
func (clnt *Client) BatchGetHeader(policy *BasePolicy, keys []*Key) ([]*Record, error) {
if policy == nil {
Expand Down
Loading

0 comments on commit e8cfdce

Please sign in to comment.