本文整理汇总了Python中pycassa.marshal.extract_type_name函数的典型用法代码示例。如果您正苦于以下问题:Python extract_type_name函数的具体用法?Python extract_type_name怎么用?Python extract_type_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了extract_type_name函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _set_default_validation_class
def _set_default_validation_class(self, t):
if isinstance(t, types.CassandraType):
self._default_validation_class = t
self._default_value_packer = t.pack
self._default_value_unpacker = t.unpack
have_counters = isinstance(t, types.CounterColumnType)
else:
self._default_validation_class = marshal.extract_type_name(t)
self._default_value_packer = marshal.packer_for(t)
self._default_value_unpacker = marshal.unpacker_for(t)
have_counters = self._default_validation_class == "CounterColumnType"
if not self.super:
if have_counters:
def _make_cosc(name, value, timestamp, ttl):
return ColumnOrSuperColumn(counter_column=CounterColumn(name, value))
else:
def _make_cosc(name, value, timestamp, ttl):
return ColumnOrSuperColumn(Column(name, value, timestamp, ttl))
self._make_cosc = _make_cosc
else:
if have_counters:
def _make_column(name, value, timestamp, ttl):
return CounterColumn(name, value)
self._make_column = _make_column
def _make_cosc(scol_name, subcols):
return ColumnOrSuperColumn(counter_super_column=(SuperColumn(scol_name, subcols)))
else:
self._make_column = Column
def _make_cosc(scol_name, subcols):
return ColumnOrSuperColumn(super_column=(SuperColumn(scol_name, subcols)))
self._make_cosc = _make_cosc
示例2: __setitem__
def __setitem__(self, item, value):
if isinstance(value, types.CassandraType):
self.type_map[item] = value
self.packers[item] = value.pack
self.unpackers[item] = value.unpack
else:
self.type_map[item] = marshal.extract_type_name(value)
self.packers[item] = marshal.packer_for(value)
self.unpackers[item] = marshal.unpacker_for(value)
示例3: _set_key_validation_class
def _set_key_validation_class(self, t):
if isinstance(t, types.CassandraType):
self._key_validation_class = t
self._key_packer = t.pack
self._key_unpacker = t.unpack
else:
self._key_validation_class = marshal.extract_type_name(t)
self._key_packer = marshal.packer_for(t)
self._key_unpacker = marshal.unpacker_for(t)
示例4: _set_super_column_name_class
def _set_super_column_name_class(self, t):
if isinstance(t, types.CassandraType):
self._super_column_name_class = t
self._super_name_packer = t.pack
self._super_name_unpacker = t.unpack
else:
self._super_column_name_class = marshal.extract_type_name(t)
self._super_name_packer = marshal.packer_for(t)
self._super_name_unpacker = marshal.unpacker_for(t)