Merge remote-tracking branch 'origin/fastpath'

* origin/fastpath:
  Small (potential performance) improvement for logging framework.
  Script-level rotation postprocessor fix.
  update input framework documentation to reflect want_record change.
  Fix crash when encountering an InterpreterException in a predicate in logging or input Framework.
  make want_record=T the default for events
This commit is contained in:
Robin Sommer 2012-07-27 12:22:03 -07:00
commit c66c6d7c46
12 changed files with 51 additions and 39 deletions

View file

@ -1546,7 +1546,7 @@ bool Manager::Delete(ReaderFrontend* reader, Value* *vals)
bool Manager::CallPred(Func* pred_func, const int numvals, ...)
{
bool result;
bool result = false;
val_list vl(numvals);
va_list lP;
@ -1557,10 +1557,13 @@ bool Manager::CallPred(Func* pred_func, const int numvals, ...)
va_end(lP);
Val* v = pred_func->Call(&vl);
result = v->AsBool();
Unref(v);
if ( v )
{
result = v->AsBool();
Unref(v);
}
return(result);
return result;
}
bool Manager::SendEvent(const string& name, const int num_vals, Value* *vals)

View file

@ -686,16 +686,13 @@ bool Manager::Write(EnumVal* id, RecordVal* columns)
int result = 1;
try
Val* v = filter->pred->Call(&vl);
if ( v )
{
Val* v = filter->pred->Call(&vl);
result = v->AsBool();
Unref(v);
}
catch ( InterpreterException& e )
{ /* Already reported. */ }
if ( ! result )
continue;
}
@ -726,15 +723,10 @@ bool Manager::Write(EnumVal* id, RecordVal* columns)
Val* v = 0;
try
{
v = filter->path_func->Call(&vl);
}
v = filter->path_func->Call(&vl);
catch ( InterpreterException& e )
{
if ( ! v )
return false;
}
if ( ! v->Type()->Tag() == TYPE_STRING )
{
@ -1382,16 +1374,13 @@ bool Manager::FinishedRotation(WriterFrontend* writer, const char* new_name, con
int result = 0;
try
Val* v = func->Call(&vl);
if ( v )
{
Val* v = func->Call(&vl);
result = v->AsBool();
Unref(v);
}
catch ( InterpreterException& e )
{ /* Already reported. */ }
return result;
}