Esempio n. 1
0
 /**
  * Description: <br>
  *
  * @author 王伟<br>
  * @taskId <br>
  * @param nodeName
  * @param node
  * @throws CacheException <br>
  */
 @Override
 public <T> void putNode(String nodeName, Map<String, T> node) throws CacheException {
   if (CommonUtil.isNotEmpty(node)) {
     Map<byte[], byte[]> hmap = new HashMap<byte[], byte[]>();
     try {
       for (Entry<String, T> entry : node.entrySet()) {
         byte[] value = SerializationUtil.serial(entry.getValue());
         if (value != null) {
           hmap.put(entry.getKey().getBytes(), value);
         }
       }
       cluster.hmsetBytes(nodeName, hmap);
     } catch (UtilException e) {
       throw new CacheException(e);
     } catch (Exception e) {
       throw new CacheException(ErrorCodeDef.CACHE_ERROR_10002, "serial map failed!", e);
     }
   }
 }