Package org.apache.xindice.core.data

Examples of org.apache.xindice.core.data.Key


        StringBuffer sb = new StringBuffer(oidTemplate);
        String document = Long.toString(documentId, 16);
        sb.insert(32 - document.length(), document);
        sb.setLength(32);
        return new Key(sb.toString());
    }
View Full Code Here


     *
     * @param docKey The Document Key
     * @return The Container
     */
    public final Container getContainer(Object docKey) throws DBException {
        Key key = createNewKey(docKey);
        Document doc = getDocument(key);
        return doc != null ? new ColContainer(key, doc) : null;
    }
View Full Code Here

        final String localDebugHeader = debugHeader() + "getEntry: docKey=<" + docKey + ">: ";
        log.trace(localDebugHeader);

        checkFiler(FaultCodes.COL_NO_FILER);

        Key key = createNewKey(docKey);

        /*
         * If the key has a corresponding value in the cache, return it
         * and save a disk access.
         *
 
View Full Code Here

            throw new DBException(FaultCodes.COL_CANNOT_STORE,
                                  "Cannot insert a binary resource in collection " + name +
                                  ": inline-metadata is not enabled.");
        }

        Key key = createNewKey(docKey);
        if (log.isInfoEnabled()) {
            log.info(debugHeader() + "Insert binary: " + key);
        }
        putBinary(key, bytes, true);
View Full Code Here

     *
     * @param docKey The document Key
     * @param document The document to insert
     */
    public final Key insertDocument(Object docKey, Document document) throws DBException {
        Key key = createNewKey(docKey);
        if (log.isInfoEnabled()) {
            log.info(debugHeader() + "Insert document: " + key);
        }
        putDocument(key, document /*, true */);

 
View Full Code Here

     *
     * @param objKey The Key to use
     * @param obj The Object to insert
     */
    public final Key insertObject(String objKey, XMLSerializable obj) throws DBException {
        Key key = createNewKey(objKey);
        if (log.isInfoEnabled()) {
            log.info(debugHeader() + "Insert object: " + key);
        }
        putObject(key, obj /*, true */);

 
View Full Code Here

            // give a hint to the size of the record set, saves on arraylist array copies.
            ArrayList temp = new ArrayList((int) filer.getRecordCount());

            RecordSet set = filer.getRecordSet();
            while (set.hasMoreRecords()) {
                Key key = set.getNextKey();
                temp.add(key.toString());
            }

            return (String[]) temp.toArray(new String[0]);
        }
    }
View Full Code Here

            log.info(debugHeader() + "Remove " + key);
        }

        checkFiler(FaultCodes.COL_NO_FILER);

        Key objKey = createNewKey(key);

        Object oldDoc = getEntry(objKey);
        if (oldDoc != null && oldDoc instanceof Document) {
            indexManager.removeDocument(objKey, (Document)oldDoc);
        }

        if (documentCache != null) {
            documentCache.removeDocument(this, objKey);
        }

        if (!filer.deleteRecord(objKey)) {
            throw new DBException(FaultCodes.COL_DOCUMENT_NOT_FOUND,
                                  "Document Does Not Exist");
        }

        // update the meta for this collection if necessary
        updateCollectionMeta();
        // remove the document meta
        if (isMetaEnabled()) {
            getMetaSystemCollection().dropDocumentMeta(this, objKey.toString());
        }
        DBObserver.getInstance().dropDocument(this, objKey);
    }
View Full Code Here

     */
    public void testFreePages() throws Exception {
        long count = ((BTreeFiler) filer).getFileHeader().getTotalCount();
        int iterations = 10;

        Key key = new Key("key");
        for (int i = 0; i < iterations; i++) {
            assertTrue(filer.writeRecord(key, TEST_VALUE));
            assertTrue(filer.deleteRecord(key));
        }

View Full Code Here

        }
        filer.open();

        RecordSet set = filer.getRecordSet();
        while (set.hasMoreRecords()) {
            Key key = set.getNextKey();
            filer.deleteRecord(key);
        }
        assertEquals(0, filer.getRecordCount());
    }
View Full Code Here

TOP

Related Classes of org.apache.xindice.core.data.Key

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.