Package com.foundationdb.server.rowdata

Examples of com.foundationdb.server.rowdata.RowData


    }

    protected void decodeEntry(FDBStoreData storeData,
                               RowDef indexStatisticsEntryRowDef,
                               IndexStatistics indexStatistics) {
        RowData rowData = new RowData();
        FDBStoreDataHelper.expandRowData(rowData, storeData, false);
        decodeIndexStatisticsEntryRow(rowData, indexStatisticsEntryRowDef, indexStatistics);
    }
View Full Code Here


        FDBGroupRow row = null;
        if (next) {
            groupScan.advance();
            next = isActive();
            if (next) {
                RowData rowData = new RowData();
                adapter.getUnderlyingStore().expandGroupData(adapter.getSession(), storeData, rowData);
                row = new FDBGroupRow(adapter);
                row.set(storeData.persistitKey, rowData);
            }
        }
View Full Code Here

        RowDef rowDefNewRow = newRow.rowType().table().rowDef();
        if (rowDef.getRowDefId() != rowDefNewRow.getRowDefId()) {
            throw new IllegalArgumentException(String.format("%s != %s", rowDef, rowDefNewRow));
        }

        RowData oldRowData = rowData(rowDef, oldRow, rowDataCreator());
        try {
            // For Update row, the new row (value being inserted) does not
            // need the default value (including identity set)
            RowData newRowData = rowData(rowDefNewRow, newRow, rowDataCreator());
            store.updateRow(getSession(), rowDef, oldRowData, rowDefNewRow, newRowData, null);
        } catch (InvalidOperationException e) {
            rollbackIfNeeded(e);
            throw e;
        }
View Full Code Here

    }
    @Override
    public void writeRow(Row newRow, Collection<TableIndex> indexes, Collection<GroupIndex> groupIndexes) {
        RowDef rowDef = newRow.rowType().table().rowDef();
        try {
            RowData newRowData = rowData (rowDef, newRow, rowDataCreator());
            store.writeRow(getSession(), rowDef, newRowData, indexes, groupIndexes);
        } catch (InvalidOperationException e) {
            rollbackIfNeeded(e);
            throw e;
        }
View Full Code Here

    }

    @Override
    public void deleteRow (Row oldRow, boolean cascadeDelete) {
        RowDef rowDef = oldRow.rowType().table().rowDef();
        RowData oldRowData = rowData(rowDef, oldRow, rowDataCreator());
        try {
            store.deleteRow(getSession(), rowDef, oldRowData, cascadeDelete);
        } catch (InvalidOperationException e) {
            rollbackIfNeeded(e);
            throw e;
View Full Code Here

    public void smallRowCantGrow() throws InvalidOperationException
    {
        int t = createTable("s", "t",
                            "string varchar(100) character set latin1");
        RowDef rowDef = getRowDef(t);
        RowData rowData = new RowData(new byte[RowData.MINIMUM_RECORD_LENGTH + 1 /* null bitmap */ + 5]);
        rowData.createRow(rowDef, new Object[]{"abc"}, false);
    }
View Full Code Here

    public void bigRowCantGrow() throws InvalidOperationException
    {
        int t = createTable("s", "t",
                            "string varchar(100)");
        RowDef rowDef = getRowDef(t);
        RowData rowData = new RowData(new byte[RowData.MINIMUM_RECORD_LENGTH + 1 /* null bitmap */ + 5]);
        rowData.createRow(rowDef, new Object[]{"abcdefghijklmnopqrstuvwxyz"}, false);
        fail();
    }
View Full Code Here

        // Buffer should grow one time
        int t = createTable("s", "t",
                            "string varchar(100)");
        RowDef rowDef = getRowDef(t);
        int initialBufferSize = RowData.MINIMUM_RECORD_LENGTH + 1 /* null bitmap */ + 5;
        RowData rowData = new RowData(new byte[initialBufferSize]);
        rowData.createRow(rowDef, new Object[]{"abcdefghijklmno"}, true);
        assertEquals(initialBufferSize * 2, rowData.getBytes().length);
    }
View Full Code Here

        // Buffer should grow two times
        int t = createTable("s", "t",
                            "string varchar(100)");
        RowDef rowDef = getRowDef(t);
        int initialBufferSize = RowData.MINIMUM_RECORD_LENGTH + 1 /* null bitmap */ + 5;
        RowData rowData = new RowData(new byte[initialBufferSize]);
        // initialBufferSize has room for varchar of size 4, (1 byte of the 5 is for length).
        // initialBufferSize is 24:
        assertEquals(24, initialBufferSize);
        // Doubling it leaves room for 28 chars. Try something a little bigger than that.
        rowData.createRow(rowDef, new Object[]{"abcdefghijklmnopqrstuvwxyz0123"}, true);
        assertEquals(initialBufferSize * 4, rowData.getBytes().length);
    }
View Full Code Here

        // Insert longs, not integers, because Persistit stores all ints as 8-byte.
        original.put(cId, 100);
        original.put(cA, 200);
        original.put(cB, 300);
        RowDef rowDef = getRowDef(t);
        RowData rowData = original.toRowData();
        NiceRow reconstituted = (NiceRow) NiceRow.fromRowData(rowData, rowDef);
        assertEquals(original, reconstituted);
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.rowdata.RowData

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.