Package com.foundationdb.server.rowdata

Examples of com.foundationdb.server.rowdata.RowData.createRow()


        // 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


        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;
    }

    @Override
    public ColumnSelector getActiveColumns() {
View Full Code Here

    {
        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);
    }

    @Test(expected=EncodingException.class)
    public void bigRowCantGrow() throws InvalidOperationException
    {
View Full Code Here

    {
        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();
    }

    @Test
    public void growALittle() throws InvalidOperationException
View Full Code Here

        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);
    }

    @Test
    public void growALot() throws InvalidOperationException
View Full Code Here

        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

                                ProtobufRowDataConverter converter,
                                RowDef rowDef,
                                Object... values)
            throws Exception {
        RowData rowDataIn = new RowData(new byte[128]);
        rowDataIn.createRow(rowDef, values, true);
        DynamicMessage msg = converter.encode(rowDataIn);
        if (false) {
            System.out.println(converter.shortFormat(msg));
        }
        RowData rowDataOut = new RowData(new byte[128]);
View Full Code Here

        return SCHEMA_FACTORY.aisWithRowDefs(ddl).getTable("test_schema", "test_table").rowDef();
    }

    private RowData create(RowDef rowDef, Object[] objects) {
        RowData rowData = new RowData(bytes());
        rowData.createRow(rowDef, objects);

        assertEquals("start", 0, rowData.getBufferStart());
        assertEquals("end and length", rowData.getBufferEnd(), rowData.getBufferLength());
        return rowData;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.