public static CassandraDBRepository Instance()
 {
     // DBController.GetInstance();
     // new DBController();
     if (instance == null)
     {
         instance      = new CassandraDBRepository();
         SERVER_NAME   = ConfigurationManager.AppSettings.Get("CASSANDRA_SERVER_NAME");
         KEYSPACE_NAME = ConfigurationManager.AppSettings.Get("CASSANDRA_KEYSPACE_NAME");
         if (cluster == null)
         {
             cluster = (Cluster)Cluster.Builder().AddContactPoints(SERVER_NAME).Build();
             session = (Session)cluster.Connect(KEYSPACE_NAME);
         }
         else
         {
             session = (Session)cluster.Connect(KEYSPACE_NAME);
         }
     }
     return(instance);
 }
Пример #2
0
 public IDBRepository GetCassandraDB()
 {
     return(CassandraDBRepository.Instance());
 }