Package com.foundationdb.server.rowdata

Examples of com.foundationdb.server.rowdata.RowData


        // Remove existing statistics for the index
        removeStatistics(session, index);

        // Parent header row.
        RowData rowData = new RowData(new byte[INITIAL_ROW_SIZE]);
        rowData.createRow(indexStatisticsRowDef, new Object[] {
                tableId,
                index.getIndexId(),
                indexStatistics.getAnalysisTimestamp() / 1000,
                indexStatistics.getRowCount(),
                indexStatistics.getSampledCount()
View Full Code Here


        if (maxRetries > 0)
            rowDatas = new ArrayList<>();
        boolean transaction = false;
        try {
            NewRow row;
            RowData rowData = null;
            do {
                if (!transaction) {
                    // A transaction is needed, even to read rows, because of auto
                    // increment.
                    transactionService.beginTransaction(session);
View Full Code Here

        }
    }

    /** Delicate: Added to support GroupIndex building which only deals with FlattenedRows containing AbstractRows. */
    protected void lock(Session session, Row row) {
        RowData rowData = ((AbstractRow)row).rowData();
        Table table = row.rowType().table();
        SDType storeData = createStoreData(session, table.getGroup());
        try {
            lock(session, storeData, table.rowDef(), rowData);
        } finally {
View Full Code Here

     * the rows, this also ensures any identity values generated by sequence
     * are also populated correctly. But is is a separate step.
     */
    @Override
    public void writeNewRow(Session session, NewRow row) {
        RowData rowData = null;
        fillIdentityColumn(session, row);
        try {
             rowData = row.toRowData();
        } catch (EncodingException e) {
            throw new TableDefinitionMismatchException(e);
View Full Code Here

    public RowData toRowData() {
        final Object[] objects = new Object[ rowDef.getFieldCount() ];
        for (Map.Entry<Integer,Object> entry : fields.entrySet()) {
            objects[ entry.getKey() ] = entry.getValue();
        }
        final RowData retval = new RowData(new byte[INITIAL_ROW_DATA_SIZE]);
        retval.createRow(rowDef, objects, true);
        return retval;
    }
View Full Code Here

    protected IndexStatistics decodeHeader(Session session,
                                           Exchange exchange,
                                           RowDef indexStatisticsRowDef,
                                           Index index) {
        RowData rowData = new RowData(new byte[exchange.getValue().getEncodedSize() + RowData.ENVELOPE_SIZE]);
        getStore().expandRowData(session, exchange, rowData);
        return decodeIndexStatisticsRow(rowData, indexStatisticsRowDef, index);
    }
View Full Code Here

    protected void decodeEntry(Session session,
                               Exchange exchange,
                               RowDef indexStatisticsEntryRowDef,
                               IndexStatistics indexStatistics) {
        RowData rowData = new RowData(new byte[exchange.getValue().getEncodedSize() + RowData.ENVELOPE_SIZE]);
        getStore().expandRowData(session, exchange, rowData);
        decodeIndexStatisticsEntryRow(rowData, indexStatisticsEntryRowDef, indexStatistics);
    }
View Full Code Here

        getStore().expandRowData(session, exchange, rowData);
        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);
            }
        }

        // Delete only the parent index_statistics row
        exchange.clear().append(Key.BEFORE);
        while (exchange.traverse(Key.Direction.GT, true)) {
            getStore().expandRowData(session, exchange, rowData);
            if (rowData.getRowDefId() == indexStatisticsRowDef.getRowDefId() &&
                selectedIndex(indexStatisticsRowDef, rowData, tableId, indexId)) {
                getStore().deleteRow(session, rowData, false);
            }
        }
    }
View Full Code Here

        FDBStoreData storeData = getStore().createStoreData(session, indexStatisticsRowDef.getGroup());
        hKey.copyTo(storeData.persistitKey);
        getStore().groupKeyAndDescendantsIterator(session, storeData, false);
        while(storeData.next()) {
            RowData rowData = new RowData();
            FDBStoreDataHelper.expandRowData(rowData, storeData, false);
            getStore().deleteRow(session, rowData, false); // TODO: Use cascade?
        }
    }
View Full Code Here

    //

    protected IndexStatistics decodeHeader(FDBStoreData storeData,
                                           RowDef indexStatisticsRowDef,
                                           Index index) {
        RowData rowData = new RowData();
        FDBStoreDataHelper.expandRowData(rowData, storeData, false);
        return decodeIndexStatisticsRow(rowData, indexStatisticsRowDef, index);
    }
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.