Examples of RecordSet


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

      this.filer = filer;
   }

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

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

      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());
      assertTrue(set.hasMoreRecords() == false);

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

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

         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

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

    * @return the list of document keys
    */
   public final String[] listDocuments() throws DBException {
      checkFiler(FaultCodes.COL_NO_FILER);

      RecordSet set = filer.getRecordSet();
      ArrayList temp = new ArrayList();

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

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

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

        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

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

        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());
        assertTrue(set.hasMoreRecords() == false);

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

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

    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

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

        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

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

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

                        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
TOP
Copyright © 2018 www.massapi.com. 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.