Merge remote-tracking branch 'origin/fastpath'

* origin/fastpath:
  ...and forgotten debug-output, sorry (was already merged in some other internal repositories before I noticed)
  and another bug in the input framework: config table does not work (is not transmitted to the readers) because the initialization was done the wrong way round.
This commit is contained in:
Robin Sommer 2012-10-12 09:32:48 -07:00
commit ebec0f4484
3 changed files with 21 additions and 13 deletions

View file

@ -1,4 +1,9 @@
2.1-61 | 2012-10-12 09:32:48 -0700
* Fix bug in the input framework: the config table did not work.
(Bernhard Amann)
2.1-58 | 2012-10-08 10:10:09 -0700 2.1-58 | 2012-10-08 10:10:09 -0700
* Fix a problem with non-manager cluster nodes applying * Fix a problem with non-manager cluster nodes applying

View file

@ -1 +1 @@
2.1-58 2.1-61

View file

@ -322,20 +322,10 @@ bool Manager::CreateStream(Stream* info, RecordVal* description)
Unref(mode); Unref(mode);
Val* config = description->LookupWithDefault(rtype->FieldOffset("config")); Val* config = description->LookupWithDefault(rtype->FieldOffset("config"));
ReaderFrontend* reader_obj = new ReaderFrontend(*rinfo, reader);
assert(reader_obj);
info->reader = reader_obj;
info->type = reader->AsEnumVal(); // ref'd by lookupwithdefault
info->name = name;
info->config = config->AsTableVal(); // ref'd by LookupWithDefault info->config = config->AsTableVal(); // ref'd by LookupWithDefault
info->info = rinfo;
Ref(description);
info->description = description;
{ {
// create config mapping in ReaderInfo. Has to be done before the construction of reader_obj.
HashKey* k; HashKey* k;
IterCookie* c = info->config->AsTable()->InitForIteration(); IterCookie* c = info->config->AsTable()->InitForIteration();
@ -345,13 +335,26 @@ bool Manager::CreateStream(Stream* info, RecordVal* description)
ListVal* index = info->config->RecoverIndex(k); ListVal* index = info->config->RecoverIndex(k);
string key = index->Index(0)->AsString()->CheckString(); string key = index->Index(0)->AsString()->CheckString();
string value = v->Value()->AsString()->CheckString(); string value = v->Value()->AsString()->CheckString();
info->info->config.insert(std::make_pair(copy_string(key.c_str()), copy_string(value.c_str()))); rinfo->config.insert(std::make_pair(copy_string(key.c_str()), copy_string(value.c_str())));
Unref(index); Unref(index);
delete k; delete k;
} }
} }
ReaderFrontend* reader_obj = new ReaderFrontend(*rinfo, reader);
assert(reader_obj);
info->reader = reader_obj;
info->type = reader->AsEnumVal(); // ref'd by lookupwithdefault
info->name = name;
info->info = rinfo;
Ref(description);
info->description = description;
DBG_LOG(DBG_INPUT, "Successfully created new input stream %s", DBG_LOG(DBG_INPUT, "Successfully created new input stream %s",
name.c_str()); name.c_str());