Exemplo n.º 1
0
        public static PartitionData <T> CreatePartition <T>(int?recordHint = null, EFileAccess access = EFileAccess.Read, EFileFlags fileFlags = EFileFlags.None)
        {
            var mmFactory = new CompositeFileFactory(fileFlags);

            using (var dbXml = typeof(Quote).Assembly.GetManifestResourceStream(
                       "Apaf.NFSdb.TestShared.Resources.nfsdb.xml"))
            {
                var dbElement = ConfigurationSerializer.ReadConfiguration(dbXml);
                var jconf     = dbElement.Journals.Single(j => j.Class.EndsWith("." + typeof(T).Name));
                if (recordHint.HasValue)
                {
                    jconf.RecordHint = recordHint.Value;
                }
                var journalPath = Path.Combine(FindJournalsPath(), jconf.DefaultPath);
                jconf.DefaultPath = journalPath;

                var metadata       = JournalBuilder.CreateNewJournalMetadata(jconf);
                var startDate      = new DateTime(2013, 10, 1);
                var journalStorage = new ColumnStorage(metadata, jconf.DefaultPath,
                                                       access, 0, mmFactory);

                var part = new Partition(
                    metadata, new CompositeFileFactory(fileFlags),
                    access, new PartitionDate(startDate, 0, metadata.Settings.PartitionType), 0,
                    Path.Combine(jconf.DefaultPath, "2013-10"), new AsyncJournalServer(TimeSpan.FromSeconds(1)));

                return(new PartitionData <T>(part, metadata, journalStorage, journalPath));
            }
        }
Exemplo n.º 2
0
 public PartitionData(Partition partition,
                      JournalMetadata metadata, ColumnStorage journalStorage,
                      string journalPath)
 {
     Partition      = partition;
     Metadata       = metadata;
     JournalStorage = journalStorage;
     JournalPath    = journalPath;
 }
Exemplo n.º 3
0
 public UtfFieldAttribute(int order, ColumnStorage storage = ColumnStorage.PerRow, string fieldName = null)
 {
     Order     = order;
     Storage   = storage;
     FieldName = fieldName;
 }