com.mymed.controller.core.manager.storage
Interface IMyJamStorageManager

All Superinterfaces:
IStorageManager
All Known Implementing Classes:
MyJamStorageManager

public interface IMyJamStorageManager
extends IStorageManager

Author:
iacopo

Field Summary
 
Fields inherited from interface com.mymed.controller.core.manager.storage.IStorageManager
consistencyOnRead, consistencyOnWrite
 
Method Summary
 int countColumns(java.lang.String tableName, java.lang.String primaryKey, byte[] superColumn)
          Counts the number of colums of a given row or SuperColumn.
 java.util.Map<byte[],byte[]> getFrom(java.lang.String string, java.lang.String reportId, byte[] array)
          Gets the columns which have name following on the given CF row.
 java.util.Map<byte[],byte[]> getLastN(java.lang.String tableName, java.lang.String primaryKey, java.lang.Integer n)
          Returns the first n columns of a given CF.
 void insertColumn(java.lang.String tableName, java.lang.String primaryKey, byte[] columnName, byte[] value)
          Is more general then the method insertColumn of IStorageManager, the name of the column can be something different from a String.
 void insertExpiringColumn(java.lang.String tableName, java.lang.String key, byte[] superColumn, byte[] columnName, byte[] value, long timestamp, int expiringTime)
          It allows to insert an expiring column.
 void removeColumn(java.lang.String tableName, java.lang.String primaryKey, byte[] superColumn, byte[] column)
          Removes the specified column (if present) from the CF.
 java.util.Map<java.lang.String,java.util.Map<byte[],byte[]>> selectAll(java.lang.String tableName, java.util.List<java.lang.String> primaryKeys)
          Select all on a list of rows.
 byte[] selectColumn(java.lang.String tableName, java.lang.String primaryKey, byte[] superColumn, byte[] column)
          Can be used to select columns in both SuperCF and CF.
 ExpColumnBean selectExpiringColumn(java.lang.String tableName, java.lang.String primaryKey, byte[] superColumn, byte[] column)
          Equals to the preceding, but apart from the name-value pair returns also the timestamp and the TTL.
 java.util.Map<byte[],byte[]> selectRange(java.lang.String tableName, java.lang.String primaryKey, byte[] startColumn, byte[] stopColumn, int maxNum)
          Returns a map of name-value pairs corresponding to a certain range of columns.
 java.util.Map<byte[],java.util.Map<byte[],byte[]>> selectSCRange(java.lang.String tableName, java.util.List<java.lang.String> primaryKeys, byte[] startColumn, byte[] stopColumn)
          Select a range of columns on a list of rows.
 
Methods inherited from interface com.mymed.controller.core.manager.storage.IStorageManager
countColumns, insertColumn, insertSlice, insertSuperColumn, insertSuperSlice, removeAll, removeColumn, removeSuperColumn, selectAll, selectColumn, selectList, selectRange
 

Method Detail

selectColumn

byte[] selectColumn(java.lang.String tableName,
                    java.lang.String primaryKey,
                    byte[] superColumn,
                    byte[] column)
                    throws IOBackEndException,
                           InternalBackEndException
Can be used to select columns in both SuperCF and CF.

Parameters:
tableName - Name of the CF.
primaryKey - Row key.
superColumn - Name of the super column, can be safely put to null when you deal with a CF
column - Name of the column.
Returns:
The column value as byte array.
Throws:
ServiceManagerException
IOBackEndException
InternalBackEndException

selectExpiringColumn

ExpColumnBean selectExpiringColumn(java.lang.String tableName,
                                   java.lang.String primaryKey,
                                   byte[] superColumn,
                                   byte[] column)
                                   throws IOBackEndException,
                                          InternalBackEndException
Equals to the preceding, but apart from the name-value pair returns also the timestamp and the TTL. Useful to update the expiration time.

Parameters:
tableName -
primaryKey -
superColumn -
column -
Returns:
Throws:
ServiceManagerException
IOBackEndException
InternalBackEndException

insertColumn

void insertColumn(java.lang.String tableName,
                  java.lang.String primaryKey,
                  byte[] columnName,
                  byte[] value)
                  throws IOBackEndException,
                         InternalBackEndException
Is more general then the method insertColumn of IStorageManager, the name of the column can be something different from a String. (e.g. In my application I use long values as Column names, I cannot use string because I need that the columns was ordered.)

Parameters:
tableName - Name of the CF.
primaryKey - Row key.
columnName - Column name.
value - Column value.
Throws:
ServiceManagerException
IOBackEndException
InternalBackEndException

insertExpiringColumn

void insertExpiringColumn(java.lang.String tableName,
                          java.lang.String key,
                          byte[] superColumn,
                          byte[] columnName,
                          byte[] value,
                          long timestamp,
                          int expiringTime)
                          throws InternalBackEndException
It allows to insert an expiring column. It permits to deal with both CF and SuperCF. Timestamp could be evaluated inside the method, but I need to insert a column in two different CF, that expire at the same time.

Parameters:
tableName - Name of the CF.
primaryKey - Row key.
superColumn - SuperColumn name, null if insertion is done on a CF.
columnName - Column name.
value - Column value.
timestamp - Timestamp in microseconds since 1 Jenuary 1970.
expiringTime - TTL in seconds.
Throws:
ServiceManagerException
IOBackEndException
InternalBackEndException

selectRange

java.util.Map<byte[],byte[]> selectRange(java.lang.String tableName,
                                         java.lang.String primaryKey,
                                         byte[] startColumn,
                                         byte[] stopColumn,
                                         int maxNum)
                                         throws IOBackEndException,
                                                InternalBackEndException
Returns a map of name-value pairs corresponding to a certain range of columns.

Parameters:
tableName - Name of the CF.
primaryKey - Row key.
startColumn - Start column (columns are ordered).
stopColumn - Stop column.
maxNum - Maximum number of returned values,
Returns:
Throws:
ServiceManagerException
IOBackEndException
InternalBackEndException

selectAll

java.util.Map<java.lang.String,java.util.Map<byte[],byte[]>> selectAll(java.lang.String tableName,
                                                                       java.util.List<java.lang.String> primaryKeys)
                                                                       throws IOBackEndException,
                                                                              InternalBackEndException
Select all on a list of rows.

Parameters:
tableName - Name of the CF.
primaryKeys - List of row keys.
Returns:
Throws:
ServiceManagerException
IOBackEndException
InternalBackEndException

selectSCRange

java.util.Map<byte[],java.util.Map<byte[],byte[]>> selectSCRange(java.lang.String tableName,
                                                                 java.util.List<java.lang.String> primaryKeys,
                                                                 byte[] startColumn,
                                                                 byte[] stopColumn)
                                                                 throws IOBackEndException,
                                                                        InternalBackEndException
Select a range of columns on a list of rows.

Parameters:
tableName - Name of the CF.
primaryKeys - List of row keys.
startColumn - Start column.
stopColumn - End column.
maxNum - Maximum number of returned values (columns).
Returns:
Throws:
ServiceManagerException
IOBackEndException
InternalBackEndException

getLastN

java.util.Map<byte[],byte[]> getLastN(java.lang.String tableName,
                                      java.lang.String primaryKey,
                                      java.lang.Integer n)
                                      throws IOBackEndException,
                                             InternalBackEndException
Returns the first n columns of a given CF.

Parameters:
tableName - Name of the CF.
primaryKey - Row key.
n - Number of columns ().
Returns:
Throws:
ServiceManagerException
IOBackEndException
InternalBackEndException

countColumns

int countColumns(java.lang.String tableName,
                 java.lang.String primaryKey,
                 byte[] superColumn)
                 throws IOBackEndException,
                        InternalBackEndException
Counts the number of colums of a given row or SuperColumn.

Parameters:
tableName - Name of the CF.
primaryKey - Row key.
superColumn - Number of columns ().
Returns:
Throws:
ServiceManagerException
IOBackEndException
InternalBackEndException

removeColumn

void removeColumn(java.lang.String tableName,
                  java.lang.String primaryKey,
                  byte[] superColumn,
                  byte[] column)
                  throws InternalBackEndException
Removes the specified column (if present) from the CF.

Parameters:
tableName - Name of the CF.
primaryKey - Row key.
superColumn - SuperColumn name. Can be set to null, if the CF is not super.
column - Column name. Can be set to null to delete the entire row.
Throws:
InternalBackEndException

getFrom

java.util.Map<byte[],byte[]> getFrom(java.lang.String string,
                                     java.lang.String reportId,
                                     byte[] array)
                                     throws IOBackEndException,
                                            InternalBackEndException
Gets the columns which have name following on the given CF row.

Parameters:
tableName - ColumnFamily.
primaryKey - Key of the row.
start - Starting value.
Returns:
Throws:
IOBackEndException
InternalBackEndException