Package com.nearinfinity.honeycomb.mysql

Examples of com.nearinfinity.honeycomb.mysql.QueryKey.serialize()


        proxy.updateRow(nextRow, row.serialize());

        Map<String, ByteBuffer> searchMap = Maps.newHashMap();
        searchMap.put(TestConstants.COLUMN1, null);
        QueryKey key = new QueryKey(TestConstants.INDEX1, QueryType.EXACT_KEY, searchMap);
        proxy.startIndexScan(key.serialize());
        Row result = Row.deserialize(proxy.getNextRow());
        assertEquals(result.getRecords().get(TestConstants.COLUMN2).getLong(), ITUtils.encodeValue(2).getLong());
        proxy.endScan();
    }
View Full Code Here


        QueryKey queryKey;
        for(IndexSchema indexSchema : schema.getIndices()) {
            queryKey = new QueryKey(indexSchema.getIndexName(),
                    QueryType.INDEX_FIRST, ImmutableMap.<String, ByteBuffer>of());
            proxy.startIndexScan(queryKey.serialize());
            assertResultCount(proxy, expectedRowCount);
            proxy.endScan();

            queryKey = new QueryKey(indexSchema.getIndexName(),
                    QueryType.INDEX_LAST, ImmutableMap.<String, ByteBuffer>of());
View Full Code Here

            assertResultCount(proxy, expectedRowCount);
            proxy.endScan();

            queryKey = new QueryKey(indexSchema.getIndexName(),
                    QueryType.INDEX_LAST, ImmutableMap.<String, ByteBuffer>of());
            proxy.startIndexScan(queryKey.serialize());
            assertResultCount(proxy, expectedRowCount);
            proxy.endScan();
        }
    }
View Full Code Here

        // Add data rows to index
        ITUtils.insertData(proxy, ROW_COUNT, keyValue);

        // Verify that we can get a row from the index scan
        proxy.startIndexScan(key.serialize());
        final Row row = Row.deserialize(proxy.getNextRow());
        byte[] result = proxy.getRow(Util.UUIDToBytes(row.getUUID()));

        assertNotNull(row);
        assertEquals(Row.deserialize(result).getUUID(), row.getUUID());
View Full Code Here

        // Verify that the data row is still available after the index has been removed
        result = proxy.getRow(Util.UUIDToBytes(row.getUUID()));
        assertEquals(Row.deserialize(result).getUUID(), row.getUUID());

        // Verify that the scan is unable to execute
        proxy.startIndexScan(key.serialize());
    }
}
View Full Code Here

    @Test
    public void testGetRow() {
        ITUtils.insertData(proxy, ROW_COUNT, INDEX_COL_VALUE);

        final QueryKey key = ITUtils.createKey(INDEX_COL_VALUE, QueryType.EXACT_KEY);
        proxy.startIndexScan(key.serialize());

        final Row r = Row.deserialize(proxy.getNextRow());
        final byte[] result = proxy.getRow(Util.UUIDToBytes(r.getUUID()));

        assertNotNull(result);
View Full Code Here

        final Row row = new Row(map, UUID.randomUUID());
        proxy.insertRow(row.serialize());
        proxy.flush();

        final QueryKey key = ITUtils.createKey(INDEX_COL_VALUE, QueryType.EXACT_KEY);
        proxy.startIndexScan(key.serialize());

        proxy.deleteRow(proxy.getNextRow());
        proxy.flush();
    }
View Full Code Here

        final Row row = new Row(map, UUID.randomUUID());
        proxy.insertRow(row.serialize());
        proxy.flush();

        final QueryKey key = ITUtils.createKey(INDEX_COL_VALUE, QueryType.EXACT_KEY);
        proxy.startIndexScan(key.serialize());
        final Row r = Row.deserialize(proxy.getNextRow());

        map.put(TestConstants.COLUMN1, ITUtils.encodeValue(3));
        final Row newRow = new Row(map, r.getUUID());
        proxy.updateRow(r.serialize(), newRow.serialize());
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.