本文整理汇总了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);
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例11: testTitanFactoryShorthand
import com.thinkaurelius.titan.core.TitanGraph; //导入方法依赖的package包/类
@Test
public void testTitanFactoryShorthand() {
TitanGraph g = TitanFactory.open("inmemory");
g.shutdown();
}