@Override public void addEventListener(TriggerListener l) { if (lm == null) createListenerManager(); lm.addListener(l); }
private void initMM() { if (getCollectionName() == null) return; // eg no scan in ncml try { if(storeFactory != null) store = storeFactory.open(getCollectionName()); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } }
protected void deleteOld(Map<String, MFile> newMap) { if (mm == null && enableMetadataManager) initMM(); if (mm != null) mm.delete(newMap); }
@Override public boolean scanIfNeeded() throws IOException { // if (map == null && !isStatic()) return true; return isScanNeeded() && scan(false); }
public static GridDatasetInv open(MCollection cm, MFile mfile, Element ncml) throws IOException { byte[] xmlBytes = ((CollectionManagerAbstract)cm).getMetadata(mfile, "fmrInv.xml"); // LOOK should we keep this functionality ?? if (xmlBytes != null) { if (logger.isDebugEnabled()) logger.debug(" got xmlFile in cache ="+ mfile.getPath()+ " size = "+xmlBytes.length); ((CollectionManagerAbstract)cm).putMetadata(mfile, "fmrInv.xml", xmlString.getBytes(CDM.utf8Charset)); if (logger.isDebugEnabled()) logger.debug(" added xmlFile "+ mfile.getPath()+".fmrInv.xml to cache"); if (debug) System.out.printf(" added xmlFile %s.fmrInv.xml to cache%n", mfile.getPath());
@Override public void sendEvent(CollectionUpdateType type) { sendEvent(new TriggerEvent(this, type)); }
@Override public CloseableIterator<MFile> getFileIterator() throws IOException { return new MFileIterator( getFilesSorted().iterator(), filter); }
public static GridDatasetInv open(CollectionManager cm, MFile mfile, Element ncml) throws IOException { byte[] xmlBytes = ((CollectionManagerAbstract)cm).getMetadata(mfile, "fmrInv.xml"); // LOOK should we keep this functionality ?? if (xmlBytes != null) { if (log.isDebugEnabled()) log.debug(" got xmlFile in cache ="+ mfile.getPath()+ " size = "+xmlBytes.length); ((CollectionManagerAbstract)cm).putMetadata(mfile, "fmrInv.xml", xmlString.getBytes(CDM.utf8Charset)); if (log.isDebugEnabled()) log.debug(" added xmlFile "+ mfile.getPath()+".fmrInv.xml to cache"); if (debug) System.out.printf(" added xmlFile %s.fmrInv.xml to cache%n", mfile.getPath());
@Override public boolean scanIfNeeded() throws IOException { // if (map == null && !isStatic()) return true; return isScanNeeded() && scan(false); }
@Override public void updateNocheck() throws IOException { sendEvent(new TriggerEvent(this, TriggerType.updateNocheck)); }
@Override public CloseableIterator<MFile> getFileIterator() throws IOException { return new MFileIterator( getFilesSorted().iterator(), null); }
public static GridDatasetInv open(MCollection cm, MFile mfile, Element ncml) throws IOException { byte[] xmlBytes = ((CollectionManagerAbstract)cm).getMetadata(mfile, "fmrInv.xml"); // LOOK should we keep this functionality ?? if (xmlBytes != null) { if (log.isDebugEnabled()) log.debug(" got xmlFile in cache ="+ mfile.getPath()+ " size = "+xmlBytes.length); ((CollectionManagerAbstract)cm).putMetadata(mfile, "fmrInv.xml", xmlString.getBytes(CDM.utf8Charset)); if (log.isDebugEnabled()) log.debug(" added xmlFile "+ mfile.getPath()+".fmrInv.xml to cache"); if (debug) System.out.printf(" added xmlFile %s.fmrInv.xml to cache%n", mfile.getPath());
public void putMetadata(MFile file, String key, byte[] value) { if (store == null) initMM(); if (store != null) store.put(file.getPath()+"#"+key, value); }
private void initMM() { if (getCollectionName() == null) return; // eg no scan in ncml try { mm = new MetadataManager(getCollectionName()); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } }
@Override public void addEventListener(TriggerListener l) { if (lm == null) createListenerManager(); lm.addListener(l); }
public byte[] getMetadata(MFile file, String key) { if (store == null) initMM(); return (store == null) ? null : store.getBytes(file.getPath()+"#"+key); }
private void initMM() { if (getCollectionName() == null) return; // eg no scan in ncml try { if (storeFactory != null) store = storeFactory.open(getCollectionName()); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } }
@Override public void addEventListener(TriggerListener l) { if (lm == null) createListenerManager(); lm.addListener(l); }
public void putMetadata(MFile file, String key, byte[] value) { if (mm == null) initMM(); if (mm != null) mm.put(file.getPath()+"#"+key, value); }
public byte[] getMetadata(MFile file, String key) { if (mm == null) initMM(); return (mm == null) ? null : mm.getBytes(file.getPath()+"#"+key); }