Ejemplo n.º 1
0
Archivo: Client.cs Proyecto: vebin/BD2
 public Client(BD2.Daemon.TransparentAgent agent, BD2.Chunk.ChunkRepository repo, string databaseName)
 {
     if (agent == null)
         throw new ArgumentNullException ("agent");
     if (repo == null)
         throw new ArgumentNullException ("repo");
     if (databaseName == null)
         throw new ArgumentNullException ("databaseName");
     this.agent = agent;
     this.repo = repo;
     this.databaseName = databaseName;
     typeIDs = new Dictionary<Type, long> ();
     typeIDs.Add (typeof(bool), 1);
     typeIDs.Add (typeof(char), 2);
     typeIDs.Add (typeof(byte), 3);
     typeIDs.Add (typeof(byte[]), 4);
     typeIDs.Add (typeof(short), 5);
     typeIDs.Add (typeof(int), 6);
     typeIDs.Add (typeof(long), 7);
     typeIDs.Add (typeof(float), 8);
     typeIDs.Add (typeof(double), 9);
     typeIDs.Add (typeof(Guid), 10);
     typeIDs.Add (typeof(String), 11);
     typeIDs.Add (typeof(DateTime), 12);
     tableDataRequests = new SortedDictionary<Guid, Table> ();
     frontend = new BD2.Frontend.Table.Frontend (new BD2.Frontend.Table.GenericValueDeserializer ());
     frontends = new BD2.Core.FrontendBase[] { frontend };
     db = new BD2.Core.Database (new BD2.Chunk.ChunkRepository[] { repo }, frontends, new byte[]{ }, databaseName);
     ss = db.GetSnapshot ("Primary");
     frontendInstance = (BD2.Frontend.Table.FrontendInstance)frontend.GetInstanse (ss);
     tableColumns = new System.Collections.Concurrent.ConcurrentDictionary<Table, System.Collections.Concurrent.BlockingCollection<Column>> ();
     tables = new SortedDictionary<Guid, Tuple<Table, List<Column>>> ();
 }
Ejemplo n.º 2
0
 public Client(BD2.Daemon.TransparentAgent agent, BD2.Chunk.ChunkRepository repo, string databaseName)
 {
     if (agent == null)
     {
         throw new ArgumentNullException("agent");
     }
     if (repo == null)
     {
         throw new ArgumentNullException("repo");
     }
     if (databaseName == null)
     {
         throw new ArgumentNullException("databaseName");
     }
     this.agent        = agent;
     this.repo         = repo;
     this.databaseName = databaseName;
     typeIDs           = new Dictionary <Type, long> ();
     typeIDs.Add(typeof(bool), 1);
     typeIDs.Add(typeof(char), 2);
     typeIDs.Add(typeof(byte), 3);
     typeIDs.Add(typeof(byte[]), 4);
     typeIDs.Add(typeof(short), 5);
     typeIDs.Add(typeof(int), 6);
     typeIDs.Add(typeof(long), 7);
     typeIDs.Add(typeof(float), 8);
     typeIDs.Add(typeof(double), 9);
     typeIDs.Add(typeof(Guid), 10);
     typeIDs.Add(typeof(String), 11);
     typeIDs.Add(typeof(DateTime), 12);
     tableDataRequests = new SortedDictionary <Guid, Table> ();
     frontend          = new BD2.Frontend.Table.Frontend(new BD2.Frontend.Table.GenericValueDeserializer());
     frontends         = new BD2.Core.FrontendBase[] { frontend };
     db = new BD2.Core.Database(new BD2.Chunk.ChunkRepository[] { repo }, frontends, new byte[] { }, databaseName);
     ss = db.GetSnapshot("Primary");
     frontendInstance = (BD2.Frontend.Table.FrontendInstance)frontend.GetInstanse(ss);
     tableColumns     = new System.Collections.Concurrent.ConcurrentDictionary <Table, System.Collections.Concurrent.BlockingCollection <Column> > ();
     tables           = new SortedDictionary <Guid, Tuple <Table, List <Column> > > ();
 }