Package com.pardot.rhombus.cobject.statement

Examples of com.pardot.rhombus.cobject.statement.CQLStatementIterator.nextShard()


          "SELECT * FROM \"testspace\".\"testtypef9bf3332bb4ec879849ec43c67776131\" WHERE shardid = ? AND foreignid = ? AND instance = ? AND type = ? AND id < ? ORDER BY id DESC LIMIT 10 ALLOW FILTERING;",
          TABLE_NAME,
          Arrays.asList(Long.valueOf(2),"777","222222","5", stop).toArray()
      );

      actual.nextShard();
      result = actual.next();
      assertEquals(expected.getQuery(), result.getQuery());
      assertEquals(expected.getValues()[0], result.getValues()[0]);
      assertEquals(expected.getValues()[1], result.getValues()[1]);
      assertEquals(expected.getValues()[2], result.getValues()[2]);
View Full Code Here


      expected = CQLStatement.make(
          "SELECT * FROM \"testspace\".\"testtypef9bf3332bb4ec879849ec43c67776131\" WHERE shardid = ? AND foreignid = ? AND instance = ? AND type = ? AND id >= ? AND id <= ? ORDER BY id ASC LIMIT 10 ALLOW FILTERING;",
          TABLE_NAME,
          Arrays.asList(Long.valueOf(134),"777","222222","5",start,stop).toArray()
      );
      actual.nextShard();
      //Should generate proper CQL for wide table get by index values
      assertEquals(expected,actual.next());

      expected = CQLStatement.make(
          "SELECT * FROM \"testspace\".\"testtypef9bf3332bb4ec879849ec43c67776131\" WHERE shardid = ? AND foreignid = ? AND instance = ? AND type = ? AND id >= ? AND id <= ? ORDER BY id ASC LIMIT 5 ALLOW FILTERING;",
View Full Code Here

          "SELECT * FROM \"testspace\".\"testtypef9bf3332bb4ec879849ec43c67776131\" WHERE shardid = ? AND foreignid = ? AND instance = ? AND type = ? AND id >= ? AND id <= ? ORDER BY id ASC LIMIT 5 ALLOW FILTERING;",
          TABLE_NAME,
          Arrays.asList(Long.valueOf(135),"777","222222","5",start,stop).toArray()
      );
      assertTrue("Should have next when hinted less than the limit",actual.hasNext(5));
      actual.nextShard();
      //"Should generate proper Limit adjustment when given the amount hint"
      assertEquals(expected,actual.next());
      assertTrue("Should have no next when hinted more than or equal to the limit",!actual.hasNext(10));

      //wide table inclusive slice descending bounded
View Full Code Here

      expected = CQLStatement.make(
          "SELECT * FROM \"testspace\".\"testtypef9bf3332bb4ec879849ec43c67776131\" WHERE shardid = ? AND foreignid = ? AND instance = ? AND type = ? AND id >= ? AND id <= ? ORDER BY id DESC LIMIT 10 ALLOW FILTERING;",
          TABLE_NAME,
          Arrays.asList(Long.valueOf(144),"777","222222","5",start,stop).toArray()
      );
      actual.nextShard();
      assertEquals("Descending: Should generate proper CQL for wide table get by index values",expected,actual.next());
      expected = CQLStatement.make(
          "SELECT * FROM \"testspace\".\"testtypef9bf3332bb4ec879849ec43c67776131\" WHERE shardid = ? AND foreignid = ? AND instance = ? AND type = ? AND id >= ? AND id <= ? ORDER BY id DESC LIMIT 5 ALLOW FILTERING;",
          TABLE_NAME,
          Arrays.asList(Long.valueOf(143),"777","222222","5",start,stop).toArray()
View Full Code Here

          "SELECT * FROM \"testspace\".\"testtypef9bf3332bb4ec879849ec43c67776131\" WHERE shardid = ? AND foreignid = ? AND instance = ? AND type = ? AND id >= ? AND id <= ? ORDER BY id DESC LIMIT 5 ALLOW FILTERING;",
          TABLE_NAME,
          Arrays.asList(Long.valueOf(143),"777","222222","5",start,stop).toArray()
      );
      assertTrue("Descending: Should have next when hinted less than the limit",actual.hasNext(5));
      actual.nextShard();
      assertEquals("Descending: Should generate proper Limit adjustment when given the amount hint",expected,actual.next());
      assertTrue("Should have no next when hinted more than or equal to the limit",!actual.hasNext(10));

    }

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.