49 eventPrincipalHolder_(),
50 adjustEventToNewProductRegistry_(
false),
52 protocolVersion_(0
U) {}
66 FDEBUG(6) <<
"mergeIntoRegistry: Product List: " << std::endl;
72 if (!mergeInfo.empty()) {
73 throw cms::Exception(
"MismatchedInput",
"RootInputFileSequence::previousEvent()") << mergeInfo;
90 std::vector<std::string> missingDictionaries;
91 std::vector<std::string> branchNamesForMissing;
92 std::vector<std::string> producedTypes;
93 for (
auto const& item : descs) {
96 FDEBUG(6) <<
"declare: " << real_name << std::endl;
97 if (!
loadCap(real_name, missingDictionaries)) {
98 branchNamesForMissing.emplace_back(item.branchName());
99 producedTypes.emplace_back(item.className() +
std::string(
" (read from input)"));
102 if (!missingDictionaries.empty()) {
103 std::string context(
"Calling StreamerInputSource::declareStreamers, checking dictionaries for input types");
109 for (
auto const& item : descs) {
112 FDEBUG(6) <<
"BuildReadData: " << real_name << std::endl;
123 throw cms::Exception(
"StreamTranslation",
"Registry deserialization error")
124 <<
"received wrong message type: expected INIT, got " << initView.
code() <<
"\n";
131 FDEBUG(10) <<
"StreamerInputSource::deserializeRegistry processName = " <<
processName_ << std::endl;
132 FDEBUG(10) <<
"StreamerInputSource::deserializeRegistry protocolVersion_= " <<
protocolVersion_ << std::endl;
143 <<
" chksum from registry data = " << adler32_chksum <<
" from header = " << initView.
adler32_chksum()
144 <<
" host name = " << initView.
hostName() << std::endl;
150 TBuffer::kRead, initView.
descLength(),
const_cast<char*
>((
char const*)initView.
descData()), kFALSE);
152 std::unique_ptr<SendJobHeader>
sd((
SendJobHeader*)xbuf.ReadObjectAny(desc));
154 if (
sd.get() ==
nullptr) {
155 throw cms::Exception(
"StreamTranslation",
"Registry deserialization error")
156 <<
"Could not read the initial product registry list\n";
159 sd->initializeTransients();
175 for (
auto const& item : psetMap) {
177 pset.setID(item.first);
187 throw cms::Exception(
"StreamTranslation",
"Event deserialization error")
188 <<
"received wrong message type: expected EVENT, got " << eventView.
code() <<
"\n";
189 FDEBUG(9) <<
"Decode event: " << eventView.
event() <<
" " << eventView.
run() <<
" " << eventView.
size() <<
" " 196 unsigned long dest_size;
205 <<
" chksum from event = " << adler32_chksum <<
" from header = " << eventView.
adler32_chksum()
206 <<
" host name = " << eventView.
hostName() << std::endl;
208 if (origsize != 78 && origsize != 0) {
217 dest_.resize(dest_size);
218 unsigned char*
pos = (
unsigned char*)&
dest_[0];
219 unsigned char const* from = (
unsigned char const*)eventView.
eventData();
227 xbuf_.SetBuffer(&
dest_[0], dest_size, kFALSE);
238 std::shared_ptr<void> refCoreStreamerGuard(
nullptr, [](
void*) {
246 throw cms::Exception(
"StreamTranslation",
"Event deserialization error")
247 <<
"got a null event from input stream\n";
291 for (
auto& spitem : sps) {
292 FDEBUG(10) <<
"check prodpair" << std::endl;
293 if (spitem.desc() ==
nullptr)
296 <<
" " << spitem.desc()->className() <<
" " << spitem.desc()->productInstanceName() <<
" " 297 << spitem.desc()->branchID() << std::endl;
301 if (spitem.parents()) {
303 if (spitem.prod() !=
nullptr) {
304 FDEBUG(10) <<
"addproduct next " << spitem.branchID() << std::endl;
306 branchDesc, std::unique_ptr<WrapperBase>(const_cast<WrapperBase*>(spitem.prod())), &productProvenance);
307 FDEBUG(10) <<
"addproduct done" << std::endl;
309 FDEBUG(10) <<
"addproduct empty next " << spitem.branchID() << std::endl;
310 eventPrincipal.
putOnRead(branchDesc, std::unique_ptr<WrapperBase>(), &productProvenance);
311 FDEBUG(10) <<
"addproduct empty done" << std::endl;
315 if (spitem.prod() !=
nullptr) {
316 FDEBUG(10) <<
"addproduct next " << spitem.branchID() << std::endl;
318 branchDesc, std::unique_ptr<WrapperBase>(const_cast<WrapperBase*>(spitem.prod())), productProvenance);
319 FDEBUG(10) <<
"addproduct done" << std::endl;
321 FDEBUG(10) <<
"addproduct empty next " << spitem.branchID() << std::endl;
322 eventPrincipal.
putOnRead(branchDesc, std::unique_ptr<WrapperBase>(), productProvenance);
323 FDEBUG(10) <<
"addproduct empty done" << std::endl;
329 FDEBUG(10) <<
"Size = " << eventPrincipal.
size() << std::endl;
341 unsigned int inputSize,
342 std::vector<unsigned char>& outputBuffer,
343 unsigned int expectedFullSize) {
344 unsigned long origSize = expectedFullSize;
345 unsigned long uncompressedSize = expectedFullSize * 1.1;
346 FDEBUG(1) <<
"Uncompress: original size = " << origSize <<
", compressed size = " << inputSize << std::endl;
347 outputBuffer.resize(uncompressedSize);
348 int ret = uncompress(&outputBuffer[0], &uncompressedSize, inputBuffer, inputSize);
352 FDEBUG(10) <<
" original size = " << origSize <<
" final size = " << uncompressedSize << std::endl;
353 if (origSize != uncompressedSize) {
355 throw cms::Exception(
"StreamDeserialization",
"Uncompression error")
356 <<
"mismatch event lengths should be" << origSize <<
" got " << uncompressedSize <<
"\n";
360 throw cms::Exception(
"StreamDeserialization",
"Uncompression error") <<
"Error code = " << ret <<
"\n ";
362 return (
unsigned int)uncompressedSize;
378 <<
"Run number cannot be modified for this type of Input Source\n" 379 <<
"Contact a Storage Manager Developer\n";
391 unsigned int&
index)
const {
396 std::vector<WrapperBase const*>& wrappers,
397 std::vector<unsigned int>&
keys)
const {
void throwMissingDictionariesException(std::vector< std::string > &missingDictionaries, std::string const &context)
WrapperBase const * getThinnedProduct(ProductID const &pid, unsigned int &key) const override
static Timestamp invalidTimestamp()
const uint8 * eventData() const
const uint8 * descData() const
std::string hostName() const
std::vector< BranchDescription > SendDescs
void doBuildRealData(const std::string &name)
bool registerProcessHistory(ProcessHistory const &processHistory)
void setRefCoreStreamer(bool resetAll=false)
void updateFromPrimaryInput(ThinnedAssociationsHelper const &)
std::vector< EventSelectionID > EventSelectionIDVector
void getThinnedProducts(ProductID const &pid, std::vector< WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys) const override
uint32 adler32_chksum() const
uint32 eventLength() const
uint32 adler32_chksum() const
std::vector< BranchListIndex > BranchListIndexes
StreamID streamID() const
std::string hostName() const
std::string merge(ProductRegistry const &other, std::string const &fileName, BranchDescription::MatchMode branchesMustMatch=BranchDescription::Permissive)
bool insertMapped(value_type const &v, bool forceUpdate=false)
void setProcessHistoryID(ProcessHistoryID const &phid)
std::vector< StreamedProduct > SendProds
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
uint32 protocolVersion() const
unsigned int value() const
std::string wrappedClassName(std::string const &iFullName)
void putOnRead(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const *productProvenance) const
bool loadCap(const std::string &name, std::vector< std::string > &missingDictionaries)
TClass * getTClass(const std::type_info &ti)
uint32 origDataSize() const
unsigned int transitionIndex() const
bool updateFromInput(BranchIDLists const &bidlists)
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
bool adjustToNewProductRegistry(ProductRegistry const ®)
std::string processName() const
void updateFromInput(ProductList const &other)
void setProcessHistoryID(ProcessHistoryID const &phid)
void adjustIndexesAfterProductRegistryAddition()
uint32 descLength() const
WrapperBase const * getIt(ProductID const &pid) const override
static Registry * instance()