Package com.nearinfinity.honeycomb.mysql.schema

Examples of com.nearinfinity.honeycomb.mysql.schema.TableSchema


        return createScannerForRange(startRow.encode(), endRow.encode());
    }

    @Override
    public Scanner descendingIndexScanAt(QueryKey key) {
        final TableSchema schema = store.getSchema(tableId);
        long indexId = store.getIndexId(tableId, key.getIndexName());

        IndexRowKey startRow = IndexRowKeyBuilder
                .newBuilder(tableId, indexId)
                .withQueryKey(key, schema)
View Full Code Here


        return createScannerForRange(startRow.encode(), endRow.encode());
    }

    @Override
    public Scanner descendingIndexScanBefore(QueryKey key) {
        final TableSchema schema = store.getSchema(tableId);
        long indexId = store.getIndexId(tableId, key.getIndexName());

        IndexRowKey startRow = IndexRowKeyBuilder
                .newBuilder(tableId, indexId)
                .withQueryKey(key, schema)
View Full Code Here

        return createScannerForRange(incrementRowKey(startRow.encode()), endRow.encode());
    }

    @Override
    public Scanner indexScanExact(QueryKey key) {
        final TableSchema schema = store.getSchema(tableId);
        long indexId = store.getIndexId(tableId, key.getIndexName());

        IndexRowKey row = IndexRowKeyBuilder
                .newBuilder(tableId, indexId)
                .withQueryKey(key, schema)
View Full Code Here

    public void testUpdateNullRows() {
        HandlerProxy proxy = factory.createHandlerProxy();
        List<ColumnSchema> columns = Lists.newArrayList();
        List<IndexSchema> indices = Lists.newArrayList();
        columns.add(ColumnSchema.builder(TestConstants.COLUMN1, ColumnType.LONG).build());
        TableSchema schema = new TableSchema(columns, indices);

        String tableName = AdapterType.HBASE.getName() + "/t1";

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

        final List<Put> puts = Lists.newArrayList();

        final List<IndexSchema> indexDetailMap = ImmutableList.of(indexSchema);

        // Update the table schema to store the new index schema details
        final TableSchema existingSchema = getSchema(tableId);
        final TableSchema updatedSchema = existingSchema.schemaCopy();
        updatedSchema.addIndices(indexDetailMap);

        // Write the updated table schema and created index
        puts.add(putTableSchema(tableId, updatedSchema));
        puts.add(putIndices(tableId, indexDetailMap));
View Full Code Here

        final List<Put> puts = Lists.newArrayList();
        final List<Delete> deletes = Lists.newArrayList();

        // Update the table schema to remove index schema details
        final TableSchema existingSchema = getSchema(tableId);
        final TableSchema updatedSchema = existingSchema.schemaCopy();
        updatedSchema.removeIndex(indexName);

        // Delete the old index
        deletes.add(generateIndexDelete(tableId, indexName));

        // Write the updated table schema
View Full Code Here

                             final Collection<IndexSchema> indices,
                             final IndexAction action) {

        for (IndexSchema index : indices) {
            long indexId = store.getIndexId(tableId, index.getIndexName());
            TableSchema schema = store.getSchema(tableId);

            IndexRowKeyBuilder builder = IndexRowKeyBuilder
                    .newBuilder(tableId, indexId)
                    .withUUID(row.getUUID())
                    .withRow(row, index.getIndexName(), schema);
View Full Code Here

TOP

Related Classes of com.nearinfinity.honeycomb.mysql.schema.TableSchema

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.