@ -382,6 +382,51 @@ Status PessimisticTransactionDB::CreateColumnFamily(
return s ;
return s ;
}
}
Status PessimisticTransactionDB : : CreateColumnFamilies (
const ColumnFamilyOptions & options ,
const std : : vector < std : : string > & column_family_names ,
std : : vector < ColumnFamilyHandle * > * handles ) {
InstrumentedMutexLock l ( & column_family_mutex_ ) ;
Status s = VerifyCFOptions ( options ) ;
if ( ! s . ok ( ) ) {
return s ;
}
s = db_ - > CreateColumnFamilies ( options , column_family_names , handles ) ;
if ( s . ok ( ) ) {
for ( auto * handle : * handles ) {
lock_manager_ - > AddColumnFamily ( handle ) ;
UpdateCFComparatorMap ( handle ) ;
}
}
return s ;
}
Status PessimisticTransactionDB : : CreateColumnFamilies (
const std : : vector < ColumnFamilyDescriptor > & column_families ,
std : : vector < ColumnFamilyHandle * > * handles ) {
InstrumentedMutexLock l ( & column_family_mutex_ ) ;
for ( auto & cf_desc : column_families ) {
Status s = VerifyCFOptions ( cf_desc . options ) ;
if ( ! s . ok ( ) ) {
return s ;
}
}
Status s = db_ - > CreateColumnFamilies ( column_families , handles ) ;
if ( s . ok ( ) ) {
for ( auto * handle : * handles ) {
lock_manager_ - > AddColumnFamily ( handle ) ;
UpdateCFComparatorMap ( handle ) ;
}
}
return s ;
}
// Let LockManager know that it can deallocate the LockMap for this
// Let LockManager know that it can deallocate the LockMap for this
// column family.
// column family.
Status PessimisticTransactionDB : : DropColumnFamily (
Status PessimisticTransactionDB : : DropColumnFamily (
@ -396,6 +441,20 @@ Status PessimisticTransactionDB::DropColumnFamily(
return s ;
return s ;
}
}
Status PessimisticTransactionDB : : DropColumnFamilies (
const std : : vector < ColumnFamilyHandle * > & column_families ) {
InstrumentedMutexLock l ( & column_family_mutex_ ) ;
Status s = db_ - > DropColumnFamilies ( column_families ) ;
if ( s . ok ( ) ) {
for ( auto * handle : column_families ) {
lock_manager_ - > RemoveColumnFamily ( handle ) ;
}
}
return s ;
}
Status PessimisticTransactionDB : : TryLock ( PessimisticTransaction * txn ,
Status PessimisticTransactionDB : : TryLock ( PessimisticTransaction * txn ,
uint32_t cfh_id ,
uint32_t cfh_id ,
const std : : string & key ,
const std : : string & key ,