本文整理汇总了C++中ObObj::get_createtime方法的典型用法代码示例。如果您正苦于以下问题:C++ ObObj::get_createtime方法的具体用法?C++ ObObj::get_createtime怎么用?C++ ObObj::get_createtime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObObj
的用法示例。
在下文中一共展示了ObObj::get_createtime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: free
TEST(ObObj,Serialize_createtime)
{
ObCreateTime data[] = {1,28,1,static_cast<int64_t>(UINT32_MAX),INT64_MAX,124543900,221348087492};
int64_t need_len = 0;
for(uint32_t i=0;i<sizeof(data)/sizeof(data[0]);++i)
{
need_len += serialization::encoded_length_createtime(data[i]);
}
char *buf = (char *)malloc(need_len);
ObObj t;
int64_t pos = 0;
for(uint32_t i=0;i<sizeof(data)/sizeof(data[0]);++i)
{
t.reset();
t.set_createtime(data[i]);
ASSERT_EQ(t.serialize(buf,need_len,pos),OB_SUCCESS);
}
pos = 0;
ObCreateTime v = 0;
for(uint32_t i=0;i<sizeof(data)/sizeof(data[0]);++i)
{
t.reset();
ASSERT_EQ(t.deserialize(buf,need_len,pos),OB_SUCCESS);
ASSERT_EQ(t.get_createtime(v),OB_SUCCESS);
ASSERT_EQ(v,data[i]);
}
free(buf);
}
示例2: apply
//.........这里部分代码省略.........
if (OB_SUCCESS == err)
{
err = mutation.get_precise_datetime(mutation_value.microsecond_val,is_add);
}
if (OB_SUCCESS == err)
{
if (is_add)
{
value.microsecond_val += mutation_value.microsecond_val;
}
else
{
value.microsecond_val = mutation_value.microsecond_val;
}
set_precise_datetime(value.microsecond_val,is_add && (org_is_add || org_is_nop));
}
break;
case ObExtendType:
switch (mutation.get_ext())
{
case ObActionFlag::OP_DEL_ROW:
case ObActionFlag::OP_DEL_TABLE:
/// used for join, if right row was deleted, set the cell to null
set_null();
break;
case ObActionFlag::OP_ROW_DOES_NOT_EXIST:
/// do nothing
break;
case ObActionFlag::OP_NOP:
if (get_ext() == ObActionFlag::OP_ROW_DOES_NOT_EXIST
|| get_ext() == ObActionFlag::OP_DEL_ROW)
{
set_null();
}
break;
default:
TBSYS_LOG(ERROR,"unsupported ext value [value:%ld]", mutation.get_ext());
err = OB_INVALID_ARGUMENT;
break;
}
break;
case ObCreateTimeType:
err = mutation.get_createtime(create_time);
if (OB_SUCCESS == err)
{
if (ext_val_can_change || org_is_nop)
{
set_createtime(create_time);
}
}
if (OB_SUCCESS == err)
{
err = get_createtime(value.create_time_val);
}
if (OB_SUCCESS == err)
{
err = mutation.get_createtime(mutation_value.create_time_val);
}
if (OB_SUCCESS == err)
{
set_createtime(std::min<ObCreateTime>(value.create_time_val,mutation_value.create_time_val));
}
break;
case ObModifyTimeType:
err = mutation.get_modifytime(modify_time);
if (OB_SUCCESS == err)
{
if (ext_val_can_change || org_is_nop)
{
set_modifytime(modify_time);
}
}
if (OB_SUCCESS == err)
{
err = get_modifytime(value.modify_time_val);
}
if (OB_SUCCESS == err)
{
err = mutation.get_modifytime(mutation_value.modify_time_val);
}
if (OB_SUCCESS == err)
{
set_modifytime(std::max<ObCreateTime>(value.modify_time_val,mutation_value.modify_time_val));
}
break;
default:
/* case ObSeqType: */
TBSYS_LOG(ERROR,"unsupported type [type:%d]", static_cast<int32_t>(mutation.get_type()));
err = OB_INVALID_ARGUMENT;
break;
}
}
if(OB_SUCCESS != err)
{
TBSYS_LOG(WARN,"fail to apply [this->type:%ld,this->ext:%ld,mutation->type:%d,mutation->ext:%ld, err:%d]",
org_type, org_ext, mutation.get_type(), mutation.get_ext(), err);
}
return err;
}