// PD_TRACE_DECLARE_FUNCTION ( SDB__DMSSU_DUMPINFO2, "_dmsStorageUnit::dumpInfo" ) void _dmsStorageUnit::dumpInfo ( set<_monStorageUnit> &storageUnitList, BOOLEAN sys ) { monStorageUnit su ; const dmsStorageUnitHeader *dataHeader = _pDataSu->getHeader() ; PD_TRACE_ENTRY ( SDB__DMSSU_DUMPINFO2 ) ; if ( !sys && dmsIsSysCSName( CSName() ) ) { goto done ; } ossMemset ( su._name, 0, sizeof ( su._name ) ) ; ossStrncpy ( su._name, CSName(), DMS_SU_NAME_SZ ) ; su._pageSize = getPageSize() ; su._lobPageSize = getLobPageSize() ; su._sequence = CSSequence() ; su._numCollections = dataHeader->_numMB ; su._collectionHWM = dataHeader->_MBHWM ; su._size = totalSize() ; su._CSID = CSID() ; su._logicalCSID = LogicalCSID() ; storageUnitList.insert ( su ) ; done : PD_TRACE_EXIT ( SDB__DMSSU_DUMPINFO2 ) ; }
// PD_TRACE_DECLARE_FUNCTION ( SDB__DMSSU_REMOVE, "_dmsStorageUnit::remove" ) INT32 _dmsStorageUnit::remove () { INT32 rc = SDB_OK ; PD_TRACE_ENTRY ( SDB__DMSSU_REMOVE ) ; if ( _pDataSu ) { rc = _pDataSu->removeStorage() ; PD_RC_CHECK( rc, PDERROR, "Failed to remove collection space[%s] " "data file, rc: %d", CSName(), rc ) ; } if ( _pIndexSu ) { rc = _pIndexSu->removeStorage() ; PD_RC_CHECK( rc, PDERROR, "Failed to remove collection space[%s] " "index file, rc: %d", CSName(), rc ) ; } if ( _pLobSu ) { _pLobSu->removeStorageFiles() ; } PD_LOG( PDEVENT, "Remove collection space[%s] files succeed", CSName() ) ; done: PD_TRACE_EXITRC ( SDB__DMSSU_REMOVE, rc ) ; return rc ; error: goto done ; }
CMPIInstance *makeInstance(const CMPIBroker *broker, const char * classname, const char * Namespace, CWS_FILE *cwsf) { CMPIInstance *in = NULL; CMPIValue val; CMPIObjectPath *op = CMNewObjectPath(broker, (char*)Namespace, (char*)classname, NULL); CMSetHostname(op,CSName()); if (!CMIsNullObject(op)) { in = CMNewInstance(broker,op,NULL); if (!CMIsNullObject(in)) { CMSetProperty(in,"CSCreationClassName",CSCreationClassName(),CMPI_chars); CMSetProperty(in,"CSName",CSName(),CMPI_chars); CMSetProperty(in,"FSCreationClassName",FSCreationClassName(),CMPI_chars); CMSetProperty(in,"FSName",FSName(),CMPI_chars); CMSetProperty(in,"CreationClassName",classname,CMPI_chars); CMSetProperty(in,"Name",cwsf->cws_name,CMPI_chars); CMSetProperty(in,"FileSize",(CMPIValue*)&cwsf->cws_size,CMPI_uint64); #ifndef SIMULATED /* We don't want this code in the simulated env - time is dynamic (diff timezones) and the testing system might using a diff timezone and report failure */ val.uint64 = cwsf->cws_ctime; val.dateTime = CMNewDateTimeFromBinary(broker,val.uint64*1000000,0,NULL); CMSetProperty(in,"CreationDate",&val,CMPI_dateTime); val.uint64 = cwsf->cws_mtime; val.dateTime = CMNewDateTimeFromBinary(broker,val.uint64*1000000,0,NULL); CMSetProperty(in,"LastModified",&val,CMPI_dateTime); val.uint64 = cwsf->cws_atime; val.dateTime = CMNewDateTimeFromBinary(broker,val.uint64*1000000,0,NULL); CMSetProperty(in,"LastAccessed",&val,CMPI_dateTime); #endif val.uint64=0L; val.boolean=(cwsf->cws_mode & 0400) != 0; CMSetProperty(in,"Readable",&val,CMPI_boolean); val.boolean=(cwsf->cws_mode & 0200) != 0; CMSetProperty(in,"Writeable",&val,CMPI_boolean); val.boolean=(cwsf->cws_mode & 0100) != 0; CMSetProperty(in,"Executable",&val,CMPI_boolean); } } return in; }
CMPIObjectPath *makePath( const CMPIBroker *broker, const char * classname, const char * Namespace, CWS_FILE *cwsf) { CMPIObjectPath *op; op = CMNewObjectPath(broker, (char*)Namespace, (char*)classname, NULL); CMSetHostname(op,CSName()); if (!CMIsNullObject(op)) { CMAddKey(op,"CSCreationClassName",CSCreationClassName(),CMPI_chars); CMAddKey(op,"CSName",CSName(),CMPI_chars); CMAddKey(op,"FSCreationClassName",FSCreationClassName(),CMPI_chars); CMAddKey(op,"FSName",FSName(),CMPI_chars); CMAddKey(op,"CreationClassName",classname,CMPI_chars); CMAddKey(op,"Name",cwsf->cws_name,CMPI_chars); } return op; }
// PD_TRACE_DECLARE_FUNCTION ( SDB__DMSSU_DUMPINFO1, "_dmsStorageUnit::dumpInfo" ) void _dmsStorageUnit::dumpInfo ( set<_monCollection> &collectionList, BOOLEAN sys ) { dmsMB *mb = NULL ; dmsMBStatInfo *mbStat = NULL ; PD_TRACE_ENTRY ( SDB__DMSSU_DUMPINFO1 ) ; _pDataSu->_metadataLatch.get_shared() ; dmsStorageData::COLNAME_MAP_IT it = _pDataSu->_collectionNameMap.begin() ; while ( it != _pDataSu->_collectionNameMap.end() ) { monCollection collection ; if ( !sys && dmsIsSysCLName( it->first ) ) { ++it ; continue ; } mb = &_pDataSu->_dmsMME->_mbList[it->second] ; mbStat = &_pDataSu->_mbStatInfo[it->second] ; ossMemset ( collection._name, 0, sizeof(collection._name) ) ; ossStrncpy ( collection._name, CSName(), DMS_SU_NAME_SZ ) ; ossStrncat ( collection._name, ".", 1 ) ; ossStrncat ( collection._name, mb->_collectionName, DMS_COLLECTION_NAME_SZ ) ; collection.addDetails ( CSSequence(), mb->_numIndexes, mb->_blockID, mb->_flag, mb->_logicalID, mbStat->_totalRecords, mbStat->_totalDataPages, mbStat->_totalIndexPages, mbStat->_totalLobPages, mbStat->_totalDataFreeSpace, mbStat->_totalIndexFreeSpace ) ; collectionList.insert ( collection ) ; ++it ; } _pDataSu->_metadataLatch.release_shared() ; PD_TRACE_EXIT ( SDB__DMSSU_DUMPINFO1 ) ; }