Skip to content

Commit

Permalink
cleanup: removed old deprecated intent logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Feb 15, 2024
1 parent 2e7762f commit 977c567
Show file tree
Hide file tree
Showing 52 changed files with 83 additions and 597 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1200,11 +1200,6 @@ public void internalClose(boolean recycle) {

callOnCloseListeners();

if (currentIntent != null) {
currentIntent.end(this);
currentIntent = null;
}

status = STATUS.CLOSED;
if (!recycle) {
sharedContext = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import com.orientechnologies.orient.core.id.ORID;
import com.orientechnologies.orient.core.id.ORecordId;
import com.orientechnologies.orient.core.index.OIndex;
import com.orientechnologies.orient.core.intent.OIntent;
import com.orientechnologies.orient.core.iterator.ORecordIteratorClass;
import com.orientechnologies.orient.core.iterator.ORecordIteratorCluster;
import com.orientechnologies.orient.core.metadata.OMetadata;
Expand Down Expand Up @@ -304,10 +303,6 @@ public <RET extends ORecord> RET load(ORecord iRecord) {
return (RET) database.load(iRecord);
}

public boolean declareIntent(OIntent iIntent) {
return database.declareIntent(iIntent);
}

public <RET extends ORecord> RET load(ORecord iRecord, String iFetchPlan) {
return (RET) database.load(iRecord, iFetchPlan);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import com.orientechnologies.orient.core.exception.OTransactionException;
import com.orientechnologies.orient.core.hook.ORecordHook;
import com.orientechnologies.orient.core.id.ORID;
import com.orientechnologies.orient.core.intent.OIntent;
import com.orientechnologies.orient.core.metadata.OMetadata;
import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.metadata.schema.OSchema;
Expand Down Expand Up @@ -168,22 +167,6 @@ enum ATTRIBUTES {
*/
OContextConfiguration getConfiguration();

/**
* Declares an intent to the database. Intents aim to optimize common use cases.
*
* @param iIntent The intent
*/
@Deprecated
boolean declareIntent(final OIntent iIntent);

/**
* Get the active intent in the current session.
*
* @return
*/
@Deprecated
OIntent getActiveIntent();

/**
* Checks if the database exists.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.orientechnologies.orient.core.db.tool.ODatabaseImport;
import com.orientechnologies.orient.core.exception.ODatabaseException;
import com.orientechnologies.orient.core.id.ORID;
import com.orientechnologies.orient.core.intent.OIntent;
import com.orientechnologies.orient.core.metadata.security.OToken;
import com.orientechnologies.orient.core.storage.ORecordMetadata;
import com.orientechnologies.orient.core.storage.OStorage;
Expand Down Expand Up @@ -283,15 +282,6 @@ public int getDefaultClusterId() {
return underlying.getDefaultClusterId();
}

public boolean declareIntent(final OIntent iIntent) {
return underlying.declareIntent(iIntent);
}

@Override
public OIntent getActiveIntent() {
return underlying.getActiveIntent();
}

public <DBTYPE extends ODatabase> DBTYPE getUnderlying() {
return (DBTYPE) underlying;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,29 @@
import com.orientechnologies.orient.core.command.OCommandRequestInternal;
import com.orientechnologies.orient.core.config.OContextConfiguration;
import com.orientechnologies.orient.core.config.OStorageEntryConfiguration;
import com.orientechnologies.orient.core.db.*;
import com.orientechnologies.orient.core.db.ODatabase;
import com.orientechnologies.orient.core.db.ODatabaseDocumentInternal;
import com.orientechnologies.orient.core.db.ODatabaseInternal;
import com.orientechnologies.orient.core.db.ODatabaseLifecycleListener;
import com.orientechnologies.orient.core.db.ODatabaseListener;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.db.OScenarioThreadLocal;
import com.orientechnologies.orient.core.db.OSharedContext;
import com.orientechnologies.orient.core.db.record.OCurrentStorageComponentsFactory;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.db.record.ORecordOperation;
import com.orientechnologies.orient.core.dictionary.ODictionary;
import com.orientechnologies.orient.core.exception.*;
import com.orientechnologies.orient.core.exception.OConcurrentModificationException;
import com.orientechnologies.orient.core.exception.ODatabaseException;
import com.orientechnologies.orient.core.exception.ORecordNotFoundException;
import com.orientechnologies.orient.core.exception.OSchemaException;
import com.orientechnologies.orient.core.exception.OSecurityException;
import com.orientechnologies.orient.core.exception.OTransactionBlockedException;
import com.orientechnologies.orient.core.exception.OTransactionException;
import com.orientechnologies.orient.core.exception.OValidationException;
import com.orientechnologies.orient.core.hook.ORecordHook;
import com.orientechnologies.orient.core.id.ORID;
import com.orientechnologies.orient.core.id.ORecordId;
import com.orientechnologies.orient.core.intent.OIntent;
import com.orientechnologies.orient.core.iterator.ORecordIteratorClass;
import com.orientechnologies.orient.core.iterator.ORecordIteratorCluster;
import com.orientechnologies.orient.core.metadata.OMetadata;
Expand All @@ -52,10 +65,28 @@
import com.orientechnologies.orient.core.metadata.schema.OProperty;
import com.orientechnologies.orient.core.metadata.schema.OSchema;
import com.orientechnologies.orient.core.metadata.schema.OView;
import com.orientechnologies.orient.core.metadata.security.*;
import com.orientechnologies.orient.core.metadata.security.OImmutableUser;
import com.orientechnologies.orient.core.metadata.security.ORole;
import com.orientechnologies.orient.core.metadata.security.ORule;
import com.orientechnologies.orient.core.metadata.security.OSecurityInternal;
import com.orientechnologies.orient.core.metadata.security.OSecurityShared;
import com.orientechnologies.orient.core.metadata.security.OSecurityUser;
import com.orientechnologies.orient.core.metadata.security.OUser;
import com.orientechnologies.orient.core.query.OQuery;
import com.orientechnologies.orient.core.record.*;
import com.orientechnologies.orient.core.record.impl.*;
import com.orientechnologies.orient.core.record.ODirection;
import com.orientechnologies.orient.core.record.OEdge;
import com.orientechnologies.orient.core.record.OElement;
import com.orientechnologies.orient.core.record.ORecord;
import com.orientechnologies.orient.core.record.ORecordInternal;
import com.orientechnologies.orient.core.record.OVertex;
import com.orientechnologies.orient.core.record.impl.OBlob;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.record.impl.ODocumentEmbedded;
import com.orientechnologies.orient.core.record.impl.ODocumentInternal;
import com.orientechnologies.orient.core.record.impl.OEdgeDelegate;
import com.orientechnologies.orient.core.record.impl.OEdgeDocument;
import com.orientechnologies.orient.core.record.impl.ORecordBytes;
import com.orientechnologies.orient.core.record.impl.OVertexDocument;
import com.orientechnologies.orient.core.serialization.serializer.binary.OBinarySerializerFactory;
import com.orientechnologies.orient.core.serialization.serializer.record.ORecordSerializer;
import com.orientechnologies.orient.core.serialization.serializer.record.ORecordSerializerFactory;
Expand All @@ -69,7 +100,20 @@
import com.orientechnologies.orient.core.tx.OTransactionAbstract;
import com.orientechnologies.orient.core.tx.OTransactionNoTx;
import com.orientechnologies.orient.core.tx.OTransactionOptimistic;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

/**
Expand All @@ -86,7 +130,6 @@ public abstract class ODatabaseDocumentAbstract extends OListenerManger<ODatabas
protected ORecordSerializer serializer;
protected String url;
protected STATUS status;
protected OIntent currentIntent;
protected ODatabaseInternal<?> databaseOwner;
protected OMetadataDefault metadata;
protected OImmutableUser user;
Expand Down Expand Up @@ -543,30 +586,6 @@ public OContextConfiguration getConfiguration() {
return null;
}

@Override
public boolean declareIntent(final OIntent intent) {
checkIfActive();
if (currentIntent != null) {
if (intent != null && intent.getClass().equals(currentIntent.getClass())) {
// SAME INTENT: JUMP IT
return false;
}
// END CURRENT INTENT
currentIntent.end(this);
}
currentIntent = intent;

if (intent != null) {
intent.begin(this);
}
return true;
}

@Override
public OIntent getActiveIntent() {
return currentIntent;
}

@Override
public void close() {
internalClose(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1978,11 +1978,6 @@ public void internalClose(boolean recycle) {

callOnCloseListeners();

if (currentIntent != null) {
currentIntent.end(this);
currentIntent = null;
}

status = STATUS.CLOSED;
if (!recycle) {
sharedContext = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@
import com.orientechnologies.orient.core.config.OContextConfiguration;
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.orientechnologies.orient.core.conflict.ORecordConflictStrategy;
import com.orientechnologies.orient.core.db.*;
import com.orientechnologies.orient.core.db.ODatabase;
import com.orientechnologies.orient.core.db.ODatabaseDocumentInternal;
import com.orientechnologies.orient.core.db.ODatabaseInternal;
import com.orientechnologies.orient.core.db.ODatabaseListener;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.db.ODatabaseType;
import com.orientechnologies.orient.core.db.OLiveQueryMonitor;
import com.orientechnologies.orient.core.db.OLiveQueryResultListener;
import com.orientechnologies.orient.core.db.OSharedContext;
import com.orientechnologies.orient.core.db.OrientDB;
import com.orientechnologies.orient.core.db.OrientDBConfig;
import com.orientechnologies.orient.core.db.OrientDBConfigBuilder;
import com.orientechnologies.orient.core.db.OrientDBInternal;
import com.orientechnologies.orient.core.db.record.OCurrentStorageComponentsFactory;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.dictionary.ODictionary;
Expand All @@ -22,7 +34,6 @@
import com.orientechnologies.orient.core.hook.ORecordHook;
import com.orientechnologies.orient.core.id.ORID;
import com.orientechnologies.orient.core.id.ORecordId;
import com.orientechnologies.orient.core.intent.OIntent;
import com.orientechnologies.orient.core.iterator.ORecordIteratorClass;
import com.orientechnologies.orient.core.iterator.ORecordIteratorCluster;
import com.orientechnologies.orient.core.metadata.OMetadataInternal;
Expand Down Expand Up @@ -60,9 +71,20 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.*;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.*;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
Expand All @@ -88,7 +110,6 @@ public class ODatabaseDocumentTx implements ODatabaseDocumentInternal {
// TODO review for the case of browseListener before open.
private final Set<ODatabaseListener> preopenListener = new HashSet<>();
private ODatabaseInternal<?> databaseOwner;
private OIntent intent;
private OStorage delegateStorage;
private ORecordConflictStrategy conflictStrategy;
private ORecordSerializer serializer;
Expand Down Expand Up @@ -1082,24 +1103,6 @@ public OContextConfiguration getConfiguration() {
return internal.getConfiguration();
}

@Override
public boolean declareIntent(OIntent iIntent) {
if (internal != null) {
return internal.declareIntent(iIntent);
} else {
intent = iIntent;
return true;
}
}

@Override
public OIntent getActiveIntent() {
if (internal == null) {
return intent;
}
return internal.getActiveIntent();
}

@Override
public boolean exists() {
if (internal != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ private long exportRecords() throws IOException {
}

public void close() {
database.declareIntent(null);

if (writer == null) return;

Expand Down

This file was deleted.

Loading

0 comments on commit 977c567

Please sign in to comment.