NAME

Jubatus::Common::Datum - Common data structure for each Perl client modules of Jubatus.

SYNOPSIS

use Jubatus::Common::Datum;

# or use Jubatus
#
# Jubatus.pm have the interfaces to use Jubatus::Common::Datum .

DESCRIPTION

This module provide the constructors and the methods to use interface of each Perl client modules of Jubatus.

METHODS

Jubatus::Common::Datum will provide many packages and constructors, methods. You can use these with Jubatus or Jubatus::***::Clients.

Packages

Jubatus::Common::Datum

If you want to use this package, all one need to do is write "use Jubatus::Common::Datum;" or "use Jubatus;".

Constructors

Jubatus::Common::Datum->new($string_values, $num_values);

Input:

- $string_values is a hash reference.
  Each entries of this hash reference are String key and String value.

- $num_values is a hash reference.
  Each entries of this hash reference are String key and Float value.

Output:

- Jubatus::Common::Datum object.

  This object have two fields.
  'string_values' field locate the array reference which was inputed as
  $string_values in constructor.
  'num_values' field locate the array reference which was inputed as
  $num_values in constructor.

Functions

to_msgpack->()

Input:

- None

Output:

- A array reference

  This array reference locate $string_values and $num_values which are given
  in constructor.

  This array reference certainly locate two array references. First
  reference are allowed to locate many array references. Each of located
  arrry references should have two string value which are called "key"
  and "value". Second reference are allowed to locate many array references.
  Each of located arrry references should have two values. First string
  value which are called "key" and second float value which are called
  "value".

from_msgpack->($return_value_from_msgpack)

Input:

- $return_value_from_msgpack is a array reference.

  This array reference certainly locate two array references. First
  reference are allowed to locate many array references. Each of located
  arrry references should have two string value which are called "key"
  and "value". Second reference are allowed to locate many array references.
  Each of located arrry references should have two values. First string
  value which are called "key" and second float value which are called
  "value".

Output:

- Jubatus::Common::Datum object.

hash_ref_to_array_ref->($hash_ref)

Input:

- $hash_ref is a hash reference.

Each entries of this hash reference are String key and (String|Float)
value.

Output:

- An array reference of the array references

This arrry references is allowed to locate many array references. Each
of these array references should have two values which are called "key"
and "value". The data type of key should be String. The data type
of value should be String or Float.

SEE ALSO

Jubatus

http://jubat.us/ https://github.com/jubatus

AnyEvent::MPRPC AnyEvent::MPRPC::Client http://msgpack.org/ http://wiki.msgpack.org/display/MSGPACK/RPC+specification

https://github.com/overlast/p5-Jubatus

LICENSE

The MIT License (MIT)

Copyright (c) 2013 by Toshinori Sato (@overlast).

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

AUTHOR

Toshinori Sato (@overlast) <overlasting@gmail.com>