本文整理汇总了Java中com.orientechnologies.orient.core.intent.OIntentMassiveInsert类的典型用法代码示例。如果您正苦于以下问题:Java OIntentMassiveInsert类的具体用法?Java OIntentMassiveInsert怎么用?Java OIntentMassiveInsert使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OIntentMassiveInsert类属于com.orientechnologies.orient.core.intent包,在下文中一共展示了OIntentMassiveInsert类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: connect
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; //导入依赖的package包/类
public OrientConnection connect() throws Exception {
final OrientGraphFactory graphFactory = new OrientGraphFactory(url.toString(), userName, password);
final ODatabaseDocumentTx database = graphFactory.getDatabase(false, false);
if (database.exists()) {
database.open(userName, password);
database.drop();
}
graphFactory.setAutoStartTx(false);
graphFactory.declareIntent(new OIntentMassiveInsert().setEnableCache(false));
return new AbstractOrientConnection(graphFactory.getNoTx()) {
@Override
public void close() throws Exception {
graph.commit();
graph.getRawGraph().close();
}
};
}
开发者ID:gsson,项目名称:dependency-grapher,代码行数:21,代码来源:OrientDB.java
示例2: begin
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; //导入依赖的package包/类
@Override
public void begin() {
ODatabaseDocumentTx documentDatabase = init();
if (documentDatabase == null) {
switch (dbType) {
case DOCUMENT:
documentDatabase = new ODatabaseDocumentTx(dbURL);
documentDatabase.open(dbUser, dbPassword);
break;
case GRAPH:
final OrientGraphFactory factory = new OrientGraphFactory(dbURL, dbUser, dbPassword);
final OrientBaseGraph graphDatabase = tx ? factory.getTx() : factory.getNoTx();
graphDatabase.setUseLightweightEdges(useLightweightEdges);
graphDatabase.setStandardElementConstraints(standardElementConstraints);
documentDatabase = graphDatabase.getRawGraph();
pipeline.setGraphDatabase(graphDatabase);
break;
}
pipeline.setDocumentDatabase(documentDatabase);
}
documentDatabase.declareIntent(new OIntentMassiveInsert());
}
开发者ID:orientechnologies,项目名称:orientdb-etl,代码行数:26,代码来源:OOrientDBLoader.java
示例3: run
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; //导入依赖的package包/类
@Override
public void run() {
db = new ODatabaseDocumentTx(url);
db.open("admin", "admin");
db.declareIntent(new OIntentMassiveInsert());
db.begin();
for (int i = 0; i < cycle; i++) {
ODocument doc = new ODocument("City");
doc.field("name", "Rome");
db.save(doc);
if (i % commitBuf == 0) {
db.commit();
db.begin();
}
}
db.close();
}
开发者ID:orientechnologies,项目名称:orientdb-lucene,代码行数:23,代码来源:LuceneInsertReadMultithreadTest.java
示例4: loadDB
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; //导入依赖的package包/类
private void loadDB(ODatabaseDocumentTx db, int documents) throws IOException
{
db.declareIntent(new OIntentMassiveInsert());
for (int i = 1; i <= documents; i++)
{
ODocument doc = new ODocument();
doc.setClassName("Item");
doc = createItem(i, doc);
db.save(doc, "Item");
}
db.declareIntent(null);
}
开发者ID:geekflow,项目名称:light,代码行数:16,代码来源:OrientJdbcTest.java
示例5: openNoTxForMassiveInsert
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; //导入依赖的package包/类
protected void openNoTxForMassiveInsert()
{
OGlobalConfiguration.USE_WAL.setValue(false);
OGlobalConfiguration.WAL_SYNC_ON_PAGE_FLUSH.setValue(false);
noTx = new OrientGraphNoTx(
"plocal:" + System.getProperty("ORIENTDB_HOME") + "/databases/" + dbName);
noTx.declareIntent(new OIntentMassiveInsert());
}
开发者ID:octopus-platform,项目名称:bjoern,代码行数:10,代码来源:CSVImporter.java
示例6: create
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; //导入依赖的package包/类
@Override
public ODatabaseDocumentTx create() throws Exception {
ODatabaseDocumentTx db = new ODatabaseDocumentTx(dbURL);
if (exists(db)) {
db.open("admin", "admin");
}
db.declareIntent(currentMode == Mode.NO_TX_MODE ? new OIntentMassiveInsert() : new OIntentMassiveRead());
allConns.add(db);
return db;
}
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:11,代码来源:OrientDatabase.java
示例7: init
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; //导入依赖的package包/类
@Override
@Test(enabled = false)
public void init() throws Exception {
String buildDirectory = System.getProperty("buildDirectory", ".");
if (buildDirectory == null)
buildDirectory = ".";
String uri = "plocal:" + buildDirectory + "/databases/city";
databaseDocumentTx = new ODatabaseDocumentTx(uri);
if (databaseDocumentTx.exists()) {
databaseDocumentTx.open("admin", "admin");
databaseDocumentTx.drop();
}
databaseDocumentTx.create();
OSchema schema = databaseDocumentTx.getMetadata().getSchema();
if (schema.getClass("City") == null) {
OClass oClass = schema.createClass("City");
oClass.createProperty("latitude", OType.DOUBLE);
oClass.createProperty("longitude", OType.DOUBLE);
oClass.createProperty("name", OType.STRING);
oClass.createIndex("City.name", "FULLTEXT", null, null, "LUCENE", new String[] { "name" });
oClass.createIndex("City.lat_lng", "SPATIAL", null, null, "LUCENE", new String[] { "latitude", "longitude" });
}
ZipFile zipFile = new ZipFile("files/allCountries.zip");
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
if (entry.getName().equals("allCountries.txt")) {
InputStream stream = zipFile.getInputStream(entry);
lineReader = new LineNumberReader(new InputStreamReader(stream));
}
}
databaseDocumentTx.declareIntent(new OIntentMassiveInsert());
}
开发者ID:orientechnologies,项目名称:orientdb-lucene,代码行数:39,代码来源:CreateCityDb.java
示例8: init
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; //导入依赖的package包/类
@Override
public void init() {
log.debug("Init loader");
documentDatabase = new ODatabaseDocumentTx(dbUrl, false);
String databaseName = documentDatabase.getName();
if (documentDatabase.exists() && dbAutoDropIfExists) {
log.debug("Dropping existent database '{}'", databaseName);
documentDatabase.open(dbUser, dbPassword).drop();
}
if (documentDatabase.exists()) {
log.debug("Open database '{}'", databaseName);
documentDatabase.open(dbUser, dbPassword);
if ((className != null) && autoDropClass) {
OSchema schema = documentDatabase.getMetadata().getSchema();
if (schema.existsClass(className)) {
log.debug("Dropping class '{}'", className);
documentDatabase.command(new OCommandSQL("DELETE FROM " + className)).execute();
schema.dropClass(className);
}
}
} else {
long time = System.currentTimeMillis();
log.debug("Create database '{}'", databaseName);
documentDatabase.create();
time = System.currentTimeMillis() - time;
log.debug("Created database '{}' in {} ms", databaseName, time);
}
documentDatabase.declareIntent(new OIntentMassiveInsert());
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:34,代码来源:OrientDbLoader.java
示例9: setMassInsertIntent
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; //导入依赖的package包/类
@Override
public void setMassInsertIntent() {
factory.declareIntent(new OIntentMassiveInsert());
}
开发者ID:gentics,项目名称:mesh,代码行数:5,代码来源:OrientDBDatabase.java
示例10: enableMassInsert
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; //导入依赖的package包/类
@Override
public void enableMassInsert() {
OrientBaseGraph tx = unwrapCurrentGraph();
tx.getRawGraph().getTransaction().setUsingLog(false);
tx.declareIntent(new OIntentMassiveInsert().setDisableHooks(true).setDisableValidation(true));
}
开发者ID:gentics,项目名称:mesh,代码行数:7,代码来源:OrientDBDatabase.java
示例11: init
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; //导入依赖的package包/类
/**
* Initialize any state for this DB. Called once per DB instance; there is one DB instance per client thread.
*/
public void init() throws DBException {
// initialize OrientDB driver
Properties props = getProperties();
String url = props.getProperty("orientdb.url", "local:C:/temp/databases/ycsb");
String user = props.getProperty("orientdb.user", "admin");
String password = props.getProperty("orientdb.password", "admin");
Boolean newdb = Boolean.parseBoolean(props.getProperty("orientdb.newdb", "false"));
try {
System.out.println("OrientDB loading database url = " + url);
OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(false);
db = new ODatabaseDocumentTx(url);
if (db.exists()) {
db.open(user, password);
if (newdb) {
System.out.println("OrientDB drop and recreate fresh db");
db.drop();
db.create();
}
} else {
System.out.println("OrientDB database not found, create fresh db");
db.create();
}
System.out.println("OrientDB connection created with " + url);
dictionary = db.getMetadata().getIndexManager().getDictionary();
if (!db.getMetadata().getSchema().existsClass(CLASS))
db.getMetadata().getSchema().createClass(CLASS);
db.declareIntent(new OIntentMassiveInsert());
} catch (Exception e1) {
System.err.println("Could not initialize OrientDB connection pool for Loader: " + e1.toString());
e1.printStackTrace();
return;
}
}
开发者ID:pbailis,项目名称:bolton-sigmod2013-code,代码行数:45,代码来源:OrientDBClient.java
注:本文中的com.orientechnologies.orient.core.intent.OIntentMassiveInsert类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论