mirror of https://github.com/apache/cassandra
revert r1058764
git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.7@1058793 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
33a6640583
commit
936b46427a
|
|
@ -309,9 +309,8 @@ index_interval: 128
|
|||
# With NetworkTopologyStrategy,
|
||||
# for each datacenter, you can specify how many replicas you want
|
||||
# on a per-keyspace basis. Replicas are placed on different racks
|
||||
# within each DC, if possible. With SimpleSnitch, this will be
|
||||
# equivalent to SimpleStrategy. Later, the snitch can be upgraded to
|
||||
# one such as RackInferringSnitch or PropertyFileSnitch.
|
||||
# within each DC, if possible. This strategy also requires rack aware
|
||||
# snitch, such as RackInferringSnitch or PropertyFileSnitch.
|
||||
# An example:
|
||||
# - name: Keyspace1
|
||||
# replica_placement_strategy: org.apache.cassandra.locator.NetworkTopologyStrategy
|
||||
|
|
@ -406,7 +405,7 @@ index_interval: 128
|
|||
# /NOTE
|
||||
keyspaces:
|
||||
- name: Keyspace1
|
||||
replica_placement_strategy: org.apache.cassandra.locator.NetworkTopologyStrategy
|
||||
replica_placement_strategy: org.apache.cassandra.locator.SimpleStrategy
|
||||
replication_factor: 1
|
||||
column_families:
|
||||
- name: Standard1
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
package org.apache.cassandra.cli;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -31,7 +29,6 @@ import org.apache.cassandra.config.ConfigurationException;
|
|||
import org.apache.cassandra.db.ColumnFamilyStoreMBean;
|
||||
import org.apache.cassandra.db.CompactionManagerMBean;
|
||||
import org.apache.cassandra.db.marshal.*;
|
||||
import org.apache.cassandra.locator.SimpleSnitch;
|
||||
import org.apache.cassandra.thrift.*;
|
||||
import org.apache.cassandra.tools.NodeProbe;
|
||||
import org.apache.cassandra.utils.ByteBufferUtil;
|
||||
|
|
@ -95,8 +92,7 @@ public class CliClient extends CliUserHelp
|
|||
PLACEMENT_STRATEGY,
|
||||
STRATEGY_OPTIONS
|
||||
}
|
||||
|
||||
private static final String DEFAULT_PLACEMENT_STRATEGY = "org.apache.cassandra.locator.NetworkTopologyStrategy";
|
||||
private static final String DEFAULT_PLACEMENT_STRATEGY = "org.apache.cassandra.locator.SimpleStrategy";
|
||||
|
||||
private Cassandra.Client thriftClient = null;
|
||||
private CliSessionState sessionState = null;
|
||||
|
|
@ -807,30 +803,6 @@ public class CliClient extends CliUserHelp
|
|||
}
|
||||
}
|
||||
|
||||
// using default snitch options if strategy is NetworkTopologyStrategy and no options were set.
|
||||
if (ksDef.getStrategy_class().contains(".NetworkTopologyStrategy"))
|
||||
{
|
||||
Map<String, String> currentStrategyOptions = ksDef.getStrategy_options();
|
||||
|
||||
// adding default data center from SimpleSnitch
|
||||
if (currentStrategyOptions == null || currentStrategyOptions.isEmpty())
|
||||
{
|
||||
SimpleSnitch snitch = new SimpleSnitch();
|
||||
Map<String, String> options = new HashMap<String, String>();
|
||||
|
||||
try
|
||||
{
|
||||
options.put(snitch.getDatacenter(InetAddress.getLocalHost()), "1");
|
||||
}
|
||||
catch (UnknownHostException e)
|
||||
{
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
|
||||
ksDef.setStrategy_options(options);
|
||||
}
|
||||
}
|
||||
|
||||
return ksDef;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.apache.commons.lang.ObjectUtils;
|
|||
import org.apache.avro.util.Utf8;
|
||||
import org.apache.cassandra.io.SerDeUtils;
|
||||
import org.apache.cassandra.locator.AbstractReplicationStrategy;
|
||||
import org.apache.cassandra.locator.NetworkTopologyStrategy;
|
||||
import org.apache.cassandra.locator.SimpleStrategy;
|
||||
|
||||
public final class KSMetaData
|
||||
{
|
||||
|
|
@ -41,7 +41,7 @@ public final class KSMetaData
|
|||
public KSMetaData(String name, Class<? extends AbstractReplicationStrategy> strategyClass, Map<String, String> strategyOptions, int replicationFactor, CFMetaData... cfDefs)
|
||||
{
|
||||
this.name = name;
|
||||
this.strategyClass = strategyClass == null ? NetworkTopologyStrategy.class : strategyClass;
|
||||
this.strategyClass = strategyClass == null ? SimpleStrategy.class : strategyClass;
|
||||
this.strategyOptions = strategyOptions;
|
||||
this.replicationFactor = replicationFactor;
|
||||
Map<String, CFMetaData> cfmap = new HashMap<String, CFMetaData>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue