Skip to content

Commit

Permalink
refactor: removed additional legacy implementations
Browse files Browse the repository at this point in the history
tglman committed Dec 23, 2024
1 parent f974824 commit 2f78c09
Showing 9 changed files with 9 additions and 915 deletions.
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@
import com.orientechnologies.orient.core.serialization.serializer.record.ORecordSerializer;
import com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerNetworkV37Client;
import com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerStringAbstract;
import com.orientechnologies.orient.core.sql.query.OBasicLegacyResultSet;
import com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryProtocol;
import com.orientechnologies.orient.enterprise.channel.binary.OChannelDataInput;
import com.orientechnologies.orient.enterprise.channel.binary.OChannelDataOutput;
@@ -210,10 +209,7 @@ protected Object readSynchResult(
final int tot = network.readInt();
final Collection<OIdentifiable> coll;

coll =
type == 's'
? new HashSet<OIdentifiable>(tot)
: new OBasicLegacyResultSet<OIdentifiable>(tot);
coll = new HashSet<OIdentifiable>(tot);
for (int i = 0; i < tot; ++i) {
final OIdentifiable resultItem = OMessageHelper.readIdentifiable(network, serializer);
if (resultItem instanceof ORecord)
@@ -224,7 +220,7 @@ protected Object readSynchResult(
result = coll;
break;
case 'i':
coll = new OBasicLegacyResultSet<OIdentifiable>();
coll = new HashSet<OIdentifiable>();
byte status;
while ((status = network.readByte()) > 0) {
final OIdentifiable record = OMessageHelper.readIdentifiable(network, serializer);
Original file line number Diff line number Diff line change
@@ -734,21 +734,6 @@ else if (iObject.getClass().isArray()) {
return false;
}

public static int indexOf(final Object iObject, final Object iItem) {
if (iObject == null) return -1;

if (iObject instanceof List) return ((List) iObject).indexOf(iItem);
else if (iObject.getClass().isArray()) {
final int size = Array.getLength(iObject);
for (int i = 0; i < size; ++i) {
final Object item = Array.get(iObject, i);
if (item != null && item.equals(iItem)) return i;
}
}

return -1;
}

public static Object toSet(final Object o) {
if (o instanceof Set<?>) return o;
else if (o instanceof Collection<?>) return new HashSet<Object>((Collection<?>) o);

This file was deleted.

Original file line number Diff line number Diff line change
@@ -8,8 +8,12 @@
import com.orientechnologies.orient.core.sql.OCommandSQLParsingException;
import com.orientechnologies.orient.core.sql.executor.OResult;
import com.orientechnologies.orient.core.sql.executor.OResultInternal;
import com.orientechnologies.orient.core.sql.query.OLegacyResultSet;
import java.util.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

public class OProjection extends SimpleNode {
@@ -188,13 +192,6 @@ private void initExcludes(OCommandContext iContext) {
}
}

public OLegacyResultSet calculateExpand(OCommandContext iContext, OResult iRecord) {
if (!isExpand()) {
throw new IllegalStateException("This is not an expand projection:" + toString());
}
throw new UnsupportedOperationException("Implement expand in projection");
}

public boolean isExpand() {
return items != null && items.size() == 1 && items.get(0).isExpand();
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@
import com.orientechnologies.orient.core.metadata.schema.OSchema;
import com.orientechnologies.orient.core.sql.executor.OResult;
import com.orientechnologies.orient.core.sql.executor.OResultSet;
import com.orientechnologies.orient.core.sql.query.OLiveResultListener;
import com.orientechnologies.orient.core.storage.OStorage;
import java.util.ArrayList;
import java.util.List;
@@ -73,7 +72,7 @@ public void after() {
odb.close();
}

class MyLiveQueryListener implements OLiveResultListener, OLiveQueryResultListener {
class MyLiveQueryListener implements OLiveQueryResultListener {

public CountDownLatch latch;

@@ -84,18 +83,6 @@ public MyLiveQueryListener(CountDownLatch latch) {
public List<ORecordOperation> ops = new ArrayList<ORecordOperation>();
public List<OResult> created = new ArrayList<OResult>();

@Override
public void onLiveResult(int iLiveToken, ORecordOperation iOp) throws OException {
ops.add(iOp);
latch.countDown();
}

@Override
public void onError(int iLiveToken) {}

@Override
public void onUnsubscribe(int iLiveToken) {}

@Override
public void onCreate(ODatabaseDocument database, OResult data) {
created.add(data);

0 comments on commit 2f78c09

Please sign in to comment.