public int compare(MCollection o1, MCollection o2) { return o1.getCollectionName().compareTo(o2.getCollectionName()); } });
private boolean wasRemoved(MCollection partition) { return removed != null && (removed.contains(partition.getCollectionName())); }
private boolean wasRemoved(MCollection partition) { return removed != null && (removed.contains(partition.getCollectionName())); } }
private boolean wasRemoved(MCollection partition) { return removed != null && (removed.contains(partition.getCollectionName())); }
private boolean wasRemoved(MCollection partition) { return removed != null && (removed.contains(partition.getCollectionName())); }
public void removePartition( MCollection partition) { if (removed == null) removed = new ArrayList<>(); removed.add(partition.getCollectionName()); }
public void removePartition(MCollection partition) { if (removed == null) removed = new ArrayList<>(); removed.add(partition.getCollectionName()); }
public void removePartition( MCollection partition) { if (removed == null) removed = new ArrayList<>(); removed.add(partition.getCollectionName()); }
public void removePartition( MCollection partition) { if (removed == null) removed = new ArrayList<>(); removed.add(partition.getCollectionName()); }
public void addPartition(MCollection dcm) { Partition partition = new Partition(dcm); try (GribCollectionMutable gc = partition.makeGribCollection()) { // make sure we can open the collection if (gc == null) logger.warn("failed to open partition {} =skipping", dcm.getCollectionName()); else partitions.add(partition); } catch (Exception e) { logger.warn("failed to open partition {} -skipping", dcm.getCollectionName(), e); } }
public void removePartition( MCollection partition) { for (MFile mfile : partIndexFiles) { if (mfile.getName().equalsIgnoreCase(partition.getCollectionName())) { List<MFile> part = new ArrayList<>(partIndexFiles); part.remove(mfile); partIndexFiles = part; return; } } } }
public PartitionManagerFromIndexList(MCollection dcm, List<MFile> partFiles, org.slf4j.Logger logger) { super(dcm.getCollectionName(), logger); this.config = (FeatureCollectionConfig) dcm.getAuxInfo(FeatureCollectionConfig.AUX_CONFIG); this.root = dcm.getRoot(); this.partIndexFiles = partFiles; }
public PartitionManagerFromIndexList(MCollection dcm, List<MFile> partFiles, org.slf4j.Logger logger) { super(dcm.getCollectionName(), logger); this.config = (FeatureCollectionConfig) dcm.getAuxInfo(FeatureCollectionConfig.AUX_CONFIG); this.root = dcm.getRoot(); this.partIndexFiles = partFiles; }
static private boolean updateGribCollection(boolean isGrib1, MCollection dcm, CollectionUpdateType updateType, FeatureCollectionConfig.PartitionType ptype, Logger logger, Formatter errlog) throws IOException { if (debug) System.out.printf("GribCdmIndex.updateGribCollection %s %s%n", dcm.getCollectionName(), updateType); if (!isUpdateNeeded(dcm.getIndexFilename(NCX_SUFFIX), updateType, (isGrib1 ? GribCollectionType.GRIB1 : GribCollectionType.GRIB2), logger)) return false; boolean changed; if (isGrib1) { // existing case handles correctly - make seperate index for each runtime (OR) partition == runtime Grib1CollectionBuilder builder = new Grib1CollectionBuilder(dcm.getCollectionName(), dcm, logger); changed = builder.updateNeeded(updateType) && builder.createIndex(ptype, errlog); } else { Grib2CollectionBuilder builder = new Grib2CollectionBuilder(dcm.getCollectionName(), dcm, logger); changed = builder.updateNeeded(updateType) && builder.createIndex(ptype, errlog); } return changed; }
public Partition(MCollection dcm) { FeatureCollectionConfig config = (FeatureCollectionConfig) dcm.getAuxInfo(FeatureCollectionConfig.AUX_CONFIG); if (config == null) logger.warn("Partition missing FeatureCollectionConfig {}", dcm); this.dcm = dcm; this.name = dcm.getCollectionName(); this.lastModified = dcm.getLastModified(); this.directory = StringUtil2.replace(dcm.getRoot(), '\\', "/"); this.partitionDate = dcm.getPartitionDate(); String indexFilename = StringUtil2.replace(dcm.getIndexFilename(GribCdmIndex.NCX_SUFFIX), '\\', "/"); if (partitionDate == null) { partitionDate = getDateExtractor().getCalendarDateFromPath(indexFilename); // LOOK dicey } // now remove the directory if (indexFilename.startsWith(directory)) { indexFilename = indexFilename.substring(directory.length()); if (indexFilename.startsWith("/")) indexFilename = indexFilename.substring(1); } filename = indexFilename; }
return new FmrcInv("fmrc:"+manager.getCollectionName(), fmrList, config.fmrcConfig.regularize);
case POINT: PointFeatureCollection firstPc = (PointFeatureCollection) first; CompositePointCollection pfc = new CompositePointCollection(dcm.getCollectionName(), firstPc.getTimeUnit(), firstPc.getAltUnits(), collection); NestedPointFeatureCollection firstNpc = (NestedPointFeatureCollection) first; CompositeStationCollection sfc = new CompositeStationCollection( dcm.getCollectionName(), firstNpc.getTimeUnit(), firstNpc.getAltUnits(), collection);
return new FmrcInv("fmrc:"+manager.getCollectionName(), fmrList, config.fmrcConfig.regularize);
static public GribCollectionImmutable openGribCollectionFromDataFile(boolean isGrib1, MFile mfile, CollectionUpdateType updateType, FeatureCollectionConfig config, Formatter errlog, org.slf4j.Logger logger) throws IOException { MCollection dcm = new CollectionSingleFile(mfile, logger); dcm.putAuxInfo(FeatureCollectionConfig.AUX_CONFIG, config); if (isGrib1) { Grib1CollectionBuilder builder = new Grib1CollectionBuilder(dcm.getCollectionName(), dcm, logger); // LOOK ignoring partition type boolean changed = (builder.updateNeeded(updateType) && builder.createIndex(FeatureCollectionConfig.PartitionType.file, errlog)); } else { Grib2CollectionBuilder builder = new Grib2CollectionBuilder(dcm.getCollectionName(), dcm, logger); boolean changed = (builder.updateNeeded(updateType) && builder.createIndex(FeatureCollectionConfig.PartitionType.file, errlog)); } // the index file should now exist, open it GribCollectionImmutable result = openCdmIndex(dcm.getIndexFilename(NCX_SUFFIX), config, true, logger); if (result != null) return result; // if open fails, force recreate the index if (updateType == CollectionUpdateType.never) return null; // not allowed to write if (updateType == CollectionUpdateType.always) return null;// already tried to force write, give up return openGribCollectionFromDataFile(isGrib1, mfile, CollectionUpdateType.always, config, errlog, logger); }
logger.debug(" Using canonical partition {}", canon.getDcm().getCollectionName());