StandardTuner implements ICassandraTuner { String derivePartitioner(String fromYaml, String fromConfig) { if (fromYaml == null || fromYaml.isEmpty()) return fromConfig; final String lowerCase = fromYaml.toLowerCase(); if (lowerCase.contains("randomparti") || lowerCase.contains("murmur")) return fromConfig; return fromYaml; } @Inject  StandardTuner(
            IConfiguration config,
            IBackupRestoreConfig backupRestoreConfig,
            InstanceInfo instanceInfo); @SuppressWarnings("unchecked") void writeAllProperties(String yamlLocation, String hostname, String seedProvider); void updateAutoBootstrap(String yamlFile, boolean autobootstrap); @Override final void updateJVMOptions(); void addExtraCassParams(Map map);  }
@Test public void derivePartitioner_NullYamlEntry() { String partitioner = tuner.derivePartitioner(null, A_PARTITIONER); assertEquals(A_PARTITIONER, partitioner); }
@Test public void derivePartitioner_EmptyYamlEntry() { String partitioner = tuner.derivePartitioner("", A_PARTITIONER); assertEquals(A_PARTITIONER, partitioner); }
@Test public void derivePartitioner_RandomPartitioner() { String partitioner = tuner.derivePartitioner(RANDOM_PARTITIONER, RANDOM_PARTITIONER); assertEquals(RANDOM_PARTITIONER, partitioner); }
@Test public void derivePartitioner_MurmurPartitioner() { String partitioner = tuner.derivePartitioner(MURMUR_PARTITIONER, MURMUR_PARTITIONER); assertEquals(MURMUR_PARTITIONER, partitioner); }
@Test public void derivePartitioner_BOPPartitionerInYaml() { String partitioner = tuner.derivePartitioner(BOP_PARTITIONER, MURMUR_PARTITIONER); assertEquals(BOP_PARTITIONER, partitioner); }
@Test public void derivePartitioner_BOPPartitionerInConfig() { String partitioner = tuner.derivePartitioner(RANDOM_PARTITIONER, BOP_PARTITIONER); assertEquals(BOP_PARTITIONER, partitioner); }