During invokeAll() execution coherence calls both applyIndex and evaluateEntry methods

There is an an odd behaviour of invokeAll(Filter filter,...) method, because both applyIndex() and evaluateEntry() (for retained entries) are called during invocation.
I don't understand why coherence calls evaluateEntry() method when a set is already filtered by using indices, since it is redundant operation which could decrease performance.
Also such behaviour causes problems with InKeySetFilter, because the underlying set contains binary keys, but evaluateEntry() receives "plain" entry and returns false:
cache.invokeAll(new InKeySetFilter(AlwaysFilter.INSTANCE, cache.keySet()), new ExtractorProcessor(new IdentityExtractor()));
//returns no items
alertCache.keySet(new InKeySetFilter(AlwaysFilter.INSTANCE, alertCache.keySet()));
//but this call returns all items
Can someone explain such behaviour and advice any solution or workaround?
PS Coherence 3.5.3
Edited by: Serge Vinogradov on 23-Aug-2010 08:43
Edited by: Serge Vinogradov on 23-Aug-2010 08:45

Serge Vinogradov wrote:
Robert,
both this methods were actually called during invokeAll execution (checked it with debugger) and applyIndex returned null.
But I've found another calls of evaluateEntry at DistributedCache.onInvokeFilterRequest. Let me quote an extract from it:
public void onInvokeFilterRequest(InvokeFilterRequest msgRequest)
Object aEntry[] = null;
aEntry = storage.query(filter, Storage.QUERY_INVOKE, partMask);
...//iterate entris
Storage.BinaryEntry entry = (Storage.BinaryEntry)aEntry[iR];
if((filter != null) ? InvocableMapHelper.evaluateEntry(filter, entry) : true)
entry.ensureWriteable();
} else
unlockKey(storage, binKey, false);
aEntry[iR] = null;
cEntries--;
continue;
...//then process not null entries
As you can see InvocableMapHelper.evaluateEntry uses original filter, but not the filter returned after appliyng index. As I understand it is done for correct dealing with locking and to ensure that entry is still complied with filter.
We have overridden InKeySetFilter class as a workaround:
public class FixedInKeySetFilter extends InKeySetFilter {
private transient boolean isFiltered = false;
public FixedInKeySetFilter() {
super();
public FixedInKeySetFilter(Filter filter, Set set) {
super(filter, set);
public Filter applyIndex(Map mapIndexes, Set setKeys)
Filter resFilter = super.applyIndex(mapIndexes, setKeys);
isFiltered = (resFilter == null);
return resFilter;
@Override
public boolean evaluateEntry(Map.Entry entry) {
return isFiltered || super.evaluateEntry(entry);
Edited by: Serge Vinogradov on 24-Aug-2010 08:33Hi Serge,
you are right... I did not expect the code to intentionally lose the returned filter reference, but that clearly seems to be the case here...
On the other hand, your evaluateEntry implementation does not seem to be correct as it does not delegate to a non-index-aware delegate filter...
The following implementation should probably fix all problems listed so far:
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import com.tangosol.util.Converter;
import com.tangosol.util.Filter;
import com.tangosol.util.InvocableMapHelper;
import com.tangosol.util.filter.InKeySetFilter;
import com.tangosol.util.filter.IndexAwareFilter;
public class FixedInKeySetFilter extends InKeySetFilter {
     private transient boolean isConverted;
     private transient boolean filtered;
     public FixedInKeySetFilter() {
     public FixedInKeySetFilter(Filter filter, Set setKeys) {
          super(filter, setKeys);
     @Override
     public synchronized void ensureConverted(Converter keyToInternalConverter) {
          super.ensureConverted(keyToInternalConverter);
          this.isConverted = true;
     @Override
     public Filter applyIndex(Map mapIndexes, Set setKeys) {
          if (setKeys.isEmpty()) {
               return null;
          if (!isConverted) {
               Converter converter = getKeyToInternalConverterOurself();
               if (converter != null) {
                    ensureConverted(converter);
               } else {
                    return this;
          Filter filter = getFilter();
          Filter res = super.applyIndex(mapIndexes, setKeys);
          res = setKeys.isEmpty() ? null : filter instanceof IndexAwareFilter ? res : filter;
          filtered = res == null;
          return res;
     @Override
     public boolean evaluateEntry(Entry entry) {
          if (filtered) {
               return true;
          Filter filter = getFilter();
          if (isConverted) {
               // apply index is surely invoked this case, so need not consult local setKeys...
               return InvocableMapHelper.evaluateEntry(filter, entry);
          } else {
               return super.evaluateEntry(entry);
      * Override this method if we can acquire the key-to-internal converter, e.g.
      * if we acquired it from the backing map manager context using the service name.
      * @return the key to internal converter of the cache service of the cache we are querying.
     protected Converter getKeyToInternalConverterOurself() {
          return null;
}Best regards,
Robert
Edited by: robvarga on Aug 24, 2010 11:35 PM

Similar Messages

  • Microphone not working on my iphone 4s  unless i'm on speaker or using headphones during calls both incoming and outgoing?

    During calls incoming and outgoing I can hear the other person but they cannot hear me unless I am on speaker phone or am using headphones?

    Basic troubleshooting steps clearly outlined in the User Guide are restart, resest, restore from backup, restore as new.
    If you still have problems after going through ALL the recommended troubleshooting steps, then you likely have a hardware issue.  You'll need to bring your phone into Apple for evaluation.

  • Calling both invalidateDisplayList() and validateNow()

    I'm doing a code review of a code base, and I see the following method calls one after the other:
    myWindow.invalidateDisplayList();
    myWindow.validateNow();
    Is the call to validateNow() unnecessary, or is it there to force an immediate update, and thus it is acceptable to have both these calls one after the other?

    If the window is not otherwise invalidated, then validateNow will not do
    anything.
    If the window is invalidated, then validateNow will force an immediate
    update.
    That code looks like it will, at minimum, force a call to
    updateDisplayList().

  • Can't get login script to work - tried both prefs and tty methods ...

    Calling all you script gurus ...
    I'm trying to auto-mount a sparse image on login (why? I got my 17" stolen along with the data - i'm using an encrypted image as my document repository now).
    I can't get this simple script to run using either method (modifying the LoginWindow plist OR the apple suggested method of adding the section into the /etc/ttys file.
    I've tested the script file from the terminal and all works fine.
    Any ideas?
    Thanks
    Paul
    MBP 2.1GHz, iBook 12" 1GHz, G3 PowerMac   Mac OS X (10.4.6)   Stolen Powerbook 17" S# W8505160RJ3 - reward offered

    I personally haven't had much success with the '/etc/ttys' method for specifying login hooks either...
    On the other hand, the ".plist" method has worked well for me in the past. Just in case you weren't aware, note that the the file for specifying a "login hook" via ".plist" file has changed in "Tiger" compared to "Panther". It was never the "loginwindow.plist", which is used for specifying "Login Items", but rather the "com.apple.loginwindow.plist" file, but unlike "Panther" which used "/Library/Preferences/com.apple.loginwindow.plist" (a security issue for which Apple was rightly criticized), in "Tiger" Apple wisely changed the location to a more secure directory, ie. "/private/var/root/Library/Preferences/com.apple.loginwindow.plist". The current procedures for specifying "login hooks" via ".plist" file can be found in this document:
    http://docs.info.apple.com/article.html?artnum=301446
    But as far as mounting a disk image is concerned, adding the mounted volume (rather than a script to mount the disk image) to "Login Items" should be sufficient to initiate the mounting process...

  • Regarding Call Transaction and Session Method in BDC.

    Hi,
    If there are 50 records and 25th row data is having error.
    What will happen when we run it in Call Transaction and Session Method in both Foreground and Background methods ? Can anybody explain me in details ?

    Hi Naresh,
    If you are using call transaction,
    if executed in Foreground, 24 records will be posted and for 25th you will have option to correct data or skip.
    if executed in background,
    if mode is N,  24 records are processed 25th is skipped and 26th onwards is processed again.
    if mode is E, 24 records will be posted and for 25th you will have option to correct data or skip.
    For Session also it should be same the difference is that the error would be there in sessionlog and you can re-process it.
    Hope it helps.
    Regards,
    Komal.

  • Regarding CT and Session Method in BDC ?

    Hi,
    If there are 50 records and 25th row data is having error.
    What will happen when we run it in Call Transaction and Session Method in both Foreground and Background methods ? Can anybody explain me in details ?

    Session method : the posting for the specific record will end in error, all other records will be processed.
    In foreground mode: you can correct the error manually.
    Once a session is processed, you can restart it in foreground to process the error ones...
    Call transaction:
    it depends on your program logic.
    Normally, your program will continue with the next record, unless you insert an error message in your program.
    e.g. call transaction....
    if sy-subrc ne 0.
    message e...
    endif.

  • Mics don't work during regular OR speakerphone calls, but work for apps and everything else!?

    This is really perplexing to me, and the first time I have experienced something like this that I can't figure out.
    I have a iphone 4 that I recently bought used, is out of warranty, have no recourse with the seller of the phone, and I have run into an issue with the mics.
    Before I changed the screen, the guy I bought it from said he had an issue with both mics not working as well. Well, after changing the screen and getting it all back together, I "reset and erased all data", and everything seemed to work fine....then after a day or two, they stopped working again.
    Long story short, I have since tried fresh installs of ios7.0.3, "erasing and resetting" many times, and even put headphones in and out of jack, AND changed the audio jack/volume flex TWICE, but to no avail...no matter what, I get the same thing:
    Bottom mic:
    1. Voice Memo always works
    2. Voice Control does pick up my voice, but seems to hear the wrong commands
    3. Mic does NOT work during regular calls
    4. Mic DOES work for calls with Viber
    Top Mic:
    1. Facetime works every time
    2. Video Record works every time
    3 Mic does NOT work during regular speakerphone calls
    4. Mic DOES work during VIBER speakerphone calls, EVERY TIME.
    a couple while testing speakerphone and regular calls, I blew and sucked air in and out of the top mic while in a speakerphone call, and it would "break through" on the other end for a second or two, occasionally....so now I'm thinking maybe both mics are just messed up, and I should replace them?
    This is frustrating the !@#$ out of me, and I really hope someone can shed some light onto this deal.....Thanks in advance for any help with this one!

    This is really perplexing to me, and the first time I have experienced something like this that I can't figure out.
    I have a iphone 4 that I recently bought used, is out of warranty, have no recourse with the seller of the phone, and I have run into an issue with the mics.
    Before I changed the screen, the guy I bought it from said he had an issue with both mics not working as well. Well, after changing the screen and getting it all back together, I "reset and erased all data", and everything seemed to work fine....then after a day or two, they stopped working again.
    Long story short, I have since tried fresh installs of ios7.0.3, "erasing and resetting" many times, and even put headphones in and out of jack, AND changed the audio jack/volume flex TWICE, but to no avail...no matter what, I get the same thing:
    Bottom mic:
    1. Voice Memo always works
    2. Voice Control does pick up my voice, but seems to hear the wrong commands
    3. Mic does NOT work during regular calls
    4. Mic DOES work for calls with Viber
    Top Mic:
    1. Facetime works every time
    2. Video Record works every time
    3 Mic does NOT work during regular speakerphone calls
    4. Mic DOES work during VIBER speakerphone calls, EVERY TIME.
    a couple while testing speakerphone and regular calls, I blew and sucked air in and out of the top mic while in a speakerphone call, and it would "break through" on the other end for a second or two, occasionally....so now I'm thinking maybe both mics are just messed up, and I should replace them?
    This is frustrating the !@#$ out of me, and I really hope someone can shed some light onto this deal.....Thanks in advance for any help with this one!

  • IPhone 5s incoming call rings on both headsets and speaker while headsets plugged in

    Why my iphone 5s rings on both speaker and headsets in incoming call, while the headsets plugged in the phone? 

    Hi Lucasethio,
    That is expected behavior on a non-muted iPhone. If you mute/silence the ringer with the side switch, you should still hear the ringer through any plugged in headsets as well. You may also find the following article helpful:
    iOS: Understanding sounds, ringtones, and alerts
    http://support.apple.com/kb/HT5800
    Regards,
    - Brenden

  • I recently purchase an ipad2.  I also have a mac laptop.  Now, when I facetime call using my iphone to my ipad2 or mac, it states busy.  how can i fix this problem?  I have the same apple id e mail for both ipad2 and mac.  it might be getting confuse now.

    I recently purchase an ipad2.  I also have a mac laptop.  Now, when I facetime call using my iphone to my ipad2 or mac, it states busy.  how can i fix this problem?  I have the same apple id e mail for both ipad2 and mac.  it might be getting confuse now.  I want to be able to face time also using my ipad2 to my laptop especially if one of the members of the family is traveling.  Thanks.

    thanks.  your answer was correct, clearer.  I have another question, maybe you can answer.  I just purchase my ipad2 2 days ago.  yesterday, there was a sound.  today there is no sound.  there is a sound only in movies and you tube and music.  but no sound on all apps and keyboards.  I look it up and seems like ther are few that have this problem.  I called walmart coz I bought it there and they told me that they have not heard that before but if I can't fix it, just return it and exchange it with anew one since I have 14 days to do that.  I tried rebooting it and still won't work.  Should I just restore it?

  • Iam using iphone 4s and Iphone 5s with same apple ID but my network is different and whenever Iam getting call in i5s and in my both handset same calls are coming. Please provide me solutions

    Iam using iphone 4s and Iphone 5s with same apple ID but my network is different and whenever Iam getting call in i5s and in my both handset same calls are coming. Please provide me solutions

    On both devices, go to Settings>Facetime and turn off cellular calls.
    ~Lyssa

  • On my ipad mini, when I delete an email from the inbox (and it goes into Trash), it immediately deletes that email from the server (ATT/Yahoo).  I've called support for both ATT and Apple and can't find a way to have the emails remain on the server.

    On my iPad Mini, when I delete an email from the inbox (and it goes into Trash), it immediately deletes that email from the server (ATT/Yahoo).  I've called support for both ATT and Apple and can't find a way to have the emails remain on the server. 
    My husband and I share an email address and if he misses a day checking email on his notebook, he doesn't receive the items that I have sent to Trash on my iPad Mini.
    Appreciate suggestions.
    [The curious thing is, if I "move" the deleted emails from Trash on my iPad Mini into the Inbox, I can go to my notebook, open my online email and they are back in my ATT/Yahoo Inbox.]

    Is your Yahoo account set up as POP3 or IMAP?

  • When I start firefox, i get this message ( The instruction at "0x7b9c77a9" referenced memory at "0x7b9c77a9". The memory could not be "read" ) hs anyone any idea why? I have scanned with AVG and something simply called 'Trojan Remover' and they both fin

    when I start firefox, i get this message ( The instruction at "0x7b9c77a9" referenced memory at "0x7b9c77a9". The memory could not be "read" ) hs anyone any idea why? I have scanned with AVG and something simply called 'Trojan Remover' and they both find nothing.... any advice would be greatly welcomed.. thanks
    == This happened ==
    Every time Firefox opened
    == this morning 22/07/10

    Lyall,
    I have seen this before, a long time ago (several years), and I cannot
    remember how/if we resolved it.
    If this is an impotant issue to you, I suggest that you open a case with
    BEA support.
    Regards,
    Peter.
    Got a Question? Ask BEA at http://askbea.bea.com
    The views expressed in this posting are solely those of the author, and BEA
    Systems, Inc. does not endorse any of these views.
    BEA Systems, Inc. is not responsible for the accuracy or completeness of
    the
    information provided
    and assumes no duty to correct, expand upon, delete or update any of the
    information contained in this posting.
    Lyall Pearce wrote:
    The title says it all really.
    I see other posts getting replies.
    This is a rather important issue, I have seen another post with a similar problem.
    While not being a show-stopper it certainly raises concerns.
    The application works ok until the application exits (in both development and
    executable form)
    Apparently this did not happen with Tux 7.1
    It does with 8, I do not have 7.1 so I have no workaround.
    ..Lyall

  • I'm new to Mac and the program/all called Numbers. I'm trying to use both Average and small in the same formula. What's I'm trying to do is take 20 cells, find the 10 lowest numbers, then get the average and after that multiply it by .96

    I'm new to Mac and the program/all called Numbers. I'm trying to use both Average and small in the same formula. What's I'm trying to do is take 20 cells in a column,  find the 10 lowest numbers, then get the average and after that multiply it by .96  I used to use Excel and the formula worked fine in that. Here is my Formula
    =(average(small(H201:H220,{1,2,3,4,5,6,7,8,9,10})))*.96
    This formula worked in Excel and when I converted my spreadsheet over to Numbers, this formula no longer works.
    The best that I have been able to do so far is use small in 10 different cells, then get the average of the 10 cells and finally multiply that average by .96  So instead of using 1 cell, I'm using 12 cells to get my answer.
    This is a formula that I will be using all the time. The next cell would be =(average(small(H202:H221,{1,2,3,4,5,6,7,8,9,10})))*.96
    Hoping I explain myself well enough and that someone can help me.
    Thanks

    You can still do it in one cell but it will be more unruly than the Excel array formula.
    =average(small(H201:H220,1),small(H201:H220,2),small(H201:H220,3),...,small(H201:H220,10))*0.96
    where you would, of course, replace the "..." with the remaining six SMALL functions.

  • N unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    some one can help me please
    i have no idea what i must to do.
    an unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    The Exception Handler gave all the info that you need. No need to print the whole stack trace.
    The exception handler says
    Exception Details: java.lang.IllegalArgumentException
    TABLE1.NAME
    Look in the session bean (assuming that is where your underlying rowset is). Look in the _init() method for statements similar to the following:
    personRowSet.setCommand("SELECT * FROM TRAVEL.PERSON");
    personRowSet.setTableName("PERSON");
    What do you have?

  • I purchased and successfully downloaded Caravan Palace - Caravan Palace and Panic. Both albums skip and cutout during playback. Q: what's happening and why?

    I purchased and successfully downloaded Caravan Palace - Caravan Palace and Panic. Both albums skip and cutout during playback. Q: what's happening and why?

    Sounds like a corrupt download.
    From iPad:
    Delete the albums: swipe you finger across and tap delete
    Make sure you have a good internet connection & re-download: Open iTunes app > More > Purchased
    From computer:
    Delete the albums: Select > right-click > delete
    Go to iTunes Store > Purchased (in Quick Links on the right)

Maybe you are looking for