Package com.dotcms.content.elasticsearch.business.IndiciesAPI

Examples of com.dotcms.content.elasticsearch.business.IndiciesAPI.IndiciesInfo


     
     
      File file = new File(backupTempFilePath + "/WorkflowSchemeImportExportObject.json");
      WorkflowImportExportUtil.getInstance().exportWorkflows(file);
     
      IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();

      file = new File(backupTempFilePath + "/index_working.json");
      new ESIndexAPI().backupIndex(info.working, file);
      
     
View Full Code Here


    private static final ESMappingAPIImpl mappingAPI = new ESMappingAPIImpl();

    public static final SimpleDateFormat timestampFormatter=new SimpleDateFormat("yyyyMMddHHmmss");

  public synchronized void getRidOfOldIndex() throws DotDataException {
      IndiciesInfo idxs=APILocator.getIndiciesAPI().loadIndicies();
      if(idxs.working!=null)
          delete(idxs.working);
      if(idxs.live!=null)
          delete(idxs.live);
      if(idxs.reindex_working!=null)
View Full Code Here

   * Tells if at least we have a "working_XXXXXX" index
   * @return
   * @throws DotDataException
   */
  private synchronized boolean indexReady() throws DotDataException {
     IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
     return info.working!=null && info.live!=null;
  }
View Full Code Here

            final IndicesAdminClient iac = new ESClient().getClient().admin().indices();

            createContentIndex(workingIndex,0);
            createContentIndex(liveIndex,0);

            IndiciesInfo info=new IndiciesInfo();
            info.working=workingIndex;
            info.live=liveIndex;
            APILocator.getIndiciesAPI().point(info);

            return timeStamp;
View Full Code Here

                final IndicesAdminClient iac = new ESClient().getClient().admin().indices();

                createContentIndex(workingIndex);
                createContentIndex(liveIndex);

                IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
                IndiciesInfo newinfo=new IndiciesInfo();
                newinfo.working=info.working;
                newinfo.live=info.live;
                newinfo.reindex_working=workingIndex;
                newinfo.reindex_live=liveIndex;
                APILocator.getIndiciesAPI().point(newinfo);
View Full Code Here

  public boolean isInFullReindex() throws DotDataException {
      return isInFullReindex(DbConnectionFactory.getConnection());
  }
 
  public boolean isInFullReindex(Connection conn) throws DotDataException {
      IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies(conn);
      return info.reindex_working!=null && info.reindex_live!=null;
  }
View Full Code Here

   */
  public synchronized void fullReindexSwitchover(Connection conn) {
      try {
          if(!isInFullReindex()) return;

            IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies(conn);

            Logger.info(this, "Executing switchover from old index ["
                   +info.working+","+info.live+"] and new index ["
                   +info.reindex_working+","+info.reindex_live+"]");

            final String oldw=info.working;
            final String oldl=info.live;

            IndiciesInfo newinfo=new IndiciesInfo();
            newinfo.working=info.reindex_working;
            newinfo.live=info.reindex_live;
            APILocator.getIndiciesAPI().point(conn,newinfo);

            iapi.moveIndexBackToCluster(newinfo.working);
View Full Code Here

  private void indexContentletList(BulkRequestBuilder req, List<Contentlet> contentToIndex, boolean reindexOnly) throws DotStateException, DotDataException, DotSecurityException, DotMappingException {

    for(Contentlet con : contentToIndex) {
            String id=con.getIdentifier()+"_"+con.getLanguageId();
            IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
            Gson gson=new Gson();
            String mapping=null;
            try {
                if(con.isWorking()) {
                    mapping=gson.toJson(mappingAPI.toMap(con));
View Full Code Here

              public void run() {
                try {
                    String id=content.getIdentifier()+"_"+content.getLanguageId();
                    Client client=new ESClient().getClient();
                    BulkRequestBuilder bulk=client.prepareBulk();
                    IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();

                    bulk.add(client.prepareDelete(info.live, "content", id));
                    if(info.reindex_live!=null)
                        bulk.add(client.prepareDelete(info.reindex_live, "content", id));
View Full Code Here

        removeContentFromIndex(content, true);
    }

  public void removeContentFromIndexByStructureInode(String structureInode) throws DotDataException {
      String structureName=StructureCache.getStructureByInode(structureInode).getVelocityVarName();
      IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();

      // collecting indexes
      List<String> idxs=new ArrayList<String>();
      idxs.add(info.working);
      idxs.add(info.live);
View Full Code Here

TOP

Related Classes of com.dotcms.content.elasticsearch.business.IndiciesAPI.IndiciesInfo

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.