/** 将日志写入数据库 */ @Override public void add(Log log) { if ((log == null) || (log.getKey().equals(""))) { // 传值有问题,处理一下 return; } mHbaseOperationImpl.insertData("cloud_log", log.getKey(), "attr", "uid", log.getUid()); mHbaseOperationImpl.insertData("cloud_log", log.getKey(), "attr", "time", log.getTime()); mHbaseOperationImpl.insertData( "cloud_log", log.getKey(), "attr", "operation", log.getOperation()); }
/** 日志分页 */ @Override public List<Log> logPage(String uid, String row, int num) { ResultScanner rs = mHbaseOperationImpl.logPage(uid, row, num); return mListMapping.logListMapping(rs); }
/** 根据时间范围检索日志 */ @Override public List<Log> getByTime(String uid, String min, String max) { ResultScanner rs = mHbaseOperationImpl.queryLog(uid, min, max); return mListMapping.logListMapping(rs); }
/** 检索某用户的所有日志 */ @Override public List<Log> getByUid(String uid) { ResultScanner rs = mHbaseOperationImpl.queryByColumn("cloud_log", "attr", "uid", uid); return mListMapping.logListMapping(rs); }