private void Config(BTreeDatabaseConfig cfg) { base.Config(cfg); /* * Database.Config calls set_flags, but that does not get the BTree * specific flags. No harm in calling it again. */ db.set_flags(cfg.flags); if (cfg.BlobDir != null && cfg.Env == null) db.set_blob_dir(cfg.BlobDir); if (cfg.blobThresholdIsSet) db.set_blob_threshold(cfg.BlobThreshold, 0); if (cfg.BTreeCompare != null) Compare = cfg.BTreeCompare; if (cfg.BTreePrefixCompare != null) PrefixCompare = cfg.BTreePrefixCompare; // The duplicate comparison function cannot change. if (cfg.DuplicateCompare != null) DupCompare = cfg.DuplicateCompare; if (cfg.minkeysIsSet) db.set_bt_minkey(cfg.MinKeysPerPage); if (cfg.compressionIsSet) { Compress = cfg.Compress; Decompress = cfg.Decompress; if (Compress == null) doCompressRef = null; else doCompressRef = new BDB_CompressDelegate(doCompress); if (Decompress == null) doDecompressRef = null; else doDecompressRef = new BDB_DecompressDelegate(doDecompress); db.set_bt_compress(doCompressRef, doDecompressRef); } if (cfg.partitionIsSet) { nparts = cfg.NParts; Partition = cfg.Partition; if (Partition == null) doPartitionRef = null; else doPartitionRef = new BDB_PartitionDelegate(doPartition); partitionKeys = cfg.PartitionKeys; IntPtr[] ptrs = null; if (partitionKeys != null) { int size = (int)nparts - 1; ptrs = new IntPtr[size]; for (int i = 0; i < size; i++) ptrs[i] = DBT.getCPtr( DatabaseEntry.getDBT(partitionKeys[i])).Handle; } db.set_partition(nparts, ptrs, doPartitionRef); } }
internal int set_partition(uint parts, IntPtr[] keys, BDB_PartitionDelegate partition) { int ret; ret = libdb_csharpPINVOKE.DB_set_partition(swigCPtr, parts, keys, partition); DatabaseException.ThrowException(ret); return(ret); }
private void Config(HashDatabaseConfig cfg) { base.Config(cfg); /* * Database.Config calls set_flags, but that does not get the Hash * specific flags. No harm in calling it again. */ db.set_flags(cfg.flags); if (cfg.BlobDir != null && cfg.Env == null) db.set_blob_dir(cfg.BlobDir); if (cfg.blobThresholdIsSet) db.set_blob_threshold(cfg.BlobThreshold, 0); if (cfg.HashFunction != null) HashFunction = cfg.HashFunction; // The duplicate comparison function cannot change. if (cfg.DuplicateCompare != null) DupCompare = cfg.DuplicateCompare; if (cfg.fillFactorIsSet) db.set_h_ffactor(cfg.FillFactor); if (cfg.nelemIsSet) db.set_h_nelem(cfg.TableSize); if (cfg.HashComparison != null) Compare = cfg.HashComparison; if (cfg.partitionIsSet) { nparts = cfg.NParts; Partition = cfg.Partition; if (Partition == null) doPartitionRef = null; else doPartitionRef = new BDB_PartitionDelegate(doPartition); partitionKeys = cfg.PartitionKeys; IntPtr[] ptrs = null; if (partitionKeys != null) { int size = (int)nparts - 1; ptrs = new IntPtr[size]; for (int i = 0; i < size; i++) { ptrs[i] = DBT.getCPtr( DatabaseEntry.getDBT(partitionKeys[i])).Handle; } } db.set_partition(nparts, ptrs, doPartitionRef); } }
private void Config(BTreeDatabaseConfig cfg) { base.Config(cfg); /* * Database.Config calls set_flags, but that does not get the BTree * specific flags. No harm in calling it again. */ db.set_flags(cfg.flags); if (cfg.BlobDir != null && cfg.Env == null) { db.set_ext_file_dir(cfg.BlobDir); } if (cfg.ExternalFileDir != null && cfg.Env == null) { db.set_ext_file_dir(cfg.ExternalFileDir); } if (cfg.blobThresholdIsSet) { db.set_ext_file_threshold(cfg.BlobThreshold, 0); } if (cfg.BTreeCompare != null) { Compare = cfg.BTreeCompare; } if (cfg.BTreePrefixCompare != null) { PrefixCompare = cfg.BTreePrefixCompare; } // The duplicate comparison function cannot change. if (cfg.DuplicateCompare != null) { DupCompare = cfg.DuplicateCompare; } if (cfg.minkeysIsSet) { db.set_bt_minkey(cfg.MinKeysPerPage); } if (cfg.compressionIsSet) { Compress = cfg.Compress; Decompress = cfg.Decompress; if (Compress == null) { doCompressRef = null; } else { doCompressRef = new BDB_CompressDelegate(doCompress); } if (Decompress == null) { doDecompressRef = null; } else { doDecompressRef = new BDB_DecompressDelegate(doDecompress); } db.set_bt_compress(doCompressRef, doDecompressRef); } if (cfg.partitionIsSet) { nparts = cfg.NParts; Partition = cfg.Partition; if (Partition == null) { doPartitionRef = null; } else { doPartitionRef = new BDB_PartitionDelegate(doPartition); } partitionKeys = cfg.PartitionKeys; IntPtr[] ptrs = null; if (partitionKeys != null) { int size = (int)nparts - 1; ptrs = new IntPtr[size]; for (int i = 0; i < size; i++) { ptrs[i] = DBT.getCPtr( DatabaseEntry.getDBT(partitionKeys[i])).Handle; } } db.set_partition(nparts, ptrs, doPartitionRef); } }
private void Config(HashDatabaseConfig cfg) { base.Config(cfg); /* * Database.Config calls set_flags, but that does not get the Hash * specific flags. No harm in calling it again. */ db.set_flags(cfg.flags); if (cfg.BlobDir != null && cfg.Env == null) { db.set_ext_file_dir(cfg.BlobDir); } if (cfg.ExternalFileDir != null && cfg.Env == null) { db.set_ext_file_dir(cfg.ExternalFileDir); } if (cfg.blobThresholdIsSet) { db.set_ext_file_threshold(cfg.BlobThreshold, 0); } if (cfg.HashFunction != null) { HashFunction = cfg.HashFunction; } // The duplicate comparison function cannot change. if (cfg.DuplicateCompare != null) { DupCompare = cfg.DuplicateCompare; } if (cfg.fillFactorIsSet) { db.set_h_ffactor(cfg.FillFactor); } if (cfg.nelemIsSet) { db.set_h_nelem(cfg.TableSize); } if (cfg.HashComparison != null) { Compare = cfg.HashComparison; } if (cfg.partitionIsSet) { nparts = cfg.NParts; Partition = cfg.Partition; if (Partition == null) { doPartitionRef = null; } else { doPartitionRef = new BDB_PartitionDelegate(doPartition); } partitionKeys = cfg.PartitionKeys; IntPtr[] ptrs = null; if (partitionKeys != null) { int size = (int)nparts - 1; ptrs = new IntPtr[size]; for (int i = 0; i < size; i++) { ptrs[i] = DBT.getCPtr( DatabaseEntry.getDBT(partitionKeys[i])).Handle; } } db.set_partition(nparts, ptrs, doPartitionRef); } }
internal int set_partition(uint parts, IntPtr[] keys, BDB_PartitionDelegate partition) { int ret; ret = libdb_csharpPINVOKE.DB_set_partition(swigCPtr, parts, keys, partition); DatabaseException.ThrowException(ret); return ret; }
public static extern int DB_set_partition(HandleRef jarg1, uint jarg2, IntPtr[] jarg3, BDB_PartitionDelegate jarg4);