1

Cassandra 1.1 の一部の CF で行キャッシュを有効にしようとしています。

UPDATE COLUMN FAMILY Users WITH rows_cached=2000 AND row_cache_provider='SerializingCacheProvider';

CLIで上記のコマンドを実行すると、エラーが発生します

java.lang.IllegalArgumentException: No enum const class org.apache.cassandra.cli.CliClient$ColumnFamilyArgument.ROWS_CACHED

次に、 nodetool setcachecapacity nodetool -h cssa01-04 setcachecapacity keyspace1 Users 200000 2000 の別のアプローチを試しました

エラーが発生します

Exception in thread "main" java.lang.IllegalArgumentException
    at com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.setCapacity(ConcurrentLinkedHashMap.java:291)
    at org.apache.cassandra.cache.ConcurrentLinkedHashCache.setCapacity(ConcurrentLinkedHashCache.java:87)
    at org.apache.cassandra.cache.InstrumentingCache.updateCapacity(InstrumentingCache.java:79)
    at org.apache.cassandra.cache.InstrumentingCache.setCapacity(InstrumentingCache.java:84)
    at org.apache.cassandra.service.CacheService.setKeyCacheCapacityInMB(CacheService.java:243)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)
    at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)
    at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeSetter(MBeanIntrospector.java:238)
    at com.sun.jmx.mbeanserver.PerInterface.setAttribute(PerInterface.java:84)
    at com.sun.jmx.mbeanserver.MBeanSupport.setAttribute(MBeanSupport.java:240)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.setAttribute(DefaultMBeanServerInterceptor.java:762)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.setAttribute(JmxMBeanServer.java:699)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1450)
    at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)
    at javax.management.remote.rmi.RMIConnectionImpl.setAttribute(RMIConnectionImpl.java:683)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

これを修正する方法はありますか?

ありがとうマニッシュ

4

3 に答える 3

3

Cassandra 1.1 では、個々の列ファミリーにキャッシュ容量を設定する必要がなくなりました。代わりに、cassandra.yaml で caching=rows_only と合計キャッシュ サイズを設定するだけです。

詳細については、 http://www.datastax.com/dev/blog/caching-in-cassandra-1-1を参照してください。

于 2012-05-09T03:26:33.037 に答える
0

私は Cassandra のコードに詳しくありませんが、CLHM の前提条件は、容量が負になることはできないということです。HTH

  /**
   * Sets the maximum weighted capacity of the map and eagerly evicts entries
   * until it shrinks to the appropriate size.
   *
   * @param capacity the maximum weighted capacity of the map
   * @throws IllegalArgumentException if the capacity is negative
   */
  public void setCapacity(long capacity) {
    if (capacity < 0) {
      throw new IllegalArgumentException();
    }
于 2012-05-08T02:35:14.217 に答える
0

ここで Cassandra-1.1 のキャッシュを有効にする方法について説明しました: Cassandra-1.1 でのキャッシュ

于 2012-05-24T06:00:39.253 に答える