How can export and import a hyperloglog key in a binary file.

312 views
Skip to first unread message

Vikash Ranjan

unread,
Apr 6, 2015, 3:35:31 AM4/6/15
to redi...@googlegroups.com
Hi All,

I would like to store set of user in a hyperloglog, After this I would like to export the data into binary file and import into some other redis cluster. Is it possible?


*************************

CONFIDENTIALITY CAUTION

This communication (including any accompanying documents) is intended only for the use of the addressee(s) and contains PRIVATE AND CONFIDENTIAL information. Unauthorized reading, dissemination, distribution or copying of this communication is prohibited. If you have received this communication in error, please notify us immediately by e-mail and promptly destroy the original communication. Please do not copy it or use it for any other purposes, or disclose its contents to any other person. Unless stated to the contrary, any opinions or comments are personal to the writer and do not represent the official view of the Company. In case where it represents our official view, it needs to be revalidated and is subject to the terms of our engagement.

Thank you for your co-operation.

*************************

Itamar Haber

unread,
Apr 6, 2015, 9:59:34 AM4/6/15
to redi...@googlegroups.com

You can use DUMP and RESTORE on the HLL key to move the data structure between databases. The serialized value of your HLL can be saved by your client in any type of file for transport.

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Marc Gravell

unread,
Apr 6, 2015, 10:09:31 AM4/6/15
to redi...@googlegroups.com

Are you simply looking for DUMP and RESTORE?

http://redis.io/commands/dump
http://redis.io/commands/restore

--

Javier Guerra Giraldez

unread,
Apr 6, 2015, 10:35:34 AM4/6/15
to redi...@googlegroups.com
On Mon, Apr 6, 2015 at 2:07 AM, Vikash Ranjan <vik...@vserv.com> wrote:
> I would like to store set of user in a hyperloglog, After this I would like
> to export the data into binary file and import into some other redis
> cluster. Is it possible?


just like the BIT operations, the hyperloglog commands operate on a
string, you can simply read/write it. just don't try to operate on it
without a mighty wizard hat.

--
Javier

Marc Gravell

unread,
Apr 6, 2015, 11:31:14 AM4/6/15
to redi...@googlegroups.com

As a minor note: it must be emphasised that a HLL is an *approximation* of a set. You mention  set of users; if the set contents need to be precisely reliable, you might want to use a set instead of a HLL.

Vikash Ranjan

unread,
Apr 8, 2015, 6:59:31 AM4/8/15
to redi...@googlegroups.com
Is it possible to take dump of HLL key only? if yes, How can we do and then import to other redis?

Vikash Ranjan

unread,
Apr 8, 2015, 7:00:11 AM4/8/15
to redi...@googlegroups.com
No. I am looking for a specific HLL key dump and restore.

Jan-Erik Rediger

unread,
Apr 8, 2015, 7:14:11 AM4/8/15
to redi...@googlegroups.com
Then what exactly do you want to dump and restore? The actual commands
DUMP and RESTORY atleast give you the exact binary representation of the
HLL and can import them again.

On Wed, Apr 08, 2015 at 04:00:11AM -0700, Vikash Ranjan wrote:
> No. I am looking for a specific HLL key dump and restore.
>
> On Monday, April 6, 2015 at 7:39:31 PM UTC+5:30, Marc Gravell wrote:
> >
> > Are you simply looking for DUMP and RESTORE?
> >
> > http://redis.io/commands/dump
> > http://redis.io/commands/restore
> > On 6 Apr 2015 08:35, "Vikash Ranjan" <vik...@vserv.com <javascript:>>
> > wrote:
> >
> >> Hi All,
> >>
> >> I would like to store set of user in a hyperloglog, After this I would
> >> like to export the data into binary file and import into some other redis
> >> cluster. Is it possible?
> >>
> >>
> >> *************************
> >>
> >> *CONFIDENTIALITY CAUTION*
> >> *This communication (including any accompanying documents) is intended
> >> only for the use of the addressee(s) and contains PRIVATE AND CONFIDENTIAL
> >> information. Unauthorized reading, dissemination, distribution or copying
> >> of this communication is prohibited. If you have received this
> >> communication in error, please notify us immediately by e-mail and promptly
> >> destroy the original communication. Please do not copy it or use it for any
> >> other purposes, or disclose its contents to any other person. Unless stated
> >> to the contrary, any opinions or comments are personal to the writer and do
> >> not represent the official view of the Company. In case where it represents
> >> our official view, it needs to be revalidated and is subject to the terms
> >> of our engagement.*
> >>
> >> *Thank you for your co-operation.*
> >> *************************
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Redis DB" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an
> >> email to redis-db+u...@googlegroups.com <javascript:>.
> >> To post to this group, send email to redi...@googlegroups.com
> >> <javascript:>.
> >> Visit this group at http://groups.google.com/group/redis-db.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
> >
> --
>
> *************************
>
> *CONFIDENTIALITY CAUTION*
> *This communication (including any accompanying documents) is intended only
> for the use of the addressee(s) and contains PRIVATE AND CONFIDENTIAL
> information. Unauthorized reading, dissemination, distribution or copying
> of this communication is prohibited. If you have received this
> communication in error, please notify us immediately by e-mail and promptly
> destroy the original communication. Please do not copy it or use it for any
> other purposes, or disclose its contents to any other person. Unless stated
> to the contrary, any opinions or comments are personal to the writer and do
> not represent the official view of the Company. In case where it represents
> our official view, it needs to be revalidated and is subject to the terms
> of our engagement.*
>
> *Thank you for your co-operation.*

Vikash Ranjan

unread,
Apr 8, 2015, 11:05:15 AM4/8/15
to redi...@googlegroups.com, jan...@fnordig.de
I have three HLL keys and want to create a dump of only one key and restore on other redis server.

Itamar Haber

unread,
Apr 8, 2015, 11:19:01 AM4/8/15
to redi...@googlegroups.com

Again, DUMB is the answer. Of course, of you want the 3 keys merged, do a PFMERGE and dump the resulting HLL.

On the target server, do a RESTORE of the dumped value.

Itamar Haber

unread,
Apr 8, 2015, 12:03:48 PM4/8/15
to redi...@googlegroups.com
^DUMP of course, sorry.
--

Itamar Haber | Chief Developers Advocate
Redis Watch Newsletter - Curator and Janitor
Redis Labs - Enterprise-Class Redis for Developers

Mobile: +1 (415) 688 2443
Mobile (IL): +972 (54) 567 9692
Email: ita...@redislabs.com
Skype: itamar.haber

Blog  |  Twitter  |  LinkedIn


Reply all
Reply to author
Forward
0 new messages