Examples of ExecutionMetadata


Examples of org.apache.stanbol.enhancer.servicesapi.helper.execution.ExecutionMetadata

                executorService.execute(new AsyncExecuter(content,request, this));
            }
        }

        void succeed(Request request, UriRef contentItemUri, TripleCollection results, Long rtt, int size) {
            ExecutionMetadata em = ExecutionMetadata.parseFrom(results, (UriRef) contentItemUri);
            results.clear(); // we no longer need the results
            if (em != null) {
                synchronized (statistics) {
                    statistics.addResult(em, rtt, size);
                }
View Full Code Here

Examples of org.apache.stanbol.enhancer.servicesapi.helper.execution.ExecutionMetadata

        EnhancementJobObserver observer = jobHandler.register(job);
        //now wait for the execution to finish for the configured maximum time
        boolean completed = observer.waitForCompletion(maxEnhancementJobWaitTime);
        if(!completed){ //throw timeout exception
            StringBuilder sb = new StringBuilder("Status:\n");
            ExecutionMetadata em = ExecutionMetadata.parseFrom(job.getExecutionMetadata(), ci.getUri());
            for(Entry<String,Execution> ex : em.getEngineExecutions().entrySet()){
                sb.append("  -").append(ex.getKey()).append(": ").append(ex.getValue().getStatus()).append('\n');
            }
            throw new ChainException("Execution timeout after "
                    +((System.currentTimeMillis()-start)/1000f)+"sec (timeout:"+(maxEnhancementJobWaitTime/1000)
                + "sec) for ContentItem "+ci.getUri()+"\n"+sb.toString()
View Full Code Here

Examples of org.apache.stanbol.enhancer.servicesapi.helper.execution.ExecutionMetadata

     * <code>{@link EnhancementJob#isFinished()} == true</code>
     */
    protected static void logExecutionTimes(Logger logger, EnhancementJob job){
      if(logger.isInfoEnabled()){
        try {
          ExecutionMetadata em = ExecutionMetadata.parseFrom(
              job.getExecutionMetadata(),job.getContentItem().getUri());
          ChainExecution ce = em.getChainExecution();
          long cd = ce.getDuration();
          logger.info("Executed Chain {} in {}ms", ce.getChainName(),
                ce.getDuration());
          logger.info(" > ContentItem: {}", job.getContentItem().getUri().getUnicodeString());
          List<Execution> ees = new ArrayList<Execution>(em.getEngineExecutions().values());
          //sort by start date (execution order)
          Collections.sort(ees, new Comparator<Execution>() {
            @Override
            public int compare(Execution e1, Execution e2) {
              return e1.getStarted().compareTo(e2.getStarted());
View Full Code Here

Examples of org.apache.stanbol.enhancer.servicesapi.helper.execution.ExecutionMetadata

        EnhancementJobObserver observer = jobHandler.register(job);
        //now wait for the execution to finish for the configured maximum time
        boolean completed = observer.waitForCompletion(maxEnhancementJobWaitTime);
        if(!completed){ //throw timeout exception
            StringBuilder sb = new StringBuilder("Status:\n");
            ExecutionMetadata em = ExecutionMetadata.parseFrom(job.getExecutionMetadata(), ci.getUri());
            for(Entry<String,Execution> ex : em.getEngineExecutions().entrySet()){
                sb.append("  -").append(ex.getKey()).append(": ").append(ex.getValue().getStatus()).append('\n');
            }
            throw new ChainException("Execution timeout after "
                    +((System.currentTimeMillis()-start)/1000f)+"sec (timeout:"+(maxEnhancementJobWaitTime/1000)
                + "sec) for ContentItem "+ci.getUri()+"\n"+sb.toString()
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.