public void close() throws Exception { if (!diskQuotaEnabled) { return; } open = false; log.info("Requesting to close quota store..."); transactionRunner.shutdown(); try { transactionRunner.awaitTermination(30 * 1000, TimeUnit.MILLISECONDS); } catch (InterruptedException ie) { log.error( "Time out shutting down quota store write thread, trying to " + "close the entity store as is.", ie); Thread.currentThread().interrupt(); } finally { Environment environment = entityStore.getEnvironment(); entityStore.close(); environment.close(); } log.info("Quota store closed."); }
public Void call() throws Exception { final Transaction transaction = entityStore.getEnvironment().beginTransaction(null, null); try { createLayer(layerName, transaction); transaction.commit(); } catch (RuntimeException e) { transaction.abort(); } return null; } });
public Void call() throws Exception { Transaction transaction = entityStore.getEnvironment().beginTransaction(null, null); try { call(transaction); transaction.commit(); } catch (RuntimeException e) { transaction.abort(); throw e; } return null; }
/** * Copy over old {@link TileSet}s, used {@link Quota}s and {@link TilePage}s from * oldLayerName to newLayerName and delete the old ones * * @see java.util.concurrent.Callable#call() */ public Void call() throws Exception { Transaction transaction = entityStore.getEnvironment().beginTransaction(null, null); try { copyTileSets(transaction); Deleter deleteCommand = new Deleter(oldLayerName, ts -> true); deleteCommand.call(transaction); transaction.commit(); } catch (RuntimeException e) { transaction.abort(); throw e; } return null; }
public Void call() throws Exception { final Transaction transaction = entityStore.getEnvironment().beginTransaction(null, null); try { if (null
public PageStats call() throws Exception { Transaction tx = entityStore.getEnvironment().beginTransaction(null, null); try { PageStats pageStats = pageStatsByPageId.get(tx, tilePage.getId(), null); if (pageStats != null) { pageStats.setFillFactor(0f); pageStatsById.putNoReturn(tx, pageStats); } tx.commit(); return pageStats; } catch (Exception e) { tx.abort(); throw e; } } }
public List<PageStats> call() throws Exception { List<PageStats> allStats = new ArrayList<PageStats>(statsUpdates.size()); PageStats pageStats = null; final Transaction tx = entityStore.getEnvironment().beginTransaction(null, null); try { for (PageStatsPayload payload : statsUpdates) {
public Void call() throws Exception { final Transaction tx = entityStore.getEnvironment().beginTransaction(null, null); try { TileSet storedTileset = getOrCreateTileSet(tx, tileSet);