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


Java Descriptor.isCompatible方法代码示例

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


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

示例1: createColumnFamilyStore

import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
private static synchronized ColumnFamilyStore createColumnFamilyStore(Keyspace keyspace,
                                                                     String columnFamily,
                                                                     IPartitioner partitioner,
                                                                     CFMetaData metadata,
                                                                     boolean loadSSTables)
{
    // get the max generation number, to prevent generation conflicts
    Directories directories = new Directories(metadata);
    Directories.SSTableLister lister = directories.sstableLister().includeBackups(true);
    List<Integer> generations = new ArrayList<Integer>();
    for (Map.Entry<Descriptor, Set<Component>> entry : lister.list().entrySet())
    {
        Descriptor desc = entry.getKey();
        generations.add(desc.generation);
        if (!desc.isCompatible())
            throw new RuntimeException(String.format("Incompatible SSTable found. Current version %s is unable to read file: %s. Please run upgradesstables.",
                                                      Descriptor.Version.CURRENT, desc));
    }
    Collections.sort(generations);
    int value = (generations.size() > 0) ? (generations.get(generations.size() - 1)) : 0;

    return new ColumnFamilyStore(keyspace, columnFamily, partitioner, value, metadata, directories, loadSSTables);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:24,代码来源:ColumnFamilyStore.java

示例2: createColumnFamilyStore

import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
private static synchronized ColumnFamilyStore createColumnFamilyStore(Keyspace keyspace,
                                                                     String columnFamily,
                                                                     IPartitioner partitioner,
                                                                     CFMetaData metadata,
                                                                     boolean loadSSTables)
{
    // get the max generation number, to prevent generation conflicts
    Directories directories = Directories.create(keyspace.getName(), columnFamily);
    Directories.SSTableLister lister = directories.sstableLister().includeBackups(true);
    List<Integer> generations = new ArrayList<Integer>();
    for (Map.Entry<Descriptor, Set<Component>> entry : lister.list().entrySet())
    {
        Descriptor desc = entry.getKey();
        generations.add(desc.generation);
        if (!desc.isCompatible())
            throw new RuntimeException(String.format("Can't open incompatible SSTable! Current version %s, found file: %s", Descriptor.Version.CURRENT, desc));
    }
    Collections.sort(generations);
    int value = (generations.size() > 0) ? (generations.get(generations.size() - 1)) : 0;

    return new ColumnFamilyStore(keyspace, columnFamily, partitioner, value, metadata, directories, loadSSTables);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:23,代码来源:ColumnFamilyStore.java

示例3: createColumnFamilyStore

import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public static synchronized ColumnFamilyStore createColumnFamilyStore(Keyspace keyspace,
                                                                     String columnFamily,
                                                                     CFMetaData metadata,
                                                                     boolean loadSSTables)
{
    // get the max generation number, to prevent generation conflicts
    Directories directories = new Directories(metadata, initialDirectories);
    Directories.SSTableLister lister = directories.sstableLister(Directories.OnTxnErr.IGNORE).includeBackups(true);
    List<Integer> generations = new ArrayList<Integer>();
    for (Map.Entry<Descriptor, Set<Component>> entry : lister.list().entrySet())
    {
        Descriptor desc = entry.getKey();
        generations.add(desc.generation);
        if (!desc.isCompatible())
            throw new RuntimeException(String.format("Incompatible SSTable found. Current version %s is unable to read file: %s. Please run upgradesstables.",
                    desc.getFormat().getLatestVersion(), desc));
    }
    Collections.sort(generations);
    int value = (generations.size() > 0) ? (generations.get(generations.size() - 1)) : 0;

    return new ColumnFamilyStore(keyspace, columnFamily, value, metadata, directories, loadSSTables);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:23,代码来源:ColumnFamilyStore.java


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