From a88db4af71bac2c29429540bc1e5387741be7d68 Mon Sep 17 00:00:00 2001 From: cwardgar Date: Mon, 10 Jul 2017 15:17:21 -0600 Subject: [PATCH] Allow default cache sizes of Variables to be modified by user. * Variables need to be static, public, and non-final. --- cdm/src/main/java/ucar/nc2/Variable.java | 4 ++-- cdm/src/main/java/ucar/nc2/dataset/CoordinateAxis.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cdm/src/main/java/ucar/nc2/Variable.java b/cdm/src/main/java/ucar/nc2/Variable.java index b1a1d1a69e..17ee14b86e 100644 --- a/cdm/src/main/java/ucar/nc2/Variable.java +++ b/cdm/src/main/java/ucar/nc2/Variable.java @@ -66,8 +66,8 @@ public class Variable extends CDMNode implements VariableIF, ProxyReader, Attrib */ static public boolean permitCaching = true; - static public final int defaultSizeToCache = 4000; // bytes cache any variable whose size() < defaultSizeToCache - static public final int defaultCoordsSizeToCache = 40 * 1000; // bytes cache coordinate variable whose size() < defaultSizeToCache + static public int defaultSizeToCache = 4000; // bytes cache any variable whose size() < defaultSizeToCache + static public int defaultCoordsSizeToCache = 40 * 1000; // bytes cache coordinate variable whose size() < defaultSizeToCache static protected boolean debugCaching = false; static private org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Variable.class); diff --git a/cdm/src/main/java/ucar/nc2/dataset/CoordinateAxis.java b/cdm/src/main/java/ucar/nc2/dataset/CoordinateAxis.java index f624656750..191a38a87f 100644 --- a/cdm/src/main/java/ucar/nc2/dataset/CoordinateAxis.java +++ b/cdm/src/main/java/ucar/nc2/dataset/CoordinateAxis.java @@ -73,7 +73,7 @@ public class CoordinateAxis extends VariableDS { static private org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(CoordinateAxis.class); - static private final int axisSizeToCache = 100 * 1000; // bytes + static public int axisSizeToCache = 100 * 1000; // bytes protected NetcdfDataset ncd; // container dataset protected AxisType axisType = null; @@ -421,4 +421,4 @@ public boolean isCoordinateVariable() { return true; } -} \ No newline at end of file +}