Example #1
0
            public static CCMCluster Create(int nbNodes, Builder builder)
            {
#if !MYTEST
                if (nbNodes > 4)
                {
                    throw new InvalidOperationException();
                }
#endif
                if (nbNodes == 0)
                {
                    throw new ArgumentException();
                }

                return(new CCMCluster(CCMBridge.Create("test", nbNodes), builder));
            }
Example #2
0
            public static void CreateCluster()
            {
                erroredOut       = false;
                schemaCreated    = false;
                cassandraCluster = CCMBridge.Create("test", 1);
                try
                {
                    var builder = Cluster.Builder().AddContactPoints(Options.Default.IP_PREFIX + "1");
                    if (Options.Default.USE_COMPRESSION)
                    {
                        builder.WithCompression(CompressionType.Snappy);
                        Console.WriteLine("Using Compression");
                    }
                    if (Options.Default.USE_NOBUFFERING)
                    {
                        builder.WithoutRowSetBuffering();
                        Console.WriteLine("No buffering");
                    }

                    cluster = builder.Build();
                    session = cluster.Connect();
                }
                catch (NoHostAvailableException e)
                {
                    erroredOut = true;
                    foreach (var entry in e.Errors)
                    {
                        Trace.TraceError("Error connecting to " + entry.Key + ": " + entry.Value);
                    }
                    throw new InvalidOperationException("", e);
                }
            }
            public static CCMCluster Create(int nbNodesDC1, int nbNodesDC2, Builder builder)
            {
                if (nbNodesDC1 == 0)
                {
                    throw new ArgumentException();
                }

                return(new CCMCluster(CCMBridge.Create("test", nbNodesDC1, nbNodesDC2), builder));
            }
Example #4
0
 public static void Setup(int nbNodesDC1, int nbNodesDC2 = 0, bool useAlreadyExisting = false)
 {
     if (nbNodesDC2 == 0)
     {
         if (nbNodesDC1 != NbNodesDC1)
         {
             Console.WriteLine("Cassandra:" + Options.Default.CASSANDRA_VERSION);
             CCMBridge  = CCMBridge.Create("test", nbNodesDC1, useAlreadyExisting);
             NbNodesDC1 = nbNodesDC1;
             NbNodesDC2 = 0;
         }
     }
     else
     {
         if (nbNodesDC1 != NbNodesDC1 || nbNodesDC2 != NbNodesDC2)
         {
             CCMBridge  = CCMBridge.Create("test", nbNodesDC1, nbNodesDC2, useAlreadyExisting);
             NbNodesDC1 = nbNodesDC1;
             NbNodesDC2 = nbNodesDC2;
         }
     }
 }
 public static void CreateCluster()
 {
     erroredOut       = false;
     schemaCreated    = false;
     cassandraCluster = CCMBridge.Create("test", 1);
     try
     {
         cluster = Cluster.Builder().AddContactPoints(IP_PREFIX + "1").Build();
         session = cluster.Connect();
     }
     catch (NoHostAvailableException e)
     {
         erroredOut = true;
         foreach (var entry in e.Errors)
         {
             Trace.TraceError("Error connecting to " + entry.Key + ": " + entry.Value);
         }
         throw new InvalidOperationException("", e);
     }
 }