15
15
*/
16
16
package com .orientechnologies .orient .core .index ;
17
17
18
+ import java .io .IOException ;
19
+ import java .lang .reflect .InvocationTargetException ;
20
+ import java .util .Collection ;
21
+ import java .util .Collections ;
22
+ import java .util .HashMap ;
23
+ import java .util .HashSet ;
24
+ import java .util .List ;
25
+ import java .util .Locale ;
26
+ import java .util .Map ;
27
+ import java .util .NoSuchElementException ;
28
+ import java .util .Set ;
29
+
18
30
import com .orientechnologies .common .concur .lock .OModificationLock ;
19
31
import com .orientechnologies .common .concur .resource .OSharedResourceAdaptiveExternal ;
20
32
import com .orientechnologies .common .listener .OProgressListener ;
45
57
import com .orientechnologies .orient .core .storage .impl .local .OStorageLocal ;
46
58
import com .orientechnologies .orient .core .tx .OTransactionIndexChanges .OPERATION ;
47
59
48
- import java .io .IOException ;
49
- import java .lang .reflect .InvocationTargetException ;
50
- import java .util .Collection ;
51
- import java .util .Collections ;
52
- import java .util .HashMap ;
53
- import java .util .HashSet ;
54
- import java .util .List ;
55
- import java .util .Locale ;
56
- import java .util .Map ;
57
- import java .util .NoSuchElementException ;
58
- import java .util .Set ;
59
-
60
60
/**
61
61
* Handles indexing when records change.
62
62
*
@@ -447,9 +447,11 @@ public long rebuild(final OProgressListener iProgressListener) {
447
447
return documentIndexed ;
448
448
}
449
449
450
- public boolean remove (final Object key , final OIdentifiable value ) {
450
+ public boolean remove (Object key , final OIdentifiable value ) {
451
451
checkForRebuild ();
452
452
453
+ key = getCollatingValue (key );
454
+
453
455
modificationLock .requestModificationLock ();
454
456
try {
455
457
return remove (key );
@@ -459,9 +461,11 @@ public boolean remove(final Object key, final OIdentifiable value) {
459
461
460
462
}
461
463
462
- public boolean remove (final Object key ) {
464
+ public boolean remove (Object key ) {
463
465
checkForRebuild ();
464
466
467
+ key = getCollatingValue (key );
468
+
465
469
modificationLock .requestModificationLock ();
466
470
467
471
try {
@@ -890,6 +894,7 @@ protected Object getCollatingValue(final Object key) {
890
894
protected abstract void removeFromSnapshot (Object key , OIdentifiable value , Map <Object , Object > snapshot );
891
895
892
896
protected void removeFromSnapshot (Object key , Map <Object , Object > snapshot ) {
897
+ key = getCollatingValue (key );
893
898
snapshot .put (key , RemovedValue .INSTANCE );
894
899
}
895
900
0 commit comments