Package com.gentics.cr.monitoring

Examples of com.gentics.cr.monitoring.UseCase.stop()


            int maxs = Integer.parseInt(maxSegmentsString);
            UseCase uc = MonitorFactory.startUseCase("optimize(" + crid + ")");
            try {
              indexWriter.optimize(maxs);
            } finally {
              uc.stop();
            }
          }
        } else {
          log.debug("Job has been interrupted and will now be closed." + " Missing objects " + "will be reindexed next run.");
        }
View Full Code Here


        if (objectCount > 0) {
          indexLocation.createReopenFile();
        }
        UseCase ucFireEvent = MonitorFactory.startUseCase("indexCR(" + crid + ") fire IndexingFinishedEvent");
        EventManager.getInstance().fireEvent(new IndexingFinishedEvent(indexLocation));
        ucFireEvent.stop();
      }
    } catch (LockedIndexException ex) {
      log.debug("LOCKED INDEX DETECTED. TRYING AGAIN IN NEXT JOB.");
      if (this.indexLocation != null && !this.indexLocation.hasLockDetection()) {
        log.error("IT SEEMS THAT THE INDEX HAS UNEXPECTEDLY BEEN " + "LOCKED. TRYING TO REMOVE THE LOCK", ex);
View Full Code Here

      CRRequest req = new CRRequest();
      String[] prefillAttributes = attributes.keySet().toArray(new String[0]);
      req.setAttributeArray(prefillAttributes);
      UseCase prefillCase = MonitorFactory.startUseCase("indexSlice(" + crid + ").prefillAttributes");
      rp.fillAttributes(slice, req, idAttribute);
      prefillCase.stop();
      for (Resolvable objectToIndex : slice) {
        CRResolvableBean bean = new CRResolvableBean(objectToIndex, prefillAttributes);
        UseCase bcase = MonitorFactory.startUseCase("indexSlice(" + crid + ").indexBean");
        try {
          //CALL PRE INDEX PROCESSORS/TRANSFORMERS
View Full Code Here

              categoryDocBuilder.build(doc);
            }
            indexWriter.addDocument(doc);
          }
        } finally {
          bcase.stop();
        }
        //Stop Indexing when thread has been interrupted
        if (Thread.currentThread().isInterrupted()) {
          break;
        }
View Full Code Here

      if (sourceAccessor != null && sourceReader != null) {
        sourceAccessor.release(sourceReader, false);
      }
    }
    log.debug("Finished reindexing didyoumean index.");
    ucReIndex.stop();
  }

}
View Full Code Here

      //always release writeReader it blocks other threads if you don't
      if (writeReader != null) {
        indexAccessor.release(writeReader, readerNeedsWrite);
      }
      log.debug("Finished cleaning stale documents");
      deleteStale.stop();
    }
    checkedDocuments.clear();
  }

  private LinkedHashMap<String, Integer> fetchSortedDocs(TermDocs termDocs, IndexReader reader, String idAttribute) throws IOException {
View Full Code Here

      }
    } finally {
      sourceReader.close();
    }
    log.debug("Finished reindexing didyoumean index.");
    ucReIndex.stop();
  }

  /**
   * Called as soon as the garbage collection detects there is no referencing object left.
   */
 
View Full Code Here

     */
    UseCase ucPrepareSearch = startUseCase("LuceneRequestProcessor.getObjects(" + name + ")#prepareSearch");
    ArrayList<CRResolvableBean> result = new ArrayList<CRResolvableBean>();
    int count = getCount(request);
    int start = getStart(request);
    ucPrepareSearch.stop();
    /** * search preparations */

    /**
     * Get results
     */
 
View Full Code Here

        request);
    } catch (IOException ex) {
      LOGGER.error("Error while getting search results from index.");
      throw new CRException(ex);
    }
    ucSearch.stop();
    LOGGER.debug("Search in Index took " + (System.currentTimeMillis() - indexSearchStartTime) + "ms");
    /**
     * process search
     */
    UseCase ucProcessSearch = startUseCase("LuceneRequestProcessor." + "getObjects(" + name + ")#processSearch");
View Full Code Here

      result = processSearchResolvables(result, searchResult, parsedQuery, request);
    } else {
      // searchresult is null - we don't want to proceed - we want to throw an error
      result = null;
    }
    ucProcessSearch.stop();
    /** * process search */

    ucGetObjects.stop();
    return result;
  }
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.