Getting All Entries from a cache

Hi Folks,
     Just a small interesting observation. In an attempt to get back all the data from my partitioned cache I tried the following approaches:
     //EntrySet
     NamedCache cache = NamedCache.getCache("MyCache");
     Iterator<Entry<MyKeyObj, MyObj>> iter = cache.entrySet().iterator();
     //iterator over objects and get values
     //KeySet & getAll
     NamedCache cache = NamedCache.getCache("MyCache");
     Map results = cache.getAll(cache.keySet());
     Iterator<Entry<MyKeyObj, MyObj>> iter = results.iterator();
     //iterate over objects and get values
     Retrieving ~47k objects from 4 nodes takes 21 seconds using the entryset approach and 10 seconds for the keyset/getal approach.
     does that sound right to you? That implies that the entryset iterator is lazy loaded using get(key) for each entry.
     Regards,
     Max

Hi Gene,
     I actually posted the question, because we are currently performance-tuning our application, and there are scenarios where (due to having a large amount of badly organized legacy code with the bottom layers ported to Coherence) there are lots of invocations getting all the entries from some caches, sometimes even hundreds of times during the processing of a HTTP request.
     In some cases (typically with caches having a low cache-size) we found, that the entrySet-AlwaysFilter solution was way faster than the keyset-getall solution, which was about as fast as the solution iterating over the cache (new HashMap(cache)).
     I just wanted to ask if there are some rules of thumb on how long is it efficient to use the AlwaysFilter on distributed caches, and where it starts to be better to use the keyset-getall approach (from a naive test-case keyset-getall seemed to be better upwards from a couple-of-thousand entries).
     Also, as we are considering to move some of the caches (static data mostly, with usually less than 1000 entries, sometimes even as few as a dozen entries in a named cache, and in very few cases as many as 40000 entries) to a replicated topology, that is why I asked about the effect of using replicated caches...
     I expect the entrySet-AlwaysFilter to be slower than the iterating solution, since it effectively does the same, and also has some additional filter evaluation to be done.
     The keySet-getall will be something similar to the iterating solution, I guess.
     What is to be known about the implementation of the values() method?
     Can it be worth using in some cases? Does it give us an instant snapshot in case of replicated caches? Is it faster than the entrySet(void) in case of replicated caches?
     Thanks and best regards,
     Robert

Similar Messages

  • Get all calendars from root

    Hi guys,
    I am developing an integration with EWS based on php. I am using a library I found https://github.com/jamesiarmes/php-ews
    In my case users have various calendars hanging from the root, I get access to the default calendar by this:
    $request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;
    $response = $ews->FindFolder($request);
    I also get access to shared calendars by this:
    $request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::PUBLIC_FOLDERS_ROOT;
    $response = $ews->FindFolder($request);
    But I am getting crazy to get all calendars hanging from the root. If I asked for all folders on the root I don't get those calendars. What service and params do I need to send to get all calendars from the root?
    Thanks!!

    If you make a FindFolder Request set the Traversal to Deep and use a restriction on the FolderClass to IPF.Appointment that should return all the Calendar folders in a mailbox eg
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="
    http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://sc
    hemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xml
    soap.org/soap/envelope/">
    <soap:Header>
    <t:RequestServerVersion Version="Exchange2013_SP1" />
    </soap:Header>
    <soap:Body>
    <m:FindFolder Traversal="Deep">
    <m:FolderShape>
    <t:BaseShape>AllProperties</t:BaseShape>
    </m:FolderShape>
    <m:IndexedPageFolderView MaxEntriesReturned="1000" Offset="0" BasePoint=
    "Beginning" />
    <m:Restriction>
    <t:IsEqualTo>
    <t:FieldURI FieldURI="folder:FolderClass" />
    <t:FieldURIOrConstant>
    <t:Constant Value="IPF.Appointment" />
    </t:FieldURIOrConstant>
    </t:IsEqualTo>
    </m:Restriction>
    <m:ParentFolderIds>
    <t:DistinguishedFolderId Id="msgfolderroot" />
    </m:ParentFolderIds>
    </m:FindFolder>
    </soap:Body>
    </soap:Envelope>
    Cheers
    Glen

  • How can i get all values from jtable with out selecting?

    i have one input table and two output tables (name it as output1, output2). Selected rows from input table are displayed in output1 table. The data in output1 table is temporary(means the dat wont store in database just for display purpose).
    Actually what i want is how can i get all values from output1 table to output2 table with out selecting the data in output1 table?
    thanks in advance.
    raja

    You could set the table's data model to be the same:
    output2.setModel( output1.getModel() );

  • How do I get all contacts from my iphone 4 to icloud?

    how do I get all contacts from my iphone 4 to icloud? I've just got some of them.

    All you have to do is enable iCloud on your phone and turn notes on.  They should automatically appear on your phone.

  • How to use a regural expression to get all digit from a string.

    Hi All,
    Do you know how to use regural expression to get all digits from the following string via ABAP program?
    "'Log Attributes                 0 (  0 )     (   10 % Available  )"
    Thanks,
    Andrew

    Hi,
    Try the code mentioned below:
      DATA: STR_LEN  LIKE SY-FDPOS,
            RSTR_LEN LIKE SY-FDPOS,
            OFF      LIKE SY-FDPOS.
      DATA: IDX      LIKE SY-FDPOS,        "mn B20K054003
            CL       LIKE SY-FDPOS.        "mn B20K054003
      DATA: RSTRING(40).
      DATA: STRING(40).   " value 'A,N,I,L'.
      FIELD-SYMBOLS: <NLS_CHAR>.           "mn B20K054003
    MOVE I_REGUH-ZNME1 TO STRING.
      MOVE SPACE TO RSTRING.
      STR_LEN = STRLEN( STRING ).
      DESCRIBE FIELD RSTRING LENGTH RSTR_LEN.
      IF RSTR_LEN < STR_LEN. RAISE TOO_SMALL. ENDIF.
      WHILE IDX < STR_LEN.                 "mn B20K054003
        ASSIGN STRING+IDX(*) TO <NLS_CHAR>.   "mn B20K054003
        IF SY-LANGU EQ '2'.                "mn B20K054003
          CALL FUNCTION 'NLS_THAI_CHARLEN' "mn B20K054003
               EXPORTING                   "mn B20K054003
                    THAI_STRING  = <NLS_CHAR>       "mn B20K054003
               CHANGING                    "mn B20K054003
                    THAI_CHARLEN = CL.     "mn B20K054003
        ELSE.                              "mn B20K054003
          CL = CHARLEN( <NLS_CHAR> ).      "mn B20K054003
        ENDIF.                             "mn B20K054003
        IF IDX NE 0.                       "mn B20K054003
          SHIFT RSTRING RIGHT BY CL PLACES."mn B20K054003
        ENDIF.                             "mn B20K054003
        RSTRING+0(CL) = STRING+IDX(CL).    "mn B20K054003
        IDX = IDX + CL.                    "mn B20K054003
      ENDWHILE.                            "mn B20K054003
    Regds,
    Anil
    Edited by: Matt on Jul 1, 2009 9:36 AM -added code tags

  • How to get all images from folder in c#?

    I am trying to get all images from folder. But it is not executing from following:
     string path=@"C:\wamp\www\fileupload\user_data";
                string[] filePaths = Directory.GetFiles(path,".jpg");
                for (int i = 0; i < filePaths.Length; i++)
                    dataGridImage.Controls.Add(filePaths[i]);
    Please give me the correct solution.

    How to display all images from folder in picturebox in c#?
    private void Form1_Load(object sender, EventArgs e)
    string[] files = Directory.GetFiles(Form1.programdir + "\\card_images", "*", SearchOption.TopDirectoryOnly);
    foreach (var filename in files)
    Bitmap bmp = null;
    try
    bmp = new Bitmap(filename);
    catch (Exception e)
    // remove this if you don't want to see the exception message
    MessageBox.Show(e.Message);
    continue;
    var card = new PictureBox();
    card.BackgroundImage = bmp;
    card.Padding = new Padding(0);
    card.BackgroundImageLayout = ImageLayout.Stretch;
    card.MouseDown += new MouseEventHandler(card_click);
    card.Size = new Size((int)(this.ClientSize.Width / 2) - 15, images.Height);
    images.Controls.Add(card);
    Free .NET Barcode Generator & Scanner supporting over 40 kinds of 1D & 2D symbologies.

  • How to get all data from nokia to i5s

    how to get all data from nokia E71 to i5s???

    if you can put those data in your computer then add it in iTunes. your iPhone 5s should get it thru syncing.

  • Cannot get all updates from iTunes software

    Hello. There is a strange problem.
    Sometimes, when I open iTunes from my computer, a small number will be displayed after "Apps".
    When I click the "Apps", I can also see that there are some updates available from the bottom link text.
    But after I click that bottom link, I cannot get all programs which need to be update listed. When I update all listed, iTunes still says there are some apps to be updated, but when I click that bottom link, only a text "No updates are currently available. To check for updates for another Apple ID, sign in with that Apple ID."
    At that time, I can get all updates from my iPhone - Apple Store. So all have to do, is update all apps from my iPhone and sync it back. But if some apps are not installed on this iPhone, I have no way to update it.
    BTW, I've tried to click Store - Check for available downloads from iTunes on my computer. It's useless in this case.
    Any solution? Thanks.

    It think its a bug. I got the same results under MX 7.0.2.
    The topic of maxrows recently came up on another thread. I
    did some searching and according to TechNote 18339 there was a
    change with maxrow
    "<cfquery maxrows=N> bug. ColdFusion MX (until ColdFusion
    MX 7.0.1 CHF2) didn't pass maxrows to the underlying driver
    (statement.setMaxRows())"
    Given the results you're getting, it sounds like CF is
    applying the maxrow to all of the resultsets, not just the one
    where maxrows was declared. I suspect cfstoredproc's usage of
    statement.setMaxRows() is incorrect. Thats just a guess though.
    Bottom line, I think you'll need handle it manually.
    Personally, I would recommend placing the row count logic in the
    stored procedure (if possible). The overall results will be more
    consistent and you won't have to worry about this kind of issue
    again.
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_18339
    http://livedocs.adobe.com/coldfusion/7/htmldocs/00000314.htm
    http://www.remotesynthesis.com/blog/index.cfm/2006/3/23/Maxrows-Issue-in-CFQuery

  • How get all record from master and matching record from detail

    hi master
    sir i have master detail table
    i have many record in master table but some record in detail table how i get
    all record from master and matching record from detail
    such as
    select m.accid,m.title,d.dr,d.cr from master m, detail d where m.accid=d.accid
    this query not work that get only related record i need all record from master
    please give me idea
    thanking you
    aamir

    hi master
    sir i have master detail table
    i have many record in master table but some record in
    detail table how i get
    all record from master and matching record from
    detail
    such as
    select m.accid,m.title,d.dr,d.cr from master m,
    detail d where m.accid=d.accid
    this query not work that get only related record i
    need all record from master
    please give me idea
    thanking you
    aamir
    select m.accid,m.title,d.dr,d.cr
    from master m, detail d
    where m.accid=d.accid (+)The outer join operator (+) will get you all the details from master and any details from the detail if they exist, but the master details will still be got even if there are not details.
    Note: Oracle 10g now supports ANSI standard outer joins as in:
    select m.accid,m.title,d.dr,d.cr
    from master m LEFT OUTER JOIN detail d on m.accid=d.accid

  • Get all groups from an AD Server

    Hi everyone,
    I'm trying to get all groups from and AD server.
    Here's how I'm doing it:
    DirContext ctx = new InitialDirContext( (Hashtable<String,String>) env);
              Name n2 = new CompositeName().add(groupsContainer);
              NamingEnumeration<Binding> contentsEnum = ctx.listBindings(n2);
              int i = 1;
              while ( contentsEnum.hasMore() && (i++) < 1000 )
                   Binding binding = contentsEnum.next();
                   groups.add(binding.getName().substring(3));
              return groups; The problem is, I always get an error if I don't restrict the results number to below 1000.
    The error is the following *javax.naming.SizeLimitExceededException: [LDAP: error code 4 - Sizelimit Exceeded];*
    After googling, I found it it's due to a field in the AD Server, that restrict the result number.
    So there is no way that I can obtain all groups without changing that field?
    Regards,
    Nuno.

    Hi Nuno,
    You have to increase the MaxPageSize value at ActiveDirectory level to retrieve results more than 1000. By default the MaxPageSize value is 1000. There is no option other than increasing the MaxPageSize value.
    Thanks & Regards,
    Murali.
    ============

  • How can I get all photos from iPhoto to automatically back up to iCloud from my Mac OSX Version 10.6.8 operating system.  Not enough memory to upgrade.

    How can I get all photos from iPhoto to automatically back up to iCloud from my Mac OSX Version 10.6.8 operating system.  Not enough memory to upgrade.

    You can't.  iCloud is not for general file backup from a Mac. It's for backup up and syncing data between mobile devices and and Macs and  The following is from this Apple document: iCloud: Backup and restore overview.
    iCloud automatically backs up the most important data on your (mobile) device using iOS 5 or later. Once you have enabled Backup on your iPhone, iPad, or iPod touch .....
    What is backed up
    You get unlimited free storage for:
    Purchased music, movies, TV shows, apps, and books
    Notes: Backup of purchased music is not available in all countries. Backups of purchased movies and TV shows are U.S. only. Previous purchases may not be restored if they are no longer in the iTunes Store, App Store, or iBookstore.
    Some previously purchased movies may not be available in iTunes in the Cloud. These movies will indicate that they are not available in iTunes in the Cloud on their product details page in the iTunes Store. Previous purchases may be unavailable if they have been refunded or are no longer available in the iTunes Store, App Store, or iBookstore.
    You get 5 GB of free iCloud storage for:
    Photos and videos in the Camera Roll
    Device settings (for example: Phone Favorites, Wallpaper, and Mail, Contacts, Calendar accounts)
    App data
    Home screen and app organization
    Messages (iMessage, SMS, and MMS)
    Ringtones
    Visual Voicemails
    But not from a Mac.  If you want to backup your photos and other important files I suggest you get an external hard drive and use  it with Time Machine.
    OT

  • How can I get all photos from the camera roll onto the photo stream so they will share between iphone and ipad?

    How can I get all photos from the camera roll, and all new pictures taken, to get on the photostream so they can share between iphone and ipad?

    When turning PhotoStream on with photos available in the Camera Roll, only photos captured by the iPhone or saved on the iPhone are placed in the PhotoStream.
    For all photos that were in the Camera Roll prior to turning PhotoStream on, import the photos with your computer and add the photos to your PhotoStream on your computer.

  • How do I get all music from my iPod classic to itunes on my computer?

    How do I get all music from my iPod classic to itunes on my computer? I was able to "authorize" the purchased music (40 songs) to download to laptop but I can't select my entire library (1500 songs) to download to laptop!

    Recover media from iPod
    See this post from forum regular Zevoneer for options on moving your iPod data back to your computer.
    tt2

  • Delete all entries from the following tables - Follow-up Activities (oracle)

    Hello,
    I performed a homogeneous system copy of our development BW system with the database (oracle 11.2.0.3) from the BW production system!
    I already start the oracle database and the SAP system in the target system/server (development BW system) and I´m doing some follow-up activities. One of this activities is (at the system copy guide 6.2.3.2 Activities at Database Level) is to delete all entries from the following tables:
    DBSTATHORA, DBSTAIHORA, DBSTATIORA, DBSTATTORA
    I tried to delete them using SQL Plus:
    sqlplus /nolog
    SQL> connect /as sysdba
    SQL> delete from DBSTATTORA;
    delete from DBSTATTORA
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ... and it show me that error message.
    This is strange because when I go to transaction SE14 and check the DBSTATTORA I see that table exist and contain a lot of entries!
    Why this is happened in SQL Plus!? I´m running the correct SQL statement for doing this type of task or not?
    How can I delete the entries of that tables? Can I do that using the transaction SE14?
    Can you help me please?
    Thank you,
    samid raif

    Hello
    sqlplus /nolog
    SQL> connect /as sysdba
    SQL> delete from DBSTATTORA;
    delete from DBSTATTORA
    ERROR at line 1:
    ORA-00942: table or view does not exist
    It doesn't surprise me as you are not mentioning the schema name here. Instead it should be
    delete from SAPSR3.DBSTATTORA;
    Assuming the schema owner is SAPSR3. if the owner is different then replace that with the correct one.
    Regards
    RB

  • HT1212 i am not able to get all songs from my Iphone/itunes? its telling me to ask computer for permission to. how?

    I am not able to get all songs from my Iphone. it said ask the computer for permission

    There is no message that says to ask the computer for permission. 
    EXACTLY what were you doing, and what is the EXACT error message?

Maybe you are looking for

  • ITunes 11.1 for Windows 64 bit not downloading, says a problem occurred with the installer.

    iTunes starts to download and the pop-up asking to allow Apple Inc. to make changes to the hardrive comes up but the installer then says "The installer encountered errors before iTunes could be configured. Errors occured during installation. Your sys

  • IPod Touch 3rd Gen not playing the selected songs - What's the problem?

    Tried to play songs by selecting them but iPod Touch is overriding the selected songs with other songs and displaying those instead. This happens in all my Playlists. Jsut wondering if anyone else has ever encountered this and what is the suggested r

  • EBS R12 - Multipl Instance using Single Databse ( with Different SID )

    Hi, Is it possible to create Multiple R12 EBS instance (i.e. TEST and DEV ), in to Single Database ( using same database binary ). Or Can these different EBS instance , configured with Single Database using differant Oralce SID ( means creating Multi

  • Malfunction after mini software update

    Hello. When I plugged in my mini to sync it today, the mini's software was updated. I followed the instructions afterwards to reconnect it to the electrical source. Then I plugged it back into my computer to sync it. The computer recognized "new hard

  • Iphoto '11 "places' question

    I am trying to add a place name/location to an album of photos but getting a 'places lookup disabled' message.  Does anyone know how to enable this?  It has only happened since I've upgraded to iphoto '11. Thanks