本文整理汇总了C#中OrderedPartCollection类的典型用法代码示例。如果您正苦于以下问题:C# OrderedPartCollection类的具体用法?C# OrderedPartCollection怎么用?C# OrderedPartCollection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OrderedPartCollection类属于命名空间,在下文中一共展示了OrderedPartCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DocumentStorageActions
public DocumentStorageActions(
JET_INSTANCE instance,
string database,
TableColumnsCache tableColumnsCache,
OrderedPartCollection<AbstractDocumentCodec> documentCodecs,
IUuidGenerator uuidGenerator,
IDocumentCacher cacher,
TransactionalStorage transactionalStorage)
{
this.tableColumnsCache = tableColumnsCache;
this.documentCodecs = documentCodecs;
this.uuidGenerator = uuidGenerator;
this.cacher = cacher;
this.transactionalStorage = transactionalStorage;
try
{
session = new Session(instance);
transaction = new Transaction(session);
Api.JetOpenDatabase(session, database, null, out dbid, OpenDatabaseGrbit.None);
}
catch (Exception)
{
Dispose();
throw;
}
}
示例2: StorageActionsAccessor
public StorageActionsAccessor(TableColumnsCache tableColumnsCache, JET_INSTANCE instance, string databaseName, UuidGenerator uuidGenerator, OrderedPartCollection<AbstractFileCodec> fileCodecs)
{
this.tableColumnsCache = tableColumnsCache;
this.uuidGenerator = uuidGenerator;
this.fileCodecs = fileCodecs;
try
{
session = new Session(instance);
transaction = new Transaction(session);
Api.JetOpenDatabase(session, databaseName, null, out database, OpenDatabaseGrbit.None);
}
catch (Exception original)
{
log.WarnException("Could not create accessor", original);
try
{
Dispose();
}
catch (Exception e)
{
log.WarnException("Could not properly dispose accessor after exception in ctor.", e);
}
throw;
}
}
示例3: StorageActionsAccessor
public StorageActionsAccessor(TableStorage storage, Reference<WriteBatch> writeBatch, Reference<SnapshotReader> snapshot, IdGenerator generator, IBufferPool bufferPool, OrderedPartCollection<AbstractFileCodec> fileCodecs)
: base(snapshot, generator, bufferPool)
{
this.storage = storage;
this.writeBatch = writeBatch;
this.fileCodecs = fileCodecs;
}
示例4: DocumentStorage_DocumentAdd_And_DocumentRead_WithCompression
public void DocumentStorage_DocumentAdd_And_DocumentRead_WithCompression(string requestedStorage)
{
var documentCodecs = new OrderedPartCollection<AbstractDocumentCodec>();
documentCodecs.Add(new DocumentCompression());
DocumentStorage_DocumentAdd_And_DocumentRead_Internal(requestedStorage, "Foo/Bar", documentCodecs);
}
示例5: StreamToClient
private void StreamToClient(Stream stream, int pageSize, Etag etag, OrderedPartCollection<AbstractFileReadTrigger> readTriggers)
{
using (var cts = new CancellationTokenSource())
using (var timeout = cts.TimeoutAfter(FileSystemsLandlord.SystemConfiguration.DatabaseOperationTimeout))
using (var writer = new JsonTextWriter(new StreamWriter(stream)))
{
writer.WriteStartObject();
writer.WritePropertyName("Results");
writer.WriteStartArray();
Storage.Batch(accessor =>
{
var files = accessor.GetFilesAfter(etag, pageSize);
foreach (var file in files)
{
if (readTriggers.CanReadFile(file.FullPath, file.Metadata, ReadOperation.Load) == false)
continue;
timeout.Delay();
var doc = RavenJObject.FromObject(file);
doc.WriteTo(writer);
writer.WriteRaw(Environment.NewLine);
}
});
writer.WriteEndArray();
writer.WriteEndObject();
writer.Flush();
}
}
示例6: GenerateText
public static string GenerateText(TypeDeclaration type, OrderedPartCollection<AbstractDynamicCompilationExtension> extensions)
{
var unit = new CompilationUnit();
var namespaces = new HashSet<string>
{
typeof (SystemTime).Namespace,
typeof (AbstractViewGenerator).Namespace,
typeof (Enumerable).Namespace,
typeof (IEnumerable<>).Namespace,
typeof (IEnumerable).Namespace,
typeof (int).Namespace,
typeof (LinqOnDynamic).Namespace,
typeof(Field).Namespace,
};
foreach (var extension in extensions)
{
foreach (var ns in extension.Value.GetNamespacesToImport())
{
namespaces.Add(ns);
}
}
foreach (var ns in namespaces)
{
unit.AddChild(new Using(ns));
}
unit.AddChild(type);
var output = new CSharpOutputVisitor();
unit.AcceptVisitor(output, null);
return output.Text;
}
示例7: MappedResultsStorageActions
public MappedResultsStorageActions(TableStorage tableStorage, IUuidGenerator generator, OrderedPartCollection<AbstractDocumentCodec> documentCodecs, Reference<SnapshotReader> snapshot, Reference<WriteBatch> writeBatch, IBufferPool bufferPool)
: base(snapshot, bufferPool)
{
this.tableStorage = tableStorage;
this.generator = generator;
this.documentCodecs = documentCodecs;
this.writeBatch = writeBatch;
}
示例8: StorageOperationsTask
public StorageOperationsTask(ITransactionalStorage storage, OrderedPartCollection<AbstractFileDeleteTrigger> deleteTriggers, IndexStorage search, INotificationPublisher notificationPublisher)
{
this.storage = storage;
this.deleteTriggers = deleteTriggers;
this.search = search;
this.notificationPublisher = notificationPublisher;
InitializeTimer();
}
示例9: MappedResultsStorageActions
public MappedResultsStorageActions(TableStorage tableStorage, IUuidGenerator generator, OrderedPartCollection<AbstractDocumentCodec> documentCodecs, Reference<SnapshotReader> snapshot,
Reference<WriteBatch> writeBatch, IBufferPool bufferPool, IStorageActionsAccessor storageActionsAccessor, ConcurrentDictionary<int, RemainingReductionPerLevel> ScheduledReductionsPerViewAndLevel)
: base(snapshot, bufferPool)
{
this.tableStorage = tableStorage;
this.generator = generator;
this.documentCodecs = documentCodecs;
this.writeBatch = writeBatch;
this.storageActionsAccessor = storageActionsAccessor;
this.scheduledReductionsPerViewAndLevel = ScheduledReductionsPerViewAndLevel;
}
示例10: DocumentStorageActions
public DocumentStorageActions(
JET_INSTANCE instance,
string database,
TableColumnsCache tableColumnsCache,
OrderedPartCollection<AbstractDocumentCodec> documentCodecs,
IUuidGenerator uuidGenerator,
IDocumentCacher cacher,
EsentTransactionContext transactionContext,
TransactionalStorage transactionalStorage)
{
this.tableColumnsCache = tableColumnsCache;
this.documentCodecs = documentCodecs;
this.uuidGenerator = uuidGenerator;
this.cacher = cacher;
this.transactionalStorage = transactionalStorage;
this.transactionContext = transactionContext;
try
{
if (transactionContext == null)
{
session = new Session(instance);
transaction = new Transaction(session);
sessionAndTransactionDisposer = () =>
{
if(transaction != null)
transaction.Dispose();
if(session != null)
session.Dispose();
};
}
else
{
session = transactionContext.Session;
transaction = transactionContext.Transaction;
var disposable = transactionContext.EnterSessionContext();
sessionAndTransactionDisposer = disposable.Dispose;
}
Api.JetOpenDatabase(session, database, null, out dbid, OpenDatabaseGrbit.None);
}
catch (Exception ex)
{
logger.WarnException("Error when trying to open a new DocumentStorageActions", ex);
try
{
Dispose();
}
catch (Exception e)
{
logger.WarnException("Error on dispose when the ctor threw an exception, resources may have leaked", e);
}
throw;
}
}
示例11: ReadFileToDatabase
public ReadFileToDatabase(BufferPool bufferPool, ITransactionalStorage storage, OrderedPartCollection<AbstractFilePutTrigger> putTriggers, Stream inputStream, string filename, RavenJObject headers)
{
this.bufferPool = bufferPool;
this.inputStream = inputStream;
this.storage = storage;
this.putTriggers = putTriggers;
this.filename = filename;
this.headers = headers;
buffer = bufferPool.TakeBuffer(StorageConstants.MaxPageSize);
md5Hasher = Encryptor.Current.CreateHash();
}
示例12: DynamicCompilerBase
public DynamicCompilerBase(InMemoryRavenConfiguration configuration, OrderedPartCollection<AbstractDynamicCompilationExtension> extensions, string name, string basePath)
{
this.configuration = configuration;
this.name = name;
this.extensions = extensions;
if (configuration.RunInMemory == false)
{
this.basePath = Path.Combine(basePath, "temp");
if (Directory.Exists(this.basePath) == false)
Directory.CreateDirectory(this.basePath);
}
}
示例13: StorageActionsAccessor
public StorageActionsAccessor(TableStorage storage, IUuidGenerator generator, OrderedPartCollection<AbstractDocumentCodec> documentCodecs, IDocumentCacher documentCacher)
{
General = new GeneralStorageActions(storage);
Attachments = new AttachmentsStorageActions(storage, generator);
Transactions = new TransactionStorageActions(storage, generator, documentCodecs);
Documents = new DocumentsStorageActions(storage, Transactions, generator, documentCodecs, documentCacher);
Indexing = new IndexingStorageActions(storage);
MappedResults = new MappedResultsStorageAction(storage, generator);
Queue = new QueueStorageActions(storage, generator);
Tasks = new TasksStorageActions(storage, generator);
Staleness = new StalenessStorageActions(storage);
}
示例14: DynamicViewCompiler
public DynamicViewCompiler(string name, IndexDefinition indexDefinition, OrderedPartCollection<AbstractDynamicCompilationExtension> extensions, string basePath, InMemoryRavenConfiguration configuration)
{
this.indexDefinition = indexDefinition;
this.extensions = extensions;
if (configuration.RunInMemory == false)
{
this.basePath = Path.Combine(basePath, "TemporaryIndexDefinitionsAsSource");
if (Directory.Exists(this.basePath) == false)
Directory.CreateDirectory(this.basePath);
}
this.name = MonoHttpUtility.UrlEncode(name);
RequiresSelectNewAnonymousType = true;
}
示例15: DocumentsStorageActions
public DocumentsStorageActions(IUuidGenerator uuidGenerator,
OrderedPartCollection<AbstractDocumentCodec> documentCodecs,
IDocumentCacher documentCacher,
Reference<WriteBatch> writeBatch,
Reference<SnapshotReader> snapshot,
TableStorage tableStorage,
IBufferPool bufferPool)
: base(snapshot, bufferPool)
{
this.uuidGenerator = uuidGenerator;
this.documentCodecs = documentCodecs;
this.documentCacher = documentCacher;
this.writeBatch = writeBatch;
this.tableStorage = tableStorage;
metadataIndex = tableStorage.Documents.GetIndex(Tables.Documents.Indices.Metadata);
}