Package com.foundationdb.server.rowdata

Examples of com.foundationdb.server.rowdata.RowDef


        decodeIndexStatisticsEntryRow(rowData, indexStatisticsEntryRowDef, indexStatistics);
    }

    private void removeStatisticsInternal(Session session, Index index, Exchange exchange) throws PersistitException {
        RowData rowData = new RowData(new byte[INITIAL_ROW_SIZE]);
        RowDef indexStatisticsRowDef = getIndexStatsRowDef(session);
        RowDef indexStatisticsEntryRowDef = getIndexStatsEntryRowDef(session);
        int tableId = index.leafMostTable().rowDef().getRowDefId();
        int indexId = index.getIndexId();
        // Delete index_statistics_entry rows.
        exchange.append(Key.BEFORE);
        while (exchange.traverse(Key.Direction.GT, true)) {
            getStore().expandRowData(session, exchange, rowData);
            if (rowData.getRowDefId() == indexStatisticsEntryRowDef.getRowDefId() &&
                selectedIndex(indexStatisticsEntryRowDef, rowData, tableId, indexId)) {
                getStore().deleteRow(session, rowData, false);
            }
        }
View Full Code Here


    // AbstractStoreIndexStatistics
    //

    @Override
    public IndexStatistics loadIndexStatistics(Session session, Index index) {
        RowDef indexRowDef = index.leafMostTable().rowDef();
        RowDef indexStatisticsRowDef = getIndexStatsRowDef(session);
        RowDef indexStatisticsEntryRowDef = getIndexStatsEntryRowDef(session);

        Key hKey = getStore().createKey();
        hKey.append(indexStatisticsRowDef.table().getOrdinal())
            .append((long) indexRowDef.getRowDefId())
            .append((long) index.getIndexId());
View Full Code Here

        return new ValuesHKey(schema.newHKeyRowType(hKeyMetadata), store.getTypesRegistry());
    }

    @Override
    public void updateRow(Row oldRow, Row newRow) {
        RowDef rowDef = oldRow.rowType().table().rowDef();
        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 {
View Full Code Here

            throw e;
        }
    }
    @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);
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);
View Full Code Here

    @Override
    protected HKey hKey(KeyUpdateRow row)
    {
        HKey hKey = null;
        RowDef rowDef = row.getRowDef();
        if (rowDef == vendorRD) {
            hKey = new HKey(vendorRD, row.get(v_vid));
        } else if (rowDef == customerRD) {
            hKey = new HKey(vendorRD, row.get(c_vid),
                            customerRD, row.get(c_cid));
View Full Code Here

        });
    }

    protected void checkInitialState(NewRow row)
    {
        RowDef rowDef = row.getRowDef();
        if (rowDef == vendorRD) {
            assertEquals(row.get(v_vx), ((Long)row.get(v_vid)) * 100);
        } else if (rowDef == customerRD) {
            assertEquals(row.get(c_cx), ((Long)row.get(c_cid)) * 100);
        } else if (rowDef == orderRD) {
View Full Code Here

    @Test
    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

    @Test(expected=EncodingException.class)
    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

    public void growALittle() throws InvalidOperationException
    {
        // 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

TOP

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

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.