Fastest way to removeAll

I need to remove quite a few entries from a cache that match a certain criteria. There is cache.putAll(Map) for en-masse cache loading, but there is no equivalent cache.removeAll(Set keys).
What is the fastest way to achieve this? I am thinking this:
        Filter f = new EqualsFilter(...)
         cache.invokeAll(f, new InvocableMap.EntryProcessor(){
               public Object process(Entry entry) {
                    entry.remove(false);
                    return null;
               public Map processAll(Set setEntries) {
                    Iterator iter = setEntries.iterator()
                    while(iter.hasNext()){
                         Entry entry = (Entry) iter.next();
                               entry.remove(false);
                                return null;
         });Is there a faster way?
Thanks
Ghanshyam

Hi Ghanshyam,
for non-transactional replicated caches, you can simply use the
cache.keySet().removeAll(keys)
for non-transactional partitioned caches, you can use either the same (provided you use a recent version, in older versions it had some performance impact).
Since 3.1 you can also use the following:
cache.invokeAll(keys, new ConditionalRemove(AlwaysFilter.INSTANCE));
For transactional caches you should not call the keySet().
For transactional caches, depending on the isolation level, you can iterate them and remove them individually (for GET_COMMITTED or EXTERNAL).
For optimistic transactional caches with a transaction validator registered and having REPEATABLE_GET or SERIALIZABLE isolation level, before the iteration and removal you should also get all entries for the keys with transactionMap.getAll(keys), so they are enlisted to the transaction validator with a bulk read, and not with individual reads upon remove.
This advices might not be the most optimal, but I believe, they are more or less so.
Best regards,
Robert

Similar Messages

  • How to print the table values in fastest way?

    Dear Friends,
    I'm having table in my application and i need to print the table values. For that I used print() method to print the table values.
    boolean complete = tableObj.print(mode, header, footer, showPrintDialog, null, interactive,
                                  null);But, the time taken for displaying print dialouge box so late and printing operation is done very slowly.
    Could anyone please tell me is there any better way and fastest way to print the table values?
    Thanks in advance

    Hi,
    In the Module pool you will have fields. For those fields you have created the name also. Assign those name to work area and from there to internal table.
    And for your requirement viceversa you need to done.
    With Regards,
    Sumodh.P

  • What is the fastest way of getting data?

    With a scanning electron microscope, I need to scan a 512*512 pixel area with a pixel repetition of 15000 (two channels), meaning averaging over 15000 measurements. Simultaneously I have to adjust the voltage output for every pixel.
    I am using a 6111E Multifunction I/O board in a 800MHz P3. The whole task has do be done as fast as possible (not more than 20 minutes altogether).
    What is the fastest way to get this huge amount of data with averaging and output in between? (E.g. do I use buffered read with hardware triggering or is there a faster way?)

    Using the NI-DAQ API (not LabView) will give you a significant amount of more control over what happens and when to the data stream; which translates to a more efficient program. But you need to program in C/C++ or Delphi then. The Measurement Studio provides ActiveX controls that are like the LabView ones for C&C++ (they�re slow like the LabView ones though � not a lot you can do about the Windows GDI).
    What are you trying to sample 15000 times? The 512*512 pixel field?
    That�s almost 15Gigs of data! And it means you need to process data at 12.8MB/s to finish it in 20 minutes. I hope you know C, x86 assembly and MMX.
    I would setup a huge circular buffer (NI-DAQ calls them �double buffers�), about 30 seconds worth or so, to use with SCAN_Start. Then I would proces
    s the actual buffer the card is DMA�ing the data into with a high priority thread. Progressively sum the scan values from the 16bit buffer (the samples are only 12 bit, but the buffer should still be 16bits wide) into a secondary buffer of DWORDs the size of the screen (512*512), and you�ll need two of those, one for each channel. Once the 15000 scans are complete, convert each entry into a float divide by 15000.0f, and store it in a third buffer of floats.
    If you wish to contract this out, send me an email at [email protected]

  • Fastest way to transfer information from my old MacBook Pro to a new one?

    What is fastest way to transfer data between MacBook pros? It takes forever on wi-if.

    Sometimes the fastest way would be just to transfer only your files via a external hard drive via drag and drop methods into the same named accounts on the new machine. This is especially useful if you want to avoid corruption of the old machine and have a chance to clean house of older files.
    By the time one fiddles around finding a Firewire cable and adpaters, a standard USB 3 external hard drive could be done already and be gotten at any local computer or office store.
    Also Retina's have SSD's and any data on them is not scrubbable like hard drives can be. Scrubbing SSD's would involve the entire drive being filled and this would wear them out prematurely as they have limited writes to each sector.
    If you want to use Migration or Setup Assistant, there is some element of risk involved because your copying the corruption over from the previous machine if it exists. If you know the previous software is fine on the older machine, then you can use Carbon Copy Cloner to clone the whole OS X boot parititon to the external USB drive, then hook this up to the new machine and run Migration/Setup Assistant against it, just like you would in Firewire Target Disk Mode if you don't want to wait to get a Thunderbolt to Firewire adpater from Apple.
    If you already have the Thunderbolt to Firewire adapter and a cable/adpater to the old Mac, then that's the fastest way.

  • Fastest way to load a BufferedImage on a JPanel

    I am looking for the fastest way to display a BufferedImage on a JPanel.
    I am using JAI to take in photo files (JPG, BMP, GIF, TIFF, PNG) and create thumbnails (BufferedImage).
    I was reading through the forums and saw you can either
    1)overwrite the Graphics method or
    2)imageicon->JLabel->JPanel
    Currently, I am doing number 2, but I was wondering what the best way truly is.

    as you arn't doing any animation or that kind of thing, using Swing Components will work just fine.

  • Fastest way to create child class from parent?

    As the subject states, what do you folks find is fastest when creating child classes directly from the parent? (esp. when the parent is in a lvlib) I thought I'd post up and ask because the fastest way I've found to get working takes a few steps.
    Any suggestions ae appreciatized!
    -pat

    Thanks for the quick response Ben!
    Yea, I apologize, in your response I realize my OP was more than vague haha (it hapens when you get used to your own way of doing things I guess huh)- I'm trying to create a child from a parent so that it has all of the methods that the parent has.
    In order to do so I currently have to open and close LV a few times during my current process so that vi's in memory dont get mixed up- Currently I save a copy of the parent class in a sub dir of where it is saved, close out of LV, open the new 'copy of parent.lvclass', save as>>rename 'child class.lvclass', close LV, and open up the project to 'add file', then right click>>properties>>inheritance.
    Is this the only way to do this?
    Thanks again!
    -pat
    p.s. I'm tempted to steal your cell phone sig, hope you dont mind haha good stuff!

  • Fastest Way To Create Ultrabeat Instrument From Wav Loop?

    Hello, can anyone share the fastest way to create and instrument from a WAV file?
    I know you can convert a wav to ESX24 instrument but I use Ultrabeat not ESX.
    Im finding my self divinding each shot into region and then exporting that to its own file.
    Is there a faster/simpler way?
    -Thanks

    You're right! It does work, however, if you follow these steps:
    1. Right-click on wave file in Arrange and choose "Slice at Transient Markers" or use the corresponding key command.
    2. Select all the split regions right-click on them and choose: Convert > Convert to new audio file(s)
    3. Again, with all the regions selected choose: Convert to new sampler track.
    4. Now launch Ultrabeat. Click on the Import button anc choose the .exs file you've just created (will be located in your project folder). Then drag the audio files into UB as desired.
    You could skip Part 3 altogether and simply slice at transients, convert to new audio file(s) and then in a new kit of UB drag them into the sample window of OSC for each part...

  • Fastest way to create subtitles

    Hi! What is the fastest way to create subtitles. I have a short film with one hundred subtitles. I have a text list with time codes, can I use that somehow? Or do I have to enter every subtile separately? And what are the basic settings?

    A possibility seems to be using Quicktime Pro to add your text to a Quicktime movie. The Apple instructions are in Text Track Tutorial. I never used it in real life,... but I tested it in the past and it seemed to be doing what I expected: to layout text over an existing movie at preassigned timecodes...
    For sure you must first adapt your text and timecodes to the required format, and most of all you must have the "original" timecode in your movie untouched (all timecodes your text is making reference to). But if you edited and exported your movie from FCE you lost the original timecodes... so I'm not sure this may help you.
    The other approach is manual: in FCE add a text clip at the correct timecodes, one at the time...
    Piero

  • Fastest way to create buttons from TOC entries?

    I am trying to make a TOC interactive by applying rollovers and links to each entry. What is the fastest way to create buttons out of each entry? Would the "create outlines" command be appropriate? As it stands now, I am copying an entry, pasting it into a new frame, aligning it over the original entry, then converting to button and applying behaviors. There's got to be a more efficient way to do this!
    Using CS3 Design Standard.
    Thanks for any help you can provide.

    Matt,
    function(){return A.apply(null,[this].concat($A(arguments)))}
    Sorry about the attachment. Not sure what happened
    See
    Announcement: File Attachments temporarily disabled
    above. The "temporarily" was an understatement at the time -- this has been in effect for, what? the past 2 years? Now it's just a poignant Daily Reminder of Jive's many shortcomings.

  • Fastest way to create a track of Whole notes beginning to end

    I am trying to create a tapper track consisting of a series or low G (G2) whole notes.
    What is the fastest way of doing this. (they really should be quantized) And, they should also be on beat-one only, throughout an occasional meter change.
    In logic you could drag blocks. I realize I could simply loop and then convert loop to real midi...
    But.. would this run amuck with meter changes. (Remember I just want notes beginning on beat one, and ONLY beat one.
    -Thanks

    Where you have sig changes, copy the region, and adjust it's length to fit the meter … you only need 1 region, rather than try to anticipate the myriad of time sigs that may crop up.
    I understand exactly what you mean, and it makes a lot of sense. I think it's strictly a question of the pattern of usage. If his style when writing is to frequently throw in some odd time sig that he hasn't used much before and is not likely to use again anytime soon, then what you say seems like the best approach. On the other hand, I'm assuming he's more in a situation where he tends to throw in, say, a measure of 2/4, 3/4 or 5/4 every now and then. And it's just a few sigs like that which he tends to use frequently. Therefore it might be slightly easier to have a few regions like that already prepared, and in a place where I can grab them easily. If I have them marked clearly by name and color, I can feel comfortable that I'm avoiding an error. Whereas if I'm creating them over and over again each time I need one, the snap settings and zoom level are relevant, and it's a little too easy to make a careless mistake, if the phone rings at the wrong time.
    Also, he sometimes wants whole notes, and sometimes quarter notes. And maybe there are some other variations like this. This would also be a reason to have some material prepared that I can use over and over again.
    But of course if one day I decide to emulate Stockhausen and throw in a bar in 142/8 time, it makes sense to create that only when I need it, because if I create that region in advance it probably won't get used much.
    So in practice I could picture him doing it a combination of both ways, because chances are certain sigs are used often and others are used rarely. I think it really depends on the writing style, and the pattern of how the unusual sigs are distributed. And also if he sees an advantage in the marking by color. That could be considered helpful, or it could be considered ugly and distracting.

  • Fastest way to create a group from list of recived emails

    I thought this would be as easy as drag and drop but no such luck.
    Here's the situation.  I had a class of 25 students email me from their mobile phones all using the same subject.  Now I'd like to create a mailing list / group so that I can easly contact all of them if need be.  I tried creating a new group and dragging all of the emails into it to no avail.  I also tried right clicking and checking the menus to see if there were any options which there weren't.
    Anyone have any suggestions?  I'd be open to using automator or something similar if it worked.
    Thanks,
    Greg

    I think the fastest way to do this is in Mail>Message>Add to Address Book, then in AB>File>New Smart Group>Card:>Was updated After... say yesterday, then select all those & make a new (not Smart) Group to drag them to so it won't change after that.
    Unless you could get them all to eMail with some other unique that AB can see as a Group field.

  • Fastest way to write out internal table to database table ?

    Hi friends,
    my question is, what is the fastest way to write about 1,5 mill. of rows from an internal table to a database table ?
    points will be awarded immediately,
    thanks for your help,
    clemens

    Hi Clemens,
    If you just want to write (INSERT) 1.5 million rows of an internal table into a database table, use:
    INSERT <table name> FROM TABLE <itab>.
    Transaction Log Size could be a problem, therefore writing in packages could help, but this depends on your row size, your database configuration and on the current changes to your database. May be it runs in one package, if the rows are small (few bytes) then one package will be the fastest but you'll not much faster than with reasonable packages (3-20 MBytes). On Oracle with rollback segments you will probably have no problems at 1.5 million rows.
    Best regards
    Ralph

  • There are over 4000 duplicates in my iTunes. What is the fastest way to delete them?

    There are over 4000 duplicates in my iTunes. What is the fastest way to delete them?

    Hello there, yandere69keita.
    The following Knowledge Base clarifies your concern about your My Photo Stream counting towards your iCloud storage:
    iCloud: My Photo Stream FAQ
    http://support.apple.com/kb/ht4486
    Does My Photo Stream use my iCloud storage?
    No. Photos uploaded to My Photo Stream do not count against your iCloud storage.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Fastest way for file modification?

    Hi there all,
    I am making a desktop swing application and i am abit confused, could you give some advice?
    What i want to learn is Which way is fastest way for;
    1. to read some data from file
    2.to read whole data from file
    3. to write data to file
    4.to modify data in file
    Way 1- Xml (sax, dom)
    way 2, file i/O
    Thanks.

    Which way is fastest way forWhy are people always obsessed with "fastest". We don't have enough information to even begin to answer this question. We have no idea about the amount of data that is involved, but from your basic description it sounds to me like a database would be overkill. It takes milliseconds to read a file.
    Based on your sample data, try starting with something simple, like using a Properties files.

  • Fastest way to read a 5MB textfile (200,000 lines)?

    My current code:
    String file = "";
    BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
    while(in.ready()) file = file.concat(in.readLine());Unfortunately it is awfully slow (starting with 2,000 lines per second but dropping to like 100 lines per second over time). What is the fastest way to load the content of that file in a string and out of curiosity, why are my lines per second dropping?
    Thank you for your help!

    tjacobs01 wrote:
    This is exactly what I've done - it's the fastest thing out there. One thing to comment on though: Using a BufferedInputStream is not necessary; BufferedInputStream only improves performance if you're doing inefficient reading (such as reading blocks by newlines). If you doubt what I'm saying set up a quick performance test bed and test it... I did this a while back which is why I know the truth :)I believe you. Thanks for the tip.
    In my case I needed the BIS because I only wanted to load the 40 MB audio file in 1 MB chunks at a time
    to process it and store it in my own representation.

Maybe you are looking for

  • I have a iMac G5.  I can no longer download my tv shows because my start up disk has no space..what do I do?

    I have tried deleting things off my iMac to create more space.  I still get the message that my recently order TV series cannot be downloaded because I have very little space left on my start up disk.  I need guidance as to how to create more space. 

  • Unable to install Weblogic server 64 bit 10.3.0

    I am trying to install Weblogic server 64 bit 10.3.0. Downloaded the generic net installer zip file of 64 bit. And installing using the jar file installer.jar by pre-installed 64 bit JDK version 1.6.0_22. During installation, while installing the fil

  • Smart View (Hyperion item in Excel is gone)

    Hello guys, I have the provider services running and 20 minutes ago there was still a smart view item in my ms excel menu bar. where is it gone? have I pressed some key combination to remove it? thanks.

  • Adoacorectl.sh time out when the computer is not connected to the network

    Hi, I successfully installed R12.1 on Oracle Linux 4.5 on my laptop. It worked perfectly when I connected the laptop to the network (router). However, if I disconnected the laptop from the network, I got all kinds of errors when running adstrtal.sh.

  • Make To Order in OPM

    I need documentation to MTO in OPM (what setup the item nedd?). I already setup of the make to order rules, create do Sales Order, execution concurrent Process Manufacturing Make to Order, but the batch not is created. Somebody have some documentatio