Package com.foundationdb.ais.protobuf

Examples of com.foundationdb.ais.protobuf.ProtobufReader


    }

    public void clone(AkibanInformationSchema destAIS, AkibanInformationSchema srcAIS, ProtobufWriter.WriteSelector selector) {
        ProtobufWriter writer = new ProtobufWriter(selector);
        AISProtobuf.AkibanInformationSchema pbAIS = writer.save(srcAIS);
        ProtobufReader reader = new ProtobufReader(typesRegistry, storageFormatRegistry, destAIS, pbAIS.toBuilder());
        reader.loadAIS();
    }
View Full Code Here


                        Long prev = onlineCache.schemaToOnline.put(schema, onlineID);
                        assert (prev == null) : String.format("%s, %d, %d", schema, prev, onlineID);
                        ++schemaCount;
                    }
                    if(generation != -1) {
                        ProtobufReader reader = newProtobufReader();
                        loadProtobufChildren(txnState, protobufDir, reader, null);
                        loadPrimaryProtobuf(txnState, reader, onlineCache.schemaToOnline.keySet());
   
                        // Reader will have two copies of affected schemas, skip second (i.e. non-online)
                        AkibanInformationSchema newAIS = finishReader(reader);
View Full Code Here

    }

    private AkibanInformationSchema loadFromStorage(Session session) {
        TransactionState txn = txnService.getTransaction(session);
        checkDataVersions(txn);
        ProtobufReader reader = newProtobufReader();
        loadPrimaryProtobuf(txn, reader, null);
        finishReader(reader);
        validateAndFreeze(session, reader.getAIS(), getTransactionalGeneration(txn));
        return reader.getAIS();
    }
View Full Code Here

    }

    private ProtobufReader newProtobufReader() {
        // Start with existing memory tables, merge in stored ones
        final AkibanInformationSchema newAIS = aisCloner.clone(memoryTableAIS);
        return new ProtobufReader(typesRegistryService.getTypesRegistry(), storageFormatRegistry, newAIS);
    }
View Full Code Here

            }
        }
    }

    private SharedAIS loadToShared(Session session, GenValue genValue, GenMap genMap) throws PersistitException {
        ProtobufReader reader = new ProtobufReader(getTypesRegistry(), storageFormatRegistry, new AkibanInformationSchema());
        loadFromStorage(session, reader);
        AkibanInformationSchema newAIS = finishReader(reader);
        return createValidatedShared(session, newAIS, genValue, genMap);
    }
View Full Code Here

                    assert (prev == null) : String.format("%s, %d, %d", schema, prev, onlineID);
                }

                ex.getKey().cut();
                if(generation != -1) {
                    ProtobufReader reader = new ProtobufReader(getTypesRegistry(), getStorageFormatRegistry());
                    loadProtobufChildren(ex, reader, null);
                    loadPrimaryProtobuf(ex, reader, onlineCache.schemaToOnline.keySet());

                    // Reader will have two copies of affected schemas, skip second (i.e. non-online)
                    AkibanInformationSchema newAIS = finishReader(reader);
View Full Code Here

    @Test
    public void reloadNormally() {
        TypesRegistry typesRegistry = TestTypesRegistry.MCOMPAT;
        StorageFormatRegistry newFormatRegistry = DummyStorageFormatRegistry.create();
        AkibanInformationSchema ais = new AkibanInformationSchema();
        ProtobufReader reader = new ProtobufReader(typesRegistry, newFormatRegistry, ais);
        reader.loadBuffer(bytes);
        reader.loadAIS();
        bytes.flip();
        ProtobufWriter writer = new ProtobufWriter();
        writer.save(ais);
        writer.serialize(bytes);
        bytes.flip();
View Full Code Here

        assertTrue(isFullDescription(sequence.getStorageDescription()));
    }

    protected Sequence loadSequence(TypesRegistry typesRegistry, StorageFormatRegistry storageFormatRegistry) {
        AkibanInformationSchema ais = new AkibanInformationSchema();
        ProtobufReader reader = new ProtobufReader(typesRegistry, storageFormatRegistry, ais);
        reader.loadBuffer(bytes);
        reader.loadAIS();
        return ais.getSequence(new TableName("test", "seq"));
}
View Full Code Here

TOP

Related Classes of com.foundationdb.ais.protobuf.ProtobufReader

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.