org.geowebcache.diskquota.storage.Quota.setBytes()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中org.geowebcache.diskquota.storage.Quota.setBytes方法的一些代码示例,展示了Quota.setBytes的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quota.setBytes方法的具体详情如下:
包路径:org.geowebcache.diskquota.storage.Quota
类名称:Quota
方法名:setBytes

Quota.setBytes介绍

暂无

代码示例

代码示例来源:origin: GeoWebCache/geowebcache

public void setBytes(long bytes) {
  setBytes(BigInteger.valueOf(bytes));
}

代码示例来源:origin: GeoWebCache/geowebcache

/**
 * Shorthand for {@code setBytes(unit.convertTo(value, StorageUnit.B).toBigInteger())}
 *
 * @param value
 * @param unit
 */
public void setValue(double value, StorageUnit unit) {
  setBytes(unit.convertTo(value, StorageUnit.B).toBigInteger());
}

代码示例来源:origin: GeoWebCache/geowebcache

@Override
  protected void doInTransactionWithoutResult(TransactionStatus arg0) {
    // update the global quota
    Quota quota = getUsedQuotaByLayerName(layerName);
    quota.setBytes(quota.getBytes().negate());
    String updateQuota =
        dialect.getUpdateQuotaStatement(schema, "tileSetId", "bytes");
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("tileSetId", GLOBAL_QUOTA_NAME);
    params.put("bytes", new BigDecimal(quota.getBytes()));
    jt.update(updateQuota, params);
    // delete the layer
    log.info("Deleting disk quota information for layer '" + layerName + "'");
    String statement = dialect.getLayerDeletionStatement(schema, "layerName");
    jt.update(statement, Collections.singletonMap("layerName", layerName));
  }
});

代码示例来源:origin: GeoWebCache/geowebcache

@Override
  protected void doInTransactionWithoutResult(TransactionStatus status) {
    // first gather the disk quota used by the gridset, and update the global
    // quota
    Quota quota = getUsedQuotaByParametersId(parametersId);
    quota.setBytes(quota.getBytes().negate());
    String updateQuota =
        dialect.getUpdateQuotaStatement(schema, "tileSetId", "bytes");
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("tileSetId", GLOBAL_QUOTA_NAME);
    params.put("bytes", new BigDecimal(quota.getBytes()));
    jt.update(updateQuota, params);
    // then delete all the gridsets with the specified id
    String statement =
        dialect.getLayerParametersDeletionStatement(
            schema, "layerName", "parametersId");
    params = new HashMap<String, Object>();
    params.put("layerName", layerName);
    params.put("parametersId", parametersId);
    jt.update(statement, params);
  }
});

代码示例来源:origin: GeoWebCache/geowebcache

@Override
  protected void doInTransactionWithoutResult(TransactionStatus status) {
    // get the disk quota used by the layer gridset
    Quota quota = getUsedQuotaByLayerGridset(layerName, gridSetId);
    // we will subtracting the current disk quota value
    quota.setBytes(quota.getBytes().negate());
    // update the global disk quota by subtracting the value above
    String updateQuota =
        dialect.getUpdateQuotaStatement(schema, "tileSetId", "bytes");
    Map<String, Object> params = new HashMap<>();
    params.put("tileSetId", GLOBAL_QUOTA_NAME);
    params.put("bytes", new BigDecimal(quota.getBytes()));
    jt.update(updateQuota, params);
    // delete layer gridset
    String statement =
        dialect.getLayerGridDeletionStatement(
            schema, "layerName", "gridSetId");
    params = new HashMap<String, Object>();
    params.put("layerName", layerName);
    params.put("gridSetId", gridSetId);
    jt.update(statement, params);
  }
});

代码示例来源:origin: GeoWebCache/geowebcache

newQuota =
    usedQuotaByTileSetId.get(transaction, newTileSetId, LockMode.DEFAULT);
newQuota.setBytes(oldQuota.getBytes());
usedQuotaById.putNoReturn(transaction, newQuota);

相关文章