The test work if i do the same thing as your correction, but ideally i 
prefer my code not to be dependent of the running mode (distributed or 
not), i don't know if it's possible ?

 @Test
 public void testCreateClass() {
 OrientGraphFactory factory = new OrientGraphFactory("plocal:target/testdb"
);
 OrientGraphNoTx graph = factory.getNoTx();
 try {
   OScenarioThreadLocal.INSTANCE.set(OScenarioThreadLocal.RUN_MODE.
RUNNING_DISTRIBUTED);
   graph.getRawGraph().getMetadata().getSchema().createClass("MyClass");
 } finally {
   graph.shutdown();
 }
 }


Le mercredi 16 avril 2014 09:11:57 UTC+2, Jérémie Brébec a écrit :
>
> hi,
>
> thank for the correction. 
> The previous test pass, but the one in my first post doesn't work yet :
>
>  @Test
>  public void testCreateClass() {
>    OrientGraphFactory factory = new OrientGraphFactory(
> "plocal:target/testdb");
>    OrientGraphNoTx graph = factory.getNoTx();
>    try {
>      graph.getRawGraph().getMetadata().getSchema().createClass("MyClass");
>    } finally {
>      graph.shutdown();
>    }
>  }
>
>
> Exception : 
> Quorum 1 not reached for request=id=0 from=node1397631982351 task=
> command_sql(create class MyClass cluster  11). Servers in timeout/conflict 
> are: no server in conflict. Received: {node1397631982351=waiting-for-
> response}
> -> com.orientechnologies.orient.server.hazelcast.
> OHazelcastDistributedDatabase.send2Nodes(OHazelcastDistributedDatabase.
> java:164)
> -> com.orientechnologies.orient.server.hazelcast.
> OHazelcastDistributedDatabase.send(OHazelcastDistributedDatabase.java:180)
> -> com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.
> sendRequest(OHazelcastPlugin.java:356)
> -> com.orientechnologies.orient.server.distributed.ODistributedStorage.
> sendRequest(ODistributedStorage.java:777)
> -> com.orientechnologies.orient.server.distributed.ODistributedStorage.
> command(ODistributedStorage.java:176)
> -> com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.
> execute(OCommandRequestTextAbstract.java:59)
> -> com.orientechnologies.orient.core.metadata.schema.OSchemaShared.
> createClass(OSchemaShared.java:242)
> -> com.orientechnologies.orient.core.metadata.schema.OSchemaShared.
> createClass(OSchemaShared.java:153)
> -> com.orientechnologies.orient.core.metadata.schema.OSchemaShared.
> createClass(OSchemaShared.java:145)
> -> com.orientechnologies.orient.core.metadata.schema.OSchemaShared.
> createClass(OSchemaShared.java:129)
> -> com.orientechnologies.orient.core.metadata.schema.OSchemaProxy.
> createClass(OSchemaProxy.java:
>
>
>
>
> Le mardi 15 avril 2014 19:58:01 UTC+2, Lvc@ a écrit :
>
> You was right. Fixed in "develop" branch, in few minutes in 1.7-snapshot.
>
> Lvc@
>
>
>
> On 15 April 2014 19:01, Luca Garulli <[email protected]> wrote:
>
> Ok, let me try your use case (thank to provide it).
>
> Lvc@
>
>
>
> On 15 April 2014 18:58, Jérémie Brébec <[email protected]> wrote:
>
> pom.properties indicates (orientdb-distributed-1.7-SNAPSHOT.jar) :
>
> #Generated by Maven
> #Mon Apr 14 20:48:56 EDT 2014
>
> Le mardi 15 avril 2014 18:53:23 UTC+2, Lvc@ a écrit :
>
> Hi,
> I fixed this bug yesterday. Are you sure to have an updated snapshot?
>
> Lvc@
>
>
> On 15 April 2014 16:44, Jérémie Brébec <[email protected]> wrote:
>
>
> Any hints on this ? ;-)
>
> I can reproduce this behavior with the following JUnit Test and the latest 
> 1.7-SNAPSHOT :
>
> public class TestDistributed {
>
>
>   private OServer server;
>  
>   public static class StandaloneHazelcastPlugin extends OHazelcastPlugin {
>  
>   @Override
>   protected HazelcastInstance configureHazelcast() throws 
> FileNotFoundException {
>     return Hazelcast.newHazelcastInstance();
>   }
>  
>   @Override
>   protected ODocument loadDatabaseConfiguration(String iDatabaseName, Filefile
> ) {
>     ODocument doc = new ODocument();
>     doc.field("replication", true)
>       .field("autoDeploy", true)
>       .field("hotAlignment", true)
>       .field("resyncEvery", 15)
>       .field("clusters", new ODocument()
>         .field("internal", new ODocument().field("replication", false))
>         .field("index", new ODocument().field("replication", false))
>         .field("*", new ODocument()
>           .field("replication", true)
>           .field("readQuorum", 1)
>           .field("writeQuorum", 1)
>           .field("failureAvailableNodesLessQuorum", false)
>           .field("readYourWrites", true)
>           .field("partitioning", new ODocument()
>           .field("strategy", "round-robin")
>           .field("default", 0)
>           .field("partitions", Collections.singletonList(new ArrayList<
> String>(Collections.singletonList("<NEW_NODE>")))))));
>  
>     return doc;
>   }
>  }
>  
>   @Before
>   public void setUp() throws Exception {
>     File target = new File("target/testdb");
>     OFileUtils.deleteRecursively(target);
>     target.mkdirs();
>  
>     server = OServerMain.create();
>     server.startup("<orient-server>"
>      + "<handlers>"
>        + "<handler class=\"" + StandaloneHazelcastPlugin.class.getName() + 
> "\">"
>          + "<parameters>"
>            + "<parameter name=\"enabled\" value=\"true\" />"
>            + "<parameter name=\"sharding.strategy.round-robin\" 
> value=\"com.orientechnologies.orient.server.hazelcast.sharding.strategy.
> ORoundRobinPartitioninStrategy\" />"<spa
>
> ...

-- 

--- 
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