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


Java TitanGraph.shutdown方法代码示例

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


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

示例1: main

import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
public static void main(String args[]) throws IOException {
    if (4 != args.length) {
        System.err.println("Usage: GraphGenerator titanproperties vertexcount edgecount outfile");
        System.exit(1);
    }
    int i = 0;
    String c = args[i++];
    int v = Integer.valueOf(args[i++]);
    int e = Integer.valueOf(args[i++]);
    String o = args[i++];
    Schema s = new Schema.Builder(v, e).build();
    TitanGraph graph = TitanFactory.open(c);
    new GraphGenerator(s).generateTypesAndData(graph);
    OutputStream out = new GZIPOutputStream(new FileOutputStream(o));
    GraphGenerator.writeData(graph, out);
    out.close();
    graph.shutdown();
    System.exit(0);
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:20,代码来源:GraphGenerator.java

示例2: readBioGRID

import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
/** prepare the databases before running the test  **/
  // /usr/local/hbase/4titan$ bin/start-hbase.sh
  // sudo /etc/init.d/elasticsearch start

  @Test
  public void readBioGRID() throws Exception
  {
    TitanGraph g = Titans.openHBaseGraph();
    g.shutdown(); TitanCleanup.clear(g);

    g = Titans.openHBaseGraph();
    Psi25Handler biogrid = new Psi25Handler(g);
    biogrid.parseDocument("/media/data/import/BioGRID/BIOGRID-ALL-3.2.120.psi25.xml");
//    uniprot.parseDocument("/media/data/import/bio4j/uniprot_sprot.xml");
    g.shutdown();
  }
 
开发者ID:wyu,项目名称:molgraph,代码行数:17,代码来源:GraphReaderTest.java

示例3: readUniprot

import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
@Test
  public void readUniprot() throws Exception
  {
    TitanGraph g = Titans.openHBaseGraph();
//    TransactionBuilder tx = g.buildTransaction();
//    tx.enableBatchLoading();
//    TitanTransaction t = tx.start();
    g.shutdown(); TitanCleanup.clear(g);
//    Graphs.clear(g);

    g = Titans.openHBaseGraph();
    UniprotHandler uniprot = new UniprotHandler(g, "Homo sapiens");
    uniprot.parseDocument("/home/wyu/Projects/molgraph/data/up1k.xml");
//    uniprot.parseDocument("/media/data/import/bio4j/uniprot_sprot.xml");
    g.shutdown();
  }
 
开发者ID:wyu,项目名称:molgraph,代码行数:17,代码来源:UniprotTest01.java

示例4: clear

import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
@Override
public void clear() {
    TitanGraph graph = getGraph();
    if (graph.isOpen()) {
        // only a shut down graph can be cleared
        graph.shutdown();
    }
    TitanCleanup.clear(graph);
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:10,代码来源:Titan0Graph.java

示例5: testGraphQueryForVertices

import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
@Override
public void testGraphQueryForVertices() {
    TitanGraph g = (TitanGraph) graphTest.generateGraph();
    if (g.getRelationType("age") == null) {
        TitanManagement mgmt = g.getManagementSystem();
        mgmt.makePropertyKey("age").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.commit();
    }
    g.shutdown();
    super.testGraphQueryForVertices();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:12,代码来源:TitanGraphQueryTestSuite.java

示例6: testGraphQueryForEdges

import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
@Override
public void testGraphQueryForEdges() {
    TitanGraph g = (TitanGraph) graphTest.generateGraph();
    if (g.getRelationType("weight") == null) {
        TitanManagement mgmt = g.getManagementSystem();
        mgmt.makePropertyKey("weight").dataType(Double.class).cardinality(Cardinality.SINGLE).make();
        mgmt.commit();
    }
    g.shutdown();
    super.testGraphQueryForEdges();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:12,代码来源:TitanGraphQueryTestSuite.java

示例7: cleanUp

import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
public void cleanUp() throws BackendException {
    synchronized (openGraphs) {
        for (Map.Entry<String, TitanGraph> entry : openGraphs.entrySet()) {
            String uid = entry.getKey();
            TitanGraph g = entry.getValue();
            if (g.isOpen()) {
                log.warn("Detected possible graph[uid={}] leak in Blueprints GraphTest method {}, shutting down the leaked graph",
                    uid, getMostRecentMethodName());
                g.shutdown();
            }
            extraCleanUp(uid);
        }
        openGraphs.clear();
    }
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:16,代码来源:TitanBlueprintsTest.java

示例8: testGraphOfTheGodsFactoryCreate

import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
/**
 * Test {@link com.thinkaurelius.titan.example.GraphOfTheGodsFactory#create(String)}.
 */
@Test
public void testGraphOfTheGodsFactoryCreate() {
    String bdbtmp = Joiner.on(File.separator).join("target", "gotgfactory");
    TitanGraph gotg = GraphOfTheGodsFactory.create(bdbtmp);
    TitanIndexTest.assertGraphOfTheGods(gotg);
    gotg.shutdown();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:11,代码来源:BerkeleyElasticsearchTest.java

示例9: readVertices

import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
@Test
public void readVertices() throws Exception
{
  TitanGraph g = Titans.openHBaseGraph();

  Map<String, PropertyNode> tag_node = Graphs.getVertices(
      g.buildTransaction().start(), "gene");

  g.shutdown();

}
 
开发者ID:wyu,项目名称:molgraph,代码行数:12,代码来源:UniprotTest01.java

示例10: testLists

import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
@Test
public void testLists() {

    int num = 13;

    TitanGraph g = TitanFactory.open("inmemory");
    StandardTitanTx tx = (StandardTitanTx) g.newTransaction();
    VertexLongList vll = new VertexLongList(tx);
    VertexArrayList val = new VertexArrayList(tx);
    for (int i=0; i<num; i++) {
        TitanVertex v = tx.addVertex();
        vll.add(v);
        val.add(v);
    }

    assertEquals(num, Iterables.size(vll));
    assertEquals(num, Iterables.size(val));

    vll.sort();
    val.sort();
    assertTrue(vll.isSorted());
    assertTrue(val.isSorted());

    for (Iterable<TitanVertex> iterable : new Iterable[]{val,vll}) {
        Iterator<TitanVertex> iter = iterable.iterator();
        TitanVertex previous = null;
        for (int i = 0; i < num; i++) {
            TitanVertex next = iter.next();
            if (previous!=null) assertTrue(previous.getLongId()<next.getLongId());
            previous = next;
        }
        try {
            iter.next();
            fail();
        } catch (NoSuchElementException ex) {

        }
    }


    tx.commit();
    g.shutdown();

}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:45,代码来源:VertexListTest.java

示例11: testTitanFactoryShorthand

import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
@Test
public void testTitanFactoryShorthand() {
    TitanGraph g = TitanFactory.open("inmemory");
    g.shutdown();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:6,代码来源:TitanFactoryShorthandTest.java


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