aboutsummaryrefslogtreecommitdiffstats
path: root/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
diff options
context:
space:
mode:
Diffstat (limited to 'configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java47
1 files changed, 0 insertions, 47 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
index d9714c7c9af..3284c9fb6c4 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
@@ -294,16 +294,6 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
* @throws RuntimeException if the delete transaction fails. This method is exception safe.
*/
public boolean delete(ApplicationId applicationId) {
- return configserverConfig.deleteApplicationLegacy() ? deleteApplicationLegacy(applicationId) : deleteApplication(applicationId);
- }
-
- /**
- * Deletes an application
- *
- * @return true if the application was found and deleted, false if it was not present
- * @throws RuntimeException if the delete transaction fails. This method is exception safe.
- */
- boolean deleteApplication(ApplicationId applicationId) {
Tenant tenant = tenantRepository.getTenant(applicationId.tenant());
if (tenant == null) return false;
@@ -340,43 +330,6 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
return true;
}
- /**
- * Deletes an application the legacy way (if there is more than one config server, the call needs to be done
- * on the config server the application was deployed)
- *
- * @return true if the application was found and deleted, false if it was not present
- * @throws RuntimeException if the delete transaction fails. This method is exception safe.
- */
- // TODO: Remove this method, use delete(ApplicationId) instead
- boolean deleteApplicationLegacy(ApplicationId applicationId) {
- Optional<Tenant> owner = Optional.ofNullable(tenantRepository.getTenant(applicationId.tenant()));
- if (!owner.isPresent()) return false;
-
- TenantApplications tenantApplications = owner.get().getApplicationRepo();
- if (!tenantApplications.listApplications().contains(applicationId)) return false;
-
- // TODO: Push lookup logic down
- long sessionId = tenantApplications.getSessionIdForApplication(applicationId);
- LocalSessionRepo localSessionRepo = owner.get().getLocalSessionRepo();
- LocalSession session = localSessionRepo.getSession(sessionId);
- if (session == null) return false;
-
- NestedTransaction transaction = new NestedTransaction();
- localSessionRepo.removeSession(session.getSessionId(), transaction);
- session.delete(transaction); // TODO: Not unit tested
-
- transaction.add(new Rotations(owner.get().getCurator(), owner.get().getPath()).delete(applicationId)); // TODO: Not unit tested
- // (When rotations are updated in zk, we need to redeploy the zone app, on the right config server
- // this is done asynchronously in application maintenance by the node repository)
- transaction.add(tenantApplications.deleteApplication(applicationId));
-
- hostProvisioner.ifPresent(provisioner -> provisioner.remove(transaction, applicationId));
- transaction.onCommitted(() -> log.log(LogLevel.INFO, "Deleted " + applicationId));
- transaction.commit();
-
- return true;
- }
-
public HttpResponse clusterControllerStatusPage(ApplicationId applicationId, String hostName, String pathSuffix) {
// WARNING: pathSuffix may be given by the external user. Make sure no security issues arise...
// We should be OK here, because at most, pathSuffix may change the parent path, but cannot otherwise