Exemplo n.º 1
0
 @Override
 public void removeBySampleId(Integer sampleId) {
   super.delete(new SmartDBObject("sampleId", sampleId));
   /*  synchronized (sampleId + ".generank.locked") {
       int sharding[][] = new int[8][];
       sharding[0] = new int[] { 30000, 100000 };
       sharding[1] = new int[] { 25710, 30000 };
       sharding[2] = new int[] { 21410, 25710 };
       sharding[3] = new int[] { 17160, 21410 };
       sharding[4] = new int[] { 12860, 17160 };
       sharding[5] = new int[] { 8610, 12860 };
       sharding[6] = new int[] { 4310, 8610 };
       sharding[7] = new int[] { 0, 4310 };
       DateTime start = DateTime.now();
       for (int i = 0; i < sharding.length; i++) {
           int[] shard = sharding[i];
           SmartDBObject query = new SmartDBObject("sampleId", sampleId);
           SmartDBObject geneRange = new SmartDBObject("$gt", shard[0]);
           geneRange.put("$lte", shard[1]);
           query.put("geneId", geneRange);
           if (logger.isDebugEnabled()) {
               logger.debug("remove:{}", query);
           }
           try {
               super.delete(query);
           } catch (Exception e) {
               logger.info("remove failed.", e);
           }
       }
       if (logger.isDebugEnabled()) {
           logger.debug("remove generank by sampleId:{} used {}.", sampleId, DateTimeUtils.used(start));
       }
   }*/
 }
Exemplo n.º 2
0
 @Override
 public void clean() {
   DateTime dt = DateTime.now();
   super.delete(new SmartDBObject());
   logger.debug("Clean generank data used {}", DateTimeUtils.diff(dt, DateTime.now()));
 }