Package org.apache.xindice.core.meta.inline

Examples of org.apache.xindice.core.meta.inline.InlineMetaMap


         */
        Value value;
        if (inlineMetaService == null) {
            value = new Value(documentBytes);
        } else {
            InlineMetaMap map = inlineMetaService.getEmptyMap();
            map.put("type", ResourceTypeReader.XML);
            value = inlineMetaService.createValue(map, documentBytes, 0, documentBytes.length);
        }
        filer.writeRecord(key, value);

        // Cache Stuff
View Full Code Here


        byte[] evilData = new byte[] {
            0x03, 0x01, 0x03, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01};
        byte[] xmlData = new byte[] {
            0x03, 0x01, 0x01, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01};

        InlineMetaMap map;

        map = reader.read(binaryData, 2, 1);
        assertEquals(ResourceTypeReader.BINARY, map.get("type"));

        map = reader.read(xmlData, 2, 1);
        assertEquals(ResourceTypeReader.XML, map.get("type"));
       
        try {
            reader.read(evilData, 2, 1);
            fail("failed to throw InlineMetaException on bad type value (3)");
        } catch (InlineMetaException e) {
View Full Code Here

        if (record == null) {
            return null;
        }

        Value value;
        InlineMetaMap metaMap = null;
        if (inlineMetaService == null) {
            value = record.getValue();

            if (log.isTraceEnabled()) {
                log.trace(localDebugHeader + "Type is not available, Length=" + value.getLength());
            }
        } else {
            InlineMetaService.DatabaseEntry databaseEntry = inlineMetaService.readDatabaseEntry(record.getValue());
            metaMap = databaseEntry.map;
            value = databaseEntry.value;

            if (log.isTraceEnabled()) {
                log.trace(localDebugHeader + "Type=" + metaMap.get("type") + ", Length=" + value.getLength());
            }
        }

        if (inlineMetaService == null || metaMap.get("type").equals(ResourceTypeReader.XML)) {
            Document document;
            if (compressed) {
                document = new DocumentImpl(value.getData(), symbols, new NodeSource(this, key));
                flushSymbolTable();
                if (log.isTraceEnabled()) {
View Full Code Here

                                      "Error storing binary object with key '" + key + "': the 'create' flag is false and" +
                                      " the key is not in the database");
            }
        }

        InlineMetaMap map = inlineMetaService.getEmptyMap();
        map.put("type", ResourceTypeReader.BINARY);
        Value value = inlineMetaService.createValue(map, bytes, 0, bytes.length);
        filer.writeRecord(key, value);

        // update the meta for this document
        updateDocumentMeta(key.toString());
View Full Code Here

            if (record == null) {
                return null;
            }

            Value value;
            InlineMetaMap metaMap = null;
            if (inlineMetaService == null) {
                value = record.getValue();

                if (log.isTraceEnabled()) {
                    log.trace(localDebugHeader + "Type is not available, Length=" + value.getLength());
                }
            } else {
                InlineMetaService.DatabaseEntry databaseEntry = inlineMetaService.readDatabaseEntry(record.getValue());
                metaMap = databaseEntry.map;
                value = databaseEntry.value;

                if (log.isTraceEnabled()) {
                    log.trace(localDebugHeader + "Type=" + metaMap.get("type") + ", Length=" + value.getLength());
                }
            }

            if (inlineMetaService == null || metaMap.get("type").equals(ResourceTypeReader.XML)) {
                Document document;
                if (compressed) {
                    document = new DocumentImpl(value.getData(), symbols, new NodeSource(this, key));
                    flushSymbolTable();
                    if (log.isTraceEnabled()) {
View Full Code Here

                    documentCache.removeDocument(this, key);
                }
                indexManager.removeDocument(key, (Document) entry);
            }

            InlineMetaMap map = inlineMetaService.getEmptyMap();
            map.put("type", ResourceTypeReader.BINARY);
            Value value = inlineMetaService.createValue(map, bytes, 0, bytes.length);
            filer.writeRecord(key, value);

            // update the meta for this document
            updateDocumentMeta(key.toString());
View Full Code Here

            // Construct the Value object that is stored in the BTree.
            Value value;
            if (inlineMetaService == null) {
                value = new Value(documentBytes);
            } else {
                InlineMetaMap map = inlineMetaService.getEmptyMap();
                map.put("type", ResourceTypeReader.XML);
                value = inlineMetaService.createValue(map, documentBytes, 0, documentBytes.length);
            }
            filer.writeRecord(key, value);

            // Cache Stuff
View Full Code Here

        byte[] evilData = new byte[] {
            0x03, 0x01, 0x03, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01};
        byte[] xmlData = new byte[] {
            0x03, 0x01, 0x01, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01};

        InlineMetaMap map;

        map = reader.read(binaryData, 2, 1);
        assertEquals(ResourceTypeReader.BINARY, map.get("type"));

        map = reader.read(xmlData, 2, 1);
        assertEquals(ResourceTypeReader.XML, map.get("type"));
       
        try {
            reader.read(evilData, 2, 1);
            fail("failed to throw InlineMetaException on bad type value (3)");
        } catch (InlineMetaException e) {
View Full Code Here

        // Construct the Value object that is stored in the BTree.
        Value value;
        if (inlineMetaService == null) {
            value = new Value(bytes);
        } else {
            InlineMetaMap map = inlineMetaService.getEmptyMap();
            if (isDocument) {
                map.put("type", ResourceTypeReader.XML);
            } else {
                map.put("type", ResourceTypeReader.BINARY);
            }
            value = inlineMetaService.createValue(map, bytes, 0, bytes.length);
        }

        return filer.writeRecord(key, value);
View Full Code Here

        if (record == null) {
            return null;
        }

        Value value;
        InlineMetaMap metaMap = null;
        if (inlineMetaService == null) {
            value = record.getValue();

            if (log.isTraceEnabled()) {
                log.trace(localDebugHeader + "Type is not available, Length=" + value.getLength());
            }
        } else {
            InlineMetaService.DatabaseEntry databaseEntry = inlineMetaService.readDatabaseEntry(record.getValue());
            metaMap = databaseEntry.map;
            value = databaseEntry.value;

            if (log.isTraceEnabled()) {
                log.trace(localDebugHeader + "Type=" + metaMap.get("type") + ", Length=" + value.getLength());
            }
        }

        if (inlineMetaService == null || metaMap.get("type").equals(ResourceTypeReader.XML)) {
            Document document;
            if (compressed) {
                document = new DocumentImpl(value.getData(), symbols, new NodeSource(this, key));
                flushSymbolTable();
                if (log.isTraceEnabled()) {
View Full Code Here

TOP

Related Classes of org.apache.xindice.core.meta.inline.InlineMetaMap

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.