Package com.thinkaurelius.titan.blueprints

Source Code of com.thinkaurelius.titan.blueprints.HBaseBlueprintsTest

package com.thinkaurelius.titan.blueprints;

import com.thinkaurelius.titan.HBaseStorageSetup;
import com.thinkaurelius.titan.core.TitanFactory;
import com.thinkaurelius.titan.diskstorage.StorageException;
import com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager;
import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration;
import com.tinkerpop.blueprints.Graph;

import java.io.IOException;
/**
* @author Matthias Broecheler (me@matthiasb.com)
*/

public class HBaseBlueprintsTest extends TitanBlueprintsTest {

    @Override
    public void startUp() {
        try {
            HBaseStorageSetup.startHBase();
        } catch (IOException e) {
            throw new AssertionError(e);
        }
    }

    @Override
    public void shutDown() {
        // we don't need to restart on each test because cleanup is in please
    }

    @Override
    public Graph generateGraph() {
        return TitanFactory.open(HBaseStorageSetup.getHBaseGraphConfiguration());
    }

    @Override
    public void cleanUp() throws StorageException {
        HBaseStoreManager s = new HBaseStoreManager(HBaseStorageSetup
                                                        .getHBaseGraphConfiguration()
                                                                .subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE));
        s.clearStorage();
    }

    @Override
    public boolean supportsMultipleGraphs() {
        return false;
    }

    @Override
    public Graph generateGraph(String s) {
        throw new UnsupportedOperationException();
    }
}
TOP

Related Classes of com.thinkaurelius.titan.blueprints.HBaseBlueprintsTest

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.