Interface ApplicationStore


  • public interface ApplicationStore
    Store for the application and tester packages. This will replace ArtifactRepository for tenant applications.
    Author:
    smorgrav, jonmv
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      Optional<byte[]> find​(com.yahoo.config.provision.TenantName tenant, com.yahoo.config.provision.ApplicationName application, long buildNumber)
      Find prod application package by given build number
      byte[] get​(DeploymentId deploymentId, ApplicationVersion applicationVersion)
      Returns the tenant application package of the given version.
      Optional<byte[]> getDevDiff​(DeploymentId deploymentId, long buildNumber)
      Returns the application package diff, compared to the previous build, for the given deployment and build number
      Optional<byte[]> getDiff​(com.yahoo.config.provision.TenantName tenantName, com.yahoo.config.provision.ApplicationName applicationName, long buildNumber)
      Returns the application package diff, compared to the previous build, for the given tenant, application and build number
      byte[] getTester​(com.yahoo.config.provision.TenantName tenant, com.yahoo.config.provision.ApplicationName application, ApplicationVersion applicationVersion)
      Returns the tester application package of the given version.
      default boolean hasBuild​(com.yahoo.config.provision.TenantName tenant, com.yahoo.config.provision.ApplicationName application, long buildNumber)
      Whether the prod application package with the given number is stored.
      boolean prune​(com.yahoo.config.provision.TenantName tenant, com.yahoo.config.provision.ApplicationName application, ApplicationVersion olderThanVersion)
      Removes applications older than the given version, for the given application, and returns whether something was removed.
      void pruneDevDiffs​(DeploymentId deploymentId, long beforeBuildNumber)
      Removes diffs for dev packages before the given build number
      void pruneDiffs​(com.yahoo.config.provision.TenantName tenantName, com.yahoo.config.provision.ApplicationName applicationName, long beforeBuildNumber)
      Removes diffs for packages before the given build number
      void pruneMeta​(Instant oldest)
      Prunes meta data such that only what was active at the given instant, and anything newer, is retained.
      boolean pruneTesters​(com.yahoo.config.provision.TenantName tenant, com.yahoo.config.provision.ApplicationName application, ApplicationVersion olderThanVersion)
      Removes tester packages older than the given version, for the given tester, and returns whether something was removed.
      void put​(com.yahoo.config.provision.TenantName tenant, com.yahoo.config.provision.ApplicationName application, ApplicationVersion applicationVersion, byte[] applicationPackage, byte[] diff)
      Stores the given tenant application package of the given version and diff since previous version.
      void putDev​(DeploymentId deploymentId, ApplicationVersion version, byte[] applicationPackage, byte[] diff)
      Stores the given application package as the development package for the given deployment and version and diff since previous version.
      void putMeta​(com.yahoo.config.provision.TenantName tenant, com.yahoo.config.provision.ApplicationName application, Instant now, byte[] metaZip)
      Stores the given application meta data with the current time as part of the path.
      void putMeta​(DeploymentId id, Instant now, byte[] metaZip)
      Stores the given manual deployment meta data with the current time as part of the path.
      void putMetaTombstone​(com.yahoo.config.provision.TenantName tenant, com.yahoo.config.provision.ApplicationName application, Instant now)
      Marks the given application as deleted, and eligible for meta data GC at a later time.
      void putMetaTombstone​(DeploymentId id, Instant now)
      Marks the given manual deployment as deleted, and eligible for meta data GC at a later time.
      void putTester​(com.yahoo.config.provision.TenantName tenant, com.yahoo.config.provision.ApplicationName application, ApplicationVersion applicationVersion, byte[] testerPackage)
      Stores the given tester application package of the given version.
      void removeAll​(com.yahoo.config.provision.TenantName tenant, com.yahoo.config.provision.ApplicationName application)
      Removes all application packages for the given application, including any development package.
      void removeAllTesters​(com.yahoo.config.provision.TenantName tenant, com.yahoo.config.provision.ApplicationName application)
      Removes all tester packages for the given tester.
    • Method Detail

      • getDiff

        Optional<byte[]> getDiff​(com.yahoo.config.provision.TenantName tenantName,
                                 com.yahoo.config.provision.ApplicationName applicationName,
                                 long buildNumber)
        Returns the application package diff, compared to the previous build, for the given tenant, application and build number
      • pruneDiffs

        void pruneDiffs​(com.yahoo.config.provision.TenantName tenantName,
                        com.yahoo.config.provision.ApplicationName applicationName,
                        long beforeBuildNumber)
        Removes diffs for packages before the given build number
      • find

        Optional<byte[]> find​(com.yahoo.config.provision.TenantName tenant,
                              com.yahoo.config.provision.ApplicationName application,
                              long buildNumber)
        Find prod application package by given build number
      • hasBuild

        default boolean hasBuild​(com.yahoo.config.provision.TenantName tenant,
                                 com.yahoo.config.provision.ApplicationName application,
                                 long buildNumber)
        Whether the prod application package with the given number is stored.
      • put

        void put​(com.yahoo.config.provision.TenantName tenant,
                 com.yahoo.config.provision.ApplicationName application,
                 ApplicationVersion applicationVersion,
                 byte[] applicationPackage,
                 byte[] diff)
        Stores the given tenant application package of the given version and diff since previous version.
      • prune

        boolean prune​(com.yahoo.config.provision.TenantName tenant,
                      com.yahoo.config.provision.ApplicationName application,
                      ApplicationVersion olderThanVersion)
        Removes applications older than the given version, for the given application, and returns whether something was removed.
      • removeAll

        void removeAll​(com.yahoo.config.provision.TenantName tenant,
                       com.yahoo.config.provision.ApplicationName application)
        Removes all application packages for the given application, including any development package.
      • getTester

        byte[] getTester​(com.yahoo.config.provision.TenantName tenant,
                         com.yahoo.config.provision.ApplicationName application,
                         ApplicationVersion applicationVersion)
        Returns the tester application package of the given version. Does NOT contain the services.xml.
      • putTester

        void putTester​(com.yahoo.config.provision.TenantName tenant,
                       com.yahoo.config.provision.ApplicationName application,
                       ApplicationVersion applicationVersion,
                       byte[] testerPackage)
        Stores the given tester application package of the given version. Does NOT contain the services.xml.
      • pruneTesters

        boolean pruneTesters​(com.yahoo.config.provision.TenantName tenant,
                             com.yahoo.config.provision.ApplicationName application,
                             ApplicationVersion olderThanVersion)
        Removes tester packages older than the given version, for the given tester, and returns whether something was removed.
      • removeAllTesters

        void removeAllTesters​(com.yahoo.config.provision.TenantName tenant,
                              com.yahoo.config.provision.ApplicationName application)
        Removes all tester packages for the given tester.
      • getDevDiff

        Optional<byte[]> getDevDiff​(DeploymentId deploymentId,
                                    long buildNumber)
        Returns the application package diff, compared to the previous build, for the given deployment and build number
      • pruneDevDiffs

        void pruneDevDiffs​(DeploymentId deploymentId,
                           long beforeBuildNumber)
        Removes diffs for dev packages before the given build number
      • putDev

        void putDev​(DeploymentId deploymentId,
                    ApplicationVersion version,
                    byte[] applicationPackage,
                    byte[] diff)
        Stores the given application package as the development package for the given deployment and version and diff since previous version.
      • putMeta

        void putMeta​(com.yahoo.config.provision.TenantName tenant,
                     com.yahoo.config.provision.ApplicationName application,
                     Instant now,
                     byte[] metaZip)
        Stores the given application meta data with the current time as part of the path.
      • putMetaTombstone

        void putMetaTombstone​(com.yahoo.config.provision.TenantName tenant,
                              com.yahoo.config.provision.ApplicationName application,
                              Instant now)
        Marks the given application as deleted, and eligible for meta data GC at a later time.
      • putMeta

        void putMeta​(DeploymentId id,
                     Instant now,
                     byte[] metaZip)
        Stores the given manual deployment meta data with the current time as part of the path.
      • putMetaTombstone

        void putMetaTombstone​(DeploymentId id,
                              Instant now)
        Marks the given manual deployment as deleted, and eligible for meta data GC at a later time.
      • pruneMeta

        void pruneMeta​(Instant oldest)
        Prunes meta data such that only what was active at the given instant, and anything newer, is retained.