Package com.nearinfinity.honeycomb.mysql

Examples of com.nearinfinity.honeycomb.mysql.Row


        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);
        assertThat(Row.deserialize(result).getUUID(), equalTo(r.getUUID()));
    }
View Full Code Here


    public void testDeleteRow() {
        final Map<String, ByteBuffer> map = Maps.newHashMap();
        map.put(TestConstants.COLUMN1, ITUtils.encodeValue(INDEX_COL_VALUE));
        map.put(TestConstants.COLUMN2, ITUtils.encodeValue(6));

        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());
View Full Code Here

    public void testUpdateRow() {
        final Map<String, ByteBuffer> map = Maps.newHashMap();
        map.put(TestConstants.COLUMN1, ITUtils.encodeValue(INDEX_COL_VALUE));
        map.put(TestConstants.COLUMN2, ITUtils.encodeValue(6));

        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());
        proxy.flush();

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

        assertThat(Row.deserialize(result), equalTo(newRow));
View Full Code Here

        int iterations = 10;

        proxy.createTable(tableName, schema.serialize(), 0);
        proxy.openTable(tableName);
        Row row = new Row(Maps.<String, ByteBuffer>newHashMap(), TestConstants.ZERO_UUID);

        List<Row> rows = new ArrayList<Row>();

        for (int j = 0; j < 50; j++) {
            for (int i = 0; i < iterations; i++) {
                proxy.insertRow(row.serialize());
            }

            proxy.flush();

            proxy.startTableScan();
            for (int i = 0; i < iterations; i++) {
                Row deserialized = Row.deserialize(proxy.getNextRow());
                deserialized.getRecords().put(TestConstants.COLUMN1, ITUtils.encodeValue(0));
                rows.add(deserialized);
            }
            proxy.endScan();

            for (Row r : rows) {
View Full Code Here

        }
        @Override
        public void run(HandlerProxy proxy) {
            byte[] row;
            for (int i = 0; i < count; i++) {
                row = new Row(fields, UUID.randomUUID()).serialize();
                proxy.insertRow(row);
            }
            proxy.flush();
        }
View Full Code Here

        for (int i = 0; i < columns.length; i++) {
            fields.put(columns[i],
                    FieldParser.parse(unparsedFields[i],
                            schema.getColumnSchema(columns[i])));
        }
        return new Row(fields.build(), UUID.randomUUID());
    }
View Full Code Here

    }

    @Override
    public void map(LongWritable offset, Text line, Context context) {
        try {
            Row row = rowParser.parseRow(line.toString());

            List<Put> puts = mutationFactory.insert(tableId, row);

            for (Put put : puts) {
                context.write(new ImmutableBytesWritable(put.getRow()), put);
View Full Code Here

TOP

Related Classes of com.nearinfinity.honeycomb.mysql.Row

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.