ObPhyOperator *ObUpsPhyOperatorFactory::get_one(ObPhyOperatorType type, common::ModuleArena &allocator)
 {
   ObPhyOperator *ret = NULL;
   if (NULL == session_ctx_ || NULL == table_mgr_)
   {
     TBSYS_LOG(ERROR, "param not set: session_ctx=%p, table_mgr=%p", session_ctx_, table_mgr_);
   }
   else
   {
     switch(type)
     {
       case PHY_LOCK_FILTER:
         ret = new_operator(ObUpsLockFilter, allocator, *session_ctx_);
         break;
       case PHY_INC_SCAN:
         {
           ObUpsIncScan *ic = tc_rp_alloc(ObUpsIncScan);
           ic->set_session_ctx(session_ctx_);
           ret = ic;
           break;
         }
       case PHY_UPS_MODIFY:
         ret = new_operator(MemTableModify, allocator, *session_ctx_, *table_mgr_);
         break;
       case PHY_UPS_MODIFY_WITH_DML_TYPE:
         ret = new_operator(MemTableModifyWithDmlType, allocator, *session_ctx_, *table_mgr_);
         break;
       default:
         ret = ObPhyOperatorFactory::get_one(type, allocator);
         break;
     }
   }
   return ret;
 }
示例#2
0
GSList *math_string_to_infix(gchar *string)
{
    GSList *infix = NULL;
    gchar *expr = string;

    for (; *expr; expr++) {
	if (strchr("+-/*^()", *expr)) {
	    infix = g_slist_append(infix, new_operator(*expr));
	} else if (strchr("@", *expr)) {
	    infix = g_slist_append(infix, new_variable(*expr));
	} else if (strchr("-.1234567890", *expr)) {
	    gfloat value;

	    sscanf(expr, "%f", &value);

	    while (*expr && strchr(".1234567890", *expr))
		expr++;
	    expr--;

	    infix = g_slist_append(infix, new_value(value));
	} else if (!isspace(*expr)) {
	    g_print("Invalid token: [%c][%d]\n", *expr, *expr);
	    math_infix_free(infix, TRUE);
	    return NULL;
	}
    }

    return infix;
}