Remove synchrnized and persistent attributes.

Code that was used by them is still there.
This commit is contained in:
Johanna Amann 2019-05-02 13:02:38 -07:00
parent 5d44735209
commit 61c84a0a40
9 changed files with 4 additions and 90 deletions

View file

@ -438,8 +438,6 @@ void Attributes::CheckAttr(Attr* a)
} }
break; break;
case ATTR_PERSISTENT:
case ATTR_SYNCHRONIZED:
case ATTR_TRACKED: case ATTR_TRACKED:
// FIXME: Check here for global ID? // FIXME: Check here for global ID?
break; break;

View file

@ -23,8 +23,6 @@ typedef enum {
ATTR_EXPIRE_READ, ATTR_EXPIRE_READ,
ATTR_EXPIRE_WRITE, ATTR_EXPIRE_WRITE,
ATTR_EXPIRE_CREATE, ATTR_EXPIRE_CREATE,
ATTR_PERSISTENT,
ATTR_SYNCHRONIZED,
ATTR_ENCRYPT, ATTR_ENCRYPT,
ATTR_RAW_OUTPUT, ATTR_RAW_OUTPUT,
ATTR_MERGEABLE, ATTR_MERGEABLE,

View file

@ -78,12 +78,6 @@ void ID::SetVal(Val* v, Opcode op, bool arg_weak_ref)
MutableVal::Properties props = 0; MutableVal::Properties props = 0;
if ( attrs && attrs->FindAttr(ATTR_SYNCHRONIZED) )
props |= MutableVal::SYNCHRONIZED;
if ( attrs && attrs->FindAttr(ATTR_PERSISTENT) )
props |= MutableVal::PERSISTENT;
if ( attrs && attrs->FindAttr(ATTR_TRACKED) ) if ( attrs && attrs->FindAttr(ATTR_TRACKED) )
props |= MutableVal::TRACKED; props |= MutableVal::TRACKED;
@ -198,27 +192,12 @@ void ID::UpdateValAttrs()
if ( val && val->IsMutableVal() ) if ( val && val->IsMutableVal() )
{ {
if ( attrs->FindAttr(ATTR_SYNCHRONIZED) )
props |= MutableVal::SYNCHRONIZED;
if ( attrs->FindAttr(ATTR_PERSISTENT) )
props |= MutableVal::PERSISTENT;
if ( attrs->FindAttr(ATTR_TRACKED) ) if ( attrs->FindAttr(ATTR_TRACKED) )
props |= MutableVal::TRACKED; props |= MutableVal::TRACKED;
val->AsMutableVal()->AddProperties(props); val->AsMutableVal()->AddProperties(props);
} }
if ( ! IsInternalGlobal() )
{
if ( attrs->FindAttr(ATTR_SYNCHRONIZED) )
remote_serializer->Register(this);
if ( attrs->FindAttr(ATTR_PERSISTENT) )
persistence_serializer->Register(this);
}
if ( val && val->Type()->Tag() == TYPE_TABLE ) if ( val && val->Type()->Tag() == TYPE_TABLE )
val->AsTableVal()->SetAttrs(attrs); val->AsTableVal()->SetAttrs(attrs);
@ -281,12 +260,6 @@ void ID::RemoveAttr(attr_tag a)
{ {
MutableVal::Properties props = 0; MutableVal::Properties props = 0;
if ( a == ATTR_SYNCHRONIZED )
props |= MutableVal::SYNCHRONIZED;
if ( a == ATTR_PERSISTENT )
props |= MutableVal::PERSISTENT;
if ( a == ATTR_TRACKED ) if ( a == ATTR_TRACKED )
props |= MutableVal::TRACKED; props |= MutableVal::TRACKED;
@ -473,12 +446,6 @@ ID* ID::Unserialize(UnserialInfo* info)
} }
} }
if ( id->FindAttr(ATTR_PERSISTENT) )
persistence_serializer->Register(id);
if ( id->FindAttr(ATTR_SYNCHRONIZED) )
remote_serializer->Register(id);
return id; return id;
} }

View file

@ -2946,7 +2946,8 @@ void RemoteSerializer::GotID(ID* id, Val* val)
assert(global_scope()->Lookup(id->Name())); assert(global_scope()->Lookup(id->Name()));
// Only synchronized values can arrive here. // Only synchronized values can arrive here.
assert(((MutableVal*) val)->GetProperties() & MutableVal::SYNCHRONIZED); // FIXME: Johanna, rip me out.
// assert(((MutableVal*) val)->GetProperties() & MutableVal::SYNCHRONIZED);
DBG_LOG(DBG_COMM, "got ID %s from peer\n", id->Name()); DBG_LOG(DBG_COMM, "got ID %s from peer\n", id->Name());
} }

View file

@ -876,23 +876,11 @@ void StateAccess::Log(StateAccess* access)
if ( access->target_type == TYPE_ID ) if ( access->target_type == TYPE_ID )
{ {
if ( access->target.id->FindAttr(ATTR_SYNCHRONIZED) )
synchronized = true;
if ( access->target.id->FindAttr(ATTR_PERSISTENT) )
persistent = true;
if ( access->target.id->FindAttr(ATTR_TRACKED) ) if ( access->target.id->FindAttr(ATTR_TRACKED) )
tracked = true; tracked = true;
} }
else else
{ {
if ( access->target.val->GetProperties() & MutableVal::SYNCHRONIZED )
synchronized = true;
if ( access->target.val->GetProperties() & MutableVal::PERSISTENT )
persistent = true;
if ( access->target.val->GetProperties() & MutableVal::TRACKED ) if ( access->target.val->GetProperties() & MutableVal::TRACKED )
tracked = true; tracked = true;
} }

View file

@ -524,9 +524,6 @@ public:
// values. (In any case, don't forget to call the parent's method.) // values. (In any case, don't forget to call the parent's method.)
typedef char Properties; typedef char Properties;
static const int PERSISTENT = 0x01;
static const int SYNCHRONIZED = 0x02;
// Tracked by NotifierRegistry, not recursive. // Tracked by NotifierRegistry, not recursive.
static const int TRACKED = 0x04; static const int TRACKED = 0x04;
@ -540,10 +537,10 @@ public:
bool LoggingAccess() const bool LoggingAccess() const
{ {
#ifndef DEBUG #ifndef DEBUG
return props & (SYNCHRONIZED|PERSISTENT|TRACKED); return props & TRACKED;
#else #else
return debug_logger.IsVerbose() || return debug_logger.IsVerbose() ||
(props & (SYNCHRONIZED|PERSISTENT|TRACKED)); (props & TRACKED);
#endif #endif
} }

View file

@ -142,26 +142,6 @@ static void make_var(ID* id, BroType* t, init_class c, Expr* init,
} }
} }
if ( id->FindAttr(ATTR_PERSISTENT) || id->FindAttr(ATTR_SYNCHRONIZED) )
{
if ( dt == VAR_CONST )
{
id->Error("&persistent/synchronized with constant");
return;
}
else if ( dt == VAR_OPTION )
{
id->Error("&persistent/synchronized with option");
return;
}
if ( ! id->IsGlobal() )
{
id->Error("&persistant/synchronized with non-global");
return;
}
}
if ( do_init ) if ( do_init )
{ {
if ( c == INIT_NONE && dt == VAR_REDEF && t->IsTable() && if ( c == INIT_NONE && dt == VAR_REDEF && t->IsTable() &&

View file

@ -25,7 +25,6 @@
%token TOK_ATTR_OPTIONAL TOK_ATTR_REDEF TOK_ATTR_ROTATE_INTERVAL %token TOK_ATTR_OPTIONAL TOK_ATTR_REDEF TOK_ATTR_ROTATE_INTERVAL
%token TOK_ATTR_ROTATE_SIZE TOK_ATTR_DEL_FUNC TOK_ATTR_EXPIRE_FUNC %token TOK_ATTR_ROTATE_SIZE TOK_ATTR_DEL_FUNC TOK_ATTR_EXPIRE_FUNC
%token TOK_ATTR_EXPIRE_CREATE TOK_ATTR_EXPIRE_READ TOK_ATTR_EXPIRE_WRITE %token TOK_ATTR_EXPIRE_CREATE TOK_ATTR_EXPIRE_READ TOK_ATTR_EXPIRE_WRITE
%token TOK_ATTR_PERSISTENT TOK_ATTR_SYNCHRONIZED
%token TOK_ATTR_RAW_OUTPUT TOK_ATTR_MERGEABLE %token TOK_ATTR_RAW_OUTPUT TOK_ATTR_MERGEABLE
%token TOK_ATTR_PRIORITY TOK_ATTR_LOG TOK_ATTR_ERROR_HANDLER %token TOK_ATTR_PRIORITY TOK_ATTR_LOG TOK_ATTR_ERROR_HANDLER
%token TOK_ATTR_TYPE_COLUMN TOK_ATTR_DEPRECATED %token TOK_ATTR_TYPE_COLUMN TOK_ATTR_DEPRECATED
@ -1308,10 +1307,6 @@ attr:
{ $$ = new Attr(ATTR_EXPIRE_READ, $3); } { $$ = new Attr(ATTR_EXPIRE_READ, $3); }
| TOK_ATTR_EXPIRE_WRITE '=' expr | TOK_ATTR_EXPIRE_WRITE '=' expr
{ $$ = new Attr(ATTR_EXPIRE_WRITE, $3); } { $$ = new Attr(ATTR_EXPIRE_WRITE, $3); }
| TOK_ATTR_PERSISTENT
{ $$ = new Attr(ATTR_PERSISTENT); }
| TOK_ATTR_SYNCHRONIZED
{ $$ = new Attr(ATTR_SYNCHRONIZED); }
| TOK_ATTR_ENCRYPT | TOK_ATTR_ENCRYPT
{ $$ = new Attr(ATTR_ENCRYPT); } { $$ = new Attr(ATTR_ENCRYPT); }
| TOK_ATTR_ENCRYPT '=' expr | TOK_ATTR_ENCRYPT '=' expr

View file

@ -310,11 +310,6 @@ when return TOK_WHEN;
return TOK_ATTR_MERGEABLE; return TOK_ATTR_MERGEABLE;
} }
&persistent {
deprecated_attr(yytext);
return TOK_ATTR_PERSISTENT;
}
&rotate_interval { &rotate_interval {
deprecated_attr(yytext); deprecated_attr(yytext);
return TOK_ATTR_ROTATE_INTERVAL; return TOK_ATTR_ROTATE_INTERVAL;
@ -325,11 +320,6 @@ when return TOK_WHEN;
return TOK_ATTR_ROTATE_SIZE; return TOK_ATTR_ROTATE_SIZE;
} }
&synchronized {
deprecated_attr(yytext);
return TOK_ATTR_SYNCHRONIZED;
}
@deprecated.* { @deprecated.* {
auto num_files = file_stack.length(); auto num_files = file_stack.length();
auto comment = skip_whitespace(yytext + 11); auto comment = skip_whitespace(yytext + 11);