コード例 #1
0
 /// <summary>
 /// Constructs the journal file.
 /// </summary>
 /// <param name="js"></param>
 /// <param name="file"></param>
 /// <param name="read_only"></param>
 public JournalFile(JournalledSystem js, string file, bool read_only)
 {
     this.js = js;
     this.file = file;
     this.read_only = read_only;
     this.is_open = false;
     buffer = new byte[36];
     resource_id_map = new Hashtable();
     cur_seq_id = 0;
     reference_count = 1;
 }
コード例 #2
0
 /// <summary>
 /// Constructs the resource.
 /// </summary>
 /// <param name="js"></param>
 /// <param name="name"></param>
 /// <param name="id"></param>
 /// <param name="data"></param>
 protected AbstractResource(JournalledSystem js, String name, long id, IStoreDataAccessor data, int page_size)
 {
     this.js = js;
     this.name = name;
     this.id = id;
     this.data = data;
     this.page_size = page_size;
 }
コード例 #3
0
 /// <summary>
 /// Constructs the resource.
 /// </summary>
 /// <param name="js"></param>
 /// <param name="name"></param>
 /// <param name="id"></param>
 /// <param name="data"></param>
 internal Resource(JournalledSystem js, String name, long id, IStoreDataAccessor data, int pageSize)
     : base(js, name, id, data, pageSize)
 {
     journal_map = new JournalEntry[257];
     data_open = false;
     data_exists = data.Exists;
     data_deleted = false;
     if (data_exists) {
         try {
             size = data.Size;
             //          Console.Out.WriteLine("Setting size of " + name + " to " + size);
         } catch (IOException e) {
             throw new ApplicationException("Error getting size of resource: " + e.Message);
         }
     }
     really_open = false;
     page_buffer = new byte[js.page_size];
 }
コード例 #4
0
 /// <summary>
 /// Constructs the resource.
 /// </summary>
 /// <param name="js"></param>
 /// <param name="name"></param>
 /// <param name="id"></param>
 /// <param name="data"></param>
 internal NonLoggingResource(JournalledSystem js, String name, long id, IStoreDataAccessor data, int pageSize)
     : base(js, name, id, data, pageSize)
 {
 }
コード例 #5
0
 internal JournalingThread(JournalledSystem js)
 {
     this.js = js;
     thread = new Thread(new ThreadStart(run));
     thread.Name = "Background Journaling";
     // This is a daemon thread.  it should be safe if this thread
     // dies at any time.
     thread.IsBackground = true;
 }
コード例 #6
0
        /// <summary>
        /// Constructs the manager.
        /// </summary>
        /// <param name="journal_path"></param>
        /// <param name="read_only"></param>
        /// <param name="max_pages"></param>
        /// <param name="page_size"></param>
        /// <param name="sda_factory"></param>
        /// <param name="enable_logging"></param>
        internal LoggingBufferManager(string journal_path, bool read_only,
            int max_pages, int page_size,
            IStoreDataAccessorFactory sda_factory, Logger logger, bool enable_logging)
        {
            PageCacheComparer = new PageCacheComparerImpl(this);
            this.max_pages = max_pages;
            this.page_size = page_size;

            check_point_in_progress = false;
            write_lock_count = 0;

            current_T = 0;
            page_list = new ArrayList();
            page_map = new BMPage[7829];

            journalled_system = new JournalledSystem(journal_path, read_only,
            page_size, sda_factory, logger, enable_logging);
        }