|
LSSTApplications
1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
|
Helper class for managing chunks of a particular type. More...
#include <ChunkManagerImpl.h>
Public Types | |
| typedef BlockAllocator< MutexT, DataT, TraitsT > | Allocator |
| typedef ChunkRef< Allocator, DataT, TraitsT > | Chunk |
| typedef ChunkDescriptor < TraitsT::MAX_BLOCKS_PER_CHUNK > | Descriptor |
Public Member Functions | |
| SubManager (unsigned char const *const ref, std::size_t const offset) | |
| int | size () const |
| Returns the number of chunks under management. More... | |
| int | space () const |
| Returns the number of additional chunks that could be handled by this manager. More... | |
| void | createOrRegisterInterest (std::vector< Chunk > &toRead, std::vector< Chunk > &toWaitFor, int const visitId, std::vector< int > const &chunkIds) |
| bool | checkForOwnership (std::vector< Chunk > &toRead, std::vector< Chunk > &toWaitFor, int const visitId) |
| void | getChunks (std::vector< Chunk > &chunks, std::vector< int > const &chunkIds) |
| bool | relinquishOwnership (int const visitId, bool const rollback, VisitTracker const &tracker) |
| void | print (std::ostream &os) const |
| void | print (int const chunkId, std::ostream &os) const |
| void | printVisit (int const visitId, std::ostream &os) const |
Public Attributes | |
| HashedSet< Descriptor, NUM_CHUNKS > | _chunks |
| Allocator | _allocator |
Static Public Attributes | |
| static int const | NUM_CHUNKS = TraitsT::MAX_CHUNKS_PER_FOV * MAX_VISITS_IN_FLIGHT |
Helper class for managing chunks of a particular type.
To be used exclusively by chunk manager implementations.
Definition at line 219 of file ChunkManagerImpl.h.
| typedef BlockAllocator<MutexT, DataT, TraitsT> lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::Allocator |
Definition at line 221 of file ChunkManagerImpl.h.
| typedef ChunkRef<Allocator, DataT, TraitsT> lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::Chunk |
Definition at line 222 of file ChunkManagerImpl.h.
| typedef ChunkDescriptor<TraitsT::MAX_BLOCKS_PER_CHUNK> lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::Descriptor |
Definition at line 223 of file ChunkManagerImpl.h.
|
inline |
Definition at line 234 of file ChunkManagerImpl.h.
| bool lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::checkForOwnership | ( | std::vector< Chunk > & | toRead, |
| std::vector< Chunk > & | toWaitFor, | ||
| int const | visitId | ||
| ) |
Checks to see whether the chunks in the toWaitFor list are owned by the given visit. Any chunks that have had their ownership transferred to the given visit are removed from toWaitFor. Of these chunks, the subset that were not completely read into memory (that is, whose previous owners failed while reading them in) are appended to toRead.
| [out] | toRead | Set to the list of chunks now owned by the given visit, but which must be re-read from disk. |
| [in,out] | toWaitFor | The list of chunks for which ownership must be checked. Any chunks now owned by the given visit are removed from the list by the call. |
| [in] | visitId | An identifier for a visit to a FOV. |
true if and only if all the chunks initially in the toWaitFor list now belong to the given visit. Definition at line 464 of file ChunkManagerImpl.cc.
| void lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::createOrRegisterInterest | ( | std::vector< Chunk > & | toRead, |
| std::vector< Chunk > & | toWaitFor, | ||
| int const | visitId, | ||
| std::vector< int > const & | chunkIds | ||
| ) |
Registers the given visit as an interested party of each of the given chunks. If any of the given identifiers doesn't correspond to a chunk, an empty chunk is created. Newly created chunks are stored in the toRead list (indicating data for them must be read from disk), previously existing chunks are returned in the toWaitFor list (indicating that the visit must wait until it owns those instances before processing can begin).
| [out] | toRead | Set to the list of chunks that were not found in memory and must be read in from disk. |
| [out] | toWaitFor | Set to the list of chunks instances that are already in memory and must be waited on. |
| [in] | visitId | The visit to register interest or create chunks for. |
| [in] | chunkIds | A list of identifiers for chunks required by the visit. Assumed to be duplicate free. |
| lsst::pex::exceptions:::MemoryError | Thrown if there is insufficient space to track all requested chunks. |
Definition at line 420 of file ChunkManagerImpl.cc.
| void lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::getChunks | ( | std::vector< Chunk > & | chunks, |
| std::vector< int > const & | chunkIds | ||
| ) |
Returns a chunk for each of the given identifiers that corresponds to a chunk managed by this SubManager.
| [out] | chunks | Set to the list of chunk instances managed by this SubManager and with an identifier in chunkIds. |
| [in] | chunkIds | The list of chunk identifiers to return chunk instances for. Assumed to be duplicate free. |
Definition at line 503 of file ChunkManagerImpl.cc.
| void lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::print | ( | std::ostream & | os | ) | const |
Definition at line 627 of file ChunkManagerImpl.cc.
| void lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::print | ( | int const | chunkId, |
| std::ostream & | os | ||
| ) | const |
Definition at line 650 of file ChunkManagerImpl.cc.
| void lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::printVisit | ( | int const | visitId, |
| std::ostream & | os | ||
| ) | const |
Definition at line 678 of file ChunkManagerImpl.cc.
| bool lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::relinquishOwnership | ( | int const | visitId, |
| bool const | rollback, | ||
| VisitTracker const & | tracker | ||
| ) |
Relinquishes ownership of any chunks owned by the given visit (each chunk is passed on to its first interested party that is still in flight).
| [in] | visitId | The visit owning the chunks to relinquish ownership of. |
| [in] | rollback | Flag indicating whether or not in-memory changes to a chunk should be rolled back (true) or committed (false) prior to relinquishing ownership. |
| [in] | tracker | Tracks the status of visits (whether or not a visit is in flight, and if so, whether or not it has failed). |
true if any chunks changed hands. Definition at line 531 of file ChunkManagerImpl.cc.
|
inline |
Returns the number of chunks under management.
Definition at line 237 of file ChunkManagerImpl.h.
|
inline |
Returns the number of additional chunks that could be handled by this manager.
Definition at line 239 of file ChunkManagerImpl.h.
| Allocator lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::_allocator |
Definition at line 230 of file ChunkManagerImpl.h.
| HashedSet<Descriptor, NUM_CHUNKS> lsst::ap::detail::SubManager< MutexT, DataT, TraitsT >::_chunks |
Definition at line 229 of file ChunkManagerImpl.h.
|
static |
Definition at line 227 of file ChunkManagerImpl.h.
1.8.5