Package org.exist.storage.index

Examples of org.exist.storage.index.CollectionStore


            this.checkDocs = checkDocs;
        }

        public boolean indexInfo( Value key, long pointer ) throws TerminatedException
        {
            final CollectionStore store        = (CollectionStore)( (NativeBroker)broker ).getStorage( NativeBroker.COLLECTIONS_DBX_ID );
            final @SuppressWarnings( "unused" )
            int             collectionId = CollectionStore.DocumentKey.getCollectionId( key );
            final int             docId        = CollectionStore.DocumentKey.getDocumentId( key );

            try {
                final byte              type    = key.data()[key.start() + Collection.LENGTH_COLLECTION_ID + DocumentImpl.LENGTH_DOCUMENT_TYPE];
                final VariableByteInput istream = store.getAsStream( pointer );
                DocumentImpl      doc     = null;

                if( type == DocumentImpl.BINARY_FILE ) {
                    doc = new BinaryDocument( broker.getBrokerPool() );
                } else {
View Full Code Here


            try {
                collectionCount++;

                if( exportCollection ) {
                    final CollectionStore store = (CollectionStore)( (NativeBroker)broker ).getStorage( NativeBroker.COLLECTIONS_DBX_ID );
                    uri = UTF8.decode( value.data(), value.start() + CollectionStore.CollectionKey.OFFSET_VALUE, value.getLength() - CollectionStore.CollectionKey.OFFSET_VALUE ).toString();

                    if( CollectionStore.NEXT_COLLECTION_ID_KEY.equals( uri ) || CollectionStore.NEXT_DOC_ID_KEY.equals( uri ) || CollectionStore.FREE_COLLECTION_ID_KEY.equals( uri ) || CollectionStore.FREE_DOC_ID_KEY.equals( uri ) ) {
                        return( true );
                    }

                    if( callback != null ) {
                        callback.startCollection( uri );
                    }
                    final Collection        collection = new Collection(broker, XmldbURI.createInternal( uri ) );
                    final VariableByteInput istream    = store.getAsStream( pointer );
                    collection.read( broker, istream );
                    BackupDescriptor bd = null;

                    if( prevBackup != null ) {
                        bd = prevBackup.getBackupDescriptor( uri );
View Full Code Here

            }
        }

        public boolean indexInfo( Value key, long pointer ) throws TerminatedException
        {
            final CollectionStore store = (CollectionStore)( (NativeBroker)broker ).getStorage( NativeBroker.COLLECTIONS_DBX_ID );
            final int             docId = CollectionStore.DocumentKey.getDocumentId( key );

            if( !exportedDocs.contains( docId ) ) {

                try {
                    final byte              type    = key.data()[key.start() + Collection.LENGTH_COLLECTION_ID + DocumentImpl.LENGTH_DOCUMENT_TYPE];
                    final VariableByteInput istream = store.getAsStream( pointer );
                    DocumentImpl      doc     = null;

                    if( type == DocumentImpl.BINARY_FILE ) {
                        doc = new BinaryDocument( broker.getBrokerPool() );
                    } else {
View Full Code Here

            }

            //Initialize collections storage
            collectionsDb = (CollectionStore) config.getProperty(CollectionStore.getConfigKeyForFile());
            if(collectionsDb == null) {
                collectionsDb = new CollectionStore(pool, COLLECTIONS_DBX_ID, dataDir, config);
            }
            if(collectionsDb.isReadOnly()) {
                LOG.warn(collectionsDb.getFile().getName() + " is read-only!");
                pool.setReadOnly();
            }
View Full Code Here

        private DocumentCallback(DBBroker broker) {
            this.broker = broker;
        }

        public boolean indexInfo(Value key, long pointer) throws TerminatedException {
            final CollectionStore store = (CollectionStore) ((NativeBroker)broker).getStorage(NativeBroker.COLLECTIONS_DBX_ID);
            try {
                final byte type = key.data()[key.start() + Collection.LENGTH_COLLECTION_ID + DocumentImpl.LENGTH_DOCUMENT_TYPE];
                final VariableByteInput istream = store.getAsStream(pointer);
                DocumentImpl doc = null;
                if (type == DocumentImpl.XML_FILE) {
                    doc = new DocumentImpl(broker.getBrokerPool());
                    doc.read(istream);
                    updateDocument(broker, doc);
View Full Code Here

TOP

Related Classes of org.exist.storage.index.CollectionStore

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.