You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by "XL.Pan" <pa...@sina.com> on 2009/12/15 06:16:39 UTC

how to transfer large data?

hi, 
I want to use the Cassandra to store pictures(about 100k ~ 3M). I don't know how to write the client, because I find the value's type in the Column class is std::string.
How can I deal with this?? My key type is int and value type is raw data(about 120K). Thanks! :-)

2009-12-15 



XL.Pan 

Re: how to transfer large data?

Posted by "XL.Pan" <pa...@sina.com>.
sorry, it's my fault. I think the data can be constructed to a string. eg : string(buf, buf_len); 


2009-12-15 




 Baidu     STL  潘晓雷|  (+86 10) 59926720| panxiaolei@baidu.com | Hi: pan_edward    |  F7-BE185





发件人: XL.Pan 
发送时间: 2009-12-15  13:16:39 
收件人: cassandra-user 
抄送: 
主题: how to transfer large data? 
 
hi, 
I want to use the Cassandra to store pictures(about 100k ~ 3M). I don't know how to write the client, because I find the value's type in the Column class is std::string.
How can I deal with this?? My key type is int and value type is raw data(about 120K). Thanks! :-)

2009-12-15 



XL.Pan 

??: how to transfer large data?

Posted by ma...@gmail.com.
As far as I know, std::string can deal with "string with unprintable char in
body", aka "binary"

#include <string>
#include <cstdio>
int main()
{
        std::string test;
        test.append("this");
        printf("length of test is %u\n",test.length());
        test.push_back('0');
        test.push_back('0');
        test.push_back('0');
        printf("length of test is %u\n",test.length());
}

length of test is 4
length of test is 7



-----????-----
???: Jonathan Ellis [mailto:jbellis@gmail.com] 
????: 2009?12?15? 21:27
???: cassandra-user@incubator.apache.org
??: Re: how to transfer large data?

really, "binary" to thrift C++ is std::string?

that doesn't make much sense to me, but I don't know C++...

On Mon, Dec 14, 2009 at 11:16 PM, XL.Pan <pa...@sina.com> wrote:
> hi,
> I want to use the Cassandra to store pictures(about 100k ~ 3M). I don't
know
> how to write the client, because I find the value's type in the Column
class
> is std::string.
> How can I deal with this?? My key type is int and value type is raw
> data(about 120K). Thanks! :-)
>
> 2009-12-15
> ________________________________
> XL.Pan


RE: how to transfer large data?

Posted by ma...@gmail.com.
As far as I know, std::string can deal with "string with unprintable char in
body", aka "binary"

#include <string>
#include <cstdio>
int main()
{
        std::string test;
        test.append("this");
        printf("length of test is %u\n",test.length());
        test.push_back('0');
        test.push_back('0');
        test.push_back('0');
        printf("length of test is %u\n",test.length());
}

[root@xxxxx tmp]# ./a.out 
length of test is 4
length of test is 7
---------END----------

-----Original Message-----
From: Jonathan Ellis [mailto:jbellis@gmail.com] 
Sent: Tuesday, December 15, 2009 9:27 PM
To: cassandra-user@incubator.apache.org
Subject: Re: how to transfer large data?

really, "binary" to thrift C++ is std::string?

that doesn't make much sense to me, but I don't know C++...

On Mon, Dec 14, 2009 at 11:16 PM, XL.Pan <pa...@sina.com> wrote:
> hi,
> I want to use the Cassandra to store pictures(about 100k ~ 3M). I don't
know
> how to write the client, because I find the value's type in the Column
class
> is std::string.
> How can I deal with this?? My key type is int and value type is raw
> data(about 120K). Thanks! :-)
>
> 2009-12-15
> ________________________________
> XL.Pan


Re: how to transfer large data?

Posted by Jonathan Ellis <jb...@gmail.com>.
really, "binary" to thrift C++ is std::string?

that doesn't make much sense to me, but I don't know C++...

On Mon, Dec 14, 2009 at 11:16 PM, XL.Pan <pa...@sina.com> wrote:
> hi,
> I want to use the Cassandra to store pictures(about 100k ~ 3M). I don't know
> how to write the client, because I find the value's type in the Column class
> is std::string.
> How can I deal with this?? My key type is int and value type is raw
> data(about 120K). Thanks! :-)
>
> 2009-12-15
> ________________________________
> XL.Pan