Package xbird.xquery.dm.dtm

Examples of xbird.xquery.dm.dtm.MemoryMappedDocumentTable


    }

    private static IDocumentTable preferedDocumentTable(DbCollection col, File docFile, long filesize) {
        final String fileName = FileUtils.getFileName(docFile);
        if(USE_MMAP) {
            return new MemoryMappedDocumentTable(col, fileName, null, false);
        } else {
            if(filesize < FIVE_HUNDREDS_MEGA_BYTES) {
                return new DocumentTable(col, fileName);
            } else if(filesize < TWO_GIGA_BYTES) {
                return new DocumentTable.PersistentDocumentTable(col, fileName);
View Full Code Here


    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        this._docid = in.readInt();
        final IDocumentTable doctbl = (IDocumentTable) in.readObject();
        if(doctbl instanceof MemoryMappedDocumentTable) {
            this._mmapedStore = true;
            MemoryMappedDocumentTable mmDoctbl = (MemoryMappedDocumentTable) doctbl;
            String docId = mmDoctbl.getDocumentIdentifer();
            if(docId != null) {
                setPool(mmDoctbl, docId);
            }
        }
        this._store = doctbl;
View Full Code Here

        ConcurrentMap<String, MemoryMappedDocumentTable> cache = _remoteDoctblCache;
        if(cache == null) {
            cache = new ConcurrentReferenceHashMap<String, MemoryMappedDocumentTable>(16, ReferenceType.STRONG, ReferenceType.SOFT);
            _remoteDoctblCache = cache;
        }
        MemoryMappedDocumentTable prevDoctbl = cache.putIfAbsent(docId, mmDoctbl);
        if(prevDoctbl != null) {
            ILongCache<int[]> prevCache = prevDoctbl.getBufferPool();
            if(prevCache != null) {
                mmDoctbl.setBufferPool(prevCache);
            }
        } else {
            File tmpDir = (TMP_DATA_DIR == null) ? null : new File(TMP_DATA_DIR);
View Full Code Here

            final int tbSize = in.readInt();
            final long[] textBlocks = new long[tbSize];
            for(int i = 0; i < tbSize; i++) {
                textBlocks[i] = in.readLong();
            }
            MemoryMappedDocumentTable mmtable = (MemoryMappedDocumentTable) node._store;
            mmtable.markReferredBlocks(curr, last, textBlocks, serContext);
            return node;
        }
View Full Code Here

    }

    private static IDocumentTable preferedDocumentTable(DbCollection col, File docFile, long filesize) {
        final String fileName = FileUtils.getFileName(docFile);
        if(USE_MMAP) {
            return new MemoryMappedDocumentTable(col, fileName, null, false);
        } else {
            if(filesize < FIVE_HUNDREDS_MEGA_BYTES) {
                return new DocumentTable(col, fileName);
            } else if(filesize < TWO_GIGA_BYTES) {
                return new DocumentTable.PersistentDocumentTable(col, fileName);
View Full Code Here

    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        this._docid = in.readInt();
        final IDocumentTable doctbl = (IDocumentTable) in.readObject();
        if(doctbl instanceof MemoryMappedDocumentTable) {
            this._mmapedStore = true;
            MemoryMappedDocumentTable mmDoctbl = (MemoryMappedDocumentTable) doctbl;
            String docId = mmDoctbl.getDocumentIdentifer();
            if(docId != null) {
                setPool(mmDoctbl, docId);
            }
        }
        this._store = doctbl;
View Full Code Here

        ReferenceMap<String, MemoryMappedDocumentTable> cache = _remoteDoctblCache;
        if(cache == null) {
            cache = new ReferenceMap<String, MemoryMappedDocumentTable>(ReferenceType.STRONG, ReferenceType.SOFT);
            _remoteDoctblCache = cache;
        }
        MemoryMappedDocumentTable prevDoctbl = cache.putIfAbsent(docId, mmDoctbl);
        if(prevDoctbl != null) {
            mmDoctbl.setBufferPool(prevDoctbl.getBufferPool());
        } else {
            File tmpDir = (TMP_DATA_DIR == null) ? null : new File(TMP_DATA_DIR);
            String docname = FileUtils.basename(docId);
            File tmpFile = File.createTempFile(docname, ".tmp", tmpDir);
            tmpFile.deleteOnExit();
View Full Code Here

            final int tbSize = in.readInt();
            final long[] textBlocks = new long[tbSize];
            for(int i = 0; i < tbSize; i++) {
                textBlocks[i] = in.readLong();
            }
            MemoryMappedDocumentTable mmtable = (MemoryMappedDocumentTable) node._store;
            mmtable.markReferredBlocks(curr, last, textBlocks, serContext);
            return node;
        }
View Full Code Here

TOP

Related Classes of xbird.xquery.dm.dtm.MemoryMappedDocumentTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.