Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.StorageDescription


            tableName = bindings.getValue(1).getString();
            TableName groupName = new TableName(schemaName, tableName);
            Group group = context.getStore().schema().ais().getGroup(groupName);
            if (group == null)
                throw new NoSuchGroupException(groupName);
            StorageDescription storage = group.getStorageDescription();
            if (!(storage instanceof ProtobufStorageDescription))
                throw new InvalidParameterValueException("group does not use STORAGE_FORMAT protobuf");
            FileDescriptorProto fileProto = ((ProtobufStorageDescription)storage).getFileProto();
            try {
                tempFile = File.createTempFile("group", ".proto");
View Full Code Here


        memoryTableFactories.remove(name);
    }

    @SuppressWarnings("unchecked")
    public StorageDescription readProtobuf(Storage pbStorage, HasStorage forObject) {
        StorageDescription storageDescription = null;
        for (Format format : formatsInOrder) {
            if (pbStorage.hasExtension(format.protobufExtension)) {
                storageDescription = readProtobuf(format, pbStorage, forObject, storageDescription);
            }
        }
        if (!pbStorage.getUnknownFields().asMap().isEmpty()) {
            if (storageDescription == null) {
                storageDescription = new UnknownStorageDescription(forObject, defaultIdentifier);
            }
            storageDescription.setUnknownFields(pbStorage.getUnknownFields());
        }
        return storageDescription;
    }
View Full Code Here

        super.registerStandardFormats();
    }

    @Override
    public StorageDescription getDefaultStorageDescription(HasStorage object) {
        StorageDescription sd = super.getDefaultStorageDescription(object);
        if(sd instanceof TupleStorageDescription) {
            TupleStorageDescription tsd = (TupleStorageDescription)sd;
            if(object instanceof Group) {
                tsd.setUsage(TupleUsage.KEY_AND_ROW);
            } else {
View Full Code Here

        int pos = value.getCursor();
        int tableId = Util.getInt(value.getEncodedBytes(), pos);
        pos += 4;
        Table root = RowDefBuilder.LATEST_FOR_DEBUGGING.getTable(tableId);
        if (root != null) {
            StorageDescription storage = root.getGroup().getStorageDescription();
            if (storage instanceof PersistitProtobufStorageDescription) {
                ProtobufRowDataConverter converter = ((PersistitProtobufStorageDescription)storage).ensureConverter();
                PersistitProtobufRow holder = new PersistitProtobufRow(converter, null);
                try {
                    render(value, holder, clazz, context);
View Full Code Here

        if (!wasPersistit) return;

        createFromDDL("test",
                      "CREATE TABLE t1(id INT PRIMARY KEY NOT NULL) STORAGE_FORMAT test(name = 'Fred', option = true)");
        Group group = ais().getGroup(new TableName("test", "t1"));
        StorageDescription storage = group.getStorageDescription();
        assertTrue(storage instanceof TestPersistitStorageDescription);
        TestPersistitStorageDescription testStorage = (TestPersistitStorageDescription)storage;
        assertEquals("Fred", testStorage.getName());
        assertEquals("true", testStorage.getOption());
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.ais.model.StorageDescription

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.