当前位置: 首页>>代码示例>>Java>>正文


Java FBUtilities.classForName方法代码示例

本文整理汇总了Java中org.apache.cassandra.utils.FBUtilities.classForName方法的典型用法代码示例。如果您正苦于以下问题:Java FBUtilities.classForName方法的具体用法?Java FBUtilities.classForName怎么用?Java FBUtilities.classForName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.utils.FBUtilities的用法示例。


在下文中一共展示了FBUtilities.classForName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate

import org.apache.cassandra.utils.FBUtilities; //导入方法依赖的package包/类
public void validate(CFMetaData cfm)
{
    if (!isNameValid(name))
        throw new ConfigurationException("Illegal index name " + name);

    if (kind == null)
        throw new ConfigurationException("Index kind is null for index " + name);

    if (kind == Kind.CUSTOM)
    {
        if (options == null || !options.containsKey(IndexTarget.CUSTOM_INDEX_OPTION_NAME))
            throw new ConfigurationException(String.format("Required option missing for index %s : %s",
                                                           name, IndexTarget.CUSTOM_INDEX_OPTION_NAME));
        String className = options.get(IndexTarget.CUSTOM_INDEX_OPTION_NAME);
        Class<Index> indexerClass = FBUtilities.classForName(className, "custom indexer");
        if(!Index.class.isAssignableFrom(indexerClass))
            throw new ConfigurationException(String.format("Specified Indexer class (%s) does not implement the Indexer interface", className));
        validateCustomIndexOptions(cfm, indexerClass, options);
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:21,代码来源:IndexMetadata.java

示例2: getAbstractType

import org.apache.cassandra.utils.FBUtilities; //导入方法依赖的package包/类
private static AbstractType<?> getAbstractType(String compareWith) throws ConfigurationException
{
    String className = compareWith.contains(".") ? compareWith : "org.apache.cassandra.db.marshal." + compareWith;
    Class<? extends AbstractType<?>> typeClass = FBUtilities.<AbstractType<?>>classForName(className, "abstract-type");
    try
    {
        Field field = typeClass.getDeclaredField("instance");
        return (AbstractType<?>) field.get(null);
    }
    catch (NoSuchFieldException | IllegalAccessException e)
    {
        // Trying with empty parser
        return getRawAbstractType(typeClass, EMPTY_PARSER);
    }
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:16,代码来源:TypeParser.java

示例3: getClass

import org.apache.cassandra.utils.FBUtilities; //导入方法依赖的package包/类
public static Class<AbstractReplicationStrategy> getClass(String cls) throws ConfigurationException
{
    String className = cls.contains(".") ? cls : "org.apache.cassandra.locator." + cls;
    Class<AbstractReplicationStrategy> strategyClass = FBUtilities.classForName(className, "replication strategy");
    if (!AbstractReplicationStrategy.class.isAssignableFrom(strategyClass))
    {
        throw new ConfigurationException(String.format("Specified replication strategy class (%s) is not derived from AbstractReplicationStrategy", className));
    }
    return strategyClass;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:11,代码来源:AbstractReplicationStrategy.java

示例4: createCompactionStrategy

import org.apache.cassandra.utils.FBUtilities; //导入方法依赖的package包/类
public static Class<? extends AbstractCompactionStrategy> createCompactionStrategy(String className) throws ConfigurationException
{
    className = className.contains(".") ? className : "org.apache.cassandra.db.compaction." + className;
    Class<AbstractCompactionStrategy> strategyClass = FBUtilities.classForName(className, "compaction strategy");
    if (className.equals(WrappingCompactionStrategy.class.getName()))
        throw new ConfigurationException("You can't set WrappingCompactionStrategy as the compaction strategy!");
    if (!AbstractCompactionStrategy.class.isAssignableFrom(strategyClass))
        throw new ConfigurationException(String.format("Specified compaction strategy class (%s) is not derived from AbstractReplicationStrategy", className));

    return strategyClass;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:12,代码来源:CFMetaData.java

示例5: createCompactionStrategy

import org.apache.cassandra.utils.FBUtilities; //导入方法依赖的package包/类
public static Class<? extends AbstractCompactionStrategy> createCompactionStrategy(String className) throws ConfigurationException
{
    className = className.contains(".") ? className : "org.apache.cassandra.db.compaction." + className;
    Class<AbstractCompactionStrategy> strategyClass = FBUtilities.classForName(className, "compaction strategy");
    if (!AbstractCompactionStrategy.class.isAssignableFrom(strategyClass))
        throw new ConfigurationException(String.format("Specified compaction strategy class (%s) is not derived from AbstractReplicationStrategy", className));

    return strategyClass;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:10,代码来源:CFMetaData.java

示例6: classFromName

import org.apache.cassandra.utils.FBUtilities; //导入方法依赖的package包/类
private static Class<? extends AbstractCompactionStrategy> classFromName(String name)
{
    String className = name.contains(".")
                     ? name
                     : "org.apache.cassandra.db.compaction." + name;
    Class<AbstractCompactionStrategy> strategyClass = FBUtilities.classForName(className, "compaction strategy");

    if (!AbstractCompactionStrategy.class.isAssignableFrom(strategyClass))
    {
        throw new ConfigurationException(format("Compaction strategy class %s is not derived from AbstractReplicationStrategy",
                                                className));
    }

    return strategyClass;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:16,代码来源:CompactionParams.java


注:本文中的org.apache.cassandra.utils.FBUtilities.classForName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。