Package org.apache.xindice.core.data

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


            // Try to use a NameIndex to resolve the path component
            // can match a wildcard node name here if pattern is "*" then every document matches
            if (attr == false && "*".equals(name))
            {
              SortedSet set = new TreeSet();
              RecordSet rs = context.getFiler().getRecordSet();
              while (rs.hasMoreRecords())
              {
                set.add(rs.getNextKey());
              }
              ks.add(set.toArray(EMPTY_KEYS));
            }
            else
            {
View Full Code Here


                        log.warn("ignored exception", e);
                    }
                }
            }

            RecordSet rs = collection.getFiler().getRecordSet();
            while (rs.hasMoreRecords()) {
                Record rec = rs.getNextRecord();

                if (rec == null) {
                    continue;
                }
View Full Code Here

            // TODO: ArrayList length is limited to the int, while filer record count is long

            // 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

        if (!filer.exists()) {
            filer.create();
        }
        filer.open();

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

        assertEquals(1, filer.getRecordCount());

        Record result = filer.readRecord(TEST_KEY);
        assertEquals(TEST_VALUE, result.getValue());

        RecordSet set = filer.getRecordSet();
        assertEquals(result.getValue(), set.getNextRecord().getValue());
        assertFalse(set.hasMoreRecords());

        filer.deleteRecord(TEST_KEY);
        assertEquals(0, filer.getRecordCount());
    }
View Full Code Here

    public void testGetRecordSet() throws Exception {
        assertTrue(filer.writeRecord(TEST_KEY, TEST_VALUE));
        assertTrue(filer.writeRecord(new Key("test2"), TEST_VALUE_2));
        assertTrue(filer.writeRecord(new Key("test3"), TEST_VALUE_3));

        RecordSet result = filer.getRecordSet();
        assertNotNull(result);

        List results = new Vector();
        while (result.hasMoreRecords()) {
            results.add(result.getNextRecord().getValue());
        }
        assertEquals(3, results.size());
        assertTrue(results.contains(TEST_VALUE));
        assertTrue(results.contains(TEST_VALUE_2));
        assertTrue(results.contains(TEST_VALUE_3));

        assertTrue(filer.deleteRecord(TEST_KEY));
        assertTrue(filer.deleteRecord(new Key("test2")));
        assertTrue(filer.deleteRecord(new Key("test3")));

        result = filer.getRecordSet();
        assertTrue(!result.hasMoreRecords());
    }
View Full Code Here

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

        assertTrue(filer.getRecordCount() == 0);
        RecordSet result = filer.getRecordSet();
        assertTrue(!result.hasMoreRecords());
    }
View Full Code Here

                    log.trace("Index Creation: " + list[i].indexer.getName());
                }
            }

            Stopwatch sw = new Stopwatch("Populated Indexes", true);
            RecordSet rs = collection.getFiler().getRecordSet();
            while (rs.hasMoreRecords()) {
                // Read only key, we don't need filer-level value
                Key key = rs.getNextKey();
                Object value = collection.getEntry(key);
                if (value instanceof Document) {
                    try {
                        new SAXHandler(key, (Document)value, ACTION_CREATE, list);
                    } catch (Exception e) {
View Full Code Here

            // TODO: ArrayList length is limited to the int, while filer record count is long

            // 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[temp.size()]);
        }
View Full Code Here

                }

                if (keySet == null) {
                    // Fall back to a Collection scan
                    SortedSet set = new TreeSet();
                    RecordSet rs = context.getFiler().getRecordSet();
                    while (rs.hasMoreRecords()) {
                        set.add(rs.getNextKey());
                    }
                    keySet = (Key[]) set.toArray(EMPTY_KEYS);
                }

                return new ResultSet(context, pr, keySet, query);
View Full Code Here

TOP

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

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.