Java Code Examples for org.apache.cassandra.utils.UUIDGen#makeType1UUIDFromHost()

The following examples show how to use org.apache.cassandra.utils.UUIDGen#makeType1UUIDFromHost() . 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: 986499_AddColumnFamily_0_s.java    From coming with MIT License 6 votes vote down vote up
public AddColumnFamily(CFMetaData cfm) throws ConfigurationException, IOException
{
    super(UUIDGen.makeType1UUIDFromHost(FBUtilities.getLocalAddress()), DatabaseDescriptor.getDefsVersion());
    this.cfm = cfm;
    KSMetaData ksm = DatabaseDescriptor.getTableDefinition(cfm.tableName);
    
    if (ksm == null)
        throw new ConfigurationException("Keyspace does not already exist.");
    else if (ksm.cfMetaData().containsKey(cfm.cfName))
        throw new ConfigurationException("CF is already defined in that keyspace.");
    else if (!Migration.isLegalName(cfm.cfName))
        throw new ConfigurationException("Invalid column family name: " + cfm.cfName);
    
    KSMetaData newKsm = makeNewKeyspaceDefinition(ksm);
    
    rm = Migration.makeDefinitionMutation(newKsm, null, newVersion);
}
 
Example 2
Source File: 986499_AddColumnFamily_0_t.java    From coming with MIT License 6 votes vote down vote up
public AddColumnFamily(CFMetaData cfm) throws ConfigurationException, IOException
{
    super(UUIDGen.makeType1UUIDFromHost(FBUtilities.getLocalAddress()), DatabaseDescriptor.getDefsVersion());
    this.cfm = cfm;
    KSMetaData ksm = DatabaseDescriptor.getTableDefinition(cfm.tableName);
    
    if (ksm == null)
        throw new ConfigurationException("Keyspace does not already exist.");
    else if (ksm.cfMetaData().containsKey(cfm.cfName))
        throw new ConfigurationException("CF is already defined in that keyspace.");
    else if (!Migration.isLegalName(cfm.cfName))
        throw new ConfigurationException("Invalid column family name: " + cfm.cfName);
    
    KSMetaData newKsm = makeNewKeyspaceDefinition(ksm);
    
    rm = Migration.makeDefinitionMutation(newKsm, null, newVersion);
}
 
Example 3
Source File: 986499_AddColumnFamily_0_s.java    From coming with MIT License 6 votes vote down vote up
public AddColumnFamily(CFMetaData cfm) throws ConfigurationException, IOException
{
    super(UUIDGen.makeType1UUIDFromHost(FBUtilities.getLocalAddress()), DatabaseDescriptor.getDefsVersion());
    this.cfm = cfm;
    KSMetaData ksm = DatabaseDescriptor.getTableDefinition(cfm.tableName);
    
    if (ksm == null)
        throw new ConfigurationException("Keyspace does not already exist.");
    else if (ksm.cfMetaData().containsKey(cfm.cfName))
        throw new ConfigurationException("CF is already defined in that keyspace.");
    else if (!Migration.isLegalName(cfm.cfName))
        throw new ConfigurationException("Invalid column family name: " + cfm.cfName);
    
    KSMetaData newKsm = makeNewKeyspaceDefinition(ksm);
    
    rm = Migration.makeDefinitionMutation(newKsm, null, newVersion);
}
 
Example 4
Source File: 986499_AddColumnFamily_0_t.java    From coming with MIT License 6 votes vote down vote up
public AddColumnFamily(CFMetaData cfm) throws ConfigurationException, IOException
{
    super(UUIDGen.makeType1UUIDFromHost(FBUtilities.getLocalAddress()), DatabaseDescriptor.getDefsVersion());
    this.cfm = cfm;
    KSMetaData ksm = DatabaseDescriptor.getTableDefinition(cfm.tableName);
    
    if (ksm == null)
        throw new ConfigurationException("Keyspace does not already exist.");
    else if (ksm.cfMetaData().containsKey(cfm.cfName))
        throw new ConfigurationException("CF is already defined in that keyspace.");
    else if (!Migration.isLegalName(cfm.cfName))
        throw new ConfigurationException("Invalid column family name: " + cfm.cfName);
    
    KSMetaData newKsm = makeNewKeyspaceDefinition(ksm);
    
    rm = Migration.makeDefinitionMutation(newKsm, null, newVersion);
}
 
Example 5
Source File: 986499_AddColumnFamily_0_s.java    From coming with MIT License 6 votes vote down vote up
public AddColumnFamily(CFMetaData cfm) throws ConfigurationException, IOException
{
    super(UUIDGen.makeType1UUIDFromHost(FBUtilities.getLocalAddress()), DatabaseDescriptor.getDefsVersion());
    this.cfm = cfm;
    KSMetaData ksm = DatabaseDescriptor.getTableDefinition(cfm.tableName);
    
    if (ksm == null)
        throw new ConfigurationException("Keyspace does not already exist.");
    else if (ksm.cfMetaData().containsKey(cfm.cfName))
        throw new ConfigurationException("CF is already defined in that keyspace.");
    else if (!Migration.isLegalName(cfm.cfName))
        throw new ConfigurationException("Invalid column family name: " + cfm.cfName);
    
    KSMetaData newKsm = makeNewKeyspaceDefinition(ksm);
    
    rm = Migration.makeDefinitionMutation(newKsm, null, newVersion);
}
 
Example 6
Source File: 986499_AddColumnFamily_0_t.java    From coming with MIT License 6 votes vote down vote up
public AddColumnFamily(CFMetaData cfm) throws ConfigurationException, IOException
{
    super(UUIDGen.makeType1UUIDFromHost(FBUtilities.getLocalAddress()), DatabaseDescriptor.getDefsVersion());
    this.cfm = cfm;
    KSMetaData ksm = DatabaseDescriptor.getTableDefinition(cfm.tableName);
    
    if (ksm == null)
        throw new ConfigurationException("Keyspace does not already exist.");
    else if (ksm.cfMetaData().containsKey(cfm.cfName))
        throw new ConfigurationException("CF is already defined in that keyspace.");
    else if (!Migration.isLegalName(cfm.cfName))
        throw new ConfigurationException("Invalid column family name: " + cfm.cfName);
    
    KSMetaData newKsm = makeNewKeyspaceDefinition(ksm);
    
    rm = Migration.makeDefinitionMutation(newKsm, null, newVersion);
}