Examples of QuotaResolver


Examples of org.geowebcache.diskquota.CacheCleaner.QuotaResolver

                        + " by " + excedent.toNiceString() + ". Currently used: "
                        + usedQuota.toNiceString() + ". Clean up task will be performed"
                        + " using expiration policy " + policy);

                Set<String> layerNames = Collections.singleton(layerName);
                QuotaResolver quotaResolver;
                quotaResolver = monitor.newLayerQuotaResolver(layerName);

                LayerQuotaEnforcementTask task;
                task = new LayerQuotaEnforcementTask(layerNames, quotaResolver, monitor);
                Future<Object> future = this.cleanUpExecutorService.submit(task);
                perLayerRunningCleanUps.put(layerName, future);
            }
        }

        if (globallyManagedLayerNames.size() > 0) {
            ExpirationPolicy globalExpirationPolicy = quotaConfig.getGlobalExpirationPolicyName();
            if (globalExpirationPolicy == null) {
                return;
            }
            final Quota globalQuota = quotaConfig.getGlobalQuota();
            if (globalQuota == null) {
                log.info("There's not a global disk quota configured. The following layers "
                        + "will not be checked for excess of disk usage: "
                        + globallyManagedLayerNames);
                return;
            }

            if (globalCleanUpTask != null && !globalCleanUpTask.isDone()) {
                log.debug("Global cache quota enforcement task still running, avoiding issueing a new one...");
                return;
            }

            Quota globalUsedQuota = monitor.getGloballyUsedQuota();
            Quota excedent = globalUsedQuota.difference(globalQuota);

            if (excedent.getBytes().compareTo(BigInteger.ZERO) > 0) {

                log.info("Submitting global cache quota enforcement task");
                LayerQuotaEnforcementTask task;
                QuotaResolver quotaResolver = monitor.newGlobalQuotaResolver();
                task = new LayerQuotaEnforcementTask(globallyManagedLayerNames, quotaResolver,
                        monitor);
                this.globalCleanUpTask = this.cleanUpExecutorService.submit(task);
            } else {
                if (log.isTraceEnabled()) {
View Full Code Here

Examples of org.geowebcache.diskquota.CacheCleaner.QuotaResolver

                            + ". Currently used: " + usedQuota.toNiceString()
                            + ". Clean up task will be performed using expiration policy " + policy);
                }

                Set<String> layerNames = Collections.singleton(layerName);
                QuotaResolver quotaResolver;
                quotaResolver = monitor.newLayerQuotaResolver(layerName);

                LayerQuotaEnforcementTask task;
                task = new LayerQuotaEnforcementTask(layerNames, quotaResolver, monitor);
                Future<Object> future = this.cleanUpExecutorService.submit(task);
                perLayerRunningCleanUps.put(layerName, future);
            }
        }

        if (globallyManagedLayerNames.size() > 0) {
            ExpirationPolicy globalExpirationPolicy = quotaConfig.getGlobalExpirationPolicyName();
            if (globalExpirationPolicy == null) {
                return;
            }
            final Quota globalQuota = quotaConfig.getGlobalQuota();
            if (globalQuota == null) {
                log.info("There's not a global disk quota configured. The following layers "
                        + "will not be checked for excess of disk usage: "
                        + globallyManagedLayerNames);
                return;
            }

            if (globalCleanUpTask != null && !globalCleanUpTask.isDone()) {
                log.debug("Global cache quota enforcement task still running, avoiding issueing a new one...");
                return;
            }

            Quota globalUsedQuota = monitor.getGloballyUsedQuota();
            Quota excedent = globalUsedQuota.difference(globalQuota);

            if (excedent.getBytes().compareTo(BigInteger.ZERO) > 0) {

                log.debug("Submitting global cache quota enforcement task");
                LayerQuotaEnforcementTask task;
                QuotaResolver quotaResolver = monitor.newGlobalQuotaResolver();
                task = new LayerQuotaEnforcementTask(globallyManagedLayerNames, quotaResolver,
                        monitor);
                this.globalCleanUpTask = this.cleanUpExecutorService.submit(task);
            } else {
                if (log.isTraceEnabled()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.