当前位置: 首页>>代码示例>>Java>>正文


Java GraphDatabaseConfiguration.getUniqueGraphId方法代码示例

本文整理汇总了Java中com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getUniqueGraphId方法的典型用法代码示例。如果您正苦于以下问题:Java GraphDatabaseConfiguration.getUniqueGraphId方法的具体用法?Java GraphDatabaseConfiguration.getUniqueGraphId怎么用?Java GraphDatabaseConfiguration.getUniqueGraphId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration的用法示例。


在下文中一共展示了GraphDatabaseConfiguration.getUniqueGraphId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: StandardTitanGraph

import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration; //导入方法依赖的package包/类
public StandardTitanGraph(GraphDatabaseConfiguration configuration) {

        this.config = configuration;
        this.backend = configuration.getBackend();

        this.idAssigner = config.getIDAssigner(backend);
        this.idManager = idAssigner.getIDManager();

        this.serializer = config.getSerializer();
        StoreFeatures storeFeatures = backend.getStoreFeatures();
        this.indexSerializer = new IndexSerializer(configuration.getConfiguration(), this.serializer,
                this.backend.getIndexInformation(), storeFeatures.isDistributed() && storeFeatures.isKeyOrdered());
        this.edgeSerializer = new EdgeSerializer(this.serializer);
        this.vertexExistenceQuery = edgeSerializer.getQuery(BaseKey.VertexExists, Direction.OUT, new EdgeSerializer.TypedInterval[0]).setLimit(1);
        this.queryCache = new RelationQueryCache(this.edgeSerializer);
        this.schemaCache = configuration.getTypeCache(typeCacheRetrieval);
        this.times = configuration.getTimestampProvider();

        isOpen = true;
        txCounter = new AtomicLong(0);
        openTransactions = Collections.newSetFromMap(new ConcurrentHashMap<StandardTitanTx, Boolean>(100, 0.75f, 1));

        //Register instance and ensure uniqueness
        String uniqueInstanceId = configuration.getUniqueGraphId();
        ModifiableConfiguration globalConfig = GraphDatabaseConfiguration.getGlobalSystemConfig(backend);
        if (globalConfig.has(REGISTRATION_TIME, uniqueInstanceId)) {
            throw new TitanException(String.format("A Titan graph with the same instance id [%s] is already open. Might required forced shutdown.", uniqueInstanceId));
        }
        globalConfig.set(REGISTRATION_TIME, times.getTime(), uniqueInstanceId);

        Log mgmtLog = backend.getSystemMgmtLog();
        mgmtLogger = new ManagementLogger(this, mgmtLog, schemaCache, this.times);
        mgmtLog.registerReader(ReadMarker.fromNow(), mgmtLogger);

        shutdownHook = new ShutdownThread(this);
        Runtime.getRuntime().addShutdownHook(shutdownHook);
        log.debug("Installed shutdown hook {}", shutdownHook, new Throwable("Hook creation trace"));
    }
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:39,代码来源:StandardTitanGraph.java

示例2: StandardTitanGraph

import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration; //导入方法依赖的package包/类
public StandardTitanGraph(GraphDatabaseConfiguration configuration) {
    this.config = configuration;
    this.backend = configuration.getBackend();

    this.idAssigner = config.getIDAssigner(backend);
    this.idManager = idAssigner.getIDManager();

    this.serializer = config.getSerializer();
    StoreFeatures storeFeatures = backend.getStoreFeatures();
    this.indexSerializer = new IndexSerializer(configuration.getConfiguration(), this.serializer,
            this.backend.getIndexInformation(),storeFeatures.isDistributed() && storeFeatures.isKeyOrdered());
    this.edgeSerializer = new EdgeSerializer(this.serializer);
    this.vertexExistenceQuery = edgeSerializer.getQuery(BaseKey.VertexExists, Direction.OUT, new EdgeSerializer.TypedInterval[0]).setLimit(1);
    this.queryCache = new RelationQueryCache(this.edgeSerializer);
    this.schemaCache = configuration.getTypeCache(typeCacheRetrieval);
    this.times = configuration.getTimestampProvider();

    isOpen = true;
    txCounter = new AtomicLong(0);
    openTransactions = Collections.newSetFromMap(new ConcurrentHashMap<StandardTitanTx, Boolean>(100,0.75f,1));

    //Register instance and ensure uniqueness
    String uniqueInstanceId = configuration.getUniqueGraphId();
    ModifiableConfiguration globalConfig = GraphDatabaseConfiguration.getGlobalSystemConfig(backend);
    if (globalConfig.has(REGISTRATION_TIME,uniqueInstanceId)) {
        throw new TitanException(String.format("A Titan graph with the same instance id [%s] is already open. Might required forced shutdown.",uniqueInstanceId));
    }
    globalConfig.set(REGISTRATION_TIME, times.getTime(), uniqueInstanceId);

    Log mgmtLog = backend.getSystemMgmtLog();
    mgmtLogger = new ManagementLogger(this,mgmtLog,schemaCache,this.times);
    mgmtLog.registerReader(ReadMarker.fromNow(),mgmtLogger);

    shutdownHook = new ShutdownThread(this);
    Runtime.getRuntime().addShutdownHook(shutdownHook);
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:37,代码来源:StandardTitanGraph.java


注:本文中的com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getUniqueGraphId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。