Exemplo n.º 1
0
 @Override
 public boolean remove(Object key) throws CacheLoaderException {
   if (trace) log.tracef("remove(\"%s\") ", key);
   Cassandra.Client cassandraClient = null;
   try {
     cassandraClient = dataSource.getConnection();
     Map<ByteBuffer, Map<String, List<Mutation>>> mutationMap =
         new HashMap<ByteBuffer, Map<String, List<Mutation>>>();
     remove0(ByteBufferUtil.bytes(hashKey(key)), mutationMap);
     cassandraClient.batch_mutate(mutationMap, writeConsistencyLevel);
     return true;
   } catch (Exception e) {
     log.errorRemovingKey(key, e);
     return false;
   } finally {
     dataSource.releaseConnection(cassandraClient);
   }
 }