Package com.gentics.cr.util.indexing

Examples of com.gentics.cr.util.indexing.IndexLocation


   * @see com.gentics.cr.util.indexing.AbstractIndexExtension#addJob(java.lang. String,
   * com.gentics.cr.util.indexing.IndexLocation)
   */
  @Override
  public void addJob(String name, IndexLocation indexLocation) throws NoSuchMethodException {
    IndexLocation actualLocation = callingIndexLocation;
    if (indexLocation != null) {
      actualLocation = indexLocation;
    }

    if (REINDEX_JOB.equalsIgnoreCase(name)) {
      AbstractUpdateCheckerJob job = new DidyoumeanIndexJob(this.config, actualLocation, this);
      actualLocation.getQueue().addJob(job);
    } else if (CLEAR_JOB.equalsIgnoreCase(name)) {
      AbstractUpdateCheckerJob job = new DidyoumeanIndexDeleteJob(config, actualLocation, this);
      actualLocation.getQueue().addJob(job);
    } else {
      throw new NoSuchMethodException("No Job-Method by the name: " + name);
    }
  }
View Full Code Here


  public String getName() {
    return name;
  }

  public static synchronized LuceneIndexLocation getIndexLocation(CRConfig config) {
    IndexLocation genericIndexLocation = IndexLocation.getIndexLocation(config);
    if (genericIndexLocation instanceof LuceneIndexLocation) {
      return (LuceneIndexLocation) genericIndexLocation;
    } else {
      log.error("IndexLocation is not created for Lucene. Using the " + CRLuceneIndexJob.class.getName()
          + " requires that you use the " + LuceneIndexLocation.class.getName()
View Full Code Here

    ConcurrentHashMap<String, IndexLocation> indexTable = indexer.getIndexes();
    indexTable = indexer.getIndexes();
    ResponseWriter writer = new ResponseWriter(response.getWriter());
    for (Entry<String, IndexLocation> e : indexTable.entrySet()) {
      if (showAll || e.getKey().equalsIgnoreCase(index)) {
        IndexLocation loc = e.getValue();
        IndexJobQueue queue = loc.getQueue();
        Map<String, CRConfigUtil> map = loc.getCRMap();
        if (queue != null && queue.isRunning()) {
          writer.write(e.getKey(), ".WorkerThread: OK\n");
        } else {
          writer.write(e.getKey(), ".WorkerThread: NOK\n");
        }
        writer.write(e.getKey(), ".ObjectsInIndex: ", loc.getDocCount() + "", "\n");
        if (queue != null) {
          AbstractUpdateCheckerJob j = queue.getCurrentJob();
          if (j != null) {
            writer.write(e.getKey(), ".CurrentJobObjectsToIndex: ", j.getObjectsToIndex() + "", "\n");
            writer.write(e.getKey(), ".CurrentJobStarted: ", j.getStart() + "", "\n");
View Full Code Here

      ConcurrentHashMap<String, IndexLocation> indexTable = indexer.getIndexes();

      setTemplateVariables(request);

      for (Entry<String, IndexLocation> e : indexTable.entrySet()) {
        IndexLocation loc = e.getValue();
        IndexJobQueue queue = loc.getQueue();
        ConcurrentHashMap<String, CRConfigUtil> map = loc.getCRMap();
        if (e.getKey().equalsIgnoreCase(index)) {
          if ("stopWorker".equalsIgnoreCase(action)) {
            queue.pauseWorker();
          }
          if ("startWorker".equalsIgnoreCase(action)) {
            queue.resumeWorker();
          }
          if ("clear".equalsIgnoreCase(action)) {
            loc.createClearJob();
          }
          if ("optimize".equalsIgnoreCase(action)) {
            loc.createOptimizeJob();
          }
          if ("addJob".equalsIgnoreCase(action)) {
            String cr = request.getParameter("cr");
            if ("all".equalsIgnoreCase(cr)) {
              loc.createAllCRIndexJobs();
            } else {
              if (cr != null) {
                CRConfigUtil crc = map.get(cr);
                loc.createCRIndexJob(crc, map);
              }
            }
          }
          if ("addExtensionJob".equalsIgnoreCase(action)) {
            String sExt = request.getParameter("ext");
View Full Code Here

   * Create an archive of the index.
   * @param index Index to create a tarball of.
   * @param response
   */
  private void generateArchive(final String index, final HttpServletResponse response) {
    IndexLocation location = indexer.getIndexes().get(index);
    if (location instanceof LuceneSingleIndexLocation) {
      LuceneSingleIndexLocation indexLocation = (LuceneSingleIndexLocation) location;
      File indexDirectory = new File(indexLocation.getReopenFilename()).getParentFile();
      File writeLock = null;
      boolean weWroteTheWriteLock = false;
View Full Code Here

   * @see com.gentics.cr.util.indexing.AbstractIndexExtension#addJob(java.lang. String,
   * com.gentics.cr.util.indexing.IndexLocation)
   */
  @Override
  public void addJob(final String name, final IndexLocation indexLocation) throws NoSuchMethodException {
    IndexLocation actualLocation = callingIndexLocation;
    if (indexLocation != null) {
      actualLocation = indexLocation;
    }

    if (REINDEX_JOB.equalsIgnoreCase(name)){
      AbstractUpdateCheckerJob job = new SynonymIndexJob(this.config, actualLocation, this);
      actualLocation.getQueue().addJob(job);
    } else if (CLEAR_JOB.equalsIgnoreCase(name)) {
      AbstractUpdateCheckerJob job = new SynonymIndexDeleteJob(config, actualLocation, this);
      actualLocation.getQueue().addJob(job);
    } else {
      throw new NoSuchMethodException("No Job-Method by the name: " + name);
    }
  }
View Full Code Here

   * @see com.gentics.cr.util.indexing.AbstractIndexExtension#addJob(java.lang. String,
   * com.gentics.cr.util.indexing.IndexLocation)
   */
  @Override
  public void addJob(String name, IndexLocation indexLocation) throws NoSuchMethodException {
    IndexLocation actualLocation = callingIndexLocation;
    if (indexLocation != null) {
      actualLocation = indexLocation;
    }
    if (REINDEX_JOB.equalsIgnoreCase(name)) {
      AbstractUpdateCheckerJob job = (AbstractUpdateCheckerJob) new AutocompleteIndexJob(this.config,
          actualLocation, this);
      actualLocation.getQueue().addJob(job);
    } else if (CLEAR_JOB.equalsIgnoreCase(name)) {
      AbstractUpdateCheckerJob job = (AbstractUpdateCheckerJob) new AutocompleteIndexDeleteJob(this.config,
          actualLocation, this);
      actualLocation.getQueue().addJob(job);
    } else {
      throw new NoSuchMethodException("No Job-Method by the name: " + name);
    }
  }
View Full Code Here

   * requests
   */
  @Deprecated
  public void processEvent(Event event) {
    if (IndexingFinishedEvent.INDEXING_FINISHED_EVENT_TYPE.equals(event.getType())) {
      IndexLocation il = (IndexLocation) event.getData();
      if (!reindexStrategy.skipReIndex(il)) {
        try {
          reIndex();
        } catch (IOException e) {
          log.error("Could not reindex autocomplete index.", e);
View Full Code Here

TOP

Related Classes of com.gentics.cr.util.indexing.IndexLocation

Copyright © 2018 www.massapicom. 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.