Ankit Shah | 22 Jun 2012 19:49
Picon
Gravatar

Writting Oracle RAW datatype into Cassandra ..

Hi All,

I am trying to write Oracle RAW(2000 BYTE) data and BLOB() into cassandra using latest hector api.
http://hector-client.github.com/hector/build/html/documentation.html

I dont see any inherent support for Raw data and Blob data, how would i store them into cassandra's column family ?
 

--
Thanks,
Ankit Shah
Cell: 559-307-8715

Nate McCall | 22 Jun 2012 20:08
Picon
Gravatar

Re: Writting Oracle RAW datatype into Cassandra ..

Column values are bytes by default. For the generics, type the query
classes requiring column type with wither byte[] or ByteBuffer and use
BytesSerializer or ByteBufferSerializer respectively.

On Fri, Jun 22, 2012 at 12:49 PM, Ankit Shah <shahankit@...> wrote:
> Hi All,
>
> I am trying to write Oracle RAW(2000 BYTE) data and BLOB() into cassandra
> using latest hector api.
> http://hector-client.github.com/hector/build/html/documentation.html
>
> I dont see any inherent support for Raw data and Blob data, how would i
> store them into cassandra's column family ?
>
>
> --
> Thanks,
> Ankit Shah
> Cell: 559-307-8715

Ankit Shah | 23 Jun 2012 03:00
Picon
Gravatar

Re: Writting Oracle RAW datatype into Cassandra ..

Hi Nate,

I am trying to use the following function thought its not compiling ..
    /**
     * Insert a new value keyed by key
     *
     * <at> param key Key for the value
     * <at> param value the Blob value to insert
     */
    public boolean insert(final String key, final String columnName, final ByteBufferSerializer value) {
        this.logger.debug("start insert(final String key, final String columnName, final String value)");
        try {
            createMutator(this.keyspace, this.byteBufferSerializer).insert(key, this.columnFamilyName,
                    createColumn(columnName, value, this.stringSerializer, this.byteBufferSerializer));
            return true;
        } catch (final HectorException hex) {
            this.logger.info("Hector Exception Message: " + hex.getMessage());
            this.logger.info("Hector Exception String: " + hex.toString());
            this.logger.info("Method will return false");
            return false;
        }
    }


this is a function where the column name is string like "sha1response" but the value will be a blob. its stored as a Blob in the oracle db ..

Any pointers will be appreciated ..


On Fri, Jun 22, 2012 at 11:08 AM, Nate McCall <zznate.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Column values are bytes by default. For the generics, type the query
classes requiring column type with wither byte[] or ByteBuffer and use
BytesSerializer or ByteBufferSerializer respectively.

On Fri, Jun 22, 2012 at 12:49 PM, Ankit Shah <shahankit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi All,
>
> I am trying to write Oracle RAW(2000 BYTE) data and BLOB() into cassandra
> using latest hector api.
> http://hector-client.github.com/hector/build/html/documentation.html
>
> I dont see any inherent support for Raw data and Blob data, how would i
> store them into cassandra's column family ?
>
>
> --
> Thanks,
> Ankit Shah
> Cell: 559-307-8715



--
Thanks,
Ankit Shah
Cell: 559-307-8715
Steven Siebert | 23 Jun 2012 03:07
Picon

Re: Writting Oracle RAW datatype into Cassandra ..

The third argument to your method should be a ByteBuffer not a ByteBufferSerializer...no?


S

On Fri, Jun 22, 2012 at 9:00 PM, Ankit Shah <shahankit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi Nate,

I am trying to use the following function thought its not compiling ..
    /**
     * Insert a new value keyed by key
     *
     * <at> param key Key for the value
     * <at> param value the Blob value to insert
     */
    public boolean insert(final String key, final String columnName, final ByteBufferSerializer value) {
        this.logger.debug("start insert(final String key, final String columnName, final String value)");
        try {
            createMutator(this.keyspace, this.byteBufferSerializer).insert(key, this.columnFamilyName,
                    createColumn(columnName, value, this.stringSerializer, this.byteBufferSerializer));
            return true;
        } catch (final HectorException hex) {
            this.logger.info("Hector Exception Message: " + hex.getMessage());
            this.logger.info("Hector Exception String: " + hex.toString());
            this.logger.info("Method will return false");
            return false;
        }
    }


this is a function where the column name is string like "sha1response" but the value will be a blob. its stored as a Blob in the oracle db ..

Any pointers will be appreciated ..



On Fri, Jun 22, 2012 at 11:08 AM, Nate McCall <zznate.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Column values are bytes by default. For the generics, type the query
classes requiring column type with wither byte[] or ByteBuffer and use
BytesSerializer or ByteBufferSerializer respectively.

On Fri, Jun 22, 2012 at 12:49 PM, Ankit Shah <shahankit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi All,
>
> I am trying to write Oracle RAW(2000 BYTE) data and BLOB() into cassandra
> using latest hector api.
> http://hector-client.github.com/hector/build/html/documentation.html
>
> I dont see any inherent support for Raw data and Blob data, how would i
> store them into cassandra's column family ?
>
>
> --
> Thanks,
> Ankit Shah
> Cell: 559-307-8715



--
Thanks,
Ankit Shah
Cell: 559-307-8715


Gmane