Add synchronous refresh mehtods for UDF, UDA
This commit is contained in:
@@ -135,7 +135,7 @@ class SignatureDescriptor(object):
|
||||
@property
|
||||
def signature(self):
|
||||
"""
|
||||
function signatue string in the form 'name([type0[,type1[...]]])'
|
||||
function signature string in the form 'name([type0[,type1[...]]])'
|
||||
|
||||
can be used to uniquely identify overloaded function names within a keyspace
|
||||
"""
|
||||
@@ -158,7 +158,7 @@ class UserFunctionDescriptor(SignatureDescriptor):
|
||||
|
||||
type_signature = None
|
||||
"""
|
||||
Ordered list of CQL argument type name comprising the type signature
|
||||
Ordered list of CQL argument type names comprising the type signature
|
||||
"""
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ class UserAggregateDescriptor(SignatureDescriptor):
|
||||
|
||||
type_signature = None
|
||||
"""
|
||||
Ordered list of CQL argument type name comprising the type signature
|
||||
Ordered list of CQL argument type names comprising the type signature
|
||||
"""
|
||||
|
||||
|
||||
|
@@ -1262,6 +1262,28 @@ class Cluster(object):
|
||||
if not self.control_connection.refresh_schema(keyspace, usertype=user_type, schema_agreement_wait=max_schema_agreement_wait):
|
||||
raise Exception("User Type metadata was not refreshed. See log for details.")
|
||||
|
||||
def refresh_user_function_metadata(self, keyspace, function, max_schema_agreement_wait=None):
|
||||
"""
|
||||
Synchronously refresh user defined function metadata.
|
||||
|
||||
``function`` is a :class:`cassandra.UserFunctionDescriptor`.
|
||||
|
||||
See :meth:`~.Cluster.refresh_schema_metadata` for description of ``max_schema_agreement_wait`` behavior
|
||||
"""
|
||||
if not self.control_connection.refresh_schema(keyspace, function=function, schema_agreement_wait=max_schema_agreement_wait):
|
||||
raise Exception("User Function metadata was not refreshed. See log for details.")
|
||||
|
||||
def refresh_user_aggregate_metadata(self, keyspace, aggregate, max_schema_agreement_wait=None):
|
||||
"""
|
||||
Synchronously refresh user defined aggregate metadata.
|
||||
|
||||
``aggregate`` is a :class:`cassandra.UserAggregateDescriptor`.
|
||||
|
||||
See :meth:`~.Cluster.refresh_schema_metadata` for description of ``max_schema_agreement_wait`` behavior
|
||||
"""
|
||||
if not self.control_connection.refresh_schema(keyspace, aggregate=aggregate, schema_agreement_wait=max_schema_agreement_wait):
|
||||
raise Exception("User Aggregate metadata was not refreshed. See log for details.")
|
||||
|
||||
def refresh_nodes(self):
|
||||
"""
|
||||
Synchronously refresh the node list and token metadata
|
||||
|
@@ -73,6 +73,10 @@
|
||||
|
||||
.. automethod:: refresh_user_type_metadata
|
||||
|
||||
.. automethod:: refresh_user_function_metadata
|
||||
|
||||
.. automethod:: refresh_user_aggregate_metadata
|
||||
|
||||
.. automethod:: refresh_schema
|
||||
|
||||
.. automethod:: refresh_nodes
|
||||
|
Reference in New Issue
Block a user