com.netflix.astyanax.recipes.storage
Class CassandraChunkedStorageProvider

java.lang.Object
  extended by com.netflix.astyanax.recipes.storage.CassandraChunkedStorageProvider
All Implemented Interfaces:
ChunkedStorageProvider

public class CassandraChunkedStorageProvider
extends Object
implements ChunkedStorageProvider

ChunkProvider responsible for reading and writing chunks to cassandra. Chunks are written to different row keys with the row key name having the format $

Author:
elandau

Nested Class Summary
static class CassandraChunkedStorageProvider.Columns
           
 
Constructor Summary
CassandraChunkedStorageProvider(Keyspace keyspace, ColumnFamily<String,String> cf)
           
CassandraChunkedStorageProvider(Keyspace keyspace, String cfName)
           
 
Method Summary
 void deleteObject(String objectName, Integer chunkCount)
          Delete a chunk
 ConsistencyLevel getConsistencyLevel()
           
 int getDefaultChunkSize()
          Return the preferred chunk size for this provider
 ByteBuffer readChunk(String objectName, int chunkId)
          Read the request chunk id from the storage
 ObjectMetadata readMetadata(String objectName)
          Retrieve information for a file
 CassandraChunkedStorageProvider setConsistencyLevel(ConsistencyLevel consistencyLevel)
           
 CassandraChunkedStorageProvider withColumnName(CassandraChunkedStorageProvider.Columns column, String name)
           
 CassandraChunkedStorageProvider withRowKeyFormat(String format)
           
 int writeChunk(String objectName, int chunkId, ByteBuffer data, Integer ttl)
          Write a single chunk to the storage
 void writeMetadata(String objectName, ObjectMetadata attr)
          Persist all attributes for an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CassandraChunkedStorageProvider

public CassandraChunkedStorageProvider(Keyspace keyspace,
                                       String cfName)

CassandraChunkedStorageProvider

public CassandraChunkedStorageProvider(Keyspace keyspace,
                                       ColumnFamily<String,String> cf)
Method Detail

withColumnName

public CassandraChunkedStorageProvider withColumnName(CassandraChunkedStorageProvider.Columns column,
                                                      String name)

withRowKeyFormat

public CassandraChunkedStorageProvider withRowKeyFormat(String format)

writeChunk

public int writeChunk(String objectName,
                      int chunkId,
                      ByteBuffer data,
                      Integer ttl)
               throws Exception
Description copied from interface: ChunkedStorageProvider
Write a single chunk to the storage

Specified by:
writeChunk in interface ChunkedStorageProvider
Throws:
Exception

readChunk

public ByteBuffer readChunk(String objectName,
                            int chunkId)
                     throws Exception
Description copied from interface: ChunkedStorageProvider
Read the request chunk id from the storage

Specified by:
readChunk in interface ChunkedStorageProvider
Returns:
Throws:
Exception

setConsistencyLevel

public CassandraChunkedStorageProvider setConsistencyLevel(ConsistencyLevel consistencyLevel)

getConsistencyLevel

public ConsistencyLevel getConsistencyLevel()

writeMetadata

public void writeMetadata(String objectName,
                          ObjectMetadata attr)
                   throws Exception
Description copied from interface: ChunkedStorageProvider
Persist all attributes for an object. Some attributes are written at the start of the operation but are updated after the file has been written with additional information such as the total number of chunks and the file size

Specified by:
writeMetadata in interface ChunkedStorageProvider
Throws:
Exception

readMetadata

public ObjectMetadata readMetadata(String objectName)
                            throws Exception,
                                   NotFoundException
Description copied from interface: ChunkedStorageProvider
Retrieve information for a file

Specified by:
readMetadata in interface ChunkedStorageProvider
Returns:
Throws:
Exception
NotFoundException

deleteObject

public void deleteObject(String objectName,
                         Integer chunkCount)
                  throws Exception,
                         NotFoundException
Description copied from interface: ChunkedStorageProvider
Delete a chunk

Specified by:
deleteObject in interface ChunkedStorageProvider
Throws:
Exception
NotFoundException

getDefaultChunkSize

public int getDefaultChunkSize()
Description copied from interface: ChunkedStorageProvider
Return the preferred chunk size for this provider

Specified by:
getDefaultChunkSize in interface ChunkedStorageProvider
Returns:


Copyright © 2012. All Rights Reserved.