After what you wrote, I did some further testing by pointing to each of 
three nodes and it did always seem to redirect to the lowest cluster in the 
class.  Everything I've been reading about how it's handled in 2.0+ seemed 
to indicate to me otherwise, especially as an additional cluster is created 
for each node.  But when I insert, it DOES seem to redirect to the first 
cluster where increments are correctly sequenced regardless of the source 
node.  Here is the code I used:

public static void singleClusterMode(String ipport) {
    int chatMsgCluster = odb.getClusterIdByName("ChatMessages");  //returned 
#16 for all nodes connected to, the lowest of all the clusters listed in Studio 
for the "ChatMessages" Class
    for (int i = 0; i<10; i++) {
        try {
            ODocument msg = new ODocument("ChatMessages");
            msg.field( "date", new Date() );
            msg.field( "text", "Test Message " + Integer.toString(i) );
            msg.field("user", ipport);
            msg.save("ChatMessages");

        } catch (Exception e){ System.out.println(e.getMessage()); }
        System.out.println("Done Message" + Integer.toString(i));
    }
}


It also seemed to elect a new leader if a node went down, but I was having 
trouble again fully testing that in 2.1-RC3 at least because I kept getting 
strange errors after killing a node.  Could just be a pre-2.1 bug.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to