Search in sources :

Example 6 with QueryKey

use of com.nearinfinity.honeycomb.mysql.QueryKey in project honeycomb by altamiracorp.

the class ScanOperationsIT method testIndexExactScan.

@Test
public void testIndexExactScan() {
    ITUtils.insertData(proxy, ROW_COUNT, INDEX_COL_VALUE);
    final QueryKey key = ITUtils.createKey(INDEX_COL_VALUE, QueryType.EXACT_KEY);
    ITUtils.assertReceivingDifferentRows(proxy, key, ROW_COUNT);
}
Also used : QueryKey(com.nearinfinity.honeycomb.mysql.QueryKey) HoneycombIntegrationTest(integrationtests.HoneycombIntegrationTest) Test(org.junit.Test)

Example 7 with QueryKey

use of com.nearinfinity.honeycomb.mysql.QueryKey in project honeycomb by altamiracorp.

the class ScanOperationsIT method testAfterKeyWithNullScan.

@Test
public void testAfterKeyWithNullScan() {
    ITUtils.insertNullData(proxy, ROW_COUNT, TestConstants.COLUMN1);
    ITUtils.insertData(proxy, ROW_COUNT, INDEX_COL_VALUE);
    ITUtils.insertData(proxy, ROW_COUNT, INDEX_COL_VALUE + 1);
    final Map<String, ByteBuffer> keyValues = Maps.newHashMap();
    keyValues.put(TestConstants.COLUMN1, ITUtils.encodeValue(2));
    final QueryKey key = new QueryKey(TestConstants.INDEX2, QueryType.AFTER_KEY, keyValues);
    ITUtils.assertReceivingDifferentRows(proxy, key, ROW_COUNT + ROW_COUNT);
}
Also used : QueryKey(com.nearinfinity.honeycomb.mysql.QueryKey) ByteBuffer(java.nio.ByteBuffer) HoneycombIntegrationTest(integrationtests.HoneycombIntegrationTest) Test(org.junit.Test)

Example 8 with QueryKey

use of com.nearinfinity.honeycomb.mysql.QueryKey in project honeycomb by altamiracorp.

the class ScanOperationsIT method testIndexFirstScan.

@Test
public void testIndexFirstScan() {
    ITUtils.insertNullData(proxy, 2);
    ITUtils.insertData(proxy, 1, INDEX_COL_VALUE, TestConstants.FULL_UUID);
    ITUtils.insertData(proxy, 1, INDEX_COL_VALUE + 1, TestConstants.ZERO_UUID);
    ITUtils.insertData(proxy, ROW_COUNT, INDEX_COL_VALUE + 1);
    final QueryKey key = new QueryKey(TestConstants.INDEX1, QueryType.INDEX_FIRST, Maps.<String, ByteBuffer>newHashMap());
    ITUtils.assertReceivingDifferentRows(proxy, key, ROW_COUNT + 4);
}
Also used : QueryKey(com.nearinfinity.honeycomb.mysql.QueryKey) HoneycombIntegrationTest(integrationtests.HoneycombIntegrationTest) Test(org.junit.Test)

Example 9 with QueryKey

use of com.nearinfinity.honeycomb.mysql.QueryKey in project honeycomb by altamiracorp.

the class ScanOperationsIT method testAfterKeyScan.

@Test
public void testAfterKeyScan() {
    ITUtils.insertData(proxy, 1, INDEX_COL_VALUE, TestConstants.FULL_UUID);
    ITUtils.insertData(proxy, 1, INDEX_COL_VALUE + 1, TestConstants.ZERO_UUID);
    ITUtils.insertData(proxy, ROW_COUNT, INDEX_COL_VALUE + 1);
    final QueryKey key = ITUtils.createKey(INDEX_COL_VALUE, QueryType.AFTER_KEY);
    ITUtils.assertReceivingDifferentRows(proxy, key, ROW_COUNT + 1);
}
Also used : QueryKey(com.nearinfinity.honeycomb.mysql.QueryKey) HoneycombIntegrationTest(integrationtests.HoneycombIntegrationTest) Test(org.junit.Test)

Example 10 with QueryKey

use of com.nearinfinity.honeycomb.mysql.QueryKey in project honeycomb by altamiracorp.

the class ScanOperationsIT method testKeyOrPreviousScan.

@Test
public void testKeyOrPreviousScan() {
    ITUtils.insertData(proxy, 1, INDEX_COL_VALUE, TestConstants.FULL_UUID);
    ITUtils.insertData(proxy, 1, INDEX_COL_VALUE - 1, TestConstants.ZERO_UUID);
    ITUtils.insertData(proxy, ROW_COUNT, INDEX_COL_VALUE - 1);
    final QueryKey key = ITUtils.createKey(INDEX_COL_VALUE, QueryType.KEY_OR_PREVIOUS);
    ITUtils.assertReceivingDifferentRows(proxy, key, ROW_COUNT + 2);
}
Also used : QueryKey(com.nearinfinity.honeycomb.mysql.QueryKey) HoneycombIntegrationTest(integrationtests.HoneycombIntegrationTest) Test(org.junit.Test)

Aggregations

QueryKey (com.nearinfinity.honeycomb.mysql.QueryKey)17 Test (org.junit.Test)16 HoneycombIntegrationTest (integrationtests.HoneycombIntegrationTest)14 Row (com.nearinfinity.honeycomb.mysql.Row)6 ByteBuffer (java.nio.ByteBuffer)6 IndexSchema (com.nearinfinity.honeycomb.mysql.schema.IndexSchema)3