Add LocalStrategy for schema export purposes
This commit is contained in:
@@ -332,6 +332,8 @@ class ReplicationStrategy(object):
|
||||
if not repl_factor:
|
||||
return None
|
||||
return SimpleStrategy(repl_factor)
|
||||
elif strategy_class.endswith("LocalStrategy"):
|
||||
return LocalStrategy()
|
||||
|
||||
def make_token_replica_map(token_to_primary_replica, ring):
|
||||
raise NotImplementedError()
|
||||
@@ -404,6 +406,17 @@ class NetworkTopologyStrategy(ReplicationStrategy):
|
||||
return ret + "}"
|
||||
|
||||
|
||||
class LocalStrategy(ReplicationStrategy):
|
||||
|
||||
name = "LocalStrategy"
|
||||
|
||||
def make_token_replica_map(self, token_to_primary_replica, ring):
|
||||
return {}
|
||||
|
||||
def export_for_schema(self):
|
||||
return "{'class': 'LocalStrategy'}"
|
||||
|
||||
|
||||
class KeyspaceMetadata(object):
|
||||
"""
|
||||
A representation of the schema for a single keyspace.
|
||||
|
||||
Reference in New Issue
Block a user