Package org.geowebcache.diskquota.storage

Examples of org.geowebcache.diskquota.storage.TileSet


     *            value decreases it
     * @param tileIdex
     */
    public QuotaUpdate(String layerName, String gridsetId, String blobFormat, Long parametersId,
            long size, long[] tileIndex) {
        this(new TileSet(layerName, gridsetId, blobFormat, parametersId), size, tileIndex);
    }
View Full Code Here


        }
    }

    private void expirePage(TilePage tilePage) throws InterruptedException {
        final String tileSetId = tilePage.getTileSetId();
        final TileSet tileSet = pageStore.getTileSetById(tileSetId);
        final String layerName = tileSet.getLayerName();
        final String gridSetId = tileSet.getGridsetId();
        final String blobFormat = tileSet.getBlobFormat();
        final Long parametersId = tileSet.getParametersId();
        final int zoomLevel = tilePage.getZoomLevel();
        final long[][] pageGridCoverage = pageStore.getTilesForPage(tilePage);

        MimeType mimeType;
        try {
View Full Code Here

                String blobFormat = null;
                Long parametersId = null;
                if(parts.length == 4){
                    parametersId = Long.parseLong(parts[3], 16);
                }
                TileSet tileSet = new TileSet(layerName, gridsetId, blobFormat, parametersId);
                foundTileSets.add(tileSet);
            }
        }
        return foundTileSets;
    }
View Full Code Here

     * @throws InterruptedException
     */
    private void performAggregatedUpdate(final UsageStats requestedTile)
            throws InterruptedException {

        final TileSet tileSet = requestedTile.getTileSet();
        final String tileSetId = tileSet.getId();
        final long[] tileIndex = requestedTile.getTileIndex();

        tilePageCalculator.pageIndexForTile(tileSet, tileIndex, pageIndexTarget);
        final int pageX = pageIndexTarget[0];
        final int pageY = pageIndexTarget[1];
View Full Code Here

        Long parametersId;
        {
            long paramsId = tile.getParametersId();
            parametersId = paramsId == -1 ? null : Long.valueOf(paramsId);
        }
        TileSet tileSet = new TileSet(layerName, gridsetId, blobFormat, parametersId);
        long[] tileIndex = tile.getTileIndex().clone();
        UsageStats usageLog = new UsageStats(tileSet, tileIndex);
        try {
            usageStatsQueue.put(usageLog);
        } catch (InterruptedException e) {
View Full Code Here

     * @param updateData
     * @throws InterruptedException
     */
    private void performAggregatedUpdate(final QuotaUpdate updateData) throws InterruptedException {

        final TileSet tileSet = updateData.getTileSet();

        TimedQuotaUpdate accumulatedUpdate = aggregatedDelayedUpdates.get(tileSet);

        if (accumulatedUpdate == null) {
            /*
 
View Full Code Here

        return false;
    }

    private void commit(final TimedQuotaUpdate aggregatedUpadte) throws InterruptedException {
        final TileSet tileSet = aggregatedUpadte.getTileSet();
        final Quota quotaDiff = aggregatedUpadte.getAccummulatedQuotaDifference();

        Collection<PageStatsPayload> tileCountDiffs;
        tileCountDiffs = new ArrayList<PageStatsPayload>(
                aggregatedUpadte.getAccummulatedTilePageCounts());
View Full Code Here

        return EMPTY_QUOTA;
    }

    @Override
    public long[][] getTilesForPage(TilePage page) throws InterruptedException {
        TileSet tileSet = getTileSetById(page.getTileSetId());
        long[][] gridCoverage = calculator.toGridCoverage(tileSet, page);
        return gridCoverage;
    }
View Full Code Here

        // two formats for topp:states2, four formats and two tilesets for topp:states
        assertNotNull(tileSets);
        assertEquals(10, tileSets.size());

        // check every possibility
        TileSet tileSet = new TileSet("topp:states", "EPSG:900913", "image/png", null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);

        tileSet = new TileSet("topp:states", "EPSG:900913", "image/jpeg", null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);

        tileSet = new TileSet("topp:states", "EPSG:900913", "image/gif", null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);

        tileSet = new TileSet("topp:states", "EPSG:900913", "application/vnd.google-earth.kml+xml",
                null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);

        tileSet = new TileSet("topp:states", "EPSG:4326", "image/png", null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);

        tileSet = new TileSet("topp:states", "EPSG:4326", "image/jpeg", null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);

        tileSet = new TileSet("topp:states", "EPSG:4326", "image/gif", null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);

        tileSet = new TileSet("topp:states", "EPSG:4326", "application/vnd.google-earth.kml+xml",
                null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);

        tileSet = new TileSet("topp:states2", "EPSG:2163", "image/png", null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);

        tileSet = new TileSet("topp:states2", "EPSG:2163", "image/jpeg", null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);

        // check the layer wide quotas
        assertQuotaZero("topp:states");
        assertQuotaZero("topp:states2");

        // remove one layer from the dispatcher
        Configuration configuration = layerDispatcher.removeLayer("topp:states");
        configuration.save();
        // and make sure at the next startup the store catches up (note this behaviour is just a
        // startup consistency check in case the store got out of sync for some reason. On normal
        // situations the store should have been notified through store.deleteLayer(layerName) if
        // the layer was removed programmatically through StorageBroker.deleteLayer
        store.close();
        store.setDataSource(getDataSource());
        store.initialize();

        tileSets = store.getTileSets();
        assertNotNull(tileSets);
        assertEquals(2, tileSets.size());
        tileSet = new TileSet("topp:states2", "EPSG:2163", "image/png", null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);

        tileSet = new TileSet("topp:states2", "EPSG:2163", "image/jpeg", null);
        assertTrue(tileSets.contains(tileSet));
        assertQuotaZero(tileSet);
    }
View Full Code Here

        // make sure the layer is there and has stuff
        Quota usedQuota = store.getUsedQuotaByLayerName(oldLayerName);
        assertNotNull(usedQuota);

        TileSet tileSet = tilePageCalculator.getTileSetsFor(oldLayerName).iterator().next();
        TilePage page = new TilePage(tileSet.getId(), 0, 0, (byte) 0);
        store.addHitsAndSetAccesTime(Collections.singleton(new PageStatsPayload(page)));
        store.addToQuotaAndTileCounts(tileSet, new Quota(BigInteger.valueOf(1024)),
                Collections.EMPTY_LIST);

        Quota expectedQuota = store.getUsedQuotaByLayerName(oldLayerName);
        assertEquals(1024L, expectedQuota.getBytes().longValue());

        assertNotNull(store.getTileSetById(tileSet.getId()));

        store.renameLayer(oldLayerName, newLayerName);

        // cascade deleted old layer?
        assertNull(store.getLeastRecentlyUsedPage(Collections.singleton(oldLayerName)));
View Full Code Here

TOP

Related Classes of org.geowebcache.diskquota.storage.TileSet

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.