@Override public Set<String> keySet() { return getSessionRegion().keySet(); }
@Override public int size() { return getSessionRegion().size(); }
@Override public void touchSessions(Set<String> sessionIds) { // Get the region attributes id to determine the region type. This is // problematic since the region attributes id doesn't really define the // region type. This should look at the actual session region. String regionAttributesID = getSessionManager().getRegionAttributesId().toLowerCase(); // Invoke the appropriate function depending on the type of region ResultCollector collector = null; if (regionAttributesID.startsWith("partition")) { // Execute the partitioned touch function on the primary server(s) Execution execution = FunctionService.onRegion(getSessionRegion()).withFilter(sessionIds); collector = execution.execute(TouchPartitionedRegionEntriesFunction.ID); } else { // Execute the member touch function on all the server(s) Execution execution = FunctionService.onMembers() .setArguments(new Object[] {this.sessionRegion.getFullPath(), sessionIds}); collector = execution.execute(TouchReplicatedRegionEntriesFunction.ID); } // Get the result try { collector.getResult(); } catch (Exception e) { // If an exception occurs in the function, log it. getSessionManager().getLogger().warn("Caught unexpected exception:", e); } }
@Override public Set<String> keySet() { return getSessionRegion().keySet(); }
@Override public int size() { return getSessionRegion().size(); }
@Override public void touchSessions(Set<String> sessionIds) { // Get the region attributes id to determine the region type. This is // problematic since the region attributes id doesn't really define the // region type. This should look at the actual session region. String regionAttributesID = getSessionManager().getRegionAttributesId().toLowerCase(); // Invoke the appropriate function depending on the type of region ResultCollector collector = null; if (regionAttributesID.startsWith("partition")) { // Execute the partitioned touch function on the primary server(s) Execution execution = FunctionService.onRegion(getSessionRegion()).withFilter(sessionIds); collector = execution.execute(TouchPartitionedRegionEntriesFunction.ID, true, false, true); } else { // Execute the member touch function on all the server(s) Execution execution = FunctionService.onMembers() .setArguments(new Object[] {this.sessionRegion.getFullPath(), sessionIds}); collector = execution.execute(TouchReplicatedRegionEntriesFunction.ID, true, false, false); } // Get the result try { collector.getResult(); } catch (Exception e) { // If an exception occurs in the function, log it. getSessionManager().getLogger().warn("Caught unexpected exception:", e); } }