Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 51067 invoked from network); 26 Apr 2010 09:45:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Apr 2010 09:45:16 -0000 Received: (qmail 35222 invoked by uid 500); 26 Apr 2010 09:45:16 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 35046 invoked by uid 500); 26 Apr 2010 09:45:15 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 35037 invoked by uid 99); 26 Apr 2010 09:45:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Apr 2010 09:45:15 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sikerasakti@gmail.com designates 209.85.222.190 as permitted sender) Received: from [209.85.222.190] (HELO mail-pz0-f190.google.com) (209.85.222.190) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Apr 2010 09:45:06 +0000 Received: by pzk28 with SMTP id 28so174768pzk.11 for ; Mon, 26 Apr 2010 02:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=YGl7hevpFvu9N5KKTzR6B4hwUjU3Ay2y+wHTile/Els=; b=R5MlQx/tPBO8G3pKyL63FF+hKyaJl65N67nD2MRexx0la606kQLhkhNnbS1qXSDY4V Z26Zd5Wm16zP5lD2/l9Pyax/qvsUnaM4Z8btqG2mEWi1KLVXaMtaFmFO2WTK4GV3nBGX doiNSmhVstxFsGJRQL6oKvC2/Q9JP0VwTpauI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=pjJHVjtbmQmctMCZqZB7jLXrNx7r8twXjqqvbQqGzjVZdvtqW2kABZT/l6UwyyCLea McQPtEZlj69EFtCCtgGZ7UjA/jWG9B8vp3FbRwGa3c6XSZBLNK10ToYEXA5aoJxcytSA ePT9Fgy66RW9oy5hwWMOe6OPr7zckv8RuGBdk= MIME-Version: 1.0 Received: by 10.141.107.6 with SMTP id j6mr3248055rvm.39.1272275085481; Mon, 26 Apr 2010 02:44:45 -0700 (PDT) Received: by 10.140.136.8 with HTTP; Mon, 26 Apr 2010 02:44:45 -0700 (PDT) In-Reply-To: References: <201004260850245660216@gmail.com> Date: Mon, 26 Apr 2010 16:44:45 +0700 Message-ID: Subject: Re: how to store file in the cassandra? From: dir dir To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=000e0cd1380686d71e048520a087 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd1380686d71e048520a087 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Jonathan, Cassandra seems has not a Blob data type. To handle binary large object data, we have to use array of byte. I have a question to you. Suppose I have a MPEG video files 15 MB. To save this video file into Cassandra database I will store this file into array of byte. One day, I feel this video is not necessary again, therefore I delete it from the database. My question is, after I delete thi= s video from Cassandra database, should I perform defragmentation operation into Cassandra's file database?? Thank you. On Mon, Apr 26, 2010 at 8:28 AM, Jonathan Ellis wrote: > Cassandra stores byte arrays. You can certainly store file data in > it, although if it is larger than a few MB you should chunk it into > multiple columns. > > On Sun, Apr 25, 2010 at 8:21 PM, Shuge Lee wrote: > > Yes. > > > > Cassandra does save raw string data only, not a file, and shouldn't sav= e > a > > file. > > > > 2010/4/26 =E5=88=98=E5=85=B5=E5=85=B5 > >> > >> sorry i'm not very familiar with python, are you meaning that the file= s > >> are stored in the file system of the os? > >> > >> then , the cassandra just stores the path to access the files? > >> > >> > >> On Mon, Apr 26, 2010 at 8:57 AM, Shuge Lee wrote= : > >>> > >>> In Python: > >>> > >>> keyspace.columnfamily[key][column] =3D value > >>> > >>> files.video[uuid.uuid4()]['name'] =3D 'foo.flv' > >>> files.video[uuid.uuid4()]['path'] =3D '/var/files/foo.flv' > >>> > >>> create a mapping > >>> files.video =3D { > >>> uuid.uuid4() : { > >>> 'name' : 'foo.flv', > >>> 'path' : '/var/files/foo.flv', > >>> } > >>> } > >>> > >>> if most of sizes >=3D 0.5MB, use sys-fs/reiser4progs, else use ext4. > >>> > >>> > >>> 2010/4/26 Bingbing Liu > >>>> > >>>> any suggestion? > >>>> > >>>> 2010-04-26 > >>>> ________________________________ > >>>> Bingbing Liu > >>> > >>> > >>> -- > >>> Shuge Lee | Lee Li | =E6=9D=8E=E8=A0=A1 > >> > >> > >> > >> -- > >> Bingbing Liu > >> > >> Web and Mobile Data Management lab > >> > >> Renmin University of China > > > > > > > > -- > > Shuge Lee | Lee Li | =E6=9D=8E=E8=A0=A1 > > > --000e0cd1380686d71e048520a087 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Jonathan,

Cassandra seems has not a Blob data type. To handle bin= ary large object data,
we have to use array of byte. I have a question t= o you. Suppose I have a MPEG
video files 15 MB. To save this video file = into Cassandra database I will store
this file into array of byte. One day, I feel this video is not necessary a= gain,
therefore I delete it from the database. My question is, after I d= elete this
video from Cassandra database, should I perform defragmentati= on operation
into Cassandra's file database??

Thank you.
=C2=A0=C2=A0 =C2= =A0 =C2=A0

On Mon, Apr 26, 2010 at 8:28 = AM, Jonathan Ellis <jbellis@gmail.com> wrote:
Cassandra stores = byte arrays. =C2=A0You can certainly store file data in
it, although if it is larger than a few MB you should chunk it into
multiple columns.

On Sun, Apr 25, 2010 at 8:21 PM, Shuge Lee <shuge.lee@gmail.com> wrote:
> Yes.
>
> Cassandra does save raw string data only, not a file, and shouldn'= t save a
> file.
>
> 2010/4/26 =E5=88=98=E5=85=B5=E5=85=B5 <rucbing@gmail.com>
>>
>> sorry i'm not very familiar with python, are you meaning that = the files
>> are stored in the file system of the os?
>>
>> then , the cassandra just stores the path to access the files?
>>
>>
>> On Mon, Apr 26, 2010 at 8:57 AM, Shuge Lee <shuge.lee@gmail.com> wrote:
>>>
>>> In Python:
>>>
>>> keyspace.columnfamily[key][column] =3D value
>>>
>>> files.video[uuid.uuid4()]['name'] =3D 'foo.flv'= ;
>>> files.video[uuid.uuid4()]['path'] =3D '/var/files/= foo.flv'
>>>
>>> create a mapping
>>> files.video =3D=C2=A0 {
>>> =C2=A0=C2=A0=C2=A0 uuid.uuid4() : {
>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'name' : &#= 39;foo.flv',
>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'path' : &#= 39;/var/files/foo.flv',
>>> =C2=A0=C2=A0=C2=A0 }
>>> }
>>>
>>> if most of sizes >=3D 0.5MB, use sys-fs/reiser4progs, else = use ext4.
>>>
>>>
>>> 2010/4/26 Bingbing Liu <rucbing@gmail.com>
>>>>
>>>> any suggestion?
>>>>
>>>> 2010-04-26
>>>> ________________________________
>>>> Bingbing Liu
>>>
>>>
>>> --
>>> Shuge Lee | Lee Li | =E6=9D=8E=E8=A0=A1
>>
>>
>>
>> --
>> Bingbing Liu
>>
>> Web and Mobile Data Management lab
>>
>> Renmin University =C2=A0of =C2=A0China
>
>
>
> --
> Shuge Lee | Lee Li | =E6=9D=8E=E8=A0=A1
>

--000e0cd1380686d71e048520a087--