@Override public boolean declareIntent(OIntent iIntent) { if (internal != null) return internal.declareIntent(iIntent); else { intent = iIntent; return true; } }
public void close() { database.declareIntent(null); }
public boolean declareIntent(OIntent iIntent) { return database.declareIntent(iIntent); }
public ODatabaseImport(final ODatabaseDocumentInternal database, final InputStream iStream, final OCommandOutputListener iListener) throws IOException { super(database, "streaming", iListener); jsonReader = new OJSONReader(new InputStreamReader(iStream)); database.declareIntent(new OIntentMassiveInsert()); }
@ConsoleCommand(description = "Declare an intent", onlineHelp = "") public void declareIntent( @ConsoleParameter(name = "Intent name", description = "name of the intent to execute") final String iIntentName) { checkForDatabase(); message("\nDeclaring intent '" + iIntentName + "'..."); if (iIntentName.equalsIgnoreCase("massiveinsert")) currentDatabase.declareIntent(new OIntentMassiveInsert()); else if (iIntentName.equalsIgnoreCase("massiveread")) currentDatabase.declareIntent(new OIntentMassiveRead()); else if (iIntentName.equalsIgnoreCase("null")) currentDatabase.declareIntent(null); else throw new IllegalArgumentException( "Intent '" + iIntentName + "' not supported. Available ones are: massiveinsert, massiveread, null"); message("\nIntent '" + iIntentName + "' set successfully"); }
public ODatabaseImport(final ODatabaseDocumentInternal database, final String iFileName, final OCommandOutputListener iListener) throws IOException { super(database, iFileName, iListener); if (iListener == null) listener = new OCommandOutputListener() { @Override public void onMessage(String iText) { } }; InputStream inStream; final BufferedInputStream bf = new BufferedInputStream(new FileInputStream(fileName)); bf.mark(1024); try { inStream = new GZIPInputStream(bf, 16384); // 16KB } catch (Exception ignore) { bf.reset(); inStream = bf; } OMurmurHash3HashFunction<OIdentifiable> keyHashFunction = new OMurmurHash3HashFunction<>(OLinkSerializer.INSTANCE); jsonReader = new OJSONReader(new InputStreamReader(inStream)); database.declareIntent(new OIntentMassiveInsert()); }
db.declareIntent(null); db.close(); if (walActive)
@Override public <DB extends ODatabase> DB open(String iUserName, String iUserPassword) { setupThreadOwner(); try { if ("remote".equals(type)) { factory = getOrCreateRemoteFactory(baseUrl); OrientDBConfig config = buildConfig(null); internal = (ODatabaseDocumentInternal) factory.open(dbName, iUserName, iUserPassword, config); } else { factory = getOrCreateEmbeddedFactory(baseUrl, null); OrientDBConfig config = buildConfig(null); internal = (ODatabaseDocumentInternal) factory.open(dbName, iUserName, iUserPassword, config); } if (databaseOwner != null) internal.setDatabaseOwner(databaseOwner); if (intent != null) internal.declareIntent(intent); if (conflictStrategy != null) internal.setConflictStrategy(conflictStrategy); if (serializer != null) internal.setSerializer(serializer); for (Entry<String, Object> pro : preopenProperties.entrySet()) internal.setProperty(pro.getKey(), pro.getValue()); } catch (RuntimeException e) { clearOwner(); throw e; } return (DB) this; }
internal.setDatabaseOwner(databaseOwner); if (intent != null) internal.declareIntent(intent); if (conflictStrategy != null) internal.setConflictStrategy(conflictStrategy);
public void close() { database.declareIntent(null); if (writer == null) return; try { writer.endObject(); writer.close(); writer = null; } catch (IOException e) { OLogManager.instance().error(this, "Error on exporting database '%s' to: %s", e, database.getName(), fileName); throw new ODatabaseExportException("Error on exporting database '" + database.getName() + "' to: " + fileName, e); } if (tempFileName != null) // may be null if writing to an output stream w/o file try { OFileUtils.atomicMoveWithFallback(Paths.get(tempFileName), Paths.get(fileName), this); } catch (IOException e) { OLogManager.instance().error(this, "Error on exporting database '%s' to: %s", e, database.getName(), fileName); throw new ODatabaseExportException("Error on exporting database '" + database.getName() + "' to: " + fileName, e); } }
@Override public void run() { try (ODatabaseDocumentInternal perThreadDbInstance = (ODatabaseDocumentInternal) orientDB.open(dbUrlConnection.getDbName(), userName, password)){ perThreadDbInstance.declareIntent(new OIntentMassiveInsert()); int clusterId = clusterIds[mod];
private String optimizeEdges() { final ODatabaseDocumentInternal db = getDatabase(); db.declareIntent(new OIntentMassiveInsert()); try { long transformed = 0; db.declareIntent(null);
private String optimizeEdges() { final ODatabaseDocumentInternal db = getDatabase(); db.declareIntent(new OIntentMassiveInsert()); try { long transformed = 0; db.declareIntent(null);
progressListener.onBegin(this, totRecords, false); database.declareIntent(new OIntentMassiveInsert()); try { database.declareIntent(null);
long currRecord = 0; database.declareIntent(new OIntentMassiveInsert()); try { throw OException.wrapException(new OCommandExecutionException("Error on creation of links"), e); } finally { database.declareIntent(null);
long documentIndexed; final boolean intentInstalled = getDatabase().declareIntent(new OIntentMassiveInsert()); getDatabase().declareIntent(null);