Package com.google.common.base

Examples of com.google.common.base.Stopwatch.stop()


            migrate(scheduleIds, find1HourData, Bucket.ONE_HOUR);
            migrate(scheduleIds, find6HourData, Bucket.SIX_HOUR);
            migrate(scheduleIds, find24HourData, Bucket.TWENTY_FOUR_HOUR);

            stopwatch.stop();
            log.info("Finished aggregate metrics migration in " + stopwatch.elapsed(TimeUnit.SECONDS) + " seconds");

            if (failedMigrations.get() > 0) {
                throw new RuntimeException("There were " + failedMigrations.get() + " failed migrations. The " +
                    "upgrade will have to be run again to complete the migration.");
View Full Code Here


        }

        collectDeletedDocuments(stats, headRevision, oldestRevTimeStamp);
        collectSplitDocuments(stats, oldestRevTimeStamp);

        sw.stop();
        log.info("Version garbage collected in {}. {}", sw, stats);
        return stats;
    }

    private void collectSplitDocuments(VersionGCStats stats, long oldestRevTimeStamp) {
View Full Code Here

            transaction.rollback();
            logger.error("exception while processing in Phoenix Sink", e);
            throw new EventDeliveryException("Failed to persist message", e);
        }
        finally {
            logger.error(String.format("Time taken to process [%s] events was [%s] seconds",events.size(),watch.stop().elapsedTime(TimeUnit.SECONDS)));
            if( transaction != null ) {
                transaction.close();
            }
        }
        return status;
View Full Code Here

      final byte[] implementationClass = classLoader.getClassByteCode(materializedClassName, entireClass);

      // Get Template Class
      final String templateClassName = templateDefinition.getTemplateClassName().replace('.', FileUtils.separatorChar);
      final String templateClassPath = FileUtils.separator + templateClassName + ".class";
      t1.stop();
      Stopwatch t2 = new Stopwatch().start();
      final byte[] templateClass = getClassByteCodeFromPath(templateClassPath);
//      int fileNum = new Random().nextInt(100);
      //Files.write(templateClass, new File(String.format("/tmp/%d-template.class", fileNum)));
      // Generate Merge Class
View Full Code Here

        outputClass = cw.toByteArray();

        // Load the class
        classLoader.injectByteCode(materializedClassName, outputClass);
      }
      t3.stop();
      Stopwatch t4 = new Stopwatch().start();
      int i = 0;
      for (String s : remapper.getSubclasses()) {
        logger.debug("Setting up sub class {}", s);
        // for each sub class, remap them into the new class.
View Full Code Here

        byte[] newByteCode = subcw.toByteArray();
        classLoader.injectByteCode(s.replace(oldTemplateSlashName, materializedSlashName).replace(FileUtils.separatorChar, '.'), newByteCode);
//        Files.write(subcw.toByteArray(), new File(String.format("/tmp/%d-sub-%d.class", fileNum, i)));
        i++;
      }
      t4.stop();
      logger.debug(String.format("[Compile Time] Janino: %dms, Bytecode load and parse: %dms, Class Merge: %dms, Subclass remap and load: %dms.", t1.elapsed(TimeUnit.MILLISECONDS), t2.elapsed(TimeUnit.MILLISECONDS), t3.elapsed(TimeUnit.MILLISECONDS), t4.elapsed(TimeUnit.MILLISECONDS)));
      Class<?> c = classLoader.findClass(materializedClassName);
      if (templateDefinition.getExternalInterface().isAssignableFrom(c)) {
        return (T) c.newInstance();
      } else {
View Full Code Here

    ImmutableRangeMap<Long,BlockLocation> blockMap;
    try {
      watch.start();
      FileStatus file = fs.getFileStatus(new Path(fileName));
      blocks = fs.getFileBlockLocations(file, 0 , file.getLen());
      watch.stop();
      logger.debug("Block locations: {}", blocks);
      logger.debug("Took {} ms to get Block locations", watch.elapsed(TimeUnit.MILLISECONDS));
    } catch (IOException ioe) { throw new RuntimeException(ioe); }
    watch.reset();
    watch.start();
View Full Code Here

      long end = start + block.getLength();
      Range<Long> range = Range.closedOpen(start, end);
      blockMapBuilder = blockMapBuilder.put(range, block);
    }
    blockMap = blockMapBuilder.build();
    watch.stop();
    logger.debug("Took {} ms to build block map", watch.elapsed(TimeUnit.MILLISECONDS));
    blockMapMap.put(fileName, blockMap);
  }
  /**
   * For a given RowGroup, calculate how many bytes are available on each on drillbit endpoint
View Full Code Here

    }

    rowGroup.setEndpointBytes(endpointByteMap);
    rowGroup.setMaxBytes(endpointByteMap.size() > 0 ? Collections.max(endpointByteMap.values()) : 0);
    logger.debug("Row group ({},{}) max bytes {}", rowGroup.getPath(), rowGroup.getStart(), rowGroup.getMaxBytes());
    watch.stop();
    logger.debug("Took {} ms to set endpoint bytes", watch.elapsed(TimeUnit.MILLISECONDS));
  }

  private DrillbitEndpoint getDrillBitEndpoint(String hostName) {
    return endPointMap.get(hostName);
View Full Code Here

    endPointMap = new HashMap<String, DrillbitEndpoint>();
    for (DrillbitEndpoint d : endpoints) {
      String hostName = d.getAddress();
      endPointMap.put(hostName, d);
    }
    watch.stop();
    logger.debug("Took {} ms to build endpoint map", watch.elapsed(TimeUnit.MILLISECONDS));
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.