Skip to content

Commit

Permalink
Merge pull request #8559 from orientechnologies/revert-8432-diffUpdat…
Browse files Browse the repository at this point in the history
…eRedesignTracking

Revert "Diff update redesign tracking"
  • Loading branch information
tglman committed Sep 21, 2018
2 parents f5810cd + e33b25a commit 6cc7e54
Show file tree
Hide file tree
Showing 30 changed files with 533 additions and 5,361 deletions.
Expand Up @@ -45,8 +45,6 @@ public class ORecordOperation implements Comparable {
public ORecordCallback<Long> createdCallback = null;
public ORecordCallback<Integer> updatedCallback = null;

private Object resultData;

public ORecordOperation() {
}

Expand Down Expand Up @@ -84,10 +82,6 @@ public ORecord getRecord() {
return record != null ? record.getRecord() : null;
}

public OIdentifiable getRecordContainer() {
return record;
}

public ORID getRID() {
return record != null ? record.getIdentity() : null;
}
Expand Down Expand Up @@ -133,13 +127,4 @@ public byte getType() {
public int compareTo(Object o) {
return record.compareTo(((ORecordOperation) o).record);
}

public Object getResultData() {
return resultData;
}

public void setResultData(Object resultData) {
this.resultData = resultData;
}

}
Expand Up @@ -63,9 +63,9 @@
* </ul>
* <br>
* The representation is automatically converted to tree-based implementation when top threshold is reached. And backward to
* embedded one when size is decreased to bottom threshold. <br> The thresholds could be configured by {@link
* OGlobalConfiguration#RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD} and {@link OGlobalConfiguration#RID_BAG_SBTREEBONSAI_TO_EMBEDDED_THRESHOLD}.
* <br>
* embedded one when size is decreased to bottom threshold. <br>
* The thresholds could be configured by {@link OGlobalConfiguration#RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD} and
* {@link OGlobalConfiguration#RID_BAG_SBTREEBONSAI_TO_EMBEDDED_THRESHOLD}. <br>
* <br>
* This collection is used to efficiently manage relationships in graph model.<br>
* <br>
Expand Down Expand Up @@ -150,32 +150,14 @@ public void addAll(Collection<OIdentifiable> values) {
delegate.addAll(values);
}

@Override
public void add(OIdentifiable identifiable) {
delegate.add(identifiable);
}

@Override
public void remove(OIdentifiable identifiable) {
delegate.remove(identifiable);
}

/**
* for internal use only
*
* @param index
* @param newValue
*
* @return
*/
public boolean changeValue(int index, OIdentifiable newValue) {
if (isEmbedded()) {
return ((OEmbeddedRidBag) delegate).swap(index, newValue);
} else {
throw new UnsupportedOperationException("Operation not supported for SB Tree ridbags");
}
}

public boolean isEmpty() {
return delegate.isEmpty();
}
Expand Down Expand Up @@ -261,7 +243,7 @@ public int toStream(BytesContainer bytesContainer) throws OSerializationExceptio
delegate.serialize(stream, offset, oldUuid);
return pointer;
}

public void checkAndConvert() {
ODatabaseInternal database = ODatabaseRecordThreadLocal.instance().getIfDefined();
if (database != null && !database.getStorage().isRemote()) {
Expand Down Expand Up @@ -506,35 +488,4 @@ public NavigableMap<OIdentifiable, Change> getChanges() {
public void replace(OMultiValueChangeEvent<Object, Object> event, Object newValue) {
//not needed do nothing
}

@Override
public boolean equals(Object other) {
if (!(other instanceof ORidBag)) {
return false;
}

ORidBag otherRidbag = (ORidBag) other;
if (!delegate.getClass().equals(otherRidbag.delegate.getClass())) {
return false;
}

Iterator<OIdentifiable> firstIter = delegate.rawIterator();
Iterator<OIdentifiable> secondIter = otherRidbag.delegate.rawIterator();
while (firstIter.hasNext()) {
if (!secondIter.hasNext()) {
return false;
}

OIdentifiable firstElement = firstIter.next();
OIdentifiable secondElement = secondIter.next();
if (!Objects.equals(firstElement, secondElement)) {
return false;
}
}
if (secondIter.hasNext()) {
return false;
}

return true;
}
}
Expand Up @@ -61,16 +61,16 @@ public void setSize(int size) {
private static enum Tombstone {
TOMBSTONE
}

public Object[] getEntries() {
public Object[] getEntries(){
return entries;
}

private final class EntriesIterator implements Iterator<OIdentifiable>, OResettable, OSizeable {
private final boolean convertToRecord;
private int currentIndex = -1;
private int nextIndex = -1;
private boolean currentRemoved;
private int currentIndex = -1;
private int nextIndex = -1;
private boolean currentRemoved;

private EntriesIterator(boolean convertToRecord) {
reset();
Expand All @@ -93,8 +93,8 @@ public boolean hasNext() {
@Override
public OIdentifiable next() {
currentRemoved = false;

currentIndex = nextIndex;
currentIndex = nextIndex;
if (currentIndex == -1)
throw new NoSuchElementException();

Expand Down Expand Up @@ -148,22 +148,6 @@ public void remove() {
nextValue));
}

protected void swapValueOnCurrent(OIdentifiable newValue) {
if (currentRemoved)
throw new IllegalStateException("Current element has already been removed");

if (currentIndex == -1)
throw new IllegalStateException("Next method was not called for given iterator");

final OIdentifiable oldValue = (OIdentifiable) entries[currentIndex];
entries[currentIndex] = newValue;

contentWasChanged = true;

fireCollectionChangedEvent(
new OMultiValueChangeEvent<>(OMultiValueChangeEvent.OChangeType.UPDATE, oldValue, oldValue, newValue));
}

@Override
public void reset() {
currentIndex = -1;
Expand Down Expand Up @@ -284,28 +268,6 @@ public void remove(OIdentifiable identifiable) {
}
}

/**
* for internal use only
*
* @param index
* @param newValue
*
* @return
*/
public boolean swap(int index, OIdentifiable newValue) {
EntriesIterator iter = (EntriesIterator) rawIterator();
int currIndex = 0;
while (iter.hasNext()) {
iter.next();
if (index == currIndex) {
iter.swapValueOnCurrent(newValue);
return true;
}
currIndex++;
}
return false;
}

@Override
public boolean isEmpty() {
return size == 0;
Expand Down

This file was deleted.

0 comments on commit 6cc7e54

Please sign in to comment.