Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.Table.hKey()


        IndexToHKey indexToHKey = null;
        SDType parentStoreData = null;
        IndexRow parentPKIndexRow = null;

        // All columns of all segments of the HKey
        for(HKeySegment hKeySegment : table.hKey().segments()) {
            // Ordinal for this segment
            RowDef segmentRowDef = hKeySegment.table().rowDef();
            hKeyAppender.append(segmentRowDef.table().getOrdinal());
            // Segment's columns
            for(HKeyColumn hKeyColumn : hKeySegment.columns()) {
View Full Code Here


                            break;
                        }
                    }
                }
                if (found) {
                    int[] keyDepth = table.hKey().keyDepth();
                    nextOrdinalIndex = keyDepth[keyDepth.length - 1];
                    seg = ordinal;
                }
            }
            key.append(seg);
View Full Code Here

        int ordinal = hkey.decodeInt();
        assert (root.getOrdinal() == ordinal) : hkey;
        Table table = root;
        int index = 0;
        while (true) {
            int[] keyDepth = table.hKey().keyDepth();
            index = keyDepth[keyDepth.length - 1];
            if (index >= hkey.getDepth()) {
                return table.rowDef();
            }
            hkey.indexTo(index);
View Full Code Here

             */
            hKey.clear();
            Table table = rowDef.table();
            PersistitKeyAppender hKeyAppender = PersistitKeyAppender.create(hKey, table.getName());
            List<Column> pkColumns = table.getPrimaryKeyIncludingInternal().getColumns();
            for(HKeySegment segment : table.hKey().segments()) {
                RowDef segmentRowDef = segment.table().rowDef();
                hKey.append(segmentRowDef.table().getOrdinal());
                for(HKeyColumn hKeyColumn : segment.columns()) {
                    Column column = hKeyColumn.column();
                    if(pkColumns.contains(column)) {
View Full Code Here

            ret.printStackTrace();
            throw ret;
        }
        schema = SchemaCache.globalSchema(ais);
        indexedRowType = schema.tableRowType(table);
        hKeyRowType = schema.newHKeyRowType(table.hKey());
        fieldsByColumn = new HashMap<>(index.getKeyColumns().size());
        for (IndexColumn indexColumn : index.getKeyColumns()) {
            Column column = indexColumn.getColumn();
            IndexedField indexedField = new IndexedField(column);
            fieldsByColumn.put(column, indexedField);
View Full Code Here

    }
   
    @Test
    public void testSegmentsTop() {
        Table customer = schema.ais().getTable("schema", "customer");
        ValuesHKey key = new ValuesHKey(schema.newHKeyRowType(customer.hKey()), registry);
        assertEquals(key.segments(), 1);
        assertEquals(key.rowType().nFields(), 1);
    }
   
    @Test
View Full Code Here

    }
   
    @Test
    public void testSegmentsBottom() {
        Table item = schema.ais().getTable("schema", "item");
        ValuesHKey key = new ValuesHKey(schema.newHKeyRowType(item.hKey()), registry);
        assertEquals(key.segments(), 3);
        assertEquals(key.rowType().nFields(), 3);
    }
   
    @Test
View Full Code Here

    }
   
    private ValuesHKey createHKey(String tableName) {
       
        Table table = schema.ais().getTable("schema", tableName);
        ValuesHKey key = new ValuesHKey(schema.newHKeyRowType(table.hKey()), registry);
        return key;
    }
   
    private int ordinal (String tableName) {
        return schema.ais().getTable("schema", tableName).getOrdinal().intValue();
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.