mirror of https://github.com/apache/cassandra
add SimpleSnitch and make it the default
patch by Erick Tryzelaar; reviewed by jbellis for CASSANDRA-994 git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@935726 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1a904da729
commit
c59a4fc4bb
|
|
@ -53,7 +53,7 @@
|
|||
~ org.apache.cassandra.locator.RackInferringSnitch and
|
||||
~ org.apache.cassandra.locator.PropertyFileSnitch.
|
||||
-->
|
||||
<EndpointSnitch>org.apache.cassandra.locator.RackInferringSnitch</EndpointSnitch>
|
||||
<EndpointSnitch>org.apache.cassandra.locator.SimpleSnitch</EndpointSnitch>
|
||||
|
||||
<!--
|
||||
~ Keyspaces and ColumnFamilies:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.cassandra.locator;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* A simple endpoint snitch implementation does not sort addresses by
|
||||
* proximity.
|
||||
*/
|
||||
public class SimpleSnitch implements IEndpointSnitch
|
||||
{
|
||||
public List<InetAddress> getSortedListByProximity(final InetAddress address, Collection<InetAddress> addresses)
|
||||
{
|
||||
List<InetAddress> list = new ArrayList<InetAddress>(addresses);
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<InetAddress> sortByProximity(final InetAddress address, List<InetAddress> addresses)
|
||||
{
|
||||
return addresses;
|
||||
}
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
<DiskAccessMode>mmap</DiskAccessMode>
|
||||
<MemtableThroughputInMB>1</MemtableThroughputInMB>
|
||||
<MemtableOperationsInMillions>0.00002</MemtableOperationsInMillions> <!-- 20 -->
|
||||
<EndpointSnitch>org.apache.cassandra.locator.RackInferringSnitch</EndpointSnitch>
|
||||
<EndpointSnitch>org.apache.cassandra.locator.SimpleSnitch</EndpointSnitch>
|
||||
<Keyspaces>
|
||||
<Keyspace Name = "Keyspace1">
|
||||
<ColumnFamily Name="Standard1" RowsCached="10%" KeysCached="0"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue