コード例 #1
0
 internal Journal(IJournalMetadata metadata,
                  IPartitionManager partitionManager, IJournalServer server)
     : base(metadata, partitionManager)
 {
     _metadata                     = metadata;
     _partitionManager             = partitionManager;
     _server                       = server;
     _partitionManager.OnCommited += OnCommited;
     _writerState                  = new WriterState <T>(metadata.GetTimestampReader <T>());
 }
コード例 #2
0
        public Partition(IJournalMetadata metadata,
                         ICompositeFileFactory memeorymMappedFileFactory,
                         EFileAccess access,
                         PartitionDate partitionDate, int partitionID,
                         string path,
                         IJournalServer journalServer,
                         PartitionConfig config = null)
        {
            _memeorymMappedFileFactory = memeorymMappedFileFactory;
            _access        = access;
            _journalServer = journalServer;
            _config        = config;
            _metadata      = metadata;

            _partitionDate = partitionDate;
            EndDate        = PartitionManagerUtils.GetPartitionEndDate(
                partitionDate.Date, partitionDate.PartitionType);
            PartitionID   = partitionID;
            DirectoryPath = path;
        }
コード例 #3
0
        public PartitionManager(IJournalMetadata metadata, EFileAccess access,
                                ICompositeFileFactory fileFactory, IJournalServer server, ITxLog txLog = null)
        {
            Access       = access;
            _metadata    = metadata;
            _settings    = metadata.Settings;
            _fileFactory = fileFactory;
            _server      = server;
            Server       = server;

            if (txLog == null)
            {
                var txFileName = Path.Combine(metadata.Settings.DefaultPath, MetadataConstants.TX_FILE_NAME);
                _txLogFile = new CompositeRawFile(txFileName,
                                                  MetadataConstants.PIPE_BIT_HINT, _fileFactory, access, SYMBOL_PARTITION_ID,
                                                  MetadataConstants.TX_LOG_FILE_ID, MetadataConstants.TX_LOG_FILE_ID, EDataType.Data);

                txLog = new TxLog(_txLogFile);
            }
            _txLog = txLog;
        }
コード例 #4
0
ファイル: JournalBuilder.cs プロジェクト: ideoma/nfsdb-csharp
 public JournalBuilder WithJournalServer(IJournalServer server)
 {
     _server = server;
     return(this);
 }