[infinispan-issues] [JBoss JIRA] Created: (ISPN-900) RemoteCache should implement size() and isEmpty()

Galder Zamarreño (JIRA) jira-events at lists.jboss.org
Thu Jan 27 04:12:50 EST 2011


RemoteCache should implement size() and isEmpty()
-------------------------------------------------

                 Key: ISPN-900
                 URL: https://issues.jboss.org/browse/ISPN-900
             Project: Infinispan
          Issue Type: Feature Request
          Components: Cache Server
            Reporter: Galder Zamarreño
            Assignee: Galder Zamarreño
             Fix For: 4.2.1.Final, 5.0.0.BETA1


It's dead easy to do this by simply checking the stats returned by the server, i.e.

   @Override
   public int size() {
      assertRemoteCacheManagerIsStarted();
      StatsOperation op = operationsFactory.newStatsOperation();
      return Integer.parseInt(((Map<String, String>) op.execute()).get(ServerStatistics.CURRENT_NR_OF_ENTRIES));
   }

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


-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the infinispan-issues mailing list