Java Doc for FLUSH.java in  » Net » JGroups-2.4.1-sp3 » org » jgroups » protocols » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » JGroups 2.4.1 sp3 » org.jgroups.protocols 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.jgroups.stack.RpcProtocol
   org.jgroups.protocols.FLUSH

FLUSH
public class FLUSH extends RpcProtocol (Code)
The task of the FLUSH protocol is to flush all pending messages out of the system. This is done before a view change by stopping all senders and then agreeing on what messages should be delivered in the current view (before switching to the new view). A coordinator broadcasts a FLUSH message. The message contains an array of the highest sequence number for each member as seen by the coordinator so far. Each member responds with its highest sequence numbers seen so far (for each member): if its sequence number for a member P is higher than the one sent by the coordinator, it will append the messages apparently not received by the coordinator to its reply. The coordinator (when all replies have been received), computes for each member the lowest and highest sequence number and re-broadcasts messages accordingly (using ACKs rather then NAKs to ensure reliable delivery).

Example:

 FLUSH  ---> (p=10, q=22, r=7)
 <-- (p=10, q=20, r=7)    (did not receive 2 messages from q)
 <-- (p=12, q=23, r=7)    (attached are messages p11, p12, and q23)
 <-- (p=10, q=22, r=8)    (attached is message r8)
 ---------------------
 min:   11    21    8
 max:   12    23    8
 
The coordinator now computes the range for each member and re-broadcasts messages p11, p12, q21, q22, q23 and r8. This is essentially the exclusive min and inclusive max of all replies. Note that messages p11, p12 and q23 were not received by the coordinator itself before. They were only returned as result of the FLUSH replies and the coordinator now re-broadcasts them.


Field Summary
final  Objectblock_mutex
    
 longblock_timeout
    
 booleanblocked
    
 Digestdigest
    
final  Objectdigest_mutex
    
 longdigest_timeout
    
 Listget_msgs
    
final  Objectget_msgs_mutex
    
final  longget_msgs_timeout
    
 long[]highest_delivered_msgs
    
final  Objecthighest_delivered_mutex
    
 booleanis_server
    
 Addresslocal_addr
    
final  Vectormbrs
    


Method Summary
 voidgetHighestDeliveredSeqnos()
    
 voidgetMessageDigest(long[] highest_seqnos)
     Interacts with a lower layer to retrieve unstable messages (e.g.
public  StringgetName()
    
public  booleanhandleDownEvent(Event evt)
     Callback.
public synchronized  DigesthandleFlush(Vector flush_dests, long[] highest_seqnos)
     Called by coordinator running the FLUSH protocol.
public  booleanhandleUpEvent(Event evt)
     Callback.
public  VectorprovidedUpServices()
    
public  voidreceiveDownEvent(Event evt)
     The default handling adds the event to the down-queue where events are handled in order of addition by a thread.
public  VectorrequiredDownServices()
    
public  booleansetProperties(Properties props)
    
public  voidstart()
    

Field Detail
block_mutex
final Object block_mutex(Code)



block_timeout
long block_timeout(Code)



blocked
boolean blocked(Code)



digest
Digest digest(Code)



digest_mutex
final Object digest_mutex(Code)



digest_timeout
long digest_timeout(Code)



get_msgs
List get_msgs(Code)



get_msgs_mutex
final Object get_msgs_mutex(Code)



get_msgs_timeout
final long get_msgs_timeout(Code)



highest_delivered_msgs
long[] highest_delivered_msgs(Code)



highest_delivered_mutex
final Object highest_delivered_mutex(Code)



is_server
boolean is_server(Code)



local_addr
Address local_addr(Code)



mbrs
final Vector mbrs(Code)





Method Detail
getHighestDeliveredSeqnos
void getHighestDeliveredSeqnos()(Code)
Returns the highest seqnos (for each member) seen so far (using the NAKACK layer)



getMessageDigest
void getMessageDigest(long[] highest_seqnos)(Code)
Interacts with a lower layer to retrieve unstable messages (e.g. NAKACK)



getName
public String getName()(Code)



handleDownEvent
public boolean handleDownEvent(Event evt)(Code)
Callback. Called by superclass when event may be handled.

Do not use PassDown in this method as the event is passed down by default by the superclass after this method returns ! boolean Defaults to true. If false, event will not be passed down the stack.




handleFlush
public synchronized Digest handleFlush(Vector flush_dests, long[] highest_seqnos)(Code)
Called by coordinator running the FLUSH protocol. Argument is an array of the highest seqnos as seen by the coordinator (for each member). handleFlush() checks for each member its own highest seqno seen for that member. If it is higher than the one seen by the coordinator, all higher messages are attached to the return value (a message digest).
Parameters:
  flush_dests - The members to which this message is sent. Processes not in this list justignore the handleFlush() message.
Parameters:
  highest_seqnos - The highest sequence numbers (order corresponding to membership) as seenby coordinator. Digest An array of the highest seqnos for each member, as seen by this member. If thismember's seqno for a member P is higher than the one in highest_seqnos,the missing messages are added to the message digest as well. This allows thecoordinator to re-broadcast missing messages.



handleUpEvent
public boolean handleUpEvent(Event evt)(Code)
Callback. Called by superclass when event may be handled.

Do not use PassUp in this method as the event is passed up by default by the superclass after this method returns ! boolean Defaults to true. If false, event will not be passed up the stack.




providedUpServices
public Vector providedUpServices()(Code)



receiveDownEvent
public void receiveDownEvent(Event evt)(Code)
The default handling adds the event to the down-queue where events are handled in order of addition by a thread. However, there exists a deadlock between the FLUSH and BLOCK_OK down events: when a FLUSH event is received, a BLOCK is sent up, which triggers a BLOCK_OK event to be sent down to be handled by the FLUSH layer. However, the FLUSH layer's thread is still processing the FLUSH down event and is therefore blocked, waiting for a BLOCK_OK event. Therefore, the BLOCK_OK event has to 'preempt' the FLUSH event processing. This is done by overriding this method: when a BLOCK_OK event is received, it is processed immediately (in parallel to the FLUSH event), which causes the FLUSH event processing to return.



requiredDownServices
public Vector requiredDownServices()(Code)



setProperties
public boolean setProperties(Properties props)(Code)



start
public void start() throws Exception(Code)



Methods inherited from org.jgroups.stack.RpcProtocol
public Object callRemoteMethod(Address dest, String method_name, int mode, long timeout) throws TimeoutException, SuspectedException(Code)(Java Doc)
public Object callRemoteMethod(Address dest, String method_name, Object[] args, Class[] types, int mode, long timeout) throws TimeoutException, SuspectedException(Code)(Java Doc)
public Object callRemoteMethod(Address dest, String method_name, Object[] args, String[] signature, int mode, long timeout) throws TimeoutException, SuspectedException(Code)(Java Doc)
public Object callRemoteMethod(Address dest, MethodCall method_call, int mode, long timeout) throws TimeoutException, SuspectedException(Code)(Java Doc)
public RspList callRemoteMethods(Vector dests, String method_name, Object[] args, Class[] types, int mode, long timeout)(Code)(Java Doc)
public RspList callRemoteMethods(Vector dests, String method_name, Object[] args, String[] signature, int mode, long timeout)(Code)(Java Doc)
public RspList callRemoteMethods(Vector dests, MethodCall method_call, int mode, long timeout)(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public Object handle(Message req)(Code)(Java Doc)
public boolean handleDownEvent(Event evt)(Code)(Java Doc)
public boolean handleUpEvent(Event evt)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.