@@ -0,0 +1,2218 @@
+package com.thinkbiganalytics.metadata.upgrade.v084;%0A%0A/*-%0A * #%25L%0A * kylo-upgrade-service%0A * %25%25%0A * Copyright (C) 2017 ThinkBig Analytics%0A * %25%25%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A *     http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * #L%25%0A */%0A%0Aimport com.thinkbiganalytics.KyloVersion;%0Aimport com.thinkbiganalytics.metadata.modeshape.JcrMetadataAccess;%0Aimport com.thinkbiganalytics.server.upgrade.KyloUpgrader;%0Aimport com.thinkbiganalytics.server.upgrade.UpgradeException;%0Aimport com.thinkbiganalytics.server.upgrade.UpgradeState;%0A%0Aimport org.modeshape.jcr.api.Workspace;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.springframework.context.annotation.Profile;%0Aimport org.springframework.core.annotation.Order;%0Aimport org.springframework.stereotype.Component;%0A%0Aimport javax.jcr.RepositoryException;%0A%0A/**%0A * Initializes all of the ModeShape indexes introduced in 0.8.4.%0A */%0A@Component(%22reindexUpgradeAction084%22)%0A@Order(0)%0A@Profile(KyloUpgrader.KYLO_UPGRADE)%0Apublic class ReindexUpgradeAction implements UpgradeState %7B%0A%0A    private static final Logger log = LoggerFactory.getLogger(ReindexUpgradeAction.class);%0A%0A    @Override%0A    public boolean isTargetVersion(KyloVersion version) %7B%0A        return version.matches(%220.8%22, %224%22, %22%22);%0A    %7D%0A%0A    @Override%0A    public void upgradeTo(final KyloVersion startingVersion) %7B%0A        log.info(%22Re-indexing metadata for version:: %7B%7D%22, startingVersion);%0A%0A        try %7B%0A            Workspace workspace = (Workspace) JcrMetadataAccess.getActiveSession().getWorkspace();%0A            workspace.reindex();%0A        %7D catch (RepositoryException e) %7B%0A            log.error(%22Failed to re-index metadata%22, e);%0A            throw new UpgradeException(%22Failed to re-index metadata%22, e);%0A        %7D%0A    %7D%0A%7D%0A

Initialize ModeShape indexes during 0.8.4 upgrade.