Java Code Examples for org.apache.cassandra.exceptions.ConfigurationException#getMessage()
The following examples show how to use
org.apache.cassandra.exceptions.ConfigurationException#getMessage() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StorageService.java From stratio-cassandra with Apache License 2.0 | 5 votes |
public void move(String newToken) throws IOException { try { getPartitioner().getTokenFactory().validate(newToken); } catch (ConfigurationException e) { throw new IOException(e.getMessage()); } move(getPartitioner().getTokenFactory().fromString(newToken)); }
Example 2
Source File: StorageService.java From stratio-cassandra with Apache License 2.0 | 5 votes |
public void updateSnitch(String epSnitchClassName, Boolean dynamic, Integer dynamicUpdateInterval, Integer dynamicResetInterval, Double dynamicBadnessThreshold) throws ClassNotFoundException { IEndpointSnitch oldSnitch = DatabaseDescriptor.getEndpointSnitch(); // new snitch registers mbean during construction IEndpointSnitch newSnitch; try { newSnitch = FBUtilities.construct(epSnitchClassName, "snitch"); } catch (ConfigurationException e) { throw new ClassNotFoundException(e.getMessage()); } if (dynamic) { DatabaseDescriptor.setDynamicUpdateInterval(dynamicUpdateInterval); DatabaseDescriptor.setDynamicResetInterval(dynamicResetInterval); DatabaseDescriptor.setDynamicBadnessThreshold(dynamicBadnessThreshold); newSnitch = new DynamicEndpointSnitch(newSnitch); } // point snitch references to the new instance DatabaseDescriptor.setEndpointSnitch(newSnitch); for (String ks : Schema.instance.getKeyspaces()) { Keyspace.open(ks).getReplicationStrategy().snitch = newSnitch; } if (oldSnitch instanceof DynamicEndpointSnitch) ((DynamicEndpointSnitch)oldSnitch).unregisterMBean(); }
Example 3
Source File: ColumnFamilyStore.java From stratio-cassandra with Apache License 2.0 | 5 votes |
public void setCompactionStrategyClass(String compactionStrategyClass) { try { metadata.compactionStrategyClass = CFMetaData.createCompactionStrategy(compactionStrategyClass); compactionStrategyWrapper.maybeReloadCompactionStrategy(metadata); } catch (ConfigurationException e) { throw new IllegalArgumentException(e.getMessage()); } }
Example 4
Source File: ColumnFamilyStore.java From stratio-cassandra with Apache License 2.0 | 5 votes |
public void setCompressionParameters(Map<String,String> opts) { try { metadata.compressionParameters = CompressionParameters.create(opts); } catch (ConfigurationException e) { throw new IllegalArgumentException(e.getMessage()); } }
Example 5
Source File: ColumnFamilyStore.java From stratio-cassandra with Apache License 2.0 | 5 votes |
public void setCrcCheckChance(double crcCheckChance) { try { for (SSTableReader sstable : keyspace.getAllSSTables()) if (sstable.compression) sstable.getCompressionMetadata().parameters.setCrcCheckChance(crcCheckChance); } catch (ConfigurationException e) { throw new IllegalArgumentException(e.getMessage()); } }