Package com.foundationdb.server.rowdata

Examples of com.foundationdb.server.rowdata.RowDataValueSource


            List<Column> lookupCols = rowType.table().getPrimaryKeyIncludingInternal().getColumns();

            bindings.setHKey(StoreGIMaintenance.HKEY_BINDING_POSITION, hKey);

            // Copy the values into the array bindings
            RowDataValueSource pSource = new RowDataValueSource();
            for (int i=0; i < lookupCols.size(); ++i) {
                int bindingsIndex = i+1;
                Column col = lookupCols.get(i);
                pSource.bind(col.getFieldDef(), forRow);
                bindings.setValue(bindingsIndex, pSource);
            }
            cursor = API.cursor(planOperator, context, bindings);
            RUN_TAP.in();
            runTapEntered = true;
View Full Code Here


                            FDBStoreData storeData, RowData rowData) {
        RowDef rowDef = rowDefFromId(((Group)object).getRoot(), rowData.getRowDefId());
        if (rowDef == null) {
            throw new AkibanInternalException("Cannot find table " + rowData);
        }
        RowDataValueSource valueSource = new RowDataValueSource();
        int nfields = rowDef.getFieldCount();
        Map<String,Object> value = new HashMap<>(nfields); // Intermediate form of value.
        for (int i = 0; i < nfields; i++) {
            FieldDef fieldDef = rowDef.getFieldDef(i);
            valueSource.bind(fieldDef, rowData);
            value.put(fieldDef.getName(), ValueSources.toObject(valueSource));
        }
        storeData.otherValue = value;
    }
View Full Code Here

    public void initialize(RowData rowData, Key hKey, SpatialColumnHandler spatialColumnHandler, long zValue) {
        pKeyAppends = 0;
        int indexField = 0;
        IndexRowComposition indexRowComp = index.indexRowComposition();
        FieldDef[] fieldDefs = index.leafMostTable().rowDef().getFieldDefs();
        RowDataSource rowDataValueSource = new RowDataValueSource();
        while (indexField < indexRowComp.getLength()) {
            // handleSpatialColumn will increment pKeyAppends once for all spatial columns
            if (spatialColumnHandler != null && spatialColumnHandler.handleSpatialColumn(this, indexField, zValue)) {
                if (indexField == index.firstSpatialArgument()) {
                    pKeyAppends++;
                }
            } else {
                if (indexRowComp.isInRowData(indexField)) {
                    FieldDef fieldDef = fieldDefs[indexRowComp.getFieldPosition(indexField)];
                    Column column = fieldDef.column();
                    rowDataValueSource.bind(fieldDef, rowData);
                    pKeyTarget().append(rowDataValueSource,
                                        column.getType());
                } else if (indexRowComp.isInHKey(indexField)) {
                    PersistitKey.appendFieldFromKey(pKey(), hKey, indexRowComp.getHKeyPosition(indexField), index
                        .getIndexName());
View Full Code Here

        }
        return illegal;
    }

    public static Tuple2 tupleFromRowData(RowDef rowDef, RowData rowData) {
        RowDataValueSource valueSource = new RowDataValueSource();
        int nfields = rowDef.getFieldCount();
        Object[] objects = new Object[nfields];
        for (int i = 0; i < nfields; i++) {
            valueSource.bind(rowDef.getFieldDef(i), rowData);
            objects[i] = ValueSources.toObject(valueSource);
        }
        return Tuple2.from(objects);
    }
View Full Code Here

    private static class New extends PersistitKeyAppender
    {
        public New(Key key, Object descForError) {
            super(key);
            fromRowDataSource = new RowDataValueSource();
            target = new PersistitKeyValueTarget(descForError);
            target.attach(this.key);
        }
View Full Code Here

            rowDef = table.rowDef();
        }

        @Override
        public DynamicMessage encode(RowData rowData) {
            RowDataValueSource value = new RowDataValueSource();
            DynamicMessage.Builder builder = DynamicMessage.newBuilder(messageType);
            for (int i = 0; i < fields.length; i++) {
                value.bind(rowDef.getFieldDef(i), rowData);
                if (value.isNull()) {
                    if (nullFields != null) {
                        FieldDescriptor nullField = nullFields[i];
                        if (nullField != null) {
                            builder.setField(nullField, Boolean.TRUE);
                        }
View Full Code Here

        dimensions = space.dimensions();
        assert index.dimensions() == dimensions;
        tinstances = new TInstance[dimensions];
        fieldDefs = new FieldDef[dimensions];
        coords = new double[dimensions];
        rowDataSource = new RowDataValueSource();
        firstSpatialField = index.firstSpatialArgument();
        lastSpatialField = index.lastSpatialArgument();
        int spatialColumns = lastSpatialField - firstSpatialField + 1;
        for (int c = 0; c < spatialColumns; c++) {
            IndexColumn indexColumn = index.getKeyColumns().get(firstSpatialField + c);
View Full Code Here

    private void bind(RowData rowData)
    {
        for (int d = 0; d < dimensions; d++) {
            rowDataSource.bind(fieldDefs[d], rowData);

            RowDataValueSource rowDataValueSource = (RowDataValueSource)rowDataSource;
            TClass tclass = tinstances[d].typeClass();
            if (tclass == MNumeric.DECIMAL) {
                BigDecimalWrapper wrapper = TBigDecimal.getWrapper(rowDataValueSource, tinstances[d]);
                coords[d] = wrapper.asBigDecimal().doubleValue();
            }
            else if (tclass == MNumeric.BIGINT) {
                coords[d] = rowDataValueSource.getInt64();
            }
            else if (tclass == MNumeric.INT) {
                coords[d] = rowDataValueSource.getInt32();
            }
            else {
                assert false : fieldDefs[d].column();
            }
        }
View Full Code Here

    }

    @Override
    public ValueSource uncheckedValue(int i) {
        FieldDef fieldDef = rowType.table().rowDef().getFieldDef(i);
        RowDataValueSource valueSource = valueSource(i);
        valueSource.bind(fieldDef, rowData);
        return valueSource;
    }
View Full Code Here

        if(valueSources == null) {
            valueSources = new SparseArray<RowDataValueSource>()
            {
                @Override
                protected RowDataValueSource initialValue() {
                    return new RowDataValueSource();
                }
            };
        }
        return valueSources.get(i);
    }
View Full Code Here

TOP

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

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.