Package org.apache.xindice.core.data

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(EmptyKeys);
            }

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


                  log.debug("No message", e);
               }
            }
         }
        
         RecordSet rs = collection.getFiler().getRecordSet();
         while ( rs.hasMoreRecords() ) {
            Record rec = rs.getNextRecord();

            if ( rec == null )
               continue;
           
            Key key = rec.getKey();
View Full Code Here

      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

      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

         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

    * @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

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

        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

        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.