缓存cassandra四

packagecom.huawei.support.cache;

importjava.io.Serializable;

importjava.util.Map;

importcom.huawei.support.exception.ApplicationException;

/**

*缓存操作接口.

*/

publicinterfaceICassCache

{

/**向缓存中存放数据.

*@paramaKeyAreaKey

*@paramaNamecolumn

*@paramaSerialObj缓存对象

*@throwsApplicationExceptionApplicationException

*/

voidput(StringaKeyArea,StringaName,SerializableaSerialObj)

throwsApplicationException;

/**根据Key和column从缓存读取数据.

*@paramaKeyAreaKey

*@paramaNamecolumn

*@returnObject缓存数据

*@throwsApplicationExceptionApplicationException

*/

Objectget(StringaKeyArea,StringaName)throwsApplicationException;

/**根据Key和column从缓存读取数据,包括timestamp.

*@returnMap<String,Object>缓存数据

*key:"cache.timestamp",value:存放缓存数据时的timestamp

*key:"cache.value",value:缓存对象

*/

Map<String,Object>getResultMap(StringaKeyArea,StringaName)

throwsApplicationException;

/**根据Key从缓存删除缓存数据.

*/

voidremove(StringaKeyArea)throwsApplicationException;

/**根据Key和column从缓存删除缓存数据.

*@throwsApplicationExceptionApplicationException

*/

voidremove(StringaKeyArea,StringaName)throwsApplicationException;

}

相关推荐