Ejemplo n.º 1
0
        public async Task TestCreateTables()
        {
            var dao = new FlattenedDocumentCassandraDao();
            await dao.EstablishConnectionAsync();

            await dao.CreateFlattenedDocumentTablesAsync();
        }
Ejemplo n.º 2
0
 public async Task EstablishSessionAsync()
 {
     if (ResilientSession == null)
     {
         var rs = new FlattenedDocumentCassandraDao();
         await rs.EstablishConnectionAsync();
         ResilientSession = rs;
     }
 }
Ejemplo n.º 3
0
        private async Task CreateAndTruncateTables()
        {
            var dao = new FlattenedDocumentCassandraDao();
            await dao.EstablishConnectionAsync();

            await dao.CreateFlattenedDocumentTablesAsync();

            await dao.TruncateTablesAsync();
        }
Ejemplo n.º 4
0
        public async Task TestTruncateTables()
        {
            var dao = new FlattenedDocumentCassandraDao();
            await dao.EstablishConnectionAsync();

            // create Tables, in case they don't exist
            await dao.CreateFlattenedDocumentTablesAsync();

            await dao.TruncateTablesAsync();
        }
Ejemplo n.º 5
0
 public TryWithAwaitInCatchExcpetionHandleResult<T> HandleCassandraException<T>(Exception ex)
 {
     var nhae = ex as NoHostAvailableException;
     if (nhae != null)
     {
         ResilientSession = null;
     }
     return new TryWithAwaitInCatchExcpetionHandleResult<T>
     {
         RethrowException = true
     };
 }
Ejemplo n.º 6
0
 public static void Init(string seedTableName)
 {
     if (!_init)
     {
         string          tableById             = FlattenedDocumentCassandraDao.TableByIdName(seedTableName);
         string          tableByTypeAndVersion = FlattenedDocumentCassandraDao.TableByTypeAndVersionName(seedTableName);
         List <Mappings> mappings = new List <Mappings>
         {
             new MyMappings(tableById, tableByTypeAndVersion)
         };
         MappingConfiguration.Global.Define(mappings.ToArray());
         _init = true;
     }
 }